C# Class CairoDesktop.Interop.NativeMethods

Container class for Win32 Native methods used within the desktop application (e.g. shutdown, sleep, et al).
显示文件 Open project: RevolutionSmythe/cairoshell

Public Methods

Method Description
FindWindow ( string className ) : IntPtr
GetIconForWindow ( IntPtr HWnd ) : uint
GetWindowRectangle ( IntPtr windowHandle ) : RECT
Logoff ( ) : void

Calls the logoff method on the Win32 API.

PostWindowsMessage ( IntPtr hWnd, uint callback, uint uid, uint messageId ) : void
Reboot ( ) : void

Calls the reboot method on the Win32 API.

Shutdown ( ) : void

Calls the shutdown method on the Win32 API.

Sleep ( ) : void

Calls the Sleep method on the Win32 Power Profile API.

Private Methods

Method Description
AdjustTokenPrivileges ( IntPtr tokenHandle, bool disableAllPrivileges, CairoDesktop.Interop.TOKEN_PRIVILEGES &newState, uint bufferLength, IntPtr previousState, IntPtr returnLength ) : bool
AdjustTokenPrivilegesForShutdown ( ) : void

Adjusts the current process's token privileges to allow it to shut down or reboot the machine. Throws an ApplicationException if an error is encountered.

BringWindowToTop ( IntPtr hWnd ) : bool
CloseHandle ( Int32 Handle ) : Int32
CreateWindowEx ( int dwExStyle, string lpClassName, string lpWindowName, int dwStyle, int x, int y, int nWidth, int nHeight, IntPtr hwndParent, IntPtr hMenu, IntPtr hInstance, IntPtr lParam ) : IntPtr
DeregisterShellHookWindow ( IntPtr hWnd ) : bool
ExitWindowsEx ( uint flags, uint reason ) : bool
FindWindow ( string className, string windowName ) : IntPtr
GetClassLong ( IntPtr handle, int longClass ) : uint
GetDesktopWindow ( ) : IntPtr
GetModuleHandle ( string filename ) : IntPtr
GetSystemMetrics ( int Index ) : int
GetWindowRect ( IntPtr hWnd, RECT &lpRect ) : bool
LookupPrivilegeValue ( string host, string name, long &pluid ) : bool
MoveWindow ( IntPtr hWnd, int x, int y, int cx, int cy, bool repaint ) : bool
OpenEvent ( Int32 DesiredAccess, bool InheritHandle, string Name ) : Int32
OpenProcessToken ( IntPtr processHandle, uint desiredAccess, IntPtr &tokenHandle ) : bool
PostMessage ( IntPtr hWnd, uint callback, uint wParam, uint lParam ) : bool
RegisterClassEx ( WNDCLASSEX &pcWndClassEx ) : int
RegisterHotKey ( IntPtr hWnd, int id, KeyModifiers fsModifiers, System vk ) : bool
RegisterShellHook ( IntPtr hWnd, uint flags ) : bool
RegisterShellHookWindow ( IntPtr hWnd ) : bool
RegisterWindowMessage ( string msg ) : int
SHAppBarMessage ( int dwMessage, APPBARDATA &pData ) : uint
SendMessage ( IntPtr hwnd, int message, IntPtr wparam, IntPtr lparam ) : IntPtr
SendMessageTimeout ( IntPtr hWnd, uint messageId, uint wparam, uint lparam, uint timeoutFlags, uint timeout, uint &retval ) : uint
SetEvent ( Int32 Handle ) : Int32
SetShellWindow ( IntPtr hWnd ) : Int32
SetSuspendState ( bool hibernate, bool forceCritical, bool disableWakeEvent ) : bool
SetTaskmanWindow ( IntPtr hWnd ) : bool
SetWindowPos ( IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, int uFlags ) : bool
SystemParametersInfo ( SPI uiAction, uint uiParam, IntPtr pvParam, SPIF fWinIni ) : bool
UnregisterClass ( string lpClassname, IntPtr hInstance ) : bool
UnregisterHotKey ( IntPtr hWnd, int id ) : bool

Method Details

FindWindow() public static method

public static FindWindow ( string className ) : IntPtr
className string
return System.IntPtr

GetIconForWindow() public static method

public static GetIconForWindow ( IntPtr HWnd ) : uint
HWnd System.IntPtr
return uint

GetWindowRectangle() public static method

public static GetWindowRectangle ( IntPtr windowHandle ) : RECT
windowHandle System.IntPtr
return RECT

Logoff() public static method

Calls the logoff method on the Win32 API.
public static Logoff ( ) : void
return void

PostWindowsMessage() public static method

public static PostWindowsMessage ( IntPtr hWnd, uint callback, uint uid, uint messageId ) : void
hWnd System.IntPtr
callback uint
uid uint
messageId uint
return void

Reboot() public static method

Calls the reboot method on the Win32 API.
public static Reboot ( ) : void
return void

Shutdown() public static method

Calls the shutdown method on the Win32 API.
public static Shutdown ( ) : void
return void

Sleep() public static method

Calls the Sleep method on the Win32 Power Profile API.
public static Sleep ( ) : void
return void