This documentation is archived and is not being maintained.

UIPermissionWindow Enumeration

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

Namespace:  System.Security.Permissions
Assembly:  mscorlib (in mscorlib.dll)

public enum UIPermissionWindow

Member nameDescription
NoWindowsUsers cannot use any windows or user interface events. No user interface can be used.
SafeSubWindowsUsers 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.
SafeTopLevelWindowsUsers 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.

When it runs under SafeTopLevelWindows permission, your application:

  • Will show the DNS name or IP address of the Web site from which the application was loaded in its title bar.

  • Will display Balloon tool-tip 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 Opacity property on Form 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 FormBorderStyle to None.

  • Cannot make windows invisible. Any attempt by the application to set the Visible property on its Form objects to False will be ignored.

  • Must have an entry in the Task Bar.

  • Will have its controls prohibited from accessing the Parent property. By implication, controls will also be barred from accessing siblings - i.e., other controls at the same level of nesting.

  • Cannot control focus using the Focus method.

  • Will have restricted keyboard input access, so that a form or control can only access keyboard events for itself and its children.

  • Will have 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 TopMost property.

  • Cannot control the z-order of controls on the form using the BringToFront and SendToBack methods.

These restrictions help prevent potentially harmful code from spoofing attacks, such as imitating trusted system dialogs.

AllWindowsUsers can use all windows and user input events without restriction.

This enumeration is used by UIPermission.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.