public interface User32 extends StdCallLibrary, WinUser
WinUser.BLENDFUNCTION, WinUser.FLASHWINFO, WinUser.GUITHREADINFO, WinUser.HARDWAREINPUT, WinUser.HHOOK, WinUser.HOOKPROC, WinUser.INPUT, WinUser.KBDLLHOOKSTRUCT, WinUser.KEYBDINPUT, WinUser.LASTINPUTINFO, WinUser.LowLevelKeyboardProc, WinUser.MOUSEINPUT, WinUser.MSG, WinUser.POINT, WinUser.SIZE, WinUser.WINDOWINFO, WinUser.WNDENUMPROC
WinDef.DWORD, WinDef.DWORDLONG, WinDef.HBITMAP, WinDef.HCURSOR, WinDef.HDC, WinDef.HFONT, WinDef.HICON, WinDef.HINSTANCE, WinDef.HMENU, WinDef.HMODULE, WinDef.HPALETTE, WinDef.HPEN, WinDef.HRGN, WinDef.HRSRC, WinDef.HWND, WinDef.INT_PTR, WinDef.LONG, WinDef.LPARAM, WinDef.LRESULT, WinDef.RECT, WinDef.UINT_PTR, WinDef.ULONG, WinDef.ULONGLONG, WinDef.WORD, WinDef.WPARAM
StdCallLibrary.StdCallCallback
Library.Handler
Modifier and Type | Field and Description |
---|---|
static User32 |
INSTANCE |
AC_SRC_ALPHA, AC_SRC_NO_ALPHA, AC_SRC_NO_PREMULT_ALPHA, AC_SRC_OVER, DWL_DLGPROC, DWL_MSGRESULT, DWL_USER, FLASHW_ALL, FLASHW_CAPTION, FLASHW_STOP, FLASHW_TIMER, FLASHW_TIMERNOFG, FLASHW_TRAY, GW_CHILD, GW_ENABLEDPOPUP, GW_HWNDFIRST, GW_HWNDLAST, GW_HWNDNEXT, GW_HWNDPREV, GW_OWNER, GWL_EXSTYLE, GWL_HINSTANCE, GWL_ID, GWL_STYLE, GWL_USERDATA, GWL_WNDPROC, HWND_BROADCAST, IMAGE_BITMAP, IMAGE_CURSOR, IMAGE_ENHMETAFILE, IMAGE_ICON, LR_COLOR, LR_COPYDELETEORG, LR_COPYFROMRESOURCE, LR_COPYRETURNORG, LR_CREATEDIBSECTION, LR_DEFAULTCOLOR, LR_DEFAULTSIZE, LR_LOADFROMFILE, LR_LOADMAP3DCOLORS, LR_LOADTRANSPARENT, LR_MONOCHROME, LR_SHARED, LR_VGACOLOR, LWA_ALPHA, LWA_COLORKEY, MOD_ALT, MOD_CONTROL, MOD_NOREPEAT, MOD_SHIFT, MOD_WIN, RDW_ALLCHILDREN, RDW_ERASE, RDW_ERASENOW, RDW_FRAME, RDW_INTERNALPAINT, RDW_INVALIDATE, RDW_NOCHILDREN, RDW_NOERASE, RDW_NOFRAME, RDW_NOINTERNALPAINT, RDW_UPDATENOW, RDW_VALIDATE, SC_MAXIMIZE, SC_MINIMIZE, SM_ARRANGE, SM_CARETBLINKINGENABLED, SM_CLEANBOOT, SM_CMONITORS, SM_CMOUSEBUTTONS, SM_CXBORDER, SM_CXCURSOR, SM_CXDLGFRAME, SM_CXDOUBLECLK, SM_CXDRAG, SM_CXEDGE, SM_CXFIXEDFRAME, SM_CXFOCUSBORDER, SM_CXFRAME, SM_CXFULLSCREEN, SM_CXHSCROLL, SM_CXHTHUMB, SM_CXICON, SM_CXICONSPACING, SM_CXMAXIMIZED, SM_CXMAXTRACK, SM_CXMENUCHECK, SM_CXMENUSIZE, SM_CXMIN, SM_CXMINIMIZED, SM_CXMINSPACING, SM_CXMINTRACK, SM_CXPADDEDBORDER, SM_CXSCREEN, SM_CXSIZE, SM_CXSIZEFRAME, SM_CXSMICON, SM_CXSMSIZE, SM_CXVIRTUALSCREEN, SM_CXVSCROLL, SM_CYBORDER, SM_CYCAPTION, SM_CYCURSOR, SM_CYDLGFRAME, SM_CYDOUBLECLK, SM_CYDRAG, SM_CYEDGE, SM_CYFIXEDFRAME, SM_CYFOCUSBORDER, SM_CYFRAME, SM_CYFULLSCREEN, SM_CYHSCROLL, SM_CYICON, SM_CYICONSPACING, SM_CYKANJIWINDOW, SM_CYMAXIMIZED, SM_CYMAXTRACK, SM_CYMENU, SM_CYMENUCHECK, SM_CYMENUSIZE, SM_CYMIN, SM_CYMINIMIZED, SM_CYMINSPACING, SM_CYMINTRACK, SM_CYSCREEN, SM_CYSIZE, SM_CYSIZEFRAME, SM_CYSMCAPTION, SM_CYSMICON, SM_CYSMSIZE, SM_CYVIRTUALSCREEN, SM_CYVSCROLL, SM_CYVTHUMB, SM_DBCSENABLED, SM_DEBUG, SM_IMMENABLED, SM_MEDIACENTER, SM_MENUDROPALIGNMENT, SM_MIDEASTENABLED, SM_MOUSEHORIZONTALWHEELPRESENT, SM_MOUSEPRESENT, SM_MOUSEWHEELPRESENT, SM_NETWORK, SM_PENWINDOWS, SM_REMOTECONTROL, SM_REMOTESESSION, SM_RESERVED1, SM_RESERVED2, SM_RESERVED3, SM_RESERVED4, SM_SAMEDISPLAYFORMAT, SM_SECURE, SM_SERVERR2, SM_SHOWSOUNDS, SM_SHUTTINGDOWN, SM_SLOWMACHINE, SM_STARTER, SM_SWAPBUTTON, SM_TABLETPC, SM_XVIRTUALSCREEN, SM_YVIRTUALSCREEN, SW_FORCEMINIMIZE, SW_HIDE, SW_MAX, SW_MAXIMIZE, SW_MINIMIZE, SW_NORMAL, SW_RESTORE, SW_SHOW, SW_SHOWDEFAULT, SW_SHOWMAXIMIZED, SW_SHOWMINIMIZED, SW_SHOWMINNOACTIVE, SW_SHOWNA, SW_SHOWNOACTIVATE, SW_SHOWNORMAL, SWP_NOZORDER, ULW_ALPHA, ULW_COLORKEY, ULW_OPAQUE, VK_CONTROL, VK_LCONTROL, VK_LMENU, VK_LSHIFT, VK_MENU, VK_RCONTROL, VK_RMENU, VK_RSHIFT, VK_SHIFT, WH_KEYBOARD, WH_KEYBOARD_LL, WH_MOUSE, WH_MOUSE_LL, WM_CHAR, WM_CLOSE, WM_DRAWITEM, WM_HOTKEY, WM_KEYDOWN, WM_KEYUP, WM_MDIMAXIMIZE, WM_PAINT, WM_QUIT, WM_SHOWWINDOW, WM_SYSCOMMAND, WM_SYSKEYDOWN, WM_SYSKEYUP, WS_CHILD, WS_EX_COMPOSITED, WS_EX_LAYERED, WS_EX_TRANSPARENT, WS_MAXIMIZE, WS_MINIMIZE, WS_POPUP, WS_VISIBLE
FUNCTION_MAPPER, STDCALL_CONVENTION
OPTION_ALLOW_OBJECTS, OPTION_CALLING_CONVENTION, OPTION_FUNCTION_MAPPER, OPTION_INVOCATION_MAPPER, OPTION_OPEN_FLAGS, OPTION_STRUCTURE_ALIGNMENT, OPTION_TYPE_MAPPER
Modifier and Type | Method and Description |
---|---|
boolean |
AttachThreadInput(WinDef.DWORD idAttach,
WinDef.DWORD idAttachTo,
boolean fAttach)
Attaches or detaches the input processing mechanism of one thread to that of another thread.
|
WinDef.LRESULT |
CallNextHookEx(WinUser.HHOOK hhk,
int nCode,
WinDef.WPARAM wParam,
Pointer lParam)
The CallNextHookEx function passes the hook information to the next hook procedure
in the current hook chain.
|
WinDef.LRESULT |
CallNextHookEx(WinUser.HHOOK hhk,
int nCode,
WinDef.WPARAM wParam,
WinDef.LPARAM lParam)
The CallNextHookEx function passes the hook information to the next hook procedure
in the current hook chain.
|
boolean |
CloseWindow(WinDef.HWND hWnd)
Minimizes (but does not destroy) the specified window.
|
boolean |
DestroyIcon(WinDef.HICON hicon)
This function destroys an icon and frees any memory the icon occupied.
|
WinDef.LRESULT |
DispatchMessage(WinUser.MSG lpMsg)
This function dispatches a message to a window procedure.
|
boolean |
EnumChildWindows(WinDef.HWND hWnd,
WinUser.WNDENUMPROC lpEnumFunc,
Pointer data)
The EnumChildWindows function enumerates the child windows that belong to the specified parent window
by passing the handle to each child window, in turn, to an application-defined callback function.
|
boolean |
EnumThreadWindows(int dwThreadId,
WinUser.WNDENUMPROC lpEnumFunc,
Pointer data)
The EnumThreadWindows function enumerates all nonchild windows associated with a thread by passing
the handle to each window, in turn, to an application-defined callback function.
|
boolean |
EnumWindows(WinUser.WNDENUMPROC lpEnumFunc,
Pointer data)
This function enumerates all top-level windows on the screen by passing the handle to each window,
in turn, to an application-defined callback function.
|
WinDef.HWND |
FindWindow(String lpClassName,
String lpWindowName)
This function retrieves the handle to the top-level window whose class name and
window name match the specified strings.
|
boolean |
FlashWindowEx(WinUser.FLASHWINFO pfwi)
The FlashWindowEx function flashes the specified window.
|
short |
GetAsyncKeyState(int vKey)
This function determines whether a key is up or down at the time the function is called,
and whether the key was pressed after a previous call to GetAsyncKeyState.
|
int |
GetClassName(WinDef.HWND hWnd,
char[] lpClassName,
int nMaxCount)
This function retrieves the name of the class to which the specified window belongs.
|
WinDef.HDC |
GetDC(WinDef.HWND hWnd)
This function retrieves a handle to a display device context (DC) for the
client area of the specified window.
|
WinDef.HWND |
GetForegroundWindow()
Retrieves a handle to the foreground window (the window with which the user is currently working).
|
boolean |
GetGUIThreadInfo(int idThread,
WinUser.GUITHREADINFO lpgui)
Retrieves information about the active window or a specified graphical user
interface (GUI) thread.
|
boolean |
GetKeyboardState(byte[] lpKeyState)
The GetKeyboardState function copies the status of the 256 virtual keys to the specified buffer.
|
boolean |
GetLastInputInfo(WinUser.LASTINPUTINFO plii)
Retrieves the time of the last input event.
|
boolean |
GetLayeredWindowAttributes(WinDef.HWND hwnd,
IntByReference pcrKey,
ByteByReference pbAlpha,
IntByReference pdwFlags)
The GetLayeredWindowAttributes function retrieves the opacity and transparency color
key of a layered window.
|
int |
GetMessage(WinUser.MSG lpMsg,
WinDef.HWND hWnd,
int wMsgFilterMin,
int wMsgFilterMax)
This function retrieves a message from the calling thread's message queue
and places it in the specified structure.
|
int |
GetSystemMetrics(int nIndex)
The GetSystemMetrics function retrieves various system metrics (widths
and heights of display elements) and system configuration settings.
|
WinDef.HWND |
GetWindow(WinDef.HWND hWnd,
WinDef.DWORD uCmd)
Retrieves a handle to a window that has the specified relationship (Z-Order or owner) to the specified window.
|
boolean |
GetWindowInfo(WinDef.HWND hWnd,
WinUser.WINDOWINFO pwi)
The GetWindowInfo function retrieves information about the specified window.
|
int |
GetWindowLong(WinDef.HWND hWnd,
int nIndex)
This function retrieves information about the specified window.
|
BaseTSD.LONG_PTR |
GetWindowLongPtr(WinDef.HWND hWnd,
int nIndex)
The GetWindowLongPtr function retrieves information about the specified window.
|
int |
GetWindowModuleFileName(WinDef.HWND hWnd,
char[] lpszFileName,
int cchFileNameMax)
The GetWindowModuleFileName function retrieves the full path and file name of the module associated
with the specified window handle.
|
boolean |
GetWindowRect(WinDef.HWND hWnd,
WinDef.RECT rect)
This function retrieves the dimensions of the bounding rectangle of the specified window.
|
int |
GetWindowText(WinDef.HWND hWnd,
char[] lpString,
int nMaxCount)
This function copies the text of the specified window's title bar - if it has one - into a buffer.
|
int |
GetWindowTextLength(WinDef.HWND hWnd)
This function retrieves the length, in characters, of the specified window's title bar text -
if the window has a title bar.
|
int |
GetWindowThreadProcessId(WinDef.HWND hWnd,
IntByReference lpdwProcessId)
This function retrieves the identifier of the thread that created the specified window and, optionally,
the identifier of the process that created the window.
|
boolean |
InvalidateRect(WinDef.HWND hWnd,
Structure.ByReference lpRect,
boolean bErase)
The InvalidateRect function adds a rectangle to the specified window's update region.
|
boolean |
IsWindowVisible(WinDef.HWND hWnd)
Determines the visibility state of the specified window.
|
WinDef.HICON |
LoadIcon(WinDef.HINSTANCE hInstance,
String iconName)
This function loads the specified icon resource from the executable (.exe) file associated with an
application instance.
|
WinNT.HANDLE |
LoadImage(WinDef.HINSTANCE hinst,
String name,
int type,
int xDesired,
int yDesired,
int load)
This function loads an icon, cursor, or bitmap.
|
boolean |
MoveWindow(WinDef.HWND hWnd,
int X,
int Y,
int nWidth,
int nHeight,
boolean bRepaint)
Changes the position and dimensions of the specified window.
|
boolean |
PeekMessage(WinUser.MSG lpMsg,
WinDef.HWND hWnd,
int wMsgFilterMin,
int wMsgFilterMax,
int wRemoveMsg)
This function checks a thread message queue for a message and places the
message (if any) in the specified structure.
|
void |
PostMessage(WinDef.HWND hWnd,
int msg,
WinDef.WPARAM wParam,
WinDef.LPARAM lParam)
This function places a message in the message queue associated with the thread that
created the specified window and then returns without waiting for the thread to process
the message.
|
void |
PostQuitMessage(int nExitCode)
This function indicates to Windows that a thread has made a request to terminate (quit).
|
boolean |
RedrawWindow(WinDef.HWND hWnd,
Structure.ByReference lprcUpdate,
WinDef.HRGN hrgnUpdate,
WinDef.DWORD flags)
The RedrawWindow function updates the specified rectangle or region in a window's client area.
|
boolean |
RegisterHotKey(WinDef.HWND hWnd,
int id,
int fsModifiers,
int vk)
Defines a system-wide hot key.
|
int |
ReleaseDC(WinDef.HWND hWnd,
WinDef.HDC hDC)
This function releases a device context (DC), freeing it for use by other
applications.
|
WinDef.DWORD |
SendInput(WinDef.DWORD nInputs,
WinUser.INPUT[] pInputs,
int cbSize)
Synthesizes keystrokes, mouse motions, and button clicks.
|
WinDef.HWND |
SetFocus(WinDef.HWND hWnd)
Sets the keyboard focus to the specified window.
|
boolean |
SetForegroundWindow(WinDef.HWND hWnd)
Brings the thread that created the specified window into the foreground and activates the window.
|
boolean |
SetLayeredWindowAttributes(WinDef.HWND hwnd,
int crKey,
byte bAlpha,
int dwFlags)
The SetLayeredWindowAttributes function sets the opacity and transparency color key of a layered window.
|
WinDef.HWND |
SetParent(WinDef.HWND hWndChild,
WinDef.HWND hWndNewParent)
Changes the parent window of the specified child window.
|
int |
SetWindowLong(WinDef.HWND hWnd,
int nIndex,
int dwNewLong)
This function changes an attribute of the specified window.
|
Pointer |
SetWindowLong(WinDef.HWND hWnd,
int nIndex,
Pointer dwNewLong)
This function changes an attribute of the specified window.
|
BaseTSD.LONG_PTR |
SetWindowLongPtr(WinDef.HWND hWnd,
int nIndex,
BaseTSD.LONG_PTR dwNewLongPtr)
The SetWindowLongPtr function changes an attribute of the specified window.
|
Pointer |
SetWindowLongPtr(WinDef.HWND hWnd,
int nIndex,
Pointer dwNewLongPtr)
The SetWindowLongPtr function changes an attribute of the specified window.
|
boolean |
SetWindowPos(WinDef.HWND hWnd,
WinDef.HWND hWndInsertAfter,
int X,
int Y,
int cx,
int cy,
int uFlags)
Changes the size, position, and Z order of a child, pop-up, or top-level window.
|
int |
SetWindowRgn(WinDef.HWND hWnd,
WinDef.HRGN hRgn,
boolean bRedraw)
This function sets the window region of a window.
|
WinUser.HHOOK |
SetWindowsHookEx(int idHook,
WinUser.HOOKPROC lpfn,
WinDef.HINSTANCE hMod,
int dwThreadId)
The SetWindowsHookEx function installs an application-defined hook procedure into a hook chain.
|
boolean |
ShowWindow(WinDef.HWND hWnd,
int nCmdShow)
Sets the specified window's show state.
|
boolean |
TranslateMessage(WinUser.MSG lpMsg)
This function translates virtual-key messages into character messages.
|
boolean |
UnhookWindowsHookEx(WinUser.HHOOK hhk)
The UnhookWindowsHookEx function removes a hook procedure installed in
a hook chain by the SetWindowsHookEx function.
|
boolean |
UnregisterHotKey(Pointer hWnd,
int id)
Frees a hot key previously registered by the calling thread.
|
boolean |
UpdateLayeredWindow(WinDef.HWND hwnd,
WinDef.HDC hdcDst,
WinUser.POINT pptDst,
WinUser.SIZE psize,
WinDef.HDC hdcSrc,
WinUser.POINT pptSrc,
int crKey,
WinUser.BLENDFUNCTION pblend,
int dwFlags)
The UpdateLayeredWindow function updates the position, size, shape, content, and
translucency of a layered window.
|
boolean |
UpdateWindow(WinDef.HWND hWnd)
The UpdateWindow function 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.
|
WinDef.DWORD |
WaitForInputIdle(WinNT.HANDLE hProcess,
WinDef.DWORD dwMilliseconds)
Waits until the specified process has finished processing its initial input and is waiting for user input with no
input pending, or until the time-out interval has elapsed.
|
static final User32 INSTANCE
WinDef.HDC GetDC(WinDef.HWND hWnd)
hWnd
- Handle to the window whose device context is to be retrieved.
If this value is NULL, GetDC retrieves the device context for
the entire screen.int ReleaseDC(WinDef.HWND hWnd, WinDef.HDC hDC)
hWnd
- Handle to the window whose device context is to be released.hDC
- Handle to the device context to be released.WinDef.HWND FindWindow(String lpClassName, String lpWindowName)
lpClassName
- Long pointer to a null-terminated string that specifies the class name or is an atom
that identifies the class-name string. If this parameter is an atom, it must be a
global atom created by a previous call to the GlobalAddAtom function. The atom, a
16-bit value, must be placed in the low-order word of lpClassName; the high-order
word must be zero.lpWindowName
- Long pointer to a null-terminated string that specifies the window name (the window's
title). If this parameter is NULL, all window names match.int GetClassName(WinDef.HWND hWnd, char[] lpClassName, int nMaxCount)
hWnd
- Handle to the window and, indirectly, the class to which the window belongs.lpClassName
- Long pointer to the buffer that is to receive the class name string.nMaxCount
- Specifies the length, in characters, of the buffer pointed to by the lpClassName
parameter. The class name string is truncated if it is longer than the buffer.boolean GetGUIThreadInfo(int idThread, WinUser.GUITHREADINFO lpgui)
idThread
- Identifies the thread for which information is to be retrieved. To retrieve
this value, use the GetWindowThreadProcessId function. If this parameter is NULL,
the function returns information for the foreground thread.lpgui
- Pointer to a GUITHREADINFO structure that receives information describing the thread.
Note that you must set GUITHREADINFO.cbSize to sizeof(GUITHREADINFO) before calling this function.boolean GetWindowInfo(WinDef.HWND hWnd, WinUser.WINDOWINFO pwi)
hWnd
- Handle to the window whose information is to be retrieved.pwi
- Pointer to a WINDOWINFO structure to receive the information. Note that you must set WINDOWINFO.cbSize
to sizeof(WINDOWINFO) before calling this function.boolean GetWindowRect(WinDef.HWND hWnd, WinDef.RECT rect)
hWnd
- Handle to the window.rect
- Long pointer to a RECT structure that receives the screen coordinates of the upper-left and lower-right
corners of the window.int GetWindowText(WinDef.HWND hWnd, char[] lpString, int nMaxCount)
hWnd
- Handle to the window or control containing the text.lpString
- Long pointer to the buffer that will receive the text.nMaxCount
- Specifies the maximum number of characters to copy to the buffer, including the NULL character.
If the text exceeds this limit, it is truncated.int GetWindowTextLength(WinDef.HWND hWnd)
hWnd
- Handle to the window or control.int GetWindowModuleFileName(WinDef.HWND hWnd, char[] lpszFileName, int cchFileNameMax)
hWnd
- Handle to the window whose module file name will be retrieved.lpszFileName
- Pointer to a buffer that receives the path and file name.cchFileNameMax
- Specifies the maximum number of TCHARs that can be copied into the lpszFileName buffer.int GetWindowThreadProcessId(WinDef.HWND hWnd, IntByReference lpdwProcessId)
hWnd
- Handle to the window.lpdwProcessId
- Pointer to a 32-bit value that receives the process identifier. If this parameter is not NULL,
GetWindowThreadProcessId copies the identifier of the process to the 32-bit value; otherwise,
it does not.boolean EnumWindows(WinUser.WNDENUMPROC lpEnumFunc, Pointer data)
lpEnumFunc
- Long pointer to an application-defined callback function.data
- Specifies an application-defined value to be passed to the callback function.boolean EnumChildWindows(WinDef.HWND hWnd, WinUser.WNDENUMPROC lpEnumFunc, Pointer data)
hWnd
- Handle to the parent window whose child windows are to be enumerated. If this parameter is NULL, this
function is equivalent to EnumWindows.lpEnumFunc
- Pointer to an application-defined callback function.data
- Specifies an application-defined value to be passed to the callback function.boolean EnumThreadWindows(int dwThreadId, WinUser.WNDENUMPROC lpEnumFunc, Pointer data)
dwThreadId
- Identifies the thread whose windows are to be enumerated.lpEnumFunc
- Pointer to an application-defined callback function.data
- Specifies an application-defined value to be passed to the callback function.boolean FlashWindowEx(WinUser.FLASHWINFO pfwi)
pfwi
- Pointer to the FLASHWINFO structure.WinDef.HICON LoadIcon(WinDef.HINSTANCE hInstance, String iconName)
hInstance
- Handle to an instance of the module whose executable file contains the icon to be loaded.
This parameter must be NULL when a standard icon is being loaded.iconName
- Long pointer to a null-terminated string that contains the name of the icon resource to be loaded.
Alternatively, this parameter can contain the resource identifier in the low-order word and zero
in the high-order word. Use the MAKEINTRESOURCE macro to create this value.WinNT.HANDLE LoadImage(WinDef.HINSTANCE hinst, String name, int type, int xDesired, int yDesired, int load)
hinst
- Handle to an instance of the module that contains the image to be loaded.name
- Pointer to a null-terminated string that contains the name of the image resource
in the hinst module that identifies the image to load.type
- Specifies the type of image to be loaded.xDesired
- Specifies the width, in pixels, of the icon or cursor. If this parameter is zero, the function uses
the SM_CXICON or SM_CXCURSOR system metric value to set the width. If uType is IMAGE_BITMAP, this
parameter must be zero.yDesired
- Specifies the height, in pixels, of the icon or cursor. If this parameter is zero, the function uses
the SM_CYICON or SM_CYCURSOR system metric value to set the height. If uType is IMAGE_BITMAP, this
parameter must be zero.load
- Set to zero.boolean DestroyIcon(WinDef.HICON hicon)
hicon
- Handle to the icon to be destroyed. The icon must not be in use.int GetWindowLong(WinDef.HWND hWnd, int nIndex)
hWnd
- Handle to the window and, indirectly, the class to which the window belongs.nIndex
- Specifies the zero-based offset to the value to be retrieved.int SetWindowLong(WinDef.HWND hWnd, int nIndex, int dwNewLong)
hWnd
- Handle to the window and, indirectly, the class to which the window belongs.nIndex
- Specifies the zero-based offset to the value to be set.dwNewLong
- Specifies the replacement value.Pointer SetWindowLong(WinDef.HWND hWnd, int nIndex, Pointer dwNewLong)
hWnd
- Handle to the window and, indirectly, the class to which the window belongs.nIndex
- Specifies the zero-based offset to the value to be set.dwNewLong
- Specifies the replacement value.BaseTSD.LONG_PTR GetWindowLongPtr(WinDef.HWND hWnd, int nIndex)
hWnd
- Handle to the window and, indirectly, the class to which the window belongs.nIndex
- Specifies the zero-based offset to the value to be retrieved.BaseTSD.LONG_PTR SetWindowLongPtr(WinDef.HWND hWnd, int nIndex, BaseTSD.LONG_PTR dwNewLongPtr)
hWnd
- Handle to the window and, indirectly, the class to which the window belongs.nIndex
- Specifies the zero-based offset to the value to be set.dwNewLongPtr
- Specifies the replacement value.Pointer SetWindowLongPtr(WinDef.HWND hWnd, int nIndex, Pointer dwNewLongPtr)
hWnd
- Handle to the window and, indirectly, the class to which the window belongs.nIndex
- Specifies the zero-based offset to the value to be set.dwNewLongPtr
- Specifies the replacement value.boolean SetLayeredWindowAttributes(WinDef.HWND hwnd, int crKey, byte bAlpha, int dwFlags)
hwnd
- Handle to the layered window.crKey
- COLORREF structure that specifies the transparency color key to be used when composing the layered window.bAlpha
- Alpha value used to describe the opacity of the layered window.dwFlags
- Specifies an action to take.boolean GetLayeredWindowAttributes(WinDef.HWND hwnd, IntByReference pcrKey, ByteByReference pbAlpha, IntByReference pdwFlags)
hwnd
- Handle to the layered window. A layered window is created by specifying WS_EX_LAYERED
when creating the window with the CreateWindowEx function or by setting WS_EX_LAYERED
via SetWindowLong after the window has been created.pcrKey
- Pointer to a COLORREF value that receives the transparency color key to be used when
composing the layered window. All pixels painted by the window in this color will be
transparent. This can be NULL if the argument is not needed.pbAlpha
- Pointer to a BYTE that receives the Alpha value used to describe the opacity of the
layered window. Similar to the SourceConstantAlpha member of the BLENDFUNCTION structure.
When the variable referred to by pbAlpha is 0, the window is completely transparent.
When the variable referred to by pbAlpha is 255, the window is opaque. This can be NULL
if the argument is not needed.pdwFlags
- Pointer to a DWORD that receives a layering flag. This can be NULL if the argument is not needed.boolean UpdateLayeredWindow(WinDef.HWND hwnd, WinDef.HDC hdcDst, WinUser.POINT pptDst, WinUser.SIZE psize, WinDef.HDC hdcSrc, WinUser.POINT pptSrc, int crKey, WinUser.BLENDFUNCTION pblend, int dwFlags)
hwnd
- Handle to a layered window. A layered window is created by specifying WS_EX_LAYERED
when creating the window with the CreateWindowEx function.hdcDst
- Handle to a device context (DC) for the screen. This handle is obtained by specifying NULL
when calling the function. It is used for palette color matching when the window contents
are updated. If hdcDst isNULL, the default palette will be used. If hdcSrc is NULL, hdcDst must be NULL.pptDst
- Pointer to a POINT structure that specifies the new screen position of the layered window.
If the current position is not changing, pptDst can be NULL.psize
- Pointer to a SIZE structure that specifies the new size of the layered window. If the size of the window
is not changing, psize can be NULL. If hdcSrc is NULL, psize must be NULL.hdcSrc
- Handle to a DC for the surface that defines the layered window. This handle can be obtained by calling
the CreateCompatibleDC function. If the shape and visual context of the window are not changing, hdcSrc
can be NULL.pptSrc
- Pointer to a POINT structure that specifies the location of the layer in the device context.
If hdcSrc is NULL, pptSrc should be NULL.crKey
- Pointer to a COLORREF value that specifies the color key to be used when composing the layered window.
To generate a COLORREF, use the RGB macro.pblend
- Pointer to a BLENDFUNCTION structure that specifies the transparency value to be used when composing
the layered window.dwFlags
- ULW_* flags.int SetWindowRgn(WinDef.HWND hWnd, WinDef.HRGN hRgn, boolean bRedraw)
hWnd
- Handle to the window whose window region is to be set.hRgn
- Handle to a region. The function sets the window region of the window to this region.
If hRgn is NULL, the function sets the window region to NULL.bRedraw
- Specifies whether the system redraws the window after setting the window region.
If bRedraw is TRUE, the system does so; otherwise, it does not.
Typically, you set bRedraw to TRUE if the window is visible.boolean GetKeyboardState(byte[] lpKeyState)
lpKeyState
- Pointer to the 256-byte array that receives the status data for each virtual key.short GetAsyncKeyState(int vKey)
vKey
- Specifies one of 256 possible virtual-key codes.WinUser.HHOOK SetWindowsHookEx(int idHook, WinUser.HOOKPROC lpfn, WinDef.HINSTANCE hMod, int dwThreadId)
idHook
- Specifies the type of hook procedure to be installed.lpfn
- Pointer to the hook procedure.hMod
- Handle to the DLL containing the hook procedure pointed to by the lpfn parameter.dwThreadId
- Specifies the identifier of the thread with which the hook procedure is to be associated.WinDef.LRESULT CallNextHookEx(WinUser.HHOOK hhk, int nCode, WinDef.WPARAM wParam, WinDef.LPARAM lParam)
hhk
- Ignored.nCode
- Specifies the hook code passed to the current hook procedure. The next hook procedure
uses this code to determine how to process the hook information.wParam
- Specifies the wParam value passed to the current hook procedure. The meaning of this
parameter depends on the type of hook associated with the current hook chain.lParam
- Specifies the lParam value passed to the current hook procedure. The meaning of this
parameter depends on the type of hook associated with the current hook chain.WinDef.LRESULT CallNextHookEx(WinUser.HHOOK hhk, int nCode, WinDef.WPARAM wParam, Pointer lParam)
hhk
- Ignored.nCode
- Specifies the hook code passed to the current hook procedure. The next hook procedure
uses this code to determine how to process the hook information.wParam
- Specifies the wParam value passed to the current hook procedure. The meaning of this
parameter depends on the type of hook associated with the current hook chain.lParam
- Specifies the lParam value passed to the current hook procedure. The meaning of this
parameter depends on the type of hook associated with the current hook chain.boolean UnhookWindowsHookEx(WinUser.HHOOK hhk)
hhk
- Handle to the hook to be removed. This parameter is a hook handle obtained
by a previous call to SetWindowsHookEx.int GetMessage(WinUser.MSG lpMsg, WinDef.HWND hWnd, int wMsgFilterMin, int wMsgFilterMax)
lpMsg
- Pointer to an MSG structure that receives message information from the thread's message queue.hWnd
- Handle to the window whose messages are to be retrieved. One value has a special meaning.wMsgFilterMin
- Specifies the integer value of the lowest message value to be retrieved.wMsgFilterMax
- Specifies the integer value of the highest message value to be retrieved.boolean PeekMessage(WinUser.MSG lpMsg, WinDef.HWND hWnd, int wMsgFilterMin, int wMsgFilterMax, int wRemoveMsg)
lpMsg
- Pointer to an MSG structure that receives message information.hWnd
- Handle to the window whose messages are to be examined.wMsgFilterMin
- Specifies the value of the first message in the range of messages to be examined.wMsgFilterMax
- Specifies the value of the last message in the range of messages to be examined.wRemoveMsg
- Specifies how messages are handled. This parameter can be one of the following values.boolean TranslateMessage(WinUser.MSG lpMsg)
lpMsg
- Pointer to an MSG structure that contains message information retrieved from the calling thread's
message queue by using the GetMessage or PeekMessage function.WinDef.LRESULT DispatchMessage(WinUser.MSG lpMsg)
lpMsg
- Pointer to an MSG structure that contains the message.void PostMessage(WinDef.HWND hWnd, int msg, WinDef.WPARAM wParam, WinDef.LPARAM lParam)
hWnd
- Handle to the window whose window procedure is to receive the message.msg
- Specifies the message to be posted.wParam
- Specifies additional message-specific information.lParam
- Specifies additional message-specific information.void PostQuitMessage(int nExitCode)
nExitCode
- Specifies an application exit code. This value is used as the wParam parameter of
the WM_QUIT message.int GetSystemMetrics(int nIndex)
nIndex
- System metric or configuration setting to retrieve. This
parameter can be one of the following values. Note that all
SM_CX* values are widths and all SM_CY* values are heights.
Also note that all settings designed to return Boolean data
represent TRUE as any nonzero value, and FALSE as a zero
value.WinDef.HWND SetParent(WinDef.HWND hWndChild, WinDef.HWND hWndNewParent)
hWndChild
- A handle to the child window.hWndNewParent
- A handle to the new parent window. If this parameter is NULL, the desktop window becomes the new parent
window. If this parameter is HWND_MESSAGE, the child window becomes a message-only window.boolean IsWindowVisible(WinDef.HWND hWnd)
hWnd
- A handle to the window to be tested.boolean MoveWindow(WinDef.HWND hWnd, int X, int Y, int nWidth, int nHeight, boolean bRepaint)
hWnd
- A handle to the window.X
- The new position of the left side of the window.Y
- The new position of the top of the window.nWidth
- The new width of the window.nHeight
- The new height of the window.bRepaint
- Indicates whether the window is to be repainted. If this parameter is TRUE, the window receives a message. If
the parameter is FALSE, no repainting of any kind occurs. This applies to the client area, the nonclient area
(including the title bar and scroll bars), and any part of the parent window uncovered as a result of moving
a child window.boolean SetWindowPos(WinDef.HWND hWnd, WinDef.HWND hWndInsertAfter, int X, int Y, int cx, int cy, int uFlags)
hWnd
- A handle to the window.hWndInsertAfter
- A handle to the window to precede the positioned window in the Z order.X
- The new position of the left side of the window, in client coordinates.Y
- The new position of the top of the window, in client coordinates.cx
- The new width of the window, in pixels.cy
- The new height of the window, in pixels.uFlags
- The window sizing and positioning flags.boolean AttachThreadInput(WinDef.DWORD idAttach, WinDef.DWORD idAttachTo, boolean fAttach)
idAttach
- The identifier of the thread to be attached to another thread. The thread to be attached cannot be a system
thread.idAttachTo
- The identifier of the thread to which idAttach will be attached. This thread cannot be a system thread. A
thread cannot attach to itself. Therefore, idAttachTo cannot equal idAttach.fAttach
- If this parameter is TRUE, the two threads are attached. If the parameter is FALSE, the threads are detached.boolean SetForegroundWindow(WinDef.HWND hWnd)
hWnd
- A handle to the window that should be activated and brought to the foreground.WinDef.HWND GetForegroundWindow()
WinDef.HWND SetFocus(WinDef.HWND hWnd)
hWnd
- A handle to the window that will receive the keyboard input. If this parameter is NULL, keystrokes are ignored.WinDef.DWORD SendInput(WinDef.DWORD nInputs, WinUser.INPUT[] pInputs, int cbSize)
nInputs
- The number of structures in the pInputs array.pInputs
- An array of INPUT structures. Each structure represents an event to be inserted into the keyboard or mouse
input stream.cbSize
- The size, in bytes, of an INPUT structure. If cbSize is not the size of an INPUT structure, the function fails.WinDef.DWORD WaitForInputIdle(WinNT.HANDLE hProcess, WinDef.DWORD dwMilliseconds)
hProcess
- A handle to the process. If this process is a console application or does not have a message queue,
WaitForInputIdle returns immediately.dwMilliseconds
- The time-out interval, in milliseconds. If dwMilliseconds is INFINITE, the function does not return until the
process is idle.Return code/value | Description |
---|---|
0 | The wait was satisfied successfully. |
WAIT_TIMEOUT | The wait was terminated because the time-out interval elapsed. |
WAIT_FAILED | An error occurred. |
boolean InvalidateRect(WinDef.HWND hWnd, Structure.ByReference lpRect, boolean bErase)
hWnd
- A handle to the window whose update region has changed. If this parameter is NULL, the system invalidates and
redraws all windows, not just the windows for this application, and sends the WM_ERASEBKGND and WM_NCPAINT
messages before the function returns. Setting this parameter to NULL is not recommended.lpRect
- A pointer to a RECT structure that contains the client coordinates of the rectangle to be added to the update
region. If this parameter is NULL, the entire client area is added to the update region.bErase
- Specifies whether the background within the update region is to be erased when the update region is processed.
If this parameter is TRUE, the background is erased when the BeginPaint function is called. If this parameter
is FALSE, the background remains unchanged.boolean RedrawWindow(WinDef.HWND hWnd, Structure.ByReference lprcUpdate, WinDef.HRGN hrgnUpdate, WinDef.DWORD flags)
hWnd
- A handle to the window to be redrawn. If this parameter is NULL, the desktop window is updated.lprcUpdate
- A pointer to a RECT structure containing the coordinates, in device units, of the update rectangle. This
parameter is ignored if the hrgnUpdate parameter identifies a region.hrgnUpdate
- A handle to the update region. If both the hrgnUpdate and lprcUpdate parameters are NULL, the entire client
area is added to the update region.flags
- One or more redraw flags. This parameter can be used to invalidate or validate a window, control repainting,
and control which windows are affected by RedrawWindow.WinDef.HWND GetWindow(WinDef.HWND hWnd, WinDef.DWORD uCmd)
hWnd
- A handle to a window. The window handle retrieved is relative to this window, based on the value of the uCmd
parameter.uCmd
- The relationship between the specified window and the window whose handle is to be retrieved.boolean UpdateWindow(WinDef.HWND hWnd)
hWnd
- Handle to the window to be updated.boolean ShowWindow(WinDef.HWND hWnd, int nCmdShow)
hWnd
- A handle to the window.nCmdShow
- Controls how the window is to be shown. This parameter is ignored the first time an application calls
ShowWindow, if the program that launched the application provides a STARTUPINFO structure. Otherwise, the
first time ShowWindow is called, the value should be the value obtained by the WinMain function in its
nCmdShow parameter.boolean CloseWindow(WinDef.HWND hWnd)
hWnd
- A handle to the window to be minimized.boolean RegisterHotKey(WinDef.HWND hWnd, int id, int fsModifiers, int vk)
hWnd
- A handle to the window that will receive WinUser.WM_HOTKEY
messages generated by the hot keyid
- The identifier of the hot keyfsModifiers
- The keys that must be pressed in combination with the key specified by the
uVirtKey parameter in order to generate the WinUser.WM_HOTKEY
message.WinUser.MOD_ALT
Either ALT key must be held down.WinUser.MOD_CONTROL
Either CTRL key must be held down.WinUser.MOD_NOREPEAT
Changes the hotkey behavior so that the keyboard
auto-repeat does not yield multiple hotkey notifications.
WinUser.MOD_SHIFT
Either SHIFT key must be held down.WinUser.MOD_WIN
Either WINDOWS key was held down.
These keys are labeled with the Windows logo.vk
- The virtual-key code of the hot keyKernel32.GetLastError()
.boolean UnregisterHotKey(Pointer hWnd, int id)
hWnd
- A handle to the window associated with the hot key to be freed. This parameter should be NULL if the hot key is not associated with a window.id
- The identifier of the hot key to be freed.Kernel32.GetLastError()
.boolean GetLastInputInfo(WinUser.LASTINPUTINFO plii)
plii
- structure that receives the time of the last input eventKernel32.GetLastError()
.