Class User32
- java.lang.Object
-
- org.lwjgl.system.windows.User32
-
public class User32 extends java.lang.Object
Native bindings to WinUser.h and user32.dll.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
User32.Functions
Contains the function pointers loaded from the user32SharedLibrary
.
-
Field Summary
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
AdjustWindowRectEx(RECT lpRect, int dwStyle, boolean bMenu, int dwExStyle)
Calculates the required size of the window rectangle, based on the desired size of the client rectangle.static boolean
BringWindowToTop(long hWnd)
Brings the specified window to the top of the Z order.static long
CallWindowProc(WindowProcI lpPrevWndFunc, long hWnd, int Msg, long wParam, long lParam)
Passes message information to the specified window procedure.static int
ChangeDisplaySettingsEx(java.lang.CharSequence lpszDeviceName, DEVMODE lpDevMode, long hwnd, int dwflags, long lParam)
Changes the settings of the specified display device to the specified graphics mode.static int
ChangeDisplaySettingsEx(java.nio.ByteBuffer lpszDeviceName, DEVMODE lpDevMode, long hwnd, int dwflags, long lParam)
Changes the settings of the specified display device to the specified graphics mode.static boolean
ClientToScreen(long hWnd, POINT lpPoint)
Converts the client-area coordinates of a specified point to screen coordinates.static boolean
ClipCursor(RECT rect)
Confines the cursor to a rectangular area on the screen.static boolean
CloseTouchInputHandle(long hTouchInput)
Closes a touch input handle, frees process memory associated with it, and invalidates the handle.static long
CreateWindowEx(int dwExStyle, java.lang.CharSequence lpClassName, java.lang.CharSequence lpWindowName, int dwStyle, int x, int y, int nWidth, int nHeight, long hWndParent, long hMenu, long hInstance, long lpParam)
Creates an overlapped, pop-up, or child window with an extended window style; otherwise, this function is identical to the CreateWindow function.static long
CreateWindowEx(int dwExStyle, java.nio.ByteBuffer lpClassName, java.nio.ByteBuffer lpWindowName, int dwStyle, int x, int y, int nWidth, int nHeight, long hWndParent, long hMenu, long hInstance, long lpParam)
Creates an overlapped, pop-up, or child window with an extended window style; otherwise, this function is identical to the CreateWindow function.static long
DefWindowProc(long hWnd, int Msg, long wParam, long lParam)
Calls the default window procedure to provide default processing for any window messages that an application does not process.static boolean
DestroyWindow(long hWnd)
Destroys the specified window.static long
DispatchMessage(MSG lpmsg)
Dispatches a message to a window procedure.static boolean
EnumDisplayDevices(java.lang.CharSequence lpDevice, int iDevNum, DISPLAY_DEVICE lpDisplayDevice, int dwFlags)
Obtains information about the display devices in the current session.static boolean
EnumDisplayDevices(java.nio.ByteBuffer lpDevice, int iDevNum, DISPLAY_DEVICE lpDisplayDevice, int dwFlags)
Obtains information about the display devices in the current session.static boolean
EnumDisplaySettingsEx(java.lang.CharSequence lpszDeviceName, int iModeNum, DEVMODE lpDevMode, int dwFlags)
Retrieves information about one of the graphics modes for a display device.static boolean
EnumDisplaySettingsEx(java.nio.ByteBuffer lpszDeviceName, int iModeNum, DEVMODE lpDevMode, int dwFlags)
Retrieves information about one of the graphics modes for a display device.static short
GetAsyncKeyState(int vKey)
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 toGetAsyncKeyState
.static int
GetAwarenessFromDpiAwarenessContext(long value)
Retrieves theDPI_AWARENESS
value from aDPI_AWARENESS_CONTEXT
.static long
GetClassLongPtr(long hWnd, int nIndex)
Retrieves the specified value from theWNDCLASSEX
structure associated with the specified window.static boolean
GetCursorPos(POINT point)
Retrieves the position of the mouse cursor, in screen coordinates.static long
GetDC(long hWnd)
Retrieves a handle to a device context (DC) for the client area of a specified window or for the entire screen.static int
GetDpiForSystem()
Returns the system DPI.static int
GetDpiForWindow(long hwnd)
Returns the dots per inch (dpi) value for the associated window.static SharedLibrary
getLibrary()
Returns the user32SharedLibrary
.static boolean
GetMessage(MSG lpMsg, long hWnd, int wMsgFilterMin, int wMsgFilterMax)
Retrieves a message from the calling thread's message queue.static long
GetMessageExtraInfo()
Retrieves the extra message information for the current thread.static boolean
GetMonitorInfo(long hMonitor, MONITORINFOEX lpmi)
Retrieves information about a display monitor.static int
GetSystemMetrics(int index)
Retrieves the specified system metric or system configuration setting.static long
GetThreadDpiAwarenessContext()
Gets theDPI_AWARENESS_CONTEXT
for the current thread.static boolean
GetTouchInputInfo(long hTouchInput, TOUCHINPUT.Buffer pInputs, int cbSize)
Retrieves detailed information about touch inputs associated with a particular touch input handle.static long
GetWindowDpiAwarenessContext(long hwnd)
Returns theDPI_AWARENESS_CONTEXT
associated with a window.static long
GetWindowLongPtr(long hWnd, int nIndex)
Retrieves information about the specified window.static boolean
GetWindowPlacement(long hWnd, WINDOWPLACEMENT lpwndpl)
Retrieves the show state and the restored, minimized, and maximized positions of the specified window.static boolean
GetWindowRect(long hWnd, RECT lpRect)
Retrieves the dimensions of the bounding rectangle of the specified window.static boolean
IsIconic(long hWnd)
Determines whether the specified window is minimized (iconic).static boolean
IsTouchWindow(long hWnd, int[] pulFlags)
Array version of:IsTouchWindow(long, java.nio.IntBuffer)
static boolean
IsTouchWindow(long hWnd, java.nio.IntBuffer pulFlags)
Checks whether a specified window is touch-capable and, optionally, retrieves the modifier flags set for the window's touch capability.static boolean
IsValidDpiAwarenessContext(long value)
Determines if a specifiedDPI_AWARENESS_CONTEXT
is valid and supported by the current system.static boolean
IsWindowVisible(long hWnd)
Determines the visibility state of the specified window.static boolean
IsZoomed(long hWnd)
Determines whether a window is maximized.static long
LoadCursor(long instance, java.lang.CharSequence cursorName)
Loads the specified cursor resource from the executable (.EXE) file associated with an application instance.static long
LoadCursor(long instance, java.nio.ByteBuffer cursorName)
Loads the specified cursor resource from the executable (.EXE) file associated with an application instance.static long
LoadIcon(long instance, java.lang.CharSequence iconName)
Loads the specified icon resource from the executable (.exe) file associated with an application instance.static long
LoadIcon(long instance, java.nio.ByteBuffer iconName)
Loads the specified icon resource from the executable (.exe) file associated with an application instance.static long
MonitorFromWindow(long hWnd, int dwFlags)
Retrieves a handle to the display monitor that has the largest area of intersection with the bounding rectangle of a specified window.static boolean
MoveWindow(long hWnd, int X, int Y, int nWidth, int nHeight, boolean bRepaint)
Changes the position and dimensions of the specified window.static int
nAdjustWindowRectEx(long lpRect, int dwStyle, int bMenu, int dwExStyle)
Unsafe version of:AdjustWindowRectEx(org.lwjgl.system.windows.RECT, int, boolean, int)
static int
nAdjustWindowRectEx(long lpRect, int dwStyle, int bMenu, int dwExStyle, long __functionAddress)
Unsafe version of:AdjustWindowRectEx(org.lwjgl.system.windows.RECT, int, boolean, int)
static long
nCallWindowProc(long lpPrevWndFunc, long hWnd, int Msg, long wParam, long lParam)
Unsafe version of:CallWindowProc(org.lwjgl.system.windows.WindowProcI, long, int, long, long)
static int
nChangeDisplaySettingsEx(long lpszDeviceName, long lpDevMode, long hwnd, int dwflags, long lParam)
static int
nClientToScreen(long hWnd, long lpPoint)
Unsafe version of:ClientToScreen(long, org.lwjgl.system.windows.POINT)
static int
nClipCursor(long rect)
Unsafe version of:ClipCursor(org.lwjgl.system.windows.RECT)
static int
nCloseTouchInputHandle(long hTouchInput, long __functionAddress)
Unsafe version of:CloseTouchInputHandle(long)
static long
nCreateWindowEx(int dwExStyle, long lpClassName, long lpWindowName, int dwStyle, int x, int y, int nWidth, int nHeight, long hWndParent, long hMenu, long hInstance, long lpParam)
static long
nCreateWindowEx(int dwExStyle, long lpClassName, long lpWindowName, int dwStyle, int x, int y, int nWidth, int nHeight, long hWndParent, long hMenu, long hInstance, long lpParam, long __functionAddress)
static int
nDestroyWindow(long hWnd, long __functionAddress)
Unsafe version of:DestroyWindow(long)
static long
nDispatchMessage(long lpmsg)
Unsafe version of:DispatchMessage(org.lwjgl.system.windows.MSG)
static int
nEnumDisplayDevices(long lpDevice, int iDevNum, long lpDisplayDevice, int dwFlags)
static int
nEnumDisplaySettingsEx(long lpszDeviceName, int iModeNum, long lpDevMode, int dwFlags)
static long
nGetClassLongPtr(long hWnd, int nIndex, long __functionAddress)
Unsafe version of:GetClassLongPtr(long, int)
static int
nGetCursorPos(long point)
Unsafe version of:GetCursorPos(org.lwjgl.system.windows.POINT)
static int
nGetMessage(long lpMsg, long hWnd, int wMsgFilterMin, int wMsgFilterMax)
Unsafe version of:GetMessage(org.lwjgl.system.windows.MSG, long, int, int)
static int
nGetMessage(long lpMsg, long hWnd, int wMsgFilterMin, int wMsgFilterMax, long __functionAddress)
Unsafe version of:GetMessage(org.lwjgl.system.windows.MSG, long, int, int)
static int
nGetMonitorInfo(long hMonitor, long lpmi)
Unsafe version of:GetMonitorInfo(long, org.lwjgl.system.windows.MONITORINFOEX)
static int
nGetTouchInputInfo(long hTouchInput, int cInputs, long pInputs, int cbSize)
Unsafe version of:GetTouchInputInfo(long, org.lwjgl.system.windows.TOUCHINPUT.Buffer, int)
static int
nGetTouchInputInfo(long hTouchInput, int cInputs, long pInputs, int cbSize, long __functionAddress)
Unsafe version of:GetTouchInputInfo(long, org.lwjgl.system.windows.TOUCHINPUT.Buffer, int)
static long
nGetWindowLongPtr(long hWnd, int nIndex, long __functionAddress)
Unsafe version of:GetWindowLongPtr(long, int)
static int
nGetWindowPlacement(long hWnd, long lpwndpl)
Unsafe version of:GetWindowPlacement(long, org.lwjgl.system.windows.WINDOWPLACEMENT)
static int
nGetWindowPlacement(long hWnd, long lpwndpl, long __functionAddress)
Unsafe version of:GetWindowPlacement(long, org.lwjgl.system.windows.WINDOWPLACEMENT)
static int
nGetWindowRect(long hWnd, long lpRect)
Unsafe version of:GetWindowRect(long, org.lwjgl.system.windows.RECT)
static int
nGetWindowRect(long hWnd, long lpRect, long __functionAddress)
Unsafe version of:GetWindowRect(long, org.lwjgl.system.windows.RECT)
static int
nIsTouchWindow(long hWnd, long pulFlags)
Unsafe version of:IsTouchWindow(long, java.nio.IntBuffer)
static long
nLoadCursor(long instance, long cursorName)
Unsafe version of:LoadCursor(long, java.nio.ByteBuffer)
static long
nLoadCursor(long instance, long cursorName, long __functionAddress)
Unsafe version of:LoadCursor(long, java.nio.ByteBuffer)
static long
nLoadIcon(long instance, long iconName)
Unsafe version of:LoadIcon(long, java.nio.ByteBuffer)
static long
nLoadIcon(long instance, long iconName, long __functionAddress)
Unsafe version of:LoadIcon(long, java.nio.ByteBuffer)
static int
nMoveWindow(long hWnd, int X, int Y, int nWidth, int nHeight, int bRepaint, long __functionAddress)
Unsafe version of:MoveWindow(long, int, int, int, int, boolean)
static int
nPeekMessage(long lpMsg, long hWnd, int wMsgFilterMin, int wMsgFilterMax, int wRemoveMsg)
Unsafe version of:PeekMessage(org.lwjgl.system.windows.MSG, long, int, int, int)
static int
nPostMessage(long hWnd, int Msg, long wParam, long lParam, long __functionAddress)
Unsafe version of:PostMessage(long, int, long, long)
static short
nRegisterClassEx(long lpwcx)
Unsafe version of:RegisterClassEx(org.lwjgl.system.windows.WNDCLASSEX)
static short
nRegisterClassEx(long lpwcx, long __functionAddress)
Unsafe version of:RegisterClassEx(org.lwjgl.system.windows.WNDCLASSEX)
static int
nRegisterTouchWindow(long hWnd, int ulFlags, long __functionAddress)
Unsafe version of:RegisterTouchWindow(long, int)
static int
nSendInput(int cInputs, long pInputs, int cbSize)
Unsafe version of:SendInput(org.lwjgl.system.windows.INPUT.Buffer, int)
static int
nSendMessage(long hWnd, int Msg, long wParam, long lParam, long __functionAddress)
Unsafe version of:SendMessage(long, int, long, long)
static long
nSetClassLongPtr(long hWnd, int nIndex, long dwNewLong, long __functionAddress)
Unsafe version of:SetClassLongPtr(long, int, long)
static int
nSetLayeredWindowAttributes(long hwnd, int crKey, byte bAlpha, int dwFlags, long __functionAddress)
Unsafe version of:SetLayeredWindowAttributes(long, int, byte, int)
static long
nSetWindowLongPtr(long hWnd, int nIndex, long dwNewLong, long __functionAddress)
Unsafe version of:SetWindowLongPtr(long, int, long)
static int
nSetWindowPlacement(long hWnd, long lpwndpl)
Unsafe version of:SetWindowPlacement(long, org.lwjgl.system.windows.WINDOWPLACEMENT)
static int
nSetWindowPlacement(long hWnd, long lpwndpl, long __functionAddress)
Unsafe version of:SetWindowPlacement(long, org.lwjgl.system.windows.WINDOWPLACEMENT)
static int
nSetWindowPos(long hWnd, long hWndInsertAfter, int X, int Y, int cx, int cy, int uFlags, long __functionAddress)
Unsafe version of:SetWindowPos(long, long, int, int, int, int, int)
static int
nSetWindowText(long hWnd, long lpString)
Unsafe version of:SetWindowText(long, java.nio.ByteBuffer)
static int
nSetWindowText(long hWnd, long lpString, long __functionAddress)
Unsafe version of:SetWindowText(long, java.nio.ByteBuffer)
static int
nTranslateMessage(long lpMsg)
Unsafe version of:TranslateMessage(org.lwjgl.system.windows.MSG)
static int
nUnregisterClass(long lpClassName, long hInstance)
Unsafe version of:UnregisterClass(java.nio.ByteBuffer, long)
static int
nUnregisterClass(long lpClassName, long hInstance, long __functionAddress)
Unsafe version of:UnregisterClass(java.nio.ByteBuffer, long)
static int
nUnregisterTouchWindow(long hWnd, long __functionAddress)
Unsafe version of:UnregisterTouchWindow(long)
static int
nWaitMessage(long __functionAddress)
Unsafe version of:WaitMessage()
static boolean
PeekMessage(MSG lpMsg, long hWnd, int wMsgFilterMin, int wMsgFilterMax, int wRemoveMsg)
Dispatches incoming sent messages, checks the thread message queue for a posted message, and retrieves the message (if any exist).static boolean
PostMessage(long hWnd, int Msg, long wParam, long lParam)
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.static short
RegisterClassEx(WNDCLASSEX lpwcx)
Registers a window class for subsequent use in calls to theCreateWindowEx(int, java.nio.ByteBuffer, java.nio.ByteBuffer, int, int, int, int, int, long, long, long, long)
function.static boolean
RegisterTouchWindow(long hWnd, int ulFlags)
Registers a window as being touch-capable.static boolean
ReleaseDC(long hWnd, long hDC)
Releases a device context (DC), freeing it for use by other applications.static int
SendInput(INPUT.Buffer pInputs, int cbSize)
Synthesizes keystrokes, mouse motions, and button clicks.static boolean
SendMessage(long hWnd, int Msg, long wParam, long lParam)
Sends the specified message to a window or windows.static long
SetClassLongPtr(long hWnd, int nIndex, long dwNewLong)
Replaces the specified value at the specified offset in the extra class memory or theWNDCLASSEX
structure for the class to which the specified window belongs.static long
SetCursor(long hCursor)
Sets the cursor shape.static boolean
SetCursorPos(int X, int Y)
Moves the cursor to the specified screen coordinates.static boolean
SetLayeredWindowAttributes(long hwnd, int crKey, byte bAlpha, int dwFlags)
static long
SetThreadDpiAwarenessContext(long dpiContext)
Set the DPI awareness for the current thread to the provided value.static long
SetWindowLongPtr(long hWnd, int nIndex, long dwNewLong)
Changes an attribute of the specified window.static boolean
SetWindowPlacement(long hWnd, WINDOWPLACEMENT lpwndpl)
Sets the show state and the restored, minimized, and maximized positions of the specified window.static boolean
SetWindowPos(long hWnd, long 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.static boolean
SetWindowText(long hWnd, java.lang.CharSequence lpString)
Changes the text of the specified window's title bar (if it has one).static boolean
SetWindowText(long hWnd, java.nio.ByteBuffer lpString)
Changes the text of the specified window's title bar (if it has one).static int
ShowCursor(boolean show)
Displays or hides the cursor.static boolean
ShowWindow(long hWnd, int nCmdShow)
Sets the specified window's show state.static boolean
TranslateMessage(MSG lpMsg)
Translates virtual-key messages into character messages.static boolean
UnregisterClass(java.lang.CharSequence lpClassName, long hInstance)
Unregisters a window class, freeing the memory required for the class.static boolean
UnregisterClass(java.nio.ByteBuffer lpClassName, long hInstance)
Unregisters a window class, freeing the memory required for the class.static boolean
UnregisterTouchWindow(long hWnd)
Registers a window as no longer being touch-capable.static boolean
UpdateWindow(long hWnd)
Updates the client area of the specified window by sending aWM_PAINT
message to the window if the window's update region is not empty.static boolean
WaitMessage()
Yields control to other threads when a thread has no other messages in its message queue.
-
-
-
Field Detail
-
WS_OVERLAPPED, WS_POPUP, WS_CHILD, WS_MINIMIZE, WS_VISIBLE, WS_DISABLED, WS_CLIPSIBLINGS, WS_CLIPCHILDREN, WS_MAXIMIZE, WS_CAPTION, WS_BORDER, WS_DLGFRAME, WS_VSCROLL, WS_HSCROLL, WS_SYSMENU, WS_THICKFRAME, WS_GROUP, WS_TABSTOP, WS_MINIMIZEBOX, WS_MAXIMIZEBOX, WS_OVERLAPPEDWINDOW, WS_POPUPWINDOW, WS_CHILDWINDOW, WS_TILED, WS_ICONIC, WS_SIZEBOX, WS_TILEDWINDOW
Window Styles
-
WS_EX_DLGMODALFRAME, WS_EX_NOPARENTNOTIFY, WS_EX_TOPMOST, WS_EX_ACCEPTFILES, WS_EX_TRANSPARENT, WS_EX_MDICHILD, WS_EX_TOOLWINDOW, WS_EX_WINDOWEDGE, WS_EX_CLIENTEDGE, WS_EX_CONTEXTHELP, WS_EX_RIGHT, WS_EX_LEFT, WS_EX_RTLREADING, WS_EX_LTRREADING, WS_EX_LEFTSCROLLBAR, WS_EX_RIGHTSCROLLBAR, WS_EX_CONTROLPARENT, WS_EX_STATICEDGE, WS_EX_APPWINDOW, WS_EX_OVERLAPPEDWINDOW, WS_EX_PALETTEWINDOW, WS_EX_LAYERED, WS_EX_NOINHERITLAYOUT, WS_EX_LAYOUTRTL, WS_EX_COMPOSITED, WS_EX_NOACTIVATE
Extended Window Styles
-
CW_USEDEFAULT
May be used inCreateWindowEx(int, java.nio.ByteBuffer, java.nio.ByteBuffer, int, int, int, int, int, long, long, long, long)
for the x, y, width, height parameters.
-
CS_VREDRAW, CS_HREDRAW, CS_DBLCLKS, CS_OWNDC, CS_CLASSDC, CS_PARENTDC, CS_NOCLOSE, CS_SAVEBITS, CS_BYTEALIGNCLIENT, CS_BYTEALIGNWINDOW, CS_GLOBALCLASS, CS_IME, CS_DROPSHADOW
Class styles
-
WM_NULL, WM_CREATE, WM_DESTROY, WM_MOVE, WM_SIZE, WM_ACTIVATE, WM_SETFOCUS, WM_KILLFOCUS, WM_ENABLE, WM_SETREDRAW, WM_SETTEXT, WM_GETTEXT, WM_GETTEXTLENGTH, WM_PAINT, WM_CLOSE, WM_QUERYENDSESSION, WM_QUERYOPEN, WM_ENDSESSION, WM_QUIT, WM_ERASEBKGND, WM_SYSCOLORCHANGE, WM_SHOWWINDOW, WM_WININICHANGE, WM_SETTINGCHANGE, WM_DEVMODECHANGE, WM_ACTIVATEAPP, WM_FONTCHANGE, WM_TIMECHANGE, WM_CANCELMODE, WM_SETCURSOR, WM_MOUSEACTIVATE, WM_CHILDACTIVATE, WM_QUEUESYNC, WM_GETMINMAXINFO, WM_PAINTICON, WM_ICONERASEBKGND, WM_NEXTDLGCTL, WM_SPOOLERSTATUS, WM_DRAWITEM, WM_MEASUREITEM, WM_DELETEITEM, WM_VKEYTOITEM, WM_CHARTOITEM, WM_SETFONT, WM_GETFONT, WM_SETHOTKEY, WM_GETHOTKEY, WM_QUERYDRAGICON, WM_COMPAREITEM, WM_GETOBJECT, WM_COMPACTING, WM_COMMNOTIFY, WM_WINDOWPOSCHANGING, WM_WINDOWPOSCHANGED, WM_POWER, WM_COPYDATA, WM_CANCELJOURNAL, WM_NOTIFY, WM_INPUTLANGCHANGEREQUEST, WM_INPUTLANGCHANGE, WM_TCARD, WM_HELP, WM_USERCHANGED, WM_NOTIFYFORMAT, WM_CONTEXTMENU, WM_STYLECHANGING, WM_STYLECHANGED, WM_DISPLAYCHANGE, WM_GETICON, WM_SETICON, WM_NCCREATE, WM_NCDESTROY, WM_NCCALCSIZE, WM_NCHITTEST, WM_NCPAINT, WM_NCACTIVATE, WM_GETDLGCODE, WM_SYNCPAINT, WM_NCMOUSEMOVE, WM_NCLBUTTONDOWN, WM_NCLBUTTONUP, WM_NCLBUTTONDBLCLK, WM_NCRBUTTONDOWN, WM_NCRBUTTONUP, WM_NCRBUTTONDBLCLK, WM_NCMBUTTONDOWN, WM_NCMBUTTONUP, WM_NCMBUTTONDBLCLK, WM_NCXBUTTONDOWN, WM_NCXBUTTONUP, WM_NCXBUTTONDBLCLK, WM_INPUT_DEVICE_CHANGE, WM_INPUT, WM_KEYFIRST, WM_KEYDOWN, WM_KEYUP, WM_CHAR, WM_DEADCHAR, WM_SYSKEYDOWN, WM_SYSKEYUP, WM_SYSCHAR, WM_SYSDEADCHAR, WM_UNICHAR, UNICODE_NOCHAR, WM_IME_STARTCOMPOSITION, WM_IME_ENDCOMPOSITION, WM_IME_COMPOSITION, WM_IME_KEYLAST, WM_INITDIALOG, WM_COMMAND, WM_SYSCOMMAND, WM_TIMER, WM_HSCROLL, WM_VSCROLL, WM_INITMENU, WM_INITMENUPOPUP, WM_GESTURE, WM_GESTURENOTIFY, WM_MENUSELECT, WM_MENUCHAR, WM_ENTERIDLE, WM_MENURBUTTONUP, WM_MENUDRAG, WM_MENUGETOBJECT, WM_UNINITMENUPOPUP, WM_MENUCOMMAND, WM_CHANGEUISTATE, WM_UPDATEUISTATE, WM_QUERYUISTATE, WM_CTLCOLORMSGBOX, WM_CTLCOLOREDIT, WM_CTLCOLORLISTBOX, WM_CTLCOLORBTN, WM_CTLCOLORDLG, WM_CTLCOLORSCROLLBAR, WM_CTLCOLORSTATIC, MN_GETHMENU, WM_MOUSEFIRST, WM_MOUSEMOVE, WM_LBUTTONDOWN, WM_LBUTTONUP, WM_LBUTTONDBLCLK, WM_RBUTTONDOWN, WM_RBUTTONUP, WM_RBUTTONDBLCLK, WM_MBUTTONDOWN, WM_MBUTTONUP, WM_MBUTTONDBLCLK, WM_MOUSEWHEEL, WM_XBUTTONDOWN, WM_XBUTTONUP, WM_XBUTTONDBLCLK, WM_MOUSEHWHEEL, WM_PARENTNOTIFY, WM_ENTERMENULOOP, WM_EXITMENULOOP, WM_NEXTMENU, WM_SIZING, WM_CAPTURECHANGED, WM_MOVING, WM_POWERBROADCAST, WM_DEVICECHANGE, WM_MDICREATE, WM_MDIDESTROY, WM_MDIACTIVATE, WM_MDIRESTORE, WM_MDINEXT, WM_MDIMAXIMIZE, WM_MDITILE, WM_MDICASCADE, WM_MDIICONARRANGE, WM_MDIGETACTIVE, WM_MDISETMENU, WM_ENTERSIZEMOVE, WM_EXITSIZEMOVE, WM_DROPFILES, WM_MDIREFRESHMENU, WM_TOUCH, WM_IME_SETCONTEXT, WM_IME_NOTIFY, WM_IME_CONTROL, WM_IME_COMPOSITIONFULL, WM_IME_SELECT, WM_IME_CHAR, WM_IME_REQUEST, WM_IME_KEYDOWN, WM_IME_KEYUP, WM_MOUSEHOVER, WM_MOUSELEAVE, WM_NCMOUSEHOVER, WM_NCMOUSELEAVE, WM_WTSSESSION_CHANGE, WM_TABLET_FIRST, WM_TABLET_LAST, WM_CUT, WM_COPY, WM_PASTE, WM_CLEAR, WM_UNDO, WM_RENDERFORMAT, WM_RENDERALLFORMATS, WM_DESTROYCLIPBOARD, WM_DRAWCLIPBOARD, WM_PAINTCLIPBOARD, WM_VSCROLLCLIPBOARD, WM_SIZECLIPBOARD, WM_ASKCBFORMATNAME, WM_CHANGECBCHAIN, WM_HSCROLLCLIPBOARD, WM_QUERYNEWPALETTE, WM_PALETTEISCHANGING, WM_PALETTECHANGED, WM_HOTKEY, WM_PRINT, WM_PRINTCLIENT, WM_APPCOMMAND, WM_THEMECHANGED, WM_CLIPBOARDUPDATE, WM_DWMCOMPOSITIONCHANGED, WM_DWMNCRENDERINGCHANGED, WM_DWMCOLORIZATIONCOLORCHANGED, WM_DWMWINDOWMAXIMIZEDCHANGE, WM_DWMSENDICONICTHUMBNAIL, WM_DWMSENDICONICLIVEPREVIEWBITMAP, WM_GETTITLEBARINFOEX, WM_HANDHELDFIRST, WM_HANDHELDLAST, WM_AFXFIRST, WM_AFXLAST, WM_PENWINFIRST, WM_PENWINLAST, WM_APP, WM_USER
Windows messages.
-
WA_ACTIVE, WA_CLICKACTIVE, WA_INACTIVE
WM_ACTIVATE
messagewParam
values.
-
SIZE_RESTORED, SIZE_MINIMIZED, SIZE_MAXIMIZED, SIZE_MAXSHOW, SIZE_MAXHIDE
WM_SIZE
messagewParam
values.
-
DBT_APPYBEGIN, DBT_APPYEND, DBT_DEVNODES_CHANGED, DBT_QUERYCHANGECONFIG, DBT_CONFIGCHANGED, DBT_CONFIGCHANGECANCELED, DBT_MONITORCHANGE
WM_DEVICECHANGE
messagewParam
params.
-
SC_SIZE, SC_MOVE, SC_MINIMIZE, SC_MAXIMIZE, SC_NEXTWINDOW, SC_PREVWINDOW, SC_CLOSE, SC_VSCROLL, SC_HSCROLL, SC_MOUSEMENU, SC_KEYMENU, SC_ARRANGE, SC_RESTORE, SC_TASKLIST, SC_SCREENSAVE, SC_HOTKEY, SC_DEFAULT, SC_MONITORPOWER, SC_CONTEXTHELP, SC_SEPARATOR
System menu command values.
-
MK_LBUTTON, MK_RBUTTON, MK_SHIFT, MK_CONTROL, MK_MBUTTON, MK_XBUTTON1, MK_XBUTTON2
Key state masks for mouse messages.
-
HTERROR, HTTRANSPARENT, HTNOWHERE, HTCLIENT, HTCAPTION, HTSYSMENU, HTGROWBOX, HTSIZE, HTMENU, HTHSCROLL, HTVSCROLL, HTMINBUTTON, HTMAXBUTTON, HTLEFT, HTRIGHT, HTTOP, HTTOPLEFT, HTTOPRIGHT, HTBOTTOM, HTBOTTOMLEFT, HTBOTTOMRIGHT, HTBORDER, HTREDUCE, HTZOOM, HTSIZEFIRST, HTSIZELAST, HTOBJECT, HTCLOSE, HTHELP
Mouse position codes.
-
GWL_WNDPROC, GWL_HINSTANCE, GWL_HWNDPARENT, GWL_STYLE, GWL_EXSTYLE, GWL_USERDATA, GWL_ID
Window field offsets forGetWindowLongPtr(long, int)
.
-
SW_HIDE, SW_SHOWNORMAL, SW_NORMAL, SW_SHOWMINIMIZED, SW_SHOWMAXIMIZED, SW_MAXIMIZE, SW_SHOWNOACTIVATE, SW_SHOW, SW_MINIMIZE, SW_SHOWMINNOACTIVE, SW_SHOWNA, SW_RESTORE, SW_SHOWDEFAULT, SW_FORCEMINIMIZE, SW_MAX
ShowWindow(long, int)
commands.
-
HWND_TOP, HWND_BOTTOM, HWND_TOPMOST, HWND_NOTOPMOST
Virtual window handles used by theSetWindowPos(long, long, int, int, int, int, int)
insertAfter argument.
-
HWND_BROADCAST
Virtual window handle used byPostMessage(long, int, long, long)
that matches all top-level windows in the system, including disabled or invisible unowned windows, overlapped windows, and pop-up windows.
-
SWP_NOSIZE, SWP_NOMOVE, SWP_NOZORDER, SWP_NOREDRAW, SWP_NOACTIVATE, SWP_FRAMECHANGED, SWP_SHOWWINDOW, SWP_HIDEWINDOW, SWP_NOCOPYBITS, SWP_NOOWNERZORDER, SWP_NOSENDCHANGING, SWP_DRAWFRAME, SWP_NOREPOSITION, SWP_DEFERERASE, SWP_ASYNCWINDOWPOS
Window sizing and positiong flags used by theSetWindowPos(long, long, int, int, int, int, int)
flags argument.
-
IDI_APPLICATION, IDI_HAND, IDI_QUESTION, IDI_EXCLAMATION, IDI_ASTERISK, IDI_WINLOGO, IDI_SHIELD, IDI_WARNING, IDI_ERROR, IDI_INFORMATION
Standard Icon IDs. Use withLoadIcon(long, java.nio.ByteBuffer)
.
-
IDC_ARROW, IDC_IBEAM, IDC_WAIT, IDC_CROSS, IDC_UPARROW, IDC_SIZE, IDC_ICON, IDC_SIZENWSE, IDC_SIZENESW, IDC_SIZEWE, IDC_SIZENS, IDC_SIZEALL, IDC_NO, IDC_HAND, IDC_APPSTARTING, IDC_HELP
Standard Cursor IDs. Use withLoadCursor(long, java.nio.ByteBuffer)
.
-
GCL_MENUNAME, GCL_HBRBACKGROUND, GCL_HCURSOR, GCL_HICON, GCL_HMODULE, GCL_CBWNDEXTRA, GCL_CBCLSEXTRA, GCL_WNDPROC, GCL_STYLE, GCW_ATOM, GCL_HICONSM
Class field offsets forGetClassLongPtr(long, int)
.
-
QS_KEY, QS_MOUSEMOVE, QS_MOUSEBUTTON, QS_POSTMESSAGE, QS_TIMER, QS_PAINT, QS_SENDMESSAGE, QS_HOTKEY, QS_ALLPOSTMESSAGE, QS_RAWINPUT, QS_MOUSE, QS_INPUT, QS_ALLEVENTS, QS_ALLINPUT
Queue status flags forGetQueueStatus
andMsgWaitForMultipleObjects
-
PM_NOREMOVE, PM_REMOVE, PM_NOYIELD, PM_QS_INPUT, PM_QS_POSTMESSAGE, PM_QS_PAINT, PM_QS_SENDMESSAGE
Remove message flags forPeekMessage(org.lwjgl.system.windows.MSG, long, int, int, int)
.
-
VK_LBUTTON, VK_RBUTTON, VK_CANCEL, VK_MBUTTON, VK_XBUTTON1, VK_XBUTTON2, VK_BACK, VK_TAB, VK_CLEAR, VK_RETURN, VK_SHIFT, VK_CONTROL, VK_MENU, VK_PAUSE, VK_CAPITAL, VK_KANA, VK_HANGEUL, VK_HANGUL, VK_JUNJA, VK_FINAL, VK_HANJA, VK_KANJI, VK_ESCAPE, VK_CONVERT, VK_NONCONVERT, VK_ACCEPT, VK_MODECHANGE, VK_SPACE, VK_PRIOR, VK_NEXT, VK_END, VK_HOME, VK_LEFT, VK_UP, VK_RIGHT, VK_DOWN, VK_SELECT, VK_PRINT, VK_EXECUTE, VK_SNAPSHOT, VK_INSERT, VK_DELETE, VK_HELP, VK_LWIN, VK_RWIN, VK_APPS, VK_SLEEP, VK_NUMPAD0, VK_NUMPAD1, VK_NUMPAD2, VK_NUMPAD3, VK_NUMPAD4, VK_NUMPAD5, VK_NUMPAD6, VK_NUMPAD7, VK_NUMPAD8, VK_NUMPAD9, VK_MULTIPLY, VK_ADD, VK_SEPARATOR, VK_SUBTRACT, VK_DECIMAL, VK_DIVIDE, VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, VK_F7, VK_F8, VK_F9, VK_F10, VK_F11, VK_F12, VK_F13, VK_F14, VK_F15, VK_F16, VK_F17, VK_F18, VK_F19, VK_F20, VK_F21, VK_F22, VK_F23, VK_F24, VK_NUMLOCK, VK_SCROLL, VK_OEM_NEC_EQUAL, VK_OEM_FJ_JISHO, VK_OEM_FJ_MASSHOU, VK_OEM_FJ_TOUROKU, VK_OEM_FJ_LOYA, VK_OEM_FJ_ROYA, VK_LSHIFT, VK_RSHIFT, VK_LCONTROL, VK_RCONTROL, VK_LMENU, VK_RMENU, VK_BROWSER_BACK, VK_BROWSER_FORWARD, VK_BROWSER_REFRESH, VK_BROWSER_STOP, VK_BROWSER_SEARCH, VK_BROWSER_FAVORITES, VK_BROWSER_HOME, VK_VOLUME_MUTE, VK_VOLUME_DOWN, VK_VOLUME_UP, VK_MEDIA_NEXT_TRACK, VK_MEDIA_PREV_TRACK, VK_MEDIA_STOP, VK_MEDIA_PLAY_PAUSE, VK_LAUNCH_MAIL, VK_LAUNCH_MEDIA_SELECT, VK_LAUNCH_APP1, VK_LAUNCH_APP2, VK_OEM_1, VK_OEM_PLUS, VK_OEM_COMMA, VK_OEM_MINUS, VK_OEM_PERIOD, VK_OEM_2, VK_OEM_3, VK_OEM_4, VK_OEM_5, VK_OEM_6, VK_OEM_7, VK_OEM_8, VK_OEM_AX, VK_OEM_102, VK_ICO_HELP, VK_ICO_00, VK_PROCESSKEY, VK_ICO_CLEAR, VK_PACKET, VK_OEM_RESET, VK_OEM_JUMP, VK_OEM_PA1, VK_OEM_PA2, VK_OEM_PA3, VK_OEM_WSCTRL, VK_OEM_CUSEL, VK_OEM_ATTN, VK_OEM_FINISH, VK_OEM_COPY, VK_OEM_AUTO, VK_OEM_ENLW, VK_OEM_BACKTAB, VK_ATTN, VK_CRSEL, VK_EXSEL, VK_EREOF, VK_PLAY, VK_ZOOM, VK_NONAME, VK_PA1, VK_OEM_CLEAR
Virtual Keys.
-
WHEEL_DELTA
Value for rolling one detent.
-
DPI_AWARENESS_INVALID, DPI_AWARENESS_UNAWARE, DPI_AWARENESS_SYSTEM_AWARE, DPI_AWARENESS_PER_MONITOR_AWARE
Identifies the dots per inch (dpi) setting for a thread, process, or window. (DPI_AWARENESS
)Enum values:
DPI_AWARENESS_INVALID
- Invalid DPI awareness.This is an invalid DPI awareness value.
DPI_AWARENESS_UNAWARE
- DPI unaware.This process does not scale for DPI changes and is always assumed to have a scale factor of 100% (96 DPI). It will be automatically scaled by the system on any other DPI setting.
DPI_AWARENESS_SYSTEM_AWARE
- System DPI aware.This process does not scale for DPI changes. It will query for the DPI once and use that value for the lifetime of the process. If the DPI changes, the process will not adjust to the new DPI value. It will be automatically scaled up or down by the system when the DPI changes from the system value.
DPI_AWARENESS_PER_MONITOR_AWARE
- Per monitor DPI aware.This process checks for the DPI when it is created and adjusts the scale factor whenever the DPI changes. These processes are not automatically scaled by the system.
-
DPI_AWARENESS_CONTEXT_UNAWARE
DPI unaware.This window does not scale for DPI changes and is always assumed to have a scale factor of 100% (96 DPI). It will be automatically scaled by the system on any other DPI setting.
-
DPI_AWARENESS_CONTEXT_SYSTEM_AWARE
System DPI aware.This window does not scale for DPI changes. It will query for the DPI once and use that value for the lifetime of the process. If the DPI changes, the process will not adjust to the new DPI value. It will be automatically scaled up or down by the system when the DPI changes from the system value.
-
DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE
Per monitor DPI aware.This window checks for the DPI when it is created and adjusts the scale factor whenever the DPI changes. These processes are not automatically scaled by the system.
-
DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2
Also known as Per Monitor v2.An advancement over the original per-monitor DPI awareness mode, which enables applications to access new DPI-related scaling behaviors on a per top-level window basis.
Per Monitor v2 was made available in the Creators Update of Windows 10, and is not available on earlier versions of the operating system.
The additional behaviors introduced are as follows:
- Child window DPI change notifications - In Per Monitor v2 contexts, the entire window tree is notified of any DPI changes that occur.
- Scaling of non-client area - All windows will automatically have their non-client area drawn in a DPI sensitive fashion. Calls to
EnableNonClientDpiScaling
are unnecessary. - Scaling of Win32 menus - All
NTUSER
menus created in Per Monitor v2 contexts will be scaling in a per-monitor fashion. - Dialog Scaling - Win32 dialogs created in Per Monitor v2 contexts will automatically respond to DPI changes.
- Improved scaling of
comctl32
controls - Variouscomctl32
controls have improved DPI scaling behavior in Per Monitor v2 contexts. - Improved theming behavior -
UxTheme
handles opened in the context of a Per Monitor v2 window will operate in terms of the DPI associated with that window.
-
SM_CXSCREEN, SM_CYSCREEN, SM_CXVSCROLL, SM_CYHSCROLL, SM_CYCAPTION, SM_CXBORDER, SM_CYBORDER, SM_CXDLGFRAME, SM_CYDLGFRAME, SM_CYVTHUMB, SM_CXHTHUMB, SM_CXICON, SM_CYICON, SM_CXCURSOR, SM_CYCURSOR, SM_CYMENU, SM_CXFULLSCREEN, SM_CYFULLSCREEN, SM_CYKANJIWINDOW, SM_MOUSEPRESENT, SM_CYVSCROLL, SM_CXHSCROLL, SM_DEBUG, SM_SWAPBUTTON, SM_RESERVED1, SM_RESERVED2, SM_RESERVED3, SM_RESERVED4, SM_CXMIN, SM_CYMIN, SM_CXSIZE, SM_CYSIZE, SM_CXFRAME, SM_CYFRAME, SM_CXMINTRACK, SM_CYMINTRACK, SM_CXDOUBLECLK, SM_CYDOUBLECLK, SM_CXICONSPACING, SM_CYICONSPACING, SM_MENUDROPALIGNMENT, SM_PENWINDOWS, SM_DBCSENABLED, SM_CMOUSEBUTTONS, SM_CXFIXEDFRAME, SM_CYFIXEDFRAME, SM_CXSIZEFRAME, SM_CYSIZEFRAME, SM_SECURE, SM_CXEDGE, SM_CYEDGE, SM_CXMINSPACING, SM_CYMINSPACING, SM_CXSMICON, SM_CYSMICON, SM_CYSMCAPTION, SM_CXSMSIZE, SM_CYSMSIZE, SM_CXMENUSIZE, SM_CYMENUSIZE, SM_ARRANGE, SM_CXMINIMIZED, SM_CYMINIMIZED, SM_CXMAXTRACK, SM_CYMAXTRACK, SM_CXMAXIMIZED, SM_CYMAXIMIZED, SM_NETWORK, SM_CLEANBOOT, SM_CXDRAG, SM_CYDRAG, SM_SHOWSOUNDS, SM_CXMENUCHECK, SM_CYMENUCHECK, SM_SLOWMACHINE, SM_MIDEASTENABLED, SM_MOUSEWHEELPRESENT, SM_XVIRTUALSCREEN, SM_YVIRTUALSCREEN, SM_CXVIRTUALSCREEN, SM_CYVIRTUALSCREEN, SM_CMONITORS, SM_SAMEDISPLAYFORMAT, SM_IMMENABLED, SM_REMOTESESSION, SM_SHUTTINGDOWN, SM_REMOTECONTROL, SM_CARETBLINKINGENABLED, SM_CXFOCUSBORDER, SM_CYFOCUSBORDER, SM_TABLETPC, SM_MEDIACENTER, SM_STARTER, SM_SERVERR2, SM_MOUSEHORIZONTALWHEELPRESENT, SM_CXPADDEDBORDER, SM_DIGITIZER, SM_MAXIMUMTOUCHES
GetSystemMetrics(int)
codes.
-
TOUCHEVENTF_MOVE, TOUCHEVENTF_DOWN, TOUCHEVENTF_UP, TOUCHEVENTF_INRANGE, TOUCHEVENTF_PRIMARY, TOUCHEVENTF_NOCOALESCE, TOUCHEVENTF_PEN, TOUCHEVENTF_PALM
Touch input flag values (TOUCHINPUT.dwFlags()
).
-
TOUCHINPUTMASKF_TIMEFROMSYSTEM, TOUCHINPUTMASKF_EXTRAINFO, TOUCHINPUTMASKF_CONTACTAREA
Touch input mask values (TOUCHINPUT.dwMask()
).
-
MONITOR_DEFAULTTONULL, MONITOR_DEFAULTTOPRIMARY, MONITOR_DEFAULTTONEAREST
MonitorFromWindow(long, int)
flags.
-
CDS_UPDATEREGISTRY, CDS_TEST, CDS_FULLSCREEN, CDS_GLOBAL, CDS_SET_PRIMARY, CDS_VIDEOPARAMETERS, CDS_ENABLE_UNSAFE_MODES, CDS_DISABLE_UNSAFE_MODES, CDS_RESET, CDS_RESET_EX, CDS_NORESET
-
DISP_CHANGE_SUCCESSFUL, DISP_CHANGE_RESTART, DISP_CHANGE_FAILED, DISP_CHANGE_BADMODE, DISP_CHANGE_NOTUPDATED, DISP_CHANGE_BADFLAGS, DISP_CHANGE_BADPARAM, DISP_CHANGE_BADDUALVIEW
-
INPUT_MOUSE, INPUT_KEYBOARD, INPUT_HARDWARE
The type of input event.
-
MOUSEEVENTF_ABSOLUTE, MOUSEEVENTF_HWHEEL, MOUSEEVENTF_MOVE, MOUSEEVENTF_MOVE_NOCOALESCE, MOUSEEVENTF_LEFTDOWN, MOUSEEVENTF_LEFTUP, MOUSEEVENTF_RIGHTDOWN, MOUSEEVENTF_RIGHTUP, MOUSEEVENTF_MIDDLEDOWN, MOUSEEVENTF_MIDDLEUP, MOUSEEVENTF_VIRTUALDESK, MOUSEEVENTF_WHEEL, MOUSEEVENTF_XDOWN, MOUSEEVENTF_XUP
MOUSEINPUT
flags.
-
-
Method Detail
-
getLibrary
public static SharedLibrary getLibrary()
Returns the user32SharedLibrary
.
-
nRegisterClassEx
public static short nRegisterClassEx(long lpwcx, long __functionAddress) public static short nRegisterClassEx(long lpwcx)
Unsafe version of:RegisterClassEx(org.lwjgl.system.windows.WNDCLASSEX)
-
RegisterClassEx
public static short RegisterClassEx(WNDCLASSEX lpwcx)
Registers a window class for subsequent use in calls to theCreateWindowEx(int, java.nio.ByteBuffer, java.nio.ByteBuffer, int, int, int, int, int, long, long, long, long)
function.- Parameters:
lpwcx
- aWNDCLASSEX
structure. You must fill the structure with the appropriate class attributes before passing it to the function.
-
nUnregisterClass
public static int nUnregisterClass(long lpClassName, long hInstance, long __functionAddress) public static int nUnregisterClass(long lpClassName, long hInstance)
Unsafe version of:UnregisterClass(java.nio.ByteBuffer, long)
-
UnregisterClass
public static boolean UnregisterClass(java.nio.ByteBuffer lpClassName, long hInstance) public static boolean UnregisterClass(java.lang.CharSequence lpClassName, long hInstance)
Unregisters a window class, freeing the memory required for the class.- Parameters:
lpClassName
- a null-terminated string or a class atom. IflpClassName
is a string, it specifies the window class name. This class name must have been registered by a previous call to theRegisterClassEx(org.lwjgl.system.windows.WNDCLASSEX)
function. System classes, such as dialog box controls, cannot be unregistered. If this parameter is an atom, it must be a class atom created by a previous call to theRegisterClassEx(org.lwjgl.system.windows.WNDCLASSEX)
function. The atom must be in the low-order word oflpClassName
; the high-order word must be zero.hInstance
- a handle to the instance of the module that created the class
-
nCreateWindowEx
public static long nCreateWindowEx(int dwExStyle, long lpClassName, long lpWindowName, int dwStyle, int x, int y, int nWidth, int nHeight, long hWndParent, long hMenu, long hInstance, long lpParam, long __functionAddress) public static long nCreateWindowEx(int dwExStyle, long lpClassName, long lpWindowName, int dwStyle, int x, int y, int nWidth, int nHeight, long hWndParent, long hMenu, long hInstance, long lpParam)
-
CreateWindowEx
public static long CreateWindowEx(int dwExStyle, @Nullable java.nio.ByteBuffer lpClassName, @Nullable java.nio.ByteBuffer lpWindowName, int dwStyle, int x, int y, int nWidth, int nHeight, long hWndParent, long hMenu, long hInstance, long lpParam) public static long CreateWindowEx(int dwExStyle, @Nullable java.lang.CharSequence lpClassName, @Nullable java.lang.CharSequence lpWindowName, int dwStyle, int x, int y, int nWidth, int nHeight, long hWndParent, long hMenu, long hInstance, long lpParam)
Creates an overlapped, pop-up, or child window with an extended window style; otherwise, this function is identical to the CreateWindow function.- Parameters:
dwExStyle
- the extended window style of the window being createdlpClassName
- a null-terminated string or a class atom created by a previous call to theRegisterClassEx(WNDCLASSEX)
function.lpWindowName
- the window name. If the window style specifies a title bar, the window title pointed to bylpWindowName
is displayed in the title bar.dwStyle
- the style of the window being createdx
- the initial horizontal position of the windowy
- the initial vertical position of the windownWidth
- the width, in device units, of the windownHeight
- the height, in device units, of the windowhWndParent
- a handle to the parent or owner window of the window being created. To create a child window or an owned window, supply a valid window handle.hMenu
- a handle to a menu, or specifies a child-window identifier, depending on the window stylehInstance
- a handle to the instance of the module to be associated with the windowlpParam
- a value to be passed to the window through theCREATESTRUCT
structure (createParams
member) pointed to by thelParam
param of theWM_CREATE
message.
-
nDestroyWindow
public static int nDestroyWindow(long hWnd, long __functionAddress)
Unsafe version of:DestroyWindow(long)
-
DestroyWindow
public static boolean DestroyWindow(long hWnd)
Destroys the specified window. The function sendsWM_DESTROY
andWM_NCDESTROY
messages to the window to deactivate it and remove the keyboard focus from it. The function also destroys the window's menu, flushes the thread message queue, destroys timers, removes clipboard ownership, and breaks the clipboard viewer chain (if the window is at the top of the viewer chain).If the specified window is a parent or owner window, DestroyWindow automatically destroys the associated child or owned windows when it destroys the parent or owner window. The function first destroys child or owned windows, and then it destroys the parent or owner window.
- Parameters:
hWnd
- a handle to the window to be destroyed
-
DefWindowProc
public static long DefWindowProc(long hWnd, int Msg, long wParam, long lParam)
Calls the default window procedure to provide default processing for any window messages that an application does not process. This function ensures that every message is processed. DefWindowProc is called with the same parameters received by the window procedure.- Parameters:
hWnd
- a handle to the window that received the messageMsg
- the messagewParam
- additional message information. The content of this parameter depends on the value of theMsg
parameter.lParam
- additional message information. The content of this parameter depends on the value of theMsg
parameter.
-
nCallWindowProc
public static long nCallWindowProc(long lpPrevWndFunc, long hWnd, int Msg, long wParam, long lParam)
Unsafe version of:CallWindowProc(org.lwjgl.system.windows.WindowProcI, long, int, long, long)
-
CallWindowProc
public static long CallWindowProc(WindowProcI lpPrevWndFunc, long hWnd, int Msg, long wParam, long lParam)
Passes message information to the specified window procedure.- Parameters:
lpPrevWndFunc
- the previous window procedure.If this value is obtained by calling the
GetWindowLongPtr(long, int)
function with thenIndex
parameter set toGWL_WNDPROC
orDWL_DLGPROC
, it is actually either the address of a window or dialog box procedure, or a special internal value meaningful only toCallWindowProc
.hWnd
- a handle to the window procedure to receive the messageMsg
- the messagewParam
- additional message information. The content of this parameter depends on the value of theMsg
parameter.lParam
- additional message information. The content of this parameter depends on the value of theMsg
parameter.
-
ShowWindow
public static boolean ShowWindow(long hWnd, int nCmdShow)
Sets the specified window's show state.- Parameters:
hWnd
- a handle to the windownCmdShow
- controls how the window is to be shown. This parameter is ignored the first time an application callsShowWindow
, if the program that launched the application provides aSTARTUPINFO
structure. Otherwise, the first timeShowWindow
is called, the value should be the value obtained by theWinMain
function in itsnCmdShow
parameter. In subsequent calls, this parameter can be one of:SW_HIDE
SW_SHOWNORMAL
SW_NORMAL
SW_SHOWMINIMIZED
SW_SHOWMAXIMIZED
SW_MAXIMIZE
SW_SHOWNOACTIVATE
SW_SHOW
SW_MINIMIZE
SW_SHOWMINNOACTIVE
SW_SHOWNA
SW_RESTORE
SW_SHOWDEFAULT
SW_FORCEMINIMIZE
SW_MAX
-
UpdateWindow
public static boolean UpdateWindow(long hWnd)
Updates the client area of the specified window by sending aWM_PAINT
message to the window if the window's update region is not empty. The function sends aWM_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.- Parameters:
hWnd
- handle to the window to be updated
-
nSetWindowPos
public static int nSetWindowPos(long hWnd, long hWndInsertAfter, int X, int Y, int cx, int cy, int uFlags, long __functionAddress)
Unsafe version of:SetWindowPos(long, long, int, int, int, int, int)
-
SetWindowPos
public static boolean SetWindowPos(long hWnd, long 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. 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.- Parameters:
hWnd
- a handle to the windowhWndInsertAfter
- a handle to the window to precede the positioned window in the Z order. This parameter must be a window handle or one of:HWND_TOP
HWND_BOTTOM
HWND_TOPMOST
HWND_NOTOPMOST
X
- the new position of the left side of the window, in client coordinatesY
- the new position of the top of the window, in client coordinatescx
- the new width of the window, in pixelscy
- the new height of the window, in pixelsuFlags
- the window sizing and positioning flags. One or more of:
-
nSetWindowText
public static int nSetWindowText(long hWnd, long lpString, long __functionAddress) public static int nSetWindowText(long hWnd, long lpString)
Unsafe version of:SetWindowText(long, java.nio.ByteBuffer)
-
SetWindowText
public static boolean SetWindowText(long hWnd, java.nio.ByteBuffer lpString) public static boolean SetWindowText(long hWnd, java.lang.CharSequence lpString)
Changes the text of the specified window's title bar (if it has one). If the specified window is a control, the text of the control is changed. However,SetWindowText
cannot change the text of a control in another application.- Parameters:
hWnd
- a handle to the window or control whose text is to be changedlpString
- the new title or control text
-
nGetMessage
public static int nGetMessage(long lpMsg, long hWnd, int wMsgFilterMin, int wMsgFilterMax, long __functionAddress) public static int nGetMessage(long lpMsg, long hWnd, int wMsgFilterMin, int wMsgFilterMax)
Unsafe version of:GetMessage(org.lwjgl.system.windows.MSG, long, int, int)
-
GetMessage
public static boolean GetMessage(MSG lpMsg, long hWnd, int wMsgFilterMin, int wMsgFilterMax)
Retrieves a message from the calling thread's message queue. The function dispatches incoming sent messages until a posted message is available for retrieval. Unlike GetMessage, thePeekMessage(org.lwjgl.system.windows.MSG, long, int, int, int)
function does not wait for a message to be posted before returning.- Parameters:
lpMsg
- a pointer to anMSG
structure that receives message information from the thread's message queuehWnd
- a handle to the window whose messages are to be retrieved. The window must belong to the current thread.If
hWnd
isNULL
,GetMessage
retrieves messages for any window that belongs to the current thread, and any messages on the current thread's message queue whosehwnd
value isNULL
(see theMSG
structure). Therefore ifhWnd
isNULL
, both window messages and thread messages are processed.If
hWnd
is -1,GetMessage
retrieves only messages on the current thread's message queue whosehwnd
value isNULL
, that is, thread messages as posted byPostMessage(long, int, long, long)
(when thehWnd
parameter isNULL
) orPostThreadMessage
.wMsgFilterMin
- the integer value of the lowest message value to be retrievedwMsgFilterMax
- the integer value of the highest message value to be retrieved
-
nPeekMessage
public static int nPeekMessage(long lpMsg, long hWnd, int wMsgFilterMin, int wMsgFilterMax, int wRemoveMsg)
Unsafe version of:PeekMessage(org.lwjgl.system.windows.MSG, long, int, int, int)
-
PeekMessage
public static boolean PeekMessage(MSG lpMsg, long hWnd, int wMsgFilterMin, int wMsgFilterMax, int wRemoveMsg)
Dispatches incoming sent messages, checks the thread message queue for a posted message, and retrieves the message (if any exist).- Parameters:
lpMsg
- a pointer to anMSG
structure that receives message informationhWnd
- a handle to the window whose messages are to be retrieved. The window must belong to the current thread.If
hWnd
isNULL
,GetMessage
retrieves messages for any window that belongs to the current thread, and any messages on the current thread's message queue whosehwnd
value isNULL
(see theMSG
structure). Therefore ifhWnd
isNULL
, both window messages and thread messages are processed.If
hWnd
is -1,GetMessage
retrieves only messages on the current thread's message queue whosehwnd
value isNULL
, that is, thread messages as posted byPostMessage(long, int, long, long)
(when thehWnd
parameter isNULL
) orPostThreadMessage
.wMsgFilterMin
- the integer value of the lowest message value to be retrievedwMsgFilterMax
- the integer value of the highest message value to be retrievedwRemoveMsg
- specifies how messages are to be handled. One of:PM_NOREMOVE
PM_REMOVE
PM_NOYIELD
-
nTranslateMessage
public static int nTranslateMessage(long lpMsg)
Unsafe version of:TranslateMessage(org.lwjgl.system.windows.MSG)
-
TranslateMessage
public static boolean TranslateMessage(MSG lpMsg)
Translates virtual-key messages into character messages. The character messages are posted to the calling thread's message queue, to be read the next time the thread calls theGetMessage(org.lwjgl.system.windows.MSG, long, int, int)
orPeekMessage(org.lwjgl.system.windows.MSG, long, int, int, int)
function.- Parameters:
lpMsg
- anMSG
structure that contains message information retrieved from the calling thread's message queue by using theGetMessage(org.lwjgl.system.windows.MSG, long, int, int)
orPeekMessage(org.lwjgl.system.windows.MSG, long, int, int, int)
function.
-
nWaitMessage
public static int nWaitMessage(long __functionAddress)
Unsafe version of:WaitMessage()
-
WaitMessage
public static boolean WaitMessage()
Yields control to other threads when a thread has no other messages in its message queue. The WaitMessage function suspends the thread and does not return until a new message is placed in the thread's message queue.
-
nDispatchMessage
public static long nDispatchMessage(long lpmsg)
Unsafe version of:DispatchMessage(org.lwjgl.system.windows.MSG)
-
DispatchMessage
public static long DispatchMessage(MSG lpmsg)
Dispatches a message to a window procedure. It is typically used to dispatch a message retrieved by theGetMessage(org.lwjgl.system.windows.MSG, long, int, int)
function.- Parameters:
lpmsg
- a pointer to a structure that contains the message.
-
nPostMessage
public static int nPostMessage(long hWnd, int Msg, long wParam, long lParam, long __functionAddress)
Unsafe version of:PostMessage(long, int, long, long)
-
PostMessage
public static boolean PostMessage(long hWnd, int Msg, long wParam, long lParam)
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.- Parameters:
hWnd
- a handle to the window whose window procedure is to receive the message. The following values have special meanings:HWND_BROADCAST
- The message is posted to all top-level windows in the system, including disabled or invisible unowned windows, overlapped windows, and pop-up windows. The message is not posted to child windows.NULL
- The function behaves like a call to PostThreadMessage with the dwThreadId parameter set to the identifier of the current thread.
Msg
- the message to be postedwParam
- additional message-specific informationlParam
- additional message-specific information
-
nSendMessage
public static int nSendMessage(long hWnd, int Msg, long wParam, long lParam, long __functionAddress)
Unsafe version of:SendMessage(long, int, long, long)
-
SendMessage
public static boolean SendMessage(long hWnd, int Msg, long wParam, long lParam)
Sends the specified message to a window or windows. TheSendMessage
function calls the window procedure for the specified window and does not return until the window procedure has processed the message.- Parameters:
hWnd
- a handle to the window whose window procedure will receive the message. If this parameter isHWND_BROADCAST
, the message is sent to all top-level windows in the system, including disabled or invisible unowned windows, overlapped windows, and pop-up windows; but the message is not sent to child windows.Message sending is subject to UIPI. The thread of a process can send messages only to message queues of threads in processes of lesser or equal integrity level.
Msg
- the message to be sentwParam
- additional message-specific informationlParam
- additional message-specific information
-
nAdjustWindowRectEx
public static int nAdjustWindowRectEx(long lpRect, int dwStyle, int bMenu, int dwExStyle, long __functionAddress) public static int nAdjustWindowRectEx(long lpRect, int dwStyle, int bMenu, int dwExStyle)
Unsafe version of:AdjustWindowRectEx(org.lwjgl.system.windows.RECT, int, boolean, int)
-
AdjustWindowRectEx
public static boolean AdjustWindowRectEx(RECT lpRect, int dwStyle, boolean bMenu, int dwExStyle)
Calculates the required size of the window rectangle, based on the desired size of the client rectangle. The window rectangle can then be passed to theCreateWindowEx(int, java.nio.ByteBuffer, java.nio.ByteBuffer, int, int, int, int, int, long, long, long, long)
function to create a window whose client area is the desired size.- Parameters:
lpRect
- a pointer to aRECT
structure that contains the coordinates of the top-left and bottom-right corners of the desired client area. When the function returns, the structure contains the coordinates of the top-left and bottom-right corners of the window to accommodate the desired client area.dwStyle
- the window style of the window whose required size is to be calculated. Note that you cannot specify theWS_OVERLAPPED
style.bMenu
- indicates whether the window has a menudwExStyle
- the extended window style of the window whose required size is to be calculated
-
nGetWindowRect
public static int nGetWindowRect(long hWnd, long lpRect, long __functionAddress) public static int nGetWindowRect(long hWnd, long lpRect)
Unsafe version of:GetWindowRect(long, org.lwjgl.system.windows.RECT)
-
GetWindowRect
public static boolean GetWindowRect(long hWnd, RECT lpRect)
Retrieves 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.- Parameters:
hWnd
- a handle to the windowlpRect
- a pointer to aRECT
structure that receives the screen coordinates of the upper-left and lower-right corners of the window
-
nMoveWindow
public static int nMoveWindow(long hWnd, int X, int Y, int nWidth, int nHeight, int bRepaint, long __functionAddress)
Unsafe version of:MoveWindow(long, int, int, int, int, boolean)
-
MoveWindow
public static boolean MoveWindow(long hWnd, int X, int Y, int nWidth, int nHeight, boolean bRepaint)
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.- Parameters:
hWnd
- a handle to the windowX
- the new position of the left side of the windowY
- the new position of the top of the windownWidth
- the new width of the windownHeight
- the new height of the windowbRepaint
- 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.
-
nGetWindowPlacement
public static int nGetWindowPlacement(long hWnd, long lpwndpl, long __functionAddress) public static int nGetWindowPlacement(long hWnd, long lpwndpl)
Unsafe version of:GetWindowPlacement(long, org.lwjgl.system.windows.WINDOWPLACEMENT)
-
GetWindowPlacement
public static boolean GetWindowPlacement(long hWnd, WINDOWPLACEMENT lpwndpl)
Retrieves the show state and the restored, minimized, and maximized positions of the specified window.- Parameters:
hWnd
- a handle to the windowlpwndpl
- a pointer to theWINDOWPLACEMENT
structure that receives the show state and position information.Before calling
GetWindowPlacement
, set the length member toWINDOWPLACEMENT.SIZEOF
.GetWindowPlacement
fails iflpwndpl->length
is not set correctly.
-
nSetWindowPlacement
public static int nSetWindowPlacement(long hWnd, long lpwndpl, long __functionAddress) public static int nSetWindowPlacement(long hWnd, long lpwndpl)
Unsafe version of:SetWindowPlacement(long, org.lwjgl.system.windows.WINDOWPLACEMENT)
-
SetWindowPlacement
public static boolean SetWindowPlacement(long hWnd, WINDOWPLACEMENT lpwndpl)
Sets the show state and the restored, minimized, and maximized positions of the specified window.- Parameters:
hWnd
- a handle to the windowlpwndpl
- a pointer to theWINDOWPLACEMENT
structure that specifies the new show state and window positions.Before calling
SetWindowPlacement
, set thelength
member of theWINDOWPLACEMENT
structure toWINDOWPLACEMENT.SIZEOF
.SetWindowPlacement
fails if the length member is not set correctly.
-
IsWindowVisible
public static boolean IsWindowVisible(long hWnd)
Determines the visibility state of the specified window.- Parameters:
hWnd
- a handle to the window to be tested
-
IsIconic
public static boolean IsIconic(long hWnd)
Determines whether the specified window is minimized (iconic).- Parameters:
hWnd
- a handle to the window to be tested
-
IsZoomed
public static boolean IsZoomed(long hWnd)
Determines whether a window is maximized.- Parameters:
hWnd
- a handle to the window to be tested
-
BringWindowToTop
public static boolean BringWindowToTop(long hWnd)
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.- Parameters:
hWnd
- a handle to the window to bring to the top of the Z order
-
nSetWindowLongPtr
public static long nSetWindowLongPtr(long hWnd, int nIndex, long dwNewLong, long __functionAddress)
Unsafe version of:SetWindowLongPtr(long, int, long)
-
SetWindowLongPtr
public static long SetWindowLongPtr(long hWnd, int nIndex, long dwNewLong)
Changes an attribute of the specified window. The function also sets a value at the specified offset in the extra window memory.- Parameters:
hWnd
- a handle to the window and, indirectly, the class to which the window belongsnIndex
- the zero-based offset to the value to be set. Valid values are in the range zero through the number of bytes of extra window memory, minus the size of an integer. To set any other value, specify one of:GWL_WNDPROC
GWL_HINSTANCE
GWL_HWNDPARENT
GWL_STYLE
GWL_EXSTYLE
GWL_USERDATA
GWL_ID
dwNewLong
- the replacement value- Returns:
- the previous value at the given
index
-
nGetWindowLongPtr
public static long nGetWindowLongPtr(long hWnd, int nIndex, long __functionAddress)
Unsafe version of:GetWindowLongPtr(long, int)
-
GetWindowLongPtr
public static long GetWindowLongPtr(long hWnd, int nIndex)
Retrieves information about the specified window. The function also retrieves the value at a specified offset into the extra window memory.- Parameters:
hWnd
- a handle to the window and, indirectly, the class to which the window belongsnIndex
- the zero-based offset to the value to be set. Valid values are in the range zero through the number of bytes of extra window memory, minus the size of an integer. To set any other value, specify one of:GWL_WNDPROC
GWL_HINSTANCE
GWL_HWNDPARENT
GWL_STYLE
GWL_EXSTYLE
GWL_USERDATA
GWL_ID
-
nSetClassLongPtr
public static long nSetClassLongPtr(long hWnd, int nIndex, long dwNewLong, long __functionAddress)
Unsafe version of:SetClassLongPtr(long, int, long)
-
SetClassLongPtr
public static long SetClassLongPtr(long hWnd, int nIndex, long dwNewLong)
Replaces the specified value at the specified offset in the extra class memory or theWNDCLASSEX
structure for the class to which the specified window belongs.- Parameters:
hWnd
- a handle to the window and, indirectly, the class to which the window belongsnIndex
- the value to be replaced. To set a value in the extra class memory, specify the positive, zero-based byte offset of the value to be set. Valid values are in the range zero through the number of bytes of extra class memory, minus eight; for example, if you specified 24 or more bytes of extra class memory, a value of 16 would be an index to the third integer. To set a value other than theWNDCLASSEX
structure, specify one of:GCL_MENUNAME
GCL_HBRBACKGROUND
GCL_HCURSOR
GCL_HICON
GCL_HMODULE
GCL_CBWNDEXTRA
GCL_CBCLSEXTRA
GCL_WNDPROC
GCL_STYLE
GCW_ATOM
GCL_HICONSM
dwNewLong
- the replacement value- Returns:
- if the function succeeds, the return value is the previous value of the specified offset. If this was not previously set, the return value is zero.
If the function fails, the return value is zero. To get extended error information, call
WinBase.getLastError()
.
-
nGetClassLongPtr
public static long nGetClassLongPtr(long hWnd, int nIndex, long __functionAddress)
Unsafe version of:GetClassLongPtr(long, int)
-
GetClassLongPtr
public static long GetClassLongPtr(long hWnd, int nIndex)
Retrieves the specified value from theWNDCLASSEX
structure associated with the specified window.- Parameters:
hWnd
- a handle to the window and, indirectly, the class to which the window belongsnIndex
- the value to be retrieved. To retrieve a value from the extra class memory, specify the positive, zero-based byte offset of the value to be retrieved. Valid values are in the range zero through the number of bytes of extra class memory, minus eight; for example, if you specified 24 or more bytes of extra class memory, a value of 16 would be an index to the third integer. To retrieve any other value from theWNDCLASSEX
structure, specify one of:GCL_MENUNAME
GCL_HBRBACKGROUND
GCL_HCURSOR
GCL_HICON
GCL_HMODULE
GCL_CBWNDEXTRA
GCL_CBCLSEXTRA
GCL_WNDPROC
GCL_STYLE
GCW_ATOM
GCL_HICONSM
-
nSetLayeredWindowAttributes
public static int nSetLayeredWindowAttributes(long hwnd, int crKey, byte bAlpha, int dwFlags, long __functionAddress)
Unsafe version of:SetLayeredWindowAttributes(long, int, byte, int)
-
SetLayeredWindowAttributes
public static boolean SetLayeredWindowAttributes(long hwnd, int crKey, byte bAlpha, int dwFlags)
- Parameters:
hwnd
- a handle to the layered window. A layered window is created by specifyingWS_EX_LAYERED
when creating the window with theCreateWindowEx(int, java.nio.ByteBuffer, java.nio.ByteBuffer, int, int, int, int, int, long, long, long, long)
function or by settingWS_EX_LAYERED
viaSetWindowLongPtr(long, int, long)
after the window has been created.crKey
- the transparency color key (0x00bbggrr) to be used when composing the layered window. All pixels painted by the window in this color will be transparent.bAlpha
- the alpha value used to describe the opacity of the layered window. WhenbAlpha
is 0, the window is completely transparent. WhenbAlpha
is 255, the window is opaque.dwFlags
- an action to be taken. One or more of:LWA_COLORKEY
LWA_ALPHA
-
nLoadIcon
public static long nLoadIcon(long instance, long iconName, long __functionAddress) public static long nLoadIcon(long instance, long iconName)
Unsafe version of:LoadIcon(long, java.nio.ByteBuffer)
-
LoadIcon
public static long LoadIcon(long instance, java.nio.ByteBuffer iconName) public static long LoadIcon(long instance, java.lang.CharSequence iconName)
Loads the specified icon resource from the executable (.exe) file associated with an application instance.- Parameters:
instance
- a handle to an instance of the module whose executable file contains the icon to be loaded. This parameter must beNULL
when a standard icon is being loaded.iconName
- the name of the icon resource to be loaded or one of:IDI_APPLICATION
IDI_HAND
IDI_QUESTION
IDI_EXCLAMATION
IDI_ASTERISK
IDI_WINLOGO
IDI_SHIELD
IDI_WARNING
IDI_ERROR
IDI_INFORMATION
-
nLoadCursor
public static long nLoadCursor(long instance, long cursorName, long __functionAddress) public static long nLoadCursor(long instance, long cursorName)
Unsafe version of:LoadCursor(long, java.nio.ByteBuffer)
-
LoadCursor
public static long LoadCursor(long instance, java.nio.ByteBuffer cursorName) public static long LoadCursor(long instance, java.lang.CharSequence cursorName)
Loads the specified cursor resource from the executable (.EXE) file associated with an application instance.- Parameters:
instance
- a handle to an instance of the module whose executable file contains the cursor to be loaded.cursorName
- the name of the cursor resource to be loaded or one of:IDC_ARROW
IDC_IBEAM
IDC_WAIT
IDC_CROSS
IDC_UPARROW
IDC_SIZE
IDC_ICON
IDC_SIZENWSE
IDC_SIZENESW
IDC_SIZEWE
IDC_SIZENS
IDC_SIZEALL
IDC_NO
IDC_HAND
IDC_APPSTARTING
IDC_HELP
-
GetDC
public static long GetDC(long hWnd)
Retrieves a handle to a device context (DC) for the client area of a specified window or for the entire screen. You can use the returned handle in subsequent GDI functions to draw in the DC. The device context is an opaque data structure, whose values are used internally by GDI.- Parameters:
hWnd
- a handle to the window whose DC is to be retrieved. If this value isNULL
, GetDC retrieves the DC for the entire screen.
-
ReleaseDC
public static boolean ReleaseDC(long hWnd, long hDC)
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.- Parameters:
hWnd
- a handle to the window whose DC is to be releasedhDC
- a handle to the DC to be released
-
GetSystemMetrics
public static int GetSystemMetrics(int index)
Retrieves the specified system metric or system configuration setting.- Parameters:
index
- the system metric or configuration setting to be retrieved. One of:
-
nRegisterTouchWindow
public static int nRegisterTouchWindow(long hWnd, int ulFlags, long __functionAddress)
Unsafe version of:RegisterTouchWindow(long, int)
-
RegisterTouchWindow
public static boolean RegisterTouchWindow(long hWnd, int ulFlags)
Registers a window as being touch-capable.RegisterTouchWindow
must be called on every window that will be used for touch input. This means that if you have an application that has multiple windows within it,RegisterTouchWindow
must be called on every window in that application that uses touch features. Also, an application can callRegisterTouchWindow
any number of times for the same window if it desires to change the modifier flags. A window can be marked as no longer requiring touch input using theUnregisterTouchWindow(long)
function.- Parameters:
hWnd
- the handle of the window being registered. The function fails withERROR_ACCESS_DENIED
if the calling thread does not own the specified window.ulFlags
- a set of bit flags that specify optional modifications. This field may contain 0 or one or more of:TWF_FINETOUCH
TWF_WANTPALM
- Since:
- Windows 7 (desktop apps only)
-
nUnregisterTouchWindow
public static int nUnregisterTouchWindow(long hWnd, long __functionAddress)
Unsafe version of:UnregisterTouchWindow(long)
-
UnregisterTouchWindow
public static boolean UnregisterTouchWindow(long hWnd)
Registers a window as no longer being touch-capable.- Parameters:
hWnd
- the handle of the window. The function fails withERROR_ACCESS_DENIED
if the calling thread does not own the specified window.- Since:
- Windows 7 (desktop apps only)
-
nIsTouchWindow
public static int nIsTouchWindow(long hWnd, long pulFlags)
Unsafe version of:IsTouchWindow(long, java.nio.IntBuffer)
-
IsTouchWindow
public static boolean IsTouchWindow(long hWnd, @Nullable java.nio.IntBuffer pulFlags)
Checks whether a specified window is touch-capable and, optionally, retrieves the modifier flags set for the window's touch capability.- Parameters:
hWnd
- the handle of the window. The function fails withERROR_ACCESS_DENIED
if the calling thread is not on the same desktop as the specified window.pulFlags
- an optional address of theULONG
variable to receive the modifier flags for the specified window's touch capability.- Since:
- Windows 7 (desktop apps only)
-
nGetTouchInputInfo
public static int nGetTouchInputInfo(long hTouchInput, int cInputs, long pInputs, int cbSize, long __functionAddress) public static int nGetTouchInputInfo(long hTouchInput, int cInputs, long pInputs, int cbSize)
Unsafe version of:GetTouchInputInfo(long, org.lwjgl.system.windows.TOUCHINPUT.Buffer, int)
- Parameters:
cInputs
- The number of structures in thepInputs
array. This should ideally be at least equal to the number of touch points associated with the message as indicated in the messageWPARAM
. IfcInputs
is less than the number of touch points, the function will still succeed and populate thepInputs
buffer with information aboutcInputs
touch points.
-
GetTouchInputInfo
public static boolean GetTouchInputInfo(long hTouchInput, TOUCHINPUT.Buffer pInputs, int cbSize)
Retrieves detailed information about touch inputs associated with a particular touch input handle.- Parameters:
hTouchInput
- the touch input handle received in theLPARAM
of a touch message. The function fails withERROR_INVALID_HANDLE
if this handle is not valid. Note that the handle is not valid after it has been used in a successful call toCloseTouchInputHandle(long)
or after it has been passed toDefWindowProc(long, int, long, long)
,PostMessage(long, int, long, long)
,SendMessage(long, int, long, long)
or one of their variants.pInputs
- a pointer to an array ofTOUCHINPUT
structures to receive information about the touch points associated with the specified touch input handlecbSize
- the size, in bytes, of a singleTOUCHINPUT
structure. IfcbSize
is not the size of a singleTOUCHINPUT
structure, the function fails withERROR_INVALID_PARAMETER
.- Since:
- Windows 7 (desktop apps only)
-
nCloseTouchInputHandle
public static int nCloseTouchInputHandle(long hTouchInput, long __functionAddress)
Unsafe version of:CloseTouchInputHandle(long)
-
CloseTouchInputHandle
public static boolean CloseTouchInputHandle(long hTouchInput)
Closes a touch input handle, frees process memory associated with it, and invalidates the handle.- Parameters:
hTouchInput
- the touch input handle received in theLPARAM
of a touch message. The function fails withERROR_INVALID_HANDLE
if this handle is not valid. Note that the handle is not valid after it has been used in a successful call toCloseTouchInputHandle(long)
or after it has been passed toDefWindowProc(long, int, long, long)
,PostMessage(long, int, long, long)
,SendMessage(long, int, long, long)
or one of their variants.- Since:
- Windows 7 (desktop apps only)
-
MonitorFromWindow
public static long MonitorFromWindow(long hWnd, int dwFlags)
Retrieves a handle to the display monitor that has the largest area of intersection with the bounding rectangle of a specified window.- Parameters:
hWnd
- a handle to the window of interestdwFlags
- determines the function's return value if the window does not intersect any display monitor. One of:MONITOR_DEFAULTTONULL
MONITOR_DEFAULTTOPRIMARY
MONITOR_DEFAULTTONEAREST
-
nGetMonitorInfo
public static int nGetMonitorInfo(long hMonitor, long lpmi)
Unsafe version of:GetMonitorInfo(long, org.lwjgl.system.windows.MONITORINFOEX)
-
GetMonitorInfo
public static boolean GetMonitorInfo(long hMonitor, MONITORINFOEX lpmi)
Retrieves information about a display monitor.- Parameters:
hMonitor
- a handle to the display monitor of interestlpmi
- a pointer to aMONITORINFOEX
structure that receives information about the specified display monitor.You must set the
cbSize
member of the structure toMONITORINFOEX.SIZEOF
before calling theGetMonitorInfo
function. Doing so lets the function determine the type of structure you are passing to it.
-
nEnumDisplayDevices
public static int nEnumDisplayDevices(long lpDevice, int iDevNum, long lpDisplayDevice, int dwFlags)
-
EnumDisplayDevices
public static boolean EnumDisplayDevices(@Nullable java.nio.ByteBuffer lpDevice, int iDevNum, DISPLAY_DEVICE lpDisplayDevice, int dwFlags) public static boolean EnumDisplayDevices(@Nullable java.lang.CharSequence lpDevice, int iDevNum, DISPLAY_DEVICE lpDisplayDevice, int dwFlags)
Obtains information about the display devices in the current session.- Parameters:
lpDevice
- the device name. IfNULL
, function returns information for the display adapter(s) on the machine, based ondevNum
.iDevNum
- an index value that specifies the display device of interest.The operating system identifies each display device in the current session with an index value. The index values are consecutive integers, starting at 0. If the current session has three display devices, for example, they are specified by the index values 0, 1, and 2.
lpDisplayDevice
- a pointer to aDISPLAY_DEVICE
structure that receives information about the display device specified byiDevNum
.Before calling
EnumDisplayDevices
, you must initialize thecb
member ofDISPLAY_DEVICE
to the size, in bytes, ofDISPLAY_DEVICE
.dwFlags
- set this flag toEDD_GET_DEVICE_INTERFACE_NAME
to retrieve the device interface name forGUID_DEVINTERFACE_MONITOR
, which is registered by the operating system on a per monitor basis. The value is placed in theDeviceID
member of theDISPLAY_DEVICE
structure returned inlpDisplayDevice
. The resulting device interface name can be used with SetupAPI functions and serves as a link between GDI monitor devices and SetupAPI monitor devices.
-
nEnumDisplaySettingsEx
public static int nEnumDisplaySettingsEx(long lpszDeviceName, int iModeNum, long lpDevMode, int dwFlags)
-
EnumDisplaySettingsEx
public static boolean EnumDisplaySettingsEx(@Nullable java.nio.ByteBuffer lpszDeviceName, int iModeNum, DEVMODE lpDevMode, int dwFlags) public static boolean EnumDisplaySettingsEx(@Nullable java.lang.CharSequence lpszDeviceName, int iModeNum, DEVMODE lpDevMode, int dwFlags)
Retrieves information about one of the graphics modes for a display device. To retrieve information for all the graphics modes for a display device, make a series of calls to this function.- Parameters:
lpszDeviceName
- a pointer to a null-terminated string that specifies the display device about which graphics mode the function will obtain information.This parameter is either
NULL
or aDISPLAY_DEVICE.DeviceName()
returned fromEnumDisplayDevices(java.nio.ByteBuffer, int, org.lwjgl.system.windows.DISPLAY_DEVICE, int)
. ANULL
value specifies the current display device on the computer that the calling thread is running on.iModeNum
- indicates the type of information to be retrieved.Graphics mode indexes start at zero. To obtain information for all of a display device's graphics modes, make a series of calls to
EnumDisplaySettingsEx
, as follows: SetiModeNum
to zero for the first call, and incrementiModeNum
by one for each subsequent call. Continue calling the function until the return value is zero.When you call
EnumDisplaySettingsEx
withiModeNum
set to zero, the operating system initializes and caches information about the display device. When you callEnumDisplaySettingsEx
withiModeNum
set to a nonzero value, the function returns the information that was cached the last time the function was called withiModeNum
set to zero.This value can be a graphics mode index or one of:
ENUM_CURRENT_SETTINGS
ENUM_REGISTRY_SETTINGS
lpDevMode
- a pointer to aDEVMODE
structure into which the function stores information about the specified graphics mode. Before callingEnumDisplaySettingsEx
, set thedmSize
member toDEVMODE.SIZEOF
, and set thedmDriverExtra
member to indicate the size, in bytes, of the additional space available to receive private driver data.The
EnumDisplaySettingsEx
function will populate thedmFields
member of thelpDevMode
and one or more other members of theDEVMODE
structure. To determine which members were set by the call toEnumDisplaySettingsEx
, inspect thedmFields
bitmask.dwFlags
- this parameter can be one of:EDS_RAWMODE
EDS_ROTATEDMODE
-
nChangeDisplaySettingsEx
public static int nChangeDisplaySettingsEx(long lpszDeviceName, long lpDevMode, long hwnd, int dwflags, long lParam)
-
ChangeDisplaySettingsEx
public static int ChangeDisplaySettingsEx(@Nullable java.nio.ByteBuffer lpszDeviceName, @Nullable DEVMODE lpDevMode, long hwnd, int dwflags, long lParam) public static int ChangeDisplaySettingsEx(@Nullable java.lang.CharSequence lpszDeviceName, @Nullable DEVMODE lpDevMode, long hwnd, int dwflags, long lParam)
Changes the settings of the specified display device to the specified graphics mode.- Parameters:
lpszDeviceName
- a pointer to a null-terminated string that specifies the display device whose graphics mode will change. Only display device names as returned byEnumDisplayDevices(java.nio.ByteBuffer, int, org.lwjgl.system.windows.DISPLAY_DEVICE, int)
are valid.The
lpszDeviceName
parameter can beNULL
. ANULL
value specifies the default display device. The default device can be determined by callingEnumDisplayDevices
and checking for theGDI32.DISPLAY_DEVICE_PRIMARY_DEVICE
flag.lpDevMode
- a pointer to aDEVMODE
structure that describes the new graphics mode. IflpDevMode
isNULL
, all the values currently in the registry will be used for the display setting. PassingNULL
for thelpDevMode
parameter and 0 for thedwFlags
parameter is the easiest way to return to the default mode after a dynamic mode change.The
dmSize
member must be initialized to the size, in bytes, of theDEVMODE
structure. ThedmDriverExtra
member must be initialized to indicate the number of bytes of private driver data following theDEVMODE
structure.hwnd
- reserved; must beNULL
dwflags
- indicates how the graphics mode should be changed. One of:CDS_UPDATEREGISTRY
CDS_TEST
CDS_FULLSCREEN
CDS_GLOBAL
CDS_SET_PRIMARY
CDS_VIDEOPARAMETERS
CDS_ENABLE_UNSAFE_MODES
CDS_DISABLE_UNSAFE_MODES
CDS_RESET
CDS_RESET_EX
CDS_NORESET
lParam
- ifflags
isCDS_VIDEOPARAMETERS
,lParam
is a pointer to aVIDEOPARAMETERS
structure. OtherwiselParam
must beNULL
.- Returns:
- one of the following values:
DISP_CHANGE_SUCCESSFUL
DISP_CHANGE_RESTART
DISP_CHANGE_FAILED
DISP_CHANGE_BADMODE
DISP_CHANGE_NOTUPDATED
DISP_CHANGE_BADFLAGS
DISP_CHANGE_BADPARAM
DISP_CHANGE_BADDUALVIEW
-
nGetCursorPos
public static int nGetCursorPos(long point)
Unsafe version of:GetCursorPos(org.lwjgl.system.windows.POINT)
-
GetCursorPos
public static boolean GetCursorPos(POINT point)
Retrieves the position of the mouse cursor, in screen coordinates.- Parameters:
point
- a pointer to aPOINT
structure that receives the screen coordinates of the cursor
-
SetCursorPos
public static boolean SetCursorPos(int X, int Y)
Moves the cursor to the specified screen coordinates. If the new coordinates are not within the screen rectangle set by the most recentClipCursor(org.lwjgl.system.windows.RECT)
function call, the system automatically adjusts the coordinates so that the cursor stays within the rectangle.- Parameters:
X
- the new x-coordinate of the cursor, in screen coordinates.Y
- the new y-coordinate of the cursor, in screen coordinates.
-
nClipCursor
public static int nClipCursor(long rect)
Unsafe version of:ClipCursor(org.lwjgl.system.windows.RECT)
-
ClipCursor
public static boolean ClipCursor(@Nullable RECT rect)
Confines the cursor to a rectangular area on the screen. If a subsequent cursor position (set by theSetCursorPos(int, int)
function or the mouse) lies outside the rectangle, the system automatically adjusts the position to keep the cursor inside the rectangular area.- Parameters:
rect
- a pointer to the structure that contains the screen coordinates of the upper-left and lower-right corners of the confining rectangle. If this parameter isNULL
, the cursor is free to move anywhere on the screen.
-
ShowCursor
public static int ShowCursor(boolean show)
Displays or hides the cursor.This function sets an internal display counter that determines whether the cursor should be displayed. The cursor is displayed only if the display count is greater than or equal to 0. If a mouse is installed, the initial display count is 0. If no mouse is installed, the display count is –1.
- Parameters:
show
- Ifshow
isWinBase.TRUE
, the display count is incremented by one. Ifshow
isWinBase.FALSE
, the display count is decremented by one.- Returns:
- the new display counter
-
SetCursor
public static long SetCursor(long hCursor)
Sets the cursor shape.The cursor is set only if the new cursor is different from the previous cursor; otherwise, the function returns immediately.
The cursor is a shared resource. A window should set the cursor shape only when the cursor is in its client area or when the window is capturing mouse input. In systems without a mouse, the window should restore the previous cursor before the cursor leaves the client area or before it relinquishes control to another window.
If your application must set the cursor while it is in a window, make sure the class cursor for the specified window's class is set to
NULL
. If the class cursor is notNULL
, the system restores the class cursor each time the mouse is moved.The cursor is not shown on the screen if the internal cursor display count is less than zero. This occurs if the application uses the
ShowCursor(boolean)
function to hide the cursor more times than to show the cursor.- Parameters:
hCursor
- a handle to the cursor. The cursor must have been created by theCreateCursor
function or loaded by theLoadCursor(long, java.nio.ByteBuffer)
orLoadImage
function. If this parameter isNULL
, the cursor is removed from the screen.- Returns:
- the handle to the previous cursor, if there was one
-
nClientToScreen
public static int nClientToScreen(long hWnd, long lpPoint)
Unsafe version of:ClientToScreen(long, org.lwjgl.system.windows.POINT)
-
ClientToScreen
public static boolean ClientToScreen(long hWnd, POINT lpPoint)
Converts the client-area coordinates of a specified point to screen coordinates.The
ClientToScreen
function replaces the client-area coordinates in thePOINT
structure with the screen coordinates. The screen coordinates are relative to the upper-left corner of the screen. Note, a screen-coordinate point that is above the window's client area has a negative y-coordinate. Similarly, a screen coordinate to the left of a client area has a negative x-coordinate.All coordinates are device coordinates.
- Parameters:
hWnd
- a handle to the window whose client area is used for the conversionlpPoint
- a pointer to aPOINT
structure that contains the client coordinates to be converted. The new screen coordinates are copied into this structure if the function succeeds.
-
GetAsyncKeyState
public static short GetAsyncKeyState(int vKey)
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 toGetAsyncKeyState
.The
GetAsyncKeyState
function works with mouse buttons. However, it checks on the state of the physical mouse buttons, not on the logical mouse buttons that the physical buttons are mapped to. For example, the callGetAsyncKeyState(VK_LBUTTON)
always returns the state of the left physical mouse button, regardless of whether it is mapped to the left or right logical mouse button. You can determine the system's current mapping of physical mouse buttons to logical mouse buttons by callingGetSystemMetrics(SM_SWAPBUTTON)
which returnsWinBase.TRUE
if the mouse buttons have been swapped.Although the least significant bit of the return value indicates whether the key has been pressed since the last query, due to the pre-emptive multitasking nature of Windows, another application can call
GetAsyncKeyState
and receive the "recently pressed" bit instead of your application. The behavior of the least significant bit of the return value is retained strictly for compatibility with 16-bit Windows applications (which are non-preemptive) and should not be relied upon.You can use the virtual-key code constants
VK_SHIFT
,VK_CONTROL
, andVK_MENU
as values for thevKey
parameter. This gives the state of the SHIFT, CTRL, or ALT keys without distinguishing between left and right.- Parameters:
vKey
- the virtual-key code. You can use left- and right-distinguishing constants to specify certain keys.- Returns:
- if the function succeeds, the return value specifies whether the key was pressed since the last call to
GetAsyncKeyState
, and whether the key is currently up or down. If the most significant bit is set, the key is down, and if the least significant bit is set, the key was pressed after the previous call toGetAsyncKeyState
. However, you should not rely on this last behavior; for more information, see the Remarks.The return value is zero for the following cases:
- The current desktop is not the active desktop
- The foreground thread belongs to another process and the desktop does not allow the hook or the journal record.
-
GetMessageExtraInfo
public static long GetMessageExtraInfo()
Retrieves the extra message information for the current thread.Extra message information is an application- or driver-defined value associated with the current thread's message queue.
- Returns:
- the extra information. The meaning of the extra information is device specific.
-
nSendInput
public static int nSendInput(int cInputs, long pInputs, int cbSize)
Unsafe version of:SendInput(org.lwjgl.system.windows.INPUT.Buffer, int)
- Parameters:
cInputs
- the number of structures in thepInputs
array
-
SendInput
public static int SendInput(INPUT.Buffer pInputs, int cbSize)
Synthesizes keystrokes, mouse motions, and button clicks.This function is subject to UIPI. Applications are permitted to inject input only into applications that are at an equal or lesser integrity level.
The
SendInput
function inserts the events in theINPUT
structures serially into the keyboard or mouse input stream. These events are not interspersed with other keyboard or mouse input events inserted either by the user (with the keyboard or mouse) or by calls tokeybd_event
,mouse_event
, or other calls toSendInput
.This function does not reset the keyboard's current state. Any keys that are already pressed when the function is called might interfere with the events that this function generates. To avoid this problem, check the keyboard's state with the
GetAsyncKeyState(int)
function and correct as necessary.Because the touch keyboard uses the surrogate macros defined in
winnls.h
to send input to the system, a listener on the keyboard event hook must decode input originating from the touch keyboard.An accessibility application can use
SendInput
to inject keystrokes corresponding to application launch shortcut keys that are handled by the shell. This functionality is not guaranteed to work for other types of applications.- Parameters:
pInputs
- an array ofINPUT
structures. Each structure represents an event to be inserted into the keyboard or mouse input stream.cbSize
- the size, in bytes, of anINPUT
structure. IfcbSiz
e is not the size of anINPUT
structure, the function fails.- Returns:
- the number of events that it successfully inserted into the keyboard or mouse input stream. If the function returns zero, the input was already blocked
by another thread. To get extended error information, call
WinBase.GetLastError()
.This function fails when it is blocked by UIPI. Note that neither GetLastError nor the return value will indicate the failure was caused by UIPI blocking.
-
GetDpiForSystem
public static int GetDpiForSystem()
Returns the system DPI.The return value will be dependent based upon the calling context. If the current thread has a
DPI_AWARENESS
value ofDPI_AWARENESS_UNAWARE
, the return value will be 96. That is because the current context always assumes a DPI of 96. For any otherDPI_AWARENESS
value, the return value will be the actual system DPI.You should not cache the system DPI, but should use
GetDpiForSystem
whenever you need the system DPI value.- Returns:
- the system DPI value
- Since:
- Windows 10
-
GetDpiForWindow
public static int GetDpiForWindow(long hwnd)
Returns the dots per inch (dpi) value for the associated window.- Parameters:
hwnd
- the window you want to get information about- Returns:
- the DPI for the window which depends on the
DPI_AWARENESS
of the window. An invalidhwnd
value will result in a return value of 0. - Since:
- Windows 10
-
GetAwarenessFromDpiAwarenessContext
public static int GetAwarenessFromDpiAwarenessContext(long value)
Retrieves theDPI_AWARENESS
value from aDPI_AWARENESS_CONTEXT
.- Parameters:
value
- theDPI_AWARENESS_CONTEXT
you want to examine- Returns:
- the
DPI_AWARENESS
. If the provided value is null or invalid, this method will returnDPI_AWARENESS_INVALID
. - Since:
- Windows 10
-
GetThreadDpiAwarenessContext
public static long GetThreadDpiAwarenessContext()
Gets theDPI_AWARENESS_CONTEXT
for the current thread.If
SetThreadDpiAwarenessContext(long)
was never called for this thread, then the return value will equal the defaultDPI_AWARENESS_CONTEXT
for the process.- Returns:
- the current
DPI_AWARENESS_CONTEXT
for the thread. - Since:
- Windows 10
-
GetWindowDpiAwarenessContext
public static long GetWindowDpiAwarenessContext(long hwnd)
Returns theDPI_AWARENESS_CONTEXT
associated with a window.- Parameters:
hwnd
- the window to query- Returns:
- the
DPI_AWARENESS_CONTEXT
for the provided window. If the window is not valid, the return value isNULL
. - Since:
- Windows 10
-
IsValidDpiAwarenessContext
public static boolean IsValidDpiAwarenessContext(long value)
Determines if a specifiedDPI_AWARENESS_CONTEXT
is valid and supported by the current system.- Parameters:
value
- the context that you want to determine if it is supported- Returns:
WinBase.TRUE
if the provided context is supported, otherwiseWinBase.FALSE
- Since:
- Windows 10
-
SetThreadDpiAwarenessContext
public static long SetThreadDpiAwarenessContext(long dpiContext)
Set the DPI awareness for the current thread to the provided value.- Parameters:
dpiContext
- the DPI awareness value to set- Returns:
- The old
DPI_AWARENESS_CONTEXT
for the thread. If thedpiContext
is invalid, the thread will not be updated and the return value will beNULL
. You can use this value to restore the oldDPI_AWARENESS_CONTEXT
after overriding it with a predefined value. - Since:
- Windows 10
-
IsTouchWindow
public static boolean IsTouchWindow(long hWnd, @Nullable int[] pulFlags)
Array version of:IsTouchWindow(long, java.nio.IntBuffer)
-
-