C# Класс UlteriusAgent.Desktop

Encapsulates the Desktop API.
Наследование: IDisposable, ICloneable
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
Default Desktop
HWND_BOTTOM System.IntPtr
HWND_BROADCAST System.IntPtr
HWND_MESSAGE System.IntPtr
HWND_NOTOPMOST System.IntPtr
HWND_TOP System.IntPtr
HWND_TOPMOST System.IntPtr
Input Desktop
MOD_ALT int
MOD_CONTROL int
MOD_SHIFT int
MOD_WIN int
VK_DELETE int
WM_HOTKEY int

Открытые методы

Метод Описание
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.

MakeLong ( int low, int high ) : int
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.

SimulateCtrlAltDel ( ) : bool
ToString ( ) : string

Gets the desktop name.

Приватные методы

Метод Описание
CheckDisposed ( ) : void
ClientToScreen ( IntPtr hWnd, POINT &point ) : bool
CloseDesktop ( IntPtr hDesktop ) : bool
CloseWindowStation ( IntPtr hWinsta ) : 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
FindWindow ( string lpClassName, string lpWindowName ) : IntPtr
FindWindowByCaption ( IntPtr ZeroOnly, string lpWindowName ) : IntPtr
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
MAKELPARAM ( int p, int p_2 ) : int
OpenDesktop ( string lpszDesktop, int dwFlags, bool fInherit, long dwDesiredAccess ) : IntPtr
OpenInputDesktop ( int dwFlags, bool fInherit, long dwDesiredAccess ) : IntPtr
OpenWindowStation ( string lpszWinSta, bool fInherit, ACCESS_MASK dwDesiredAccess ) : IntPtr
PostMessage ( IntPtr hWnd, int uMsg, int wParam, int lParam ) : int
SendSAS ( bool asUser ) : void
SetCursorPos ( int x, int y ) : long
SetProcessWindowStation ( IntPtr hWinSta ) : bool
SetThreadDesktop ( IntPtr hDesktop ) : bool
SwitchDesktop ( IntPtr hDesktop ) : bool
WTSGetActiveConsoleSessionId ( ) : int

Описание методов

Clone() публичный Метод

Creates a new Desktop object with the same desktop open.
public Clone ( ) : object
Результат object

Close() публичный Метод

Closes the handle to a desktop.
public Close ( ) : bool
Результат bool

Create() публичный Метод

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.
Результат bool

CreateDesktop() публичный статический Метод

Creates a new desktop.
public static CreateDesktop ( string name ) : Desktop
name string The name of the desktop to create. Names are case sensitive.
Результат Desktop

CreateProcess() публичный Метод

Creates a new process in a desktop.
public CreateProcess ( string path ) : Process
path string Path to application.
Результат System.Diagnostics.Process

CreateProcess() публичный статический Метод

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.
Результат System.Diagnostics.Process

Desktop() публичный Метод

Creates a new Desktop object.
public Desktop ( ) : System
Результат System

Dispose() публичный Метод

Dispose Object.
public Dispose ( ) : void
Результат void

Dispose() публичный Метод

Dispose Object.
public Dispose ( bool disposing ) : void
disposing bool True to dispose managed resources.
Результат void

Exists() публичный статический Метод

Checks if the specified desktop exists (using a case sensitive search).
public static Exists ( string name ) : bool
name string The name of the desktop.
Результат bool

Exists() публичный статический Метод

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.
Результат bool

GetCurrent() публичный статический Метод

Gets the desktop of the calling thread.
public static GetCurrent ( ) : Desktop
Результат Desktop

GetDesktopName() публичный статический Метод

Gets the name of a given desktop.
public static GetDesktopName ( Desktop desktop ) : string
desktop Desktop Desktop object whos name is to be found.
Результат string

GetDesktopName() публичный статический Метод

Gets the name of a desktop from a desktop handle.
public static GetDesktopName ( IntPtr desktopHandle ) : string
desktopHandle System.IntPtr
Результат string

GetDesktops() публичный статический Метод

Enumerates all of the desktops.
public static GetDesktops ( ) : string[]
Результат string[]

GetInputProcesses() публичный статический Метод

Gets an array of all the processes running on the Input desktop.
public static GetInputProcesses ( ) : System.Diagnostics.Process[]
Результат System.Diagnostics.Process[]

GetWindows() публичный Метод

Enumerates the windows on a desktop.
public GetWindows ( ) : WindowCollection
Результат WindowCollection

MakeLong() публичный статический Метод

public static MakeLong ( int low, int high ) : int
low int
high int
Результат int

Open() публичный Метод

Opens a desktop.
public Open ( string name ) : bool
name string The name of the desktop to open.
Результат bool

OpenDefaultDesktop() публичный статический Метод

Opens the default desktop.
public static OpenDefaultDesktop ( ) : Desktop
Результат Desktop

OpenDesktop() публичный статический Метод

Opens a desktop.
public static OpenDesktop ( string name ) : Desktop
name string The name of the desktop to open.
Результат Desktop

OpenInput() публичный Метод

Opens the current input desktop.
public OpenInput ( ) : bool
Результат bool

OpenInputDesktop() публичный статический Метод

Opens the current input desktop.
public static OpenInputDesktop ( ) : Desktop
Результат Desktop

Prepare() публичный Метод

Prepares a desktop for use. For use only on newly created desktops, call straight after CreateDesktop.
public Prepare ( ) : void
Результат void

SetCurrent() публичный статический Метод

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.
Результат bool

Show() публичный Метод

Switches input to the currently opened desktop.
public Show ( ) : bool
Результат bool

Show() публичный статический Метод

Switches to the specified desktop.
public static Show ( string name ) : bool
name string Name of desktop to switch input to.
Результат bool

SimulateCtrlAltDel() публичный статический Метод

public static SimulateCtrlAltDel ( ) : bool
Результат bool

ToString() публичный Метод

Gets the desktop name.
public ToString ( ) : string
Результат string

Описание свойств

Default публичное статическое свойство

Opens the default desktop.
public static Desktop,UlteriusAgent Default
Результат Desktop

HWND_BOTTOM публичное статическое свойство

public static IntPtr,System HWND_BOTTOM
Результат System.IntPtr

HWND_BROADCAST публичное статическое свойство

public static IntPtr,System HWND_BROADCAST
Результат System.IntPtr

HWND_MESSAGE публичное статическое свойство

public static IntPtr,System HWND_MESSAGE
Результат System.IntPtr

HWND_NOTOPMOST публичное статическое свойство

public static IntPtr,System HWND_NOTOPMOST
Результат System.IntPtr

HWND_TOP публичное статическое свойство

public static IntPtr,System HWND_TOP
Результат System.IntPtr

HWND_TOPMOST публичное статическое свойство

public static IntPtr,System HWND_TOPMOST
Результат System.IntPtr

Input публичное статическое свойство

Opens the desktop the user if viewing.
public static Desktop,UlteriusAgent Input
Результат Desktop

MOD_ALT публичное статическое свойство

public static int MOD_ALT
Результат int

MOD_CONTROL публичное статическое свойство

public static int MOD_CONTROL
Результат int

MOD_SHIFT публичное статическое свойство

public static int MOD_SHIFT
Результат int

MOD_WIN публичное статическое свойство

public static int MOD_WIN
Результат int

VK_DELETE публичное статическое свойство

public static int VK_DELETE
Результат int

WM_HOTKEY публичное статическое свойство

public static int WM_HOTKEY
Результат int