Location: Symbol Reference > Classes > TJwSecurityDesktop Class
JWSCL Documentation
ContentsIndexHome
PreviousUpNext
TJwSecurityDesktop Class
Pascal
TJwSecurityDesktop = class;

TJwSecurityDesktop is the main class that provides methods to create, open and manipulate desktops. Be aware of following things:

  1. nearly every function can create an exception.
If you don't check for them it can happen that a switch back to default desktop does not work. This especially happens if Delphi is active and shows the exception source on the default desktop.
  1. This instance does not dynamically react on changes done by direct WinAPI calls.

 
Name 
Description 
 
public declarations Constructor Create creates a new instance of TJwSecurityDesktop. This constructor can create and open a desktop object.
 
 
CreateAndGetInputDesktop creates an instance using the current input desktop. The input desktop is the one which can receive user inputs. 
 
CreateByHandle creates an instance using an existing handle. The handle can be automatically destroyed on freeing. 
 
CreateDesktop creates a new desktop using the current window station. See Create for more information. 
 
CreateUnInitialized creates a desktop instance without creating or opening a desktop. This function is used for internal purposes and should not be used. 
 
Destroy frees the desktop instance and closes the desktop handle if any and if the property OnDestroyDesktop is true. If OnDestroyDesktop is false the desktop instance is freed but the desktop handle is retained. 
 
OpenDesktop opens a desktop using the current window station. See Create for more information. 
Name 
Description 
The following tables list the members exposed by TJwSecurityDesktop. 
The methods of the TJwSecurityDesktop class are listed here. 
The properties of the TJwSecurityDesktop class are listed here. 
The events of the TJwSecurityDesktop class are listed here. 
 
Name 
Description 
 
The event property OnDestroyDesktop is called if the desktop instance is destroyed. See TJwOnDestroyDesktop for more information. 
 
Name 
Description 
 
Close frees a desktop handle. The instance cannot be used for more desktop manipulation. 
 
DesktopFlagsToInt converts the enum type TJwSecurityDesktopFlags to the corresponding integer type.  
 
GeTSecurityDesktopWindowHandles creates a list of available desktop window handles. All TList pointers are desktop handles. You can convert them to HDESK by type cast : HDESK(List.Item[i])  
 
OpenDesktopByName opens a desktop with the name given in the property Name. This function does not check for an already opened desktop in this instance. It simply overrides the current handle of this desktop instance. For more information about parameters see Create .
Do not use this function, it is used for internal purposes. 
 
OpenInputDesktop opens the desktop that currently holds the input. This function does check for an already opened desktop in this instance and raises an EOpenDesktop Error It simply overrides the current handle of this desktop instance. For more information about parameters see Create .
Do not use this function, it is used for internal purposes. 
 
SetLastThreadDesktop tries to return to the thread desktop that was used before a call to SetThreadDesktop. ! 
 
SetThreadDesktop assigns the desktop to the thread that calls this function. This only works if the thread has no already opened windows or hooks. If the desktop is not opened this function does nothing. 
 
SwitchDesktop switches input to the desktop of this instance. If no desktop is opened this function does nothing.
SwitchDesktop does save a handle to the desktop that was active before it is called so it can be changed back in SwitchDesktopBack
 
SwitchDesktopBack switches the input to the desktop used before SwitchDesktop was called. 
 
Name 
Description 
 
The property CloseOnDestroy is a flag that determines if the desktop handle shall be closed if the desktop instance is freed. That case is used if aCloseOnDestroy is TRUE otherwise the handle will exists until you close it by yourself or the application is closed. 
 
The readonly property DesiredAccess contains the access mask specified by the parameter aDesiredAccess in Create 
 
The property DesktopFlags gets or sets the desktop flag. If no desktop is opened a change of this flag is ignored. EJwsclDesktopException can be raised if an error occures while setting flag. 
 
The readonly property Handle contains the handle to the desktop. It can be 0 if the desktop is not opened or invald. Be aware that an access to this handle can result to unexpected results. 
 
The property IsInputDesktop returns true if this desktop instance was created by OpenInputDesktop; otherwise false. 
 
This is LastSwitchDesktop, a member of class TJwSecurityDesktop. 
 
This is LastThreadDesktop, a member of class TJwSecurityDesktop. 
 
Name 
The readonly propertyName contains the name of the Desktops. Be aware that desktop names are case sensitive. 
 
This is ObjectType, a member of class TJwSecurityDesktop. 
 
The readonly property Opened gets the status of the desktop handle. If the desktop handle is not zero it returns true. Opened cannot determine a open status of a desktop that was closed by a winapi call. 
 
The property Parent returns the parameter aParent in in Create
 
SecurityDescriptor[Info sets or gets the security descriptor of the current window station. This property uses a parameter Info to set which information is to be set or get. ex. SecurityDescriptor[[sif_XXXX,sif_XXXX]]
If used for getting the SD the caller is responsible for freeing the instance.
Getting the security parameter uses TJwSecureGeneralObject.GetSecurityInfo , setting the security parameter uses TJwSecureGeneralObject.SetSecurityInfo , see the methods for more informations and errors. 
 
The readonly property SecurityDescriptorPtr contains the SecurityDescriptor specified by the parameter aSecurityDescriptor in Create 
 
This is UserSID, a member of class TJwSecurityDesktop. 
Copyright (c) 2010. All rights reserved.
This help was created by Doc-O-Matic sponsored by toolsfactory software inc.
What do you think about this topic? Send feedback!