C# Class Binarysharp.MemoryManagement.Windows.WindowCore

Static core class providing tools for managing windows.
Afficher le fichier Open project: ZenLulz/MemorySharp Class Usage Examples

Méthodes publiques

Méthode Description
EnumAllWindows ( ) : IEnumerable

Enumerates all the windows on the screen.

EnumChildWindows ( IntPtr parentHandle ) : IEnumerable

Enumerates recursively all the child windows that belong to the specified parent window.

EnumTopLevelWindows ( ) : IEnumerable

Enumerates all top-level windows on the screen. This function does not search child windows.

FlashWindow ( IntPtr windowHandle ) : bool

Flashes the specified window one time. It does not change the active state of the window. To flash the window a specified number of times, use the FlashWindowEx(IntPtr, FlashWindowFlags, uint, TimeSpan) function.

FlashWindowEx ( IntPtr windowHandle, FlashWindowFlags flags ) : void

Flashes the specified window. It does not change the active state of the window. The function uses the default cursor blink rate.

FlashWindowEx ( IntPtr windowHandle, FlashWindowFlags flags, uint count ) : void

Flashes the specified window. It does not change the active state of the window. The function uses the default cursor blink rate.

FlashWindowEx ( IntPtr windowHandle, FlashWindowFlags flags, uint count, System.TimeSpan timeout ) : void

Flashes the specified window. It does not change the active state of the window.

GetClassName ( IntPtr windowHandle ) : string

Retrieves the name of the class to which the specified window belongs.

GetForegroundWindow ( ) : IntPtr

Retrieves a handle to the foreground window (the window with which the user is currently working).

GetSystemMetrics ( SystemMetrics metric ) : int

Retrieves the specified system metric or system configuration setting.

GetWindowPlacement ( IntPtr windowHandle ) : WindowPlacement

Retrieves the show state and the restored, minimized, and maximized positions of the specified window.

GetWindowProcessId ( IntPtr windowHandle ) : int

Retrieves the identifier of the process that created the window.

GetWindowText ( IntPtr windowHandle ) : string

Gets the text of the specified window's title bar.

GetWindowThreadId ( IntPtr windowHandle ) : int

Retrieves the identifier of the thread that created the specified window.

MapVirtualKey ( Keys key, TranslationTypes translation ) : uint

Translates (maps) a virtual-key code into a scan code or character value, or translates a scan code into a virtual-key code. To specify a handle to the keyboard layout to use for translating the specified code, use the MapVirtualKeyEx function.

MapVirtualKey ( uint key, TranslationTypes translation ) : uint

Translates (maps) a virtual-key code into a scan code or character value, or translates a scan code into a virtual-key code. To specify a handle to the keyboard layout to use for translating the specified code, use the MapVirtualKeyEx function.

PostMessage ( IntPtr windowHandle, WindowsMessages message, UIntPtr wParam, UIntPtr lParam ) : void

Places (posts) a message in the message queue associated with the thread that created the specified window and returns without waiting for the thread to process the message.

PostMessage ( IntPtr windowHandle, uint message, UIntPtr wParam, UIntPtr lParam ) : void

Places (posts) a message in the message queue associated with the thread that created the specified window and returns without waiting for the thread to process the message.

SendInput ( Input inputs ) : void

Synthesizes keystrokes, mouse motions, and button clicks.

SendMessage ( IntPtr windowHandle, WindowsMessages message, UIntPtr wParam, IntPtr lParam ) : IntPtr

Sends the specified message to a window or windows. The SendMessage function calls the window procedure for the specified window and does not return until the window procedure has processed the message.

SendMessage ( IntPtr windowHandle, uint message, UIntPtr wParam, IntPtr lParam ) : IntPtr

Sends the specified message to a window or windows. The SendMessage function calls the window procedure for the specified window and does not return until the window procedure has processed the message.

SetForegroundWindow ( IntPtr windowHandle ) : void

Brings the thread that created the specified window into the foreground and activates the window. The window is restored if minimized. Performs no action if the window is already activated.

SetWindowPlacement ( IntPtr windowHandle, WindowPlacement placement ) : void

Sets the show state and the restored, minimized, and maximized positions of the specified window.

SetWindowPlacement ( IntPtr windowHandle, int left, int top, int height, int width ) : void

Sets the current position and size of the specified window.

SetWindowText ( IntPtr windowHandle, string title ) : void

Sets the text of the specified window's title bar.

ShowWindow ( IntPtr windowHandle, WindowStates state ) : bool

Sets the specified window's show state.

Method Details

EnumAllWindows() public static méthode

Enumerates all the windows on the screen.
public static EnumAllWindows ( ) : IEnumerable
Résultat IEnumerable

EnumChildWindows() public static méthode

Enumerates recursively all the child windows that belong to the specified parent window.
public static EnumChildWindows ( IntPtr parentHandle ) : IEnumerable
parentHandle System.IntPtr The parent window handle.
Résultat IEnumerable

EnumTopLevelWindows() public static méthode

Enumerates all top-level windows on the screen. This function does not search child windows.
public static EnumTopLevelWindows ( ) : IEnumerable
Résultat IEnumerable

FlashWindow() public static méthode

Flashes the specified window one time. It does not change the active state of the window. To flash the window a specified number of times, use the FlashWindowEx(IntPtr, FlashWindowFlags, uint, TimeSpan) function.
public static FlashWindow ( IntPtr windowHandle ) : bool
windowHandle System.IntPtr A handle to the window to be flashed. The window can be either open or minimized.
Résultat bool

FlashWindowEx() public static méthode

Flashes the specified window. It does not change the active state of the window. The function uses the default cursor blink rate.
public static FlashWindowEx ( IntPtr windowHandle, FlashWindowFlags flags ) : void
windowHandle System.IntPtr A handle to the window to be flashed. The window can be either opened or minimized.
flags FlashWindowFlags The flash status.
Résultat void

FlashWindowEx() public static méthode

Flashes the specified window. It does not change the active state of the window. The function uses the default cursor blink rate.
public static FlashWindowEx ( IntPtr windowHandle, FlashWindowFlags flags, uint count ) : void
windowHandle System.IntPtr A handle to the window to be flashed. The window can be either opened or minimized.
flags FlashWindowFlags The flash status.
count uint The number of times to flash the window.
Résultat void

FlashWindowEx() public static méthode

Flashes the specified window. It does not change the active state of the window.
public static FlashWindowEx ( IntPtr windowHandle, FlashWindowFlags flags, uint count, System.TimeSpan timeout ) : void
windowHandle System.IntPtr A handle to the window to be flashed. The window can be either opened or minimized.
flags FlashWindowFlags The flash status.
count uint The number of times to flash the window.
timeout System.TimeSpan The rate at which the window is to be flashed.
Résultat void

GetClassName() public static méthode

Retrieves the name of the class to which the specified window belongs.
public static GetClassName ( IntPtr windowHandle ) : string
windowHandle System.IntPtr A handle to the window and, indirectly, the class to which the window belongs.
Résultat string

GetForegroundWindow() public static méthode

Retrieves a handle to the foreground window (the window with which the user is currently working).
public static GetForegroundWindow ( ) : IntPtr
Résultat System.IntPtr

GetSystemMetrics() public static méthode

Retrieves the specified system metric or system configuration setting.
public static GetSystemMetrics ( SystemMetrics metric ) : int
metric SystemMetrics The system metric or configuration setting to be retrieved.
Résultat int

GetWindowPlacement() public static méthode

Retrieves the show state and the restored, minimized, and maximized positions of the specified window.
public static GetWindowPlacement ( IntPtr windowHandle ) : WindowPlacement
windowHandle System.IntPtr A handle to the window.
Résultat Binarysharp.MemoryManagement.Native.WindowPlacement

GetWindowProcessId() public static méthode

Retrieves the identifier of the process that created the window.
public static GetWindowProcessId ( IntPtr windowHandle ) : int
windowHandle System.IntPtr A handle to the window.
Résultat int

GetWindowText() public static méthode

Gets the text of the specified window's title bar.
public static GetWindowText ( IntPtr windowHandle ) : string
windowHandle System.IntPtr A handle to the window containing the text.
Résultat string

GetWindowThreadId() public static méthode

Retrieves the identifier of the thread that created the specified window.
public static GetWindowThreadId ( IntPtr windowHandle ) : int
windowHandle System.IntPtr A handle to the window.
Résultat int

MapVirtualKey() public static méthode

Translates (maps) a virtual-key code into a scan code or character value, or translates a scan code into a virtual-key code. To specify a handle to the keyboard layout to use for translating the specified code, use the MapVirtualKeyEx function.
public static MapVirtualKey ( Keys key, TranslationTypes translation ) : uint
key Keys /// The virtual key code for a key. How this value is interpreted depends on the value of the uMapType parameter. ///
translation TranslationTypes /// The translation to be performed. The value of this parameter depends on the value of the uCode parameter. ///
Résultat uint

MapVirtualKey() public static méthode

Translates (maps) a virtual-key code into a scan code or character value, or translates a scan code into a virtual-key code. To specify a handle to the keyboard layout to use for translating the specified code, use the MapVirtualKeyEx function.
public static MapVirtualKey ( uint key, TranslationTypes translation ) : uint
key uint /// The virtual key code or scan code for a key. How this value is interpreted depends on the value of the uMapType parameter. ///
translation TranslationTypes /// The translation to be performed. The value of this parameter depends on the value of the uCode parameter. ///
Résultat uint

PostMessage() public static méthode

Places (posts) a message in the message queue associated with the thread that created the specified window and returns without waiting for the thread to process the message.
public static PostMessage ( IntPtr windowHandle, WindowsMessages message, UIntPtr wParam, UIntPtr lParam ) : void
windowHandle System.IntPtr A handle to the window whose window procedure is to receive the message. The following values have special meanings.
message WindowsMessages The message to be posted.
wParam System.UIntPtr Additional message-specific information.
lParam System.UIntPtr Additional message-specific information.
Résultat void

PostMessage() public static méthode

Places (posts) a message in the message queue associated with the thread that created the specified window and returns without waiting for the thread to process the message.
public static PostMessage ( IntPtr windowHandle, uint message, UIntPtr wParam, UIntPtr lParam ) : void
windowHandle System.IntPtr A handle to the window whose window procedure is to receive the message. The following values have special meanings.
message uint The message to be posted.
wParam System.UIntPtr Additional message-specific information.
lParam System.UIntPtr Additional message-specific information.
Résultat void

SendInput() public static méthode

Synthesizes keystrokes, mouse motions, and button clicks.
public static SendInput ( Input inputs ) : void
inputs Binarysharp.MemoryManagement.Native.Input An array of structures. Each structure represents an event to be inserted into the keyboard or mouse input stream.
Résultat void

SendMessage() public static méthode

Sends the specified message to a window or windows. The SendMessage function calls the window procedure for the specified window and does not return until the window procedure has processed the message.
public static SendMessage ( IntPtr windowHandle, WindowsMessages message, UIntPtr wParam, IntPtr lParam ) : IntPtr
windowHandle System.IntPtr A handle to the window whose window procedure will receive the message.
message WindowsMessages The message to be sent.
wParam System.UIntPtr Additional message-specific information.
lParam System.IntPtr Additional message-specific information.
Résultat System.IntPtr

SendMessage() public static méthode

Sends the specified message to a window or windows. The SendMessage function calls the window procedure for the specified window and does not return until the window procedure has processed the message.
public static SendMessage ( IntPtr windowHandle, uint message, UIntPtr wParam, IntPtr lParam ) : IntPtr
windowHandle System.IntPtr A handle to the window whose window procedure will receive the message.
message uint The message to be sent.
wParam System.UIntPtr Additional message-specific information.
lParam System.IntPtr Additional message-specific information.
Résultat System.IntPtr

SetForegroundWindow() public static méthode

Brings the thread that created the specified window into the foreground and activates the window. The window is restored if minimized. Performs no action if the window is already activated.
public static SetForegroundWindow ( IntPtr windowHandle ) : void
windowHandle System.IntPtr A handle to the window that should be activated and brought to the foreground.
Résultat void

SetWindowPlacement() public static méthode

Sets the show state and the restored, minimized, and maximized positions of the specified window.
public static SetWindowPlacement ( IntPtr windowHandle, WindowPlacement placement ) : void
windowHandle System.IntPtr A handle to the window.
placement Binarysharp.MemoryManagement.Native.WindowPlacement A pointer to the structure that specifies the new show state and window positions.
Résultat void

SetWindowPlacement() public static méthode

Sets the current position and size of the specified window.
public static SetWindowPlacement ( IntPtr windowHandle, int left, int top, int height, int width ) : void
windowHandle System.IntPtr A handle to the window.
left int The x-coordinate of the upper-left corner of the window.
top int The y-coordinate of the upper-left corner of the window.
height int The height of the window.
width int The width of the window.
Résultat void

SetWindowText() public static méthode

Sets the text of the specified window's title bar.
public static SetWindowText ( IntPtr windowHandle, string title ) : void
windowHandle System.IntPtr A handle to the window whose text is to be changed.
title string The new title text.
Résultat void

ShowWindow() public static méthode

Sets the specified window's show state.
public static ShowWindow ( IntPtr windowHandle, WindowStates state ) : bool
windowHandle System.IntPtr A handle to the window.
state WindowStates Controls how the window is to be shown.
Résultat bool