UIPermissionWindow 列舉


指定程式碼允許使用的視窗類型。Specifies the type of windows that code is allowed to use.

public enum class UIPermissionWindow
public enum UIPermissionWindow
type UIPermissionWindow = 
Public Enum 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 Forms 不會接受設定 Form.FormBorderStyle FormBorderStyle.NoneWindows Forms will not honor setting Form.FormBorderStyle to FormBorderStyle.None.

  • 無法讓 windows 看不見。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 方法來控制表單上控制項的迭置順序。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.