UIPermissionWindow Enum

Definition

Caution

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

Specifies the type of windows that code is allowed to use.

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
Inheritance
UIPermissionWindow
Attributes

Fields

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

Users can only use SafeSubWindows for drawing, and can only use user input events for user interface within that subwindow. Examples of SafeSubWindows are a MessageBox, common dialog controls, and a control displayed within a browser.

SafeTopLevelWindows 2

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.

Remarks

Caution

Code Access Security (CAS) has been deprecated across all versions of .NET Framework and .NET. Recent versions of .NET do not honor CAS annotations and produce errors if CAS-related APIs are used. Developers should seek alternative means of accomplishing security tasks.

This enumeration is used by UIPermission.

When an application runs under the SafeTopLevelWindows permission, it:

  • 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.

  • 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 will not honor setting Form.FormBorderStyle to FormBorderStyle.None.

  • Cannot make windows invisible. Any attempt by the application to set the Control.Visible property to False will be ignored.

  • Must have an entry in the Task Bar.

  • 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.

  • 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.

  • Cannot set the Form.TopMost property.

  • 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.

Applies to

See also