WindowsUtilities Class |
Namespace: ShellBoost.Core.Utilities
public static class WindowsUtilities
The WindowsUtilities type exposes the following members.
Name | Description | |
---|---|---|
KernelVersion |
Gets the current Windows version using the kernel32.dll file.
|
Name | Description | |
---|---|---|
ActivateModalWindow |
Activates the modal child window of a given window.
| |
ActivateWindow(IntPtr) |
Activates a window.
| |
ActivateWindow(Window) |
Activates a window.
| |
AllocConsole |
Allocates a new console for the calling process.
| |
AllowSetForegroundWindow |
Enables the specified process to set the foreground window using the SetForegroundWindow function.
The calling process must already be able to set the foreground window.
| |
AttachConsole |
Attaches the calling process to the console of the specified process.
| |
AttachThreadInput |
Attaches the input processing mechanism of one thread to that of another thread.
| |
BringWindowToTop |
Brings the specified window to the top of the Z order.
If the window is a top-level window, it is activated.
If the window is a child window, the top-level parent window associated with the child window is activated.
| |
Center(Window) |
Centers a window relatively to the screen.
| |
Center(Window, IntPtr) |
Centers a window relatively to another window, or to the screen.
| |
CenterWindow(IntPtr) |
Centers a window relatively to the screen.
| |
CenterWindow(IntPtr, IntPtr) |
Centers a window relatively to another window, or to the screen.
| |
ChildWindowFromPoint |
Determines which, if any, of the child windows belonging to the specified parent window contains the specified point.
The function can ignore invisible, disabled, and transparent child windows.
The search is restricted to immediate child windows.
Grandchildren and deeper descendants are not searched.
| |
CloseWindow |
Closes the specified window.
| |
Decode |
Decodes a Windows message.
| |
DecodeMessage |
Decodes a Windows message.
| |
DecryptSecureString |
Decrypts an array of bytes, encrypted used EncryptSecureString, into a secure string.
| |
DestroyWindow |
Destroys the specified window.
| |
DetachThreadInput |
Detaches the input processing mechanism of one thread from that of another thread.
| |
DoModalUI(Action) |
Runs an action in a modal UI loop.
| |
DoModalUIT(FuncT) |
Runs a function in a modal UI loop.
| |
DoModelessAsync(Action) |
Runs an action in a modeless UI loop.
| |
DoModelessAsyncT(FuncT) |
Runs a function in a modeless UI loop.
| |
EnableWindow |
Enables or disables mouse and keyboard input to the specified window or control.
When input is disabled, the window does not receive input such as mouse clicks and key presses.
When input is enabled, the window receives all input.
| |
EncryptSecureString |
Encrypts a secure string into an array of bytes.
| |
EnsureSubKey |
Ensures a registry sub key exists and opens it for write access.
| |
EnumerateChildWindows |
Enumerates the child windows that belong to the specified parent window.
| |
EnumerateParentWindows |
Enumerates the specified window's parent windows, if any.
| |
EnumerateProcessWindows(Int32) |
Enumerates the child windows that belong to the specified parent window.
| |
EnumerateProcessWindows(Process) |
Enumerates the child windows that belong to the specified parent window.
| |
EnumerateProperties |
Enumerates all entries in the property list of a window.
| |
EnumerateThreadWindows |
Enumerates the child windows that belong to the specified parent window.
| |
EnumerateTopLevelWindows |
Enumerates all top-level windows on the screen.
This function does not enumerate child windows, with the exception of a few top-level windows owned by the system that have the WS_CHILD style.
| |
EqualsOrdinal(SecureString, SecureString, Boolean) |
Compares two secure strings by evaluating the numeric values of the corresponding character objects in each string.
| |
EqualsOrdinal(SecureString, String, Boolean) |
Compares a secure string with an insecure string by evaluating the numeric values of the corresponding character objects in each string.
| |
FreeConsole |
Detaches the calling process from its console.
| |
GetActiveWindow |
Gets the window handle to the active window attached to the calling thread's message queue.
| |
GetAtomName |
Retrieves a string associated with the specified local atom.
| |
GetClientRect |
Gets the coordinates of a window's client area.
The client coordinates specify the upper-left and lower-right corners of the client area.
Because client coordinates are relative to the upper-left corner of a window's client area, the coordinates of the upper-left corner are (0,0).
| |
GetConsoleWindow |
Retrieves the window handle used by the console associated with the calling process.
| |
GetCurrentThreadId |
Retrieves the native thread identifier of the calling thread.
| |
GetDesktopWindow |
Retrieves a handle to the desktop window. The desktop window covers the entire screen.
The desktop window is the area on top of which other windows are painted.
| |
GetFocus |
Retrieves the handle to the window that has the keyboard focus, if the window is attached to the calling thread's message queue.
| |
GetForegroundWindow |
Retrieves a handle to the foreground window (the window with which the user is currently working).
The system assigns a slightly higher priority to the thread that creates the foreground window than it does to other threads.
| |
GetLastActivePopup |
Determines which pop-up window owned by the specified window was most recently active.
The return value is the same as the handle parameter, if any of the following conditions are met:
1) The window identified by hWnd was most recently active.
2) The window identified by hWnd does not own any pop-up windows.
3) The window identifies by hWnd is not a top-level window, or it is owned by another window.
| |
GetModalWindow |
Gets the modal window for a given parent window.
| |
GetOwnerWindow |
Gets the specified window's owner window, if any.
| |
GetParentWindow |
Gets the specified window's parent window, if any.
| |
GetProfilesDirectory |
Gets the path to the root directory where user profiles are stored.
| |
GetProp |
Retrieves a data handle from the property list of the specified window.
The character string identifies the handle to be retrieved.
The string and handle must have been added to the property list by a previous call to the SetProp function.
| |
GetRealWindowClass |
Retrieves the real name of the class to which the specified window belongs.
| |
GetRootOwnerWindow |
Gets the specified window's root window, if any.
| |
GetRootWindow |
Gets the specified window's root window, if any.
| |
GetShellWindow |
Retrieves a handle to the Shell's desktop window.
| |
GetThreadActiveWindow |
Gets a handle to the active window within the thread for a given thread.
| |
GetThreadCaptureWindow |
Gets a handle to the window that has captured the mouse for a given thread.
| |
GetThreadCaretWindow |
Gets a handle to the window that is displaying the caret for a given thread.
| |
GetThreadFocusWindow |
Gets a handle to the window that has the keyboard focus for a given thread.
| |
GetThreadMenuOwnerWindow |
Gets a handle to the window that owns any active menus for a given thread.
| |
GetThreadMoveSizeWindow |
Gets a handle to the window in a move or size loop for a given thread.
| |
GetTopWindow |
Examines the Z order of the child windows associated with the specified parent window and retrieves a handle to the child window at the top of the Z order.
| |
GetUserName |
Gets the name of the user or other security principal associated with the calling thread. You can specify the format of the returned name.
If the thread is impersonating a client, GetUserName returns the name of the client.
| |
GetUserProfileDirectory |
Gets the path to the root directory of the specified user's profile.
| |
GetWindowClass |
Retrieves the name of the class to which the specified window belongs.
| |
GetWindowDC |
Retrieves the device context (DC) for the entire window, including title bar, menus, and scroll bars.
The ReleaseDC function must be called to release the device context
| |
GetWindowDisplayAffinity |
Retrieves the current display affinity setting, from any process, for a given window.
| |
GetWindowLong |
Retrieves information about the specified window.
The function also retrieves the value at a specified offset into the extra window memory.
| |
GetWindowModuleFileName |
Retrieves the full path and file name of the module associated with the specified window handle.
| |
GetWindowProcessId |
Gets the identifier of the process that created the window.
| |
GetWindowRect |
Gets the dimensions of the bounding rectangle of the specified window.
The dimensions are given in screen coordinates that are relative to the upper-left corner of the screen.
| |
GetWindowText |
Gets the text of the specified window's title bar (if it has one).
| |
GetWindowThreadId |
Retrieves the identifier of the thread that created the specified window.
| |
GlobalGetAtomName |
Retrieves a string associated with the specified global atom.
| |
Invalidate |
Invalidates the specified window's client area.
| |
InvalidateRect |
Adds a rectangle to the specified window's update region.
The update region represents the portion of the window's client area that must be redrawn.
| |
InvalidateRgn |
Invalidates the client area within the specified region by adding it to the current update region of a window.
The invalidated region, along with all other areas in the update region, is marked for painting when the next WM_PAINT message occurs.
| |
IsHungAppWindow |
Determines whether the system considers that a specified application is not responding.
An application is considered to be not responding if it is not waiting for input, is not in startup processing, and has not called PeekMessage within the internal timeout period of 5 seconds.
This function is not intended for general use. It may be altered or unavailable in subsequent versions of Windows.
| |
IsIconic |
Determines whether a window is minimized (iconic).
| |
IsOutlook |
Determines whether the specified process instance corresponds to Microsoft Office Outlook
| |
IsParentWindow |
Determines whether the specified parent window is a parent or grand parent of the specified child window.
| |
IsPickerHost(Int32) |
Determines whether the specified process instance corresponds to Windows Picker Host.
| |
IsPickerHost(Process) |
Determines whether the specified process instance corresponds to Windows Picker Host.
| |
IsWindow |
Determines whether the specified window handle identifies an existing window.
| |
IsWindowEnabled |
Determines whether the specified window is enabled for mouse and keyboard input.
| |
IsWindows10OrGreater |
Indicates if the current OS version matches, or is greater than, the Windows 10 version.
On Windows 10 this function can return false if the application has no manifest. Check this for more information: https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-verifyversioninfoa
| |
IsWindows7OrGreater |
Indicates if the current OS version matches, or is greater than, the Windows 7 version.
| |
IsWindows7SP1OrGreater |
Indicates if the current OS version matches, or is greater than, the Windows 7 with Service Pack 1 (SP1) version.
| |
IsWindows8OrGreater |
Indicates if the current OS version matches, or is greater than, the Windows 8 version.
| |
IsWindows8Point1OrGreater |
Indicates if the current OS version matches, or is greater than, the Windows 8.1 version.
On Windows 10 this function can return false if the application has no manifest. Check this for more information: https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-verifyversioninfoa
| |
IsWindowsExplorer(Int32) |
Determines whether the specified process identifier corresponds to Windows Explorer.
| |
IsWindowsExplorer(Process) |
Determines whether the specified process instance corresponds to Windows Explorer.
| |
IsWindowsVersionOrGreater |
Indicates if the current OS version matches, or is greater than, the provided version information. This function is useful in confirming a version of Windows Server that doesn't share a version number with a client release.
On Windows 10 this function can return false if the application has no manifest. Check this for more information: https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-verifyversioninfoa
| |
IsWindowsVistaOrGreater |
Indicates if the current OS version matches, or is greater than, the Windows Vista version.
| |
IsWindowsVistaSP1OrGreater |
Indicates if the current OS version matches, or is greater than, the Windows Vista with Service Pack 1 (SP1) version.
| |
IsWindowsVistaSP2OrGreater |
Indicates if the current OS version matches, or is greater than, the Windows Vista with Service Pack 2 (SP2) version.
| |
IsWindowUnicode |
Determines whether the specified window is a native Unicode window.
| |
IsWindowVisible |
Determines the visibility state of the specified window.
| |
IsZoomed |
Determines whether a window is maximized.
| |
LogicalToPhysicalPoint |
Converts the logical coordinates of a point in a window to physical coordinates.
| |
MoveWindow |
Changes the position and dimensions of the specified window.
For a top-level window, the position and dimensions are relative to the upper-left corner of the screen. For a child window, they are relative to the upper-left corner of the parent window's client area.
| |
OpenExplorer |
Opens the Windows Explorer on a given directory path.
| |
PhysicalToLogicalPoint |
Converts the physical coordinates of a point in a window to logical coordinates.
| |
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.
| |
RedrawWindow(IntPtr, RDW) |
Updates the entire client area of window.
| |
RedrawWindow(IntPtr, RECT, RDW) |
Updates the specified rectangle in a window's client area.
| |
RedrawWindow(IntPtr, IntPtr, RDW) |
Updates the region in a window's client area.
| |
ReleaseDC |
Releases a device context (DC), freeing it for use by other applications.
The effect of the ReleaseDC function depends on the type of DC.
It frees only common and window DCs. It has no effect on class or private DCs.
| |
RemoveProp |
Removes an entry from the property list of the specified window.
The specified character string identifies the entry to be removed.
| |
Rename |
Renames the specified registry key.
| |
RenameRegistryKey |
Renames the specified registry key.
| |
RunForm(Form, Boolean) |
Shows the form as a modal dialog box.
| |
RunForm(Form, IntPtr, Boolean) |
Shows the form as a modal dialog box.
| |
RunWindow(Window) |
Shows the window as a modal dialog box.
| |
RunWindow(Window, IntPtr) |
Shows the window as a modal dialog box.
| |
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.
| |
SetActiveWindow |
Activates a window.
The window must be attached to the calling thread's message queue.
| |
SetConsoleIcon |
Defines the console icon, if the current application is a console.
| |
SetConsoleStandardStreams |
Sets In, Out and Error Console streams.
| |
SetFocus |
Sets the keyboard focus to the specified window. The window must be attached to the calling thread's message queue.
| |
SetForegroundWindow(IntPtr) |
Brings the thread that created the specified window into the foreground and activates the window.
Keyboard input is directed to the window, and various visual cues are changed for the user.
The system assigns a slightly higher priority to the thread that created the foreground window than it does to other threads.
| |
SetForegroundWindow(Window) |
Brings the thread that created the specified window into the foreground and activates the window.
Keyboard input is directed to the window, and various visual cues are changed for the user.
The system assigns a slightly higher priority to the thread that created the foreground window than it does to other threads.
| |
SetParent |
Changes the parent window of the specified child window.
| |
SetProp |
Adds a new entry or changes an existing entry in the property list of the specified window.
The function adds a new entry to the list if the specified character string does not exist already in the list.
The new entry contains the string and the handle.
Otherwise, the function replaces the string's current handle with the specified handle.
| |
SetWindowDisplayAffinity |
Stores the display affinity setting in kernel mode on the handle associated with the window.
| |
SetWindowLong |
Changes an attribute of the specified window.
The function also sets a value at the specified offset in the extra window memory.
| |
SetWindowPos |
Changes the size, position, and Z order of a child, pop-up, or top-level window.
These windows are ordered according to their appearance on the screen.
The topmost window receives the highest rank and is the first window in the Z order.
| |
ShowModal(Window) |
Shows the window as a modal dialog box.
| |
ShowModal(Form, Boolean) |
Shows the form as a modal dialog box.
| |
ShowModal(Window, IntPtr) |
Shows the window as a modal dialog box.
| |
ShowModal(Form, IntPtr, Boolean) |
Shows the form as a modal dialog box.
| |
ShowModelessAsync(Window) |
Shows the window as a modeless dialog box.
| |
ShowModelessAsync(Form, Boolean) |
Shows the form as a modeless dialog box.
| |
ShowModelessAsync(Window, IntPtr) |
Shows the window as a modeless dialog box.
| |
ShowModelessAsync(Form, IntPtr, Boolean) |
Shows the form as a modeless dialog box.
| |
ShowWindow |
Sets the specified window's show state.
| |
ShowWindowAsync |
Sets the show state of a window without waiting for the operation to complete.
| |
SwitchToThisWindow |
Switches focus to the specified window and brings it to the foreground.
This function is not intended for general use. It may be altered or unavailable in subsequent versions of Windows.
| |
ToInsecureString |
Converts a secure string to an insecure string.
| |
ToSecureString |
Converts an insecure string to a secure string.
| |
UpdateWindow |
updates the client area of the specified window by sending a WM_PAINT message to the window if the window's update region is not empty.
The function sends a WM_PAINT message directly to the window procedure of the specified window, bypassing the application queue.
If the update region is empty, no message is sent.
| |
WindowFromDC |
Retrieves a handle to the window associated with the specified display device context (DC).
| |
WindowFromPhysicalPoint |
Retrieves a handle to the window that contains the specified physical point.
| |
WindowFromPoint |
Retrieves a handle to the window that contains the specified point.
|
Name | Description | |
---|---|---|
ApplicationIcon |
The Application icon index.
| |
HWND_BOTTOM |
The HWND_BOTTOM desktop constant (1).
| |
HWND_BROADCAST |
The HWND_BROADCAST desktop constant (65535).
| |
HWND_DESKTOP |
The HWND desktop constant (0).
| |
HWND_MESSAGE |
The HWND_MESSAGE desktop constant (-3).
| |
HWND_NOTOPMOST |
The HWND_NOTOPMOST desktop constant (-2).
| |
HWND_TOP |
The HWND_TOP desktop constant (0).
| |
HWND_TOPMOST |
The HWND_TOPMOST desktop constant (-1).
|