UIPermissionWindow 枚举

定义

指定允许使用代码的窗口的类型。Specifies the type of windows that code is allowed to use.

public enum class UIPermissionWindow
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public enum UIPermissionWindow
type UIPermissionWindow = 
Public Enum UIPermissionWindow
继承
UIPermissionWindow
属性

字段

AllWindows 3

用户可以不受限制地使用所有窗口和用户输入事件。Users can use all windows and user input events without restriction.

NoWindows 0

用户不能使用任何窗口或用户界面事件。Users cannot use any windows or user interface events. 不能使用任何用户界面。No user interface can be used.

SafeSubWindows 1

用户只能使用 SafeSubWindows 进行绘图,并且只能对该子窗口中的用户界面使用用户输入事件。Users can only use SafeSubWindows for drawing, and can only use user input events for user interface within that subwindow. SafeSubWindows 的示例包括 MessageBox、通用对话框控件和在浏览器中显示的控件。Examples of SafeSubWindows are a MessageBox, common dialog controls, and a control displayed within a browser.

SafeTopLevelWindows 2

用户只能使用 SafeTopLevelWindowsSafeSubWindows 进行绘图,并且只能对那些顶级窗口和子窗口中的用户界面使用用户输入事件。Users can only use SafeTopLevelWindows and SafeSubWindows for drawing, and can only use user input events for the user interface within those top-level windows and subwindows. 有关详细信息,请参阅“备注”部分。See the Remarks section for more information.

注解

此枚举由 UIPermission使用。This enumeration is used by UIPermission.

当应用程序在 SafeTopLevelWindows 权限下运行时,它会执行以下操作:When an application runs under the SafeTopLevelWindows permission, it:

  • 在标题栏中显示从中加载应用程序的网站的 DNS 名称或 IP 地址。Shows the DNS name or IP address of the Web site from which the application was loaded in its title bar.

  • 当首次显示时显示气球工具提示,通知用户它正在受限制的信任级别下运行。Displays Balloon tooltip when it first displays, informing the user that it is running under a restricted trust level.

  • 必须始终显示其标题栏。Must display its title bar at all times.

  • 必须在窗体上显示窗口控件。Must display window controls on its forms.

  • 无法在启动时最小化其主窗口。Cannot minimize its main window on startup.

  • 无法在屏幕上移动它的窗口。Cannot move its windows off-screen.

  • 无法使用 Form.Opacity 属性使其 windows 小于50% 透明。Cannot use the Form.Opacity property to make its windows less than 50% transparent.

  • 必须仅使用矩形窗口,并且必须包含窗口框架。Must use only rectangular windows, and must include the window frame. Windows 窗体不会服从 FormBorderStyle.NoneForm.FormBorderStyle 设置。Windows Forms will not honor setting Form.FormBorderStyle to FormBorderStyle.None.

  • 无法使窗口不可见。Cannot make windows invisible. 应用程序将 Control.Visible 属性设置为 False 的任何尝试都将被忽略。Any attempt by the application to set the Control.Visible property to False will be ignored.

  • 任务栏中必须有一个条目。Must have an entry in the Task Bar.

  • 禁止其控件访问 Parent 属性。Has its controls prohibited from accessing the Parent property. 根据隐含,控件也将无法访问同级,即同一嵌套级别的其他控件。By implication, controls will also be barred from accessing siblings - that is, other controls at the same level of nesting.

  • 无法使用 Control.Focus 方法控制焦点。Cannot control focus using the Control.Focus method.

  • 具有受限的键盘输入访问权限,因此窗体或控件只能访问其自身及其子控件的键盘事件。Has restricted keyboard input access, so that a form or control can only access keyboard events for itself and its children.

  • 具有受限制的鼠标坐标访问,因此,如果鼠标位于其可见区域,则窗体或控件只能读取鼠标坐标。Has restricted mouse coordinate access, so that a form or control can only read mouse coordinates if the mouse is over its visible area.

  • 无法设置 Form.TopMost 属性。Cannot set the Form.TopMost property.

  • 无法使用 Control.BringToFrontControl.SendToBack 方法控制窗体上控件的 z 顺序。Cannot control the z-order of controls on the form using the Control.BringToFront and Control.SendToBack methods.

这些限制有助于防止潜在的有害代码遭受欺骗攻击,如模拟受信任的系统对话框。These restrictions help prevent potentially harmful code from spoofing attacks, such as imitating trusted system dialogs.

适用于

另请参阅