UIPermissionWindow 列舉

定義

警告

Code Access Security is not supported or honored by the runtime.

指定程式碼允許使用的視窗類型。

public enum class UIPermissionWindow
public enum UIPermissionWindow
[System.Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public enum UIPermissionWindow
[System.Serializable]
public enum UIPermissionWindow
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public enum UIPermissionWindow
type UIPermissionWindow = 
[<System.Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
type UIPermissionWindow = 
[<System.Serializable>]
type UIPermissionWindow = 
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type UIPermissionWindow = 
Public Enum UIPermissionWindow
繼承
UIPermissionWindow
屬性

欄位

AllWindows 3

使用者可以無限制使用所有視窗和使用者輸入事件。

NoWindows 0

使用者無法使用任何視窗或使用者介面事件。 無法使用任何使用者介面。

SafeSubWindows 1

使用者只能使用 SafeSubWindows 來進行繪圖,並只能使用該子視窗中使用者介面的使用者輸入事件。 SafeSubWindows 的一些例子有:MessageBox、常見的對話方塊控制項及瀏覽器內顯示的控制項。

SafeTopLevelWindows 2

使用者只能使用 SafeTopLevelWindowsSafeSubWindows 來進行繪圖,也只能在這些最上層視窗和子視窗中的使用者介面中使用使用者輸入事件。 如需詳細資訊,請參閱<備註>一節。

備註

這個列舉是由 UIPermission 使用。

當應用程式在許可權下 SafeTopLevelWindows 執行時,它會:

  • 顯示應用程式在其標題列中載入之網站的 DNS 名稱或 IP 位址。

  • 第一次顯示時顯示 [批註方塊] 工具提示,告知使用者正在受限制的信任層級下執行。

  • 必須隨時顯示其標題列。

  • 必須在其表單上顯示視窗控制項。

  • 無法在啟動時將其主視窗最小化。

  • 無法將其視窗從畫面外移動。

  • 無法使用 Form.Opacity 屬性讓視窗小於 50% 透明。

  • 只能使用矩形視窗,而且必須包含視窗框架。 Windows Forms不接受 將 設定 Form.FormBorderStyleFormBorderStyle.None

  • 無法讓視窗不可見。 應用程式將屬性設定 Control.VisibleFalse 的任何嘗試都會被忽略。

  • 工作列中必須有專案。

  • 已禁止其控制項存取 Parent 屬性。 透過隱含方式,控制項也會被禁止存取同層級 ,也就是位於相同巢狀層級的其他控制項。

  • 無法使用 方法控制焦點 Control.Focus

  • 具有受限制的鍵盤輸入存取權,讓表單或控制項只能存取本身及其子系的鍵盤事件。

  • 具有受限制的滑鼠座標存取權,讓表單或控制項只能在滑鼠位於其可見區域上方時讀取滑鼠座標。

  • 無法設定 Form.TopMost 屬性。

  • 無法使用 和 Control.SendToBack 方法控制表單 Control.BringToFront 上控制項的迭置順序。

這些限制有助於防止可能有害的程式碼詐騙攻擊,例如模擬受信任的系統對話方塊。

適用於

另請參閱