C# Класс Binarysharp.MemoryManagement.Windows.WindowCore

Static core class providing tools for managing windows.
Показать файл Открыть проект Примеры использования класса

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

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

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

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

Enumerates all the windows on the screen.
public static EnumAllWindows ( ) : IEnumerable
Результат IEnumerable

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

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

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

Enumerates all top-level windows on the screen. This function does not search child windows.
public static EnumTopLevelWindows ( ) : IEnumerable
Результат IEnumerable

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

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

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

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

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

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

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

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

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

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

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

Retrieves a handle to the foreground window (the window with which the user is currently working).
public static GetForegroundWindow ( ) : IntPtr
Результат System.IntPtr

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

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

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

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.
Результат Binarysharp.MemoryManagement.Native.WindowPlacement

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

Retrieves the identifier of the process that created the window.
public static GetWindowProcessId ( IntPtr windowHandle ) : int
windowHandle System.IntPtr A handle to the window.
Результат int

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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