C# Class UlteriusServer.Api.Win32.Desktop

Encapsulates the Desktop API.
Inheritance: IDisposable, ICloneable
Afficher le fichier Open project: Ulterius/server Class Usage Examples

Méthodes publiques

Свойство Type Description
Default Desktop
Input Desktop

Méthodes publiques

Méthode Description
Clone ( ) : object

Creates a new Desktop object with the same desktop open.

Close ( ) : bool

Closes the handle to a desktop.

Create ( string name ) : bool

Creates a new desktop. If a handle is open, it will be closed.

CreateDesktop ( string name ) : Desktop

Creates a new desktop.

CreateProcess ( string path ) : Process

Creates a new process in a desktop.

CreateProcess ( string path, string desktop ) : Process

Creates a new process on the specified desktop.

Desktop ( ) : System

Creates a new Desktop object.

Dispose ( ) : void

Dispose Object.

Dispose ( bool disposing ) : void

Dispose Object.

Exists ( string name ) : bool

Checks if the specified desktop exists (using a case sensitive search).

Exists ( string name, bool caseInsensitive ) : bool

Checks if the specified desktop exists.

GetCurrent ( ) : Desktop

Gets the desktop of the calling thread.

GetDesktopName ( Desktop desktop ) : string

Gets the name of a given desktop.

GetDesktopName ( IntPtr desktopHandle ) : string

Gets the name of a desktop from a desktop handle.

GetDesktops ( ) : string[]

Enumerates all of the desktops.

GetInputProcesses ( ) : System.Diagnostics.Process[]

Gets an array of all the processes running on the Input desktop.

GetWindows ( ) : WindowCollection

Enumerates the windows on a desktop.

Open ( string name ) : bool

Opens a desktop.

OpenDefaultDesktop ( ) : Desktop

Opens the default desktop.

OpenDesktop ( string name ) : Desktop

Opens a desktop.

OpenInput ( ) : bool

Opens the current input desktop.

OpenInputDesktop ( ) : Desktop

Opens the current input desktop.

Prepare ( ) : void

Prepares a desktop for use. For use only on newly created desktops, call straight after CreateDesktop.

SetCurrent ( Desktop desktop ) : bool

Sets the desktop of the calling thread. NOTE: Function will fail if thread has hooks or windows in the current desktop.

Show ( ) : bool

Switches input to the currently opened desktop.

Show ( string name ) : bool

Switches to the specified desktop.

ToString ( ) : string

Gets the desktop name.

Private Methods

Méthode Description
CheckDisposed ( ) : void
CloseDesktop ( IntPtr hDesktop ) : bool
CreateDesktop ( string lpszDesktop, IntPtr lpszDevice, IntPtr pDevmode, int dwFlags, long dwDesiredAccess, IntPtr lpsa ) : IntPtr
CreateProcess ( string lpApplicationName, string lpCommandLine, IntPtr lpProcessAttributes, IntPtr lpThreadAttributes, bool bInheritHandles, int dwCreationFlags, IntPtr lpEnvironment, string lpCurrentDirectory, STARTUPINFO &lpStartupInfo, PROCESS_INFORMATION &lpProcessInformation ) : bool
Desktop ( IntPtr desktop ) : System
DesktopProc ( string lpszDesktop, IntPtr lParam ) : bool
DesktopWindowsProc ( IntPtr wndHandle, IntPtr lParam ) : bool
EnumDesktopWindows ( IntPtr hDesktop, EnumDesktopWindowsProc lpfn, IntPtr lParam ) : bool
EnumDesktops ( IntPtr hwinsta, EnumDesktopProc lpEnumFunc, IntPtr lParam ) : bool
GetCurrentThreadId ( ) : int
GetProcessId ( IntPtr process ) : int
GetProcessWindowStation ( ) : IntPtr
GetThreadDesktop ( int dwThreadId ) : IntPtr
GetThreadId ( IntPtr thread ) : int
GetUserObjectInformation ( IntPtr hObj, int nIndex, IntPtr pvInfo, int nLength, int &lpnLengthNeeded ) : bool
GetWindowText ( IntPtr hWnd, IntPtr lpString, int nMaxCount ) : int
OpenDesktop ( string lpszDesktop, int dwFlags, bool fInherit, long dwDesiredAccess ) : IntPtr
OpenInputDesktop ( int dwFlags, bool fInherit, long dwDesiredAccess ) : IntPtr
SetThreadDesktop ( IntPtr hDesktop ) : bool
SwitchDesktop ( IntPtr hDesktop ) : bool
WTSGetActiveConsoleSessionId ( ) : int

Method Details

Clone() public méthode

Creates a new Desktop object with the same desktop open.
public Clone ( ) : object
Résultat object

Close() public méthode

Closes the handle to a desktop.
public Close ( ) : bool
Résultat bool

Create() public méthode

Creates a new desktop. If a handle is open, it will be closed.
public Create ( string name ) : bool
name string The name of the new desktop. Must be unique, and is case sensitive.
Résultat bool

CreateDesktop() public static méthode

Creates a new desktop.
public static CreateDesktop ( string name ) : Desktop
name string The name of the desktop to create. Names are case sensitive.
Résultat Desktop

CreateProcess() public méthode

Creates a new process in a desktop.
public CreateProcess ( string path ) : Process
path string Path to application.
Résultat System.Diagnostics.Process

CreateProcess() public static méthode

Creates a new process on the specified desktop.
public static CreateProcess ( string path, string desktop ) : Process
path string Path to application.
desktop string Desktop name.
Résultat System.Diagnostics.Process

Desktop() public méthode

Creates a new Desktop object.
public Desktop ( ) : System
Résultat System

Dispose() public méthode

Dispose Object.
public Dispose ( ) : void
Résultat void

Dispose() public méthode

Dispose Object.
public Dispose ( bool disposing ) : void
disposing bool True to dispose managed resources.
Résultat void

Exists() public static méthode

Checks if the specified desktop exists (using a case sensitive search).
public static Exists ( string name ) : bool
name string The name of the desktop.
Résultat bool

Exists() public static méthode

Checks if the specified desktop exists.
public static Exists ( string name, bool caseInsensitive ) : bool
name string The name of the desktop.
caseInsensitive bool If the search is case INsensitive.
Résultat bool

GetCurrent() public static méthode

Gets the desktop of the calling thread.
public static GetCurrent ( ) : Desktop
Résultat Desktop

GetDesktopName() public static méthode

Gets the name of a given desktop.
public static GetDesktopName ( Desktop desktop ) : string
desktop Desktop Desktop object whos name is to be found.
Résultat string

GetDesktopName() public static méthode

Gets the name of a desktop from a desktop handle.
public static GetDesktopName ( IntPtr desktopHandle ) : string
desktopHandle System.IntPtr
Résultat string

GetDesktops() public static méthode

Enumerates all of the desktops.
public static GetDesktops ( ) : string[]
Résultat string[]

GetInputProcesses() public static méthode

Gets an array of all the processes running on the Input desktop.
public static GetInputProcesses ( ) : System.Diagnostics.Process[]
Résultat System.Diagnostics.Process[]

GetWindows() public méthode

Enumerates the windows on a desktop.
public GetWindows ( ) : WindowCollection
Résultat WindowCollection

Open() public méthode

Opens a desktop.
public Open ( string name ) : bool
name string The name of the desktop to open.
Résultat bool

OpenDefaultDesktop() public static méthode

Opens the default desktop.
public static OpenDefaultDesktop ( ) : Desktop
Résultat Desktop

OpenDesktop() public static méthode

Opens a desktop.
public static OpenDesktop ( string name ) : Desktop
name string The name of the desktop to open.
Résultat Desktop

OpenInput() public méthode

Opens the current input desktop.
public OpenInput ( ) : bool
Résultat bool

OpenInputDesktop() public static méthode

Opens the current input desktop.
public static OpenInputDesktop ( ) : Desktop
Résultat Desktop

Prepare() public méthode

Prepares a desktop for use. For use only on newly created desktops, call straight after CreateDesktop.
public Prepare ( ) : void
Résultat void

SetCurrent() public static méthode

Sets the desktop of the calling thread. NOTE: Function will fail if thread has hooks or windows in the current desktop.
public static SetCurrent ( Desktop desktop ) : bool
desktop Desktop Desktop to put the thread in.
Résultat bool

Show() public méthode

Switches input to the currently opened desktop.
public Show ( ) : bool
Résultat bool

Show() public static méthode

Switches to the specified desktop.
public static Show ( string name ) : bool
name string Name of desktop to switch input to.
Résultat bool

ToString() public méthode

Gets the desktop name.
public ToString ( ) : string
Résultat string

Property Details

Default public_oe static_oe property

Opens the default desktop.
public static Desktop,UlteriusServer.Api.Win32 Default
Résultat Desktop

Input public_oe static_oe property

Opens the desktop the user if viewing.
public static Desktop,UlteriusServer.Api.Win32 Input
Résultat Desktop