Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sun.jna.platform.win32
Interface User32

All Superinterfaces:
  com.sun.jna.AltCallingConvention, com.sun.jna.Library, com.sun.jna.win32.StdCall, com.sun.jna.win32.StdCallLibrary

    public interface User32

extends com.sun.jna.win32.StdCallLibrary

Provides access to the w32 user32 library. Incomplete implementation to support demos.

Nested Class Summary

Nested classes/interfaces inherited from interface com.sun.jna.win32.StdCallLibrary
`com.sun.jna.win32.StdCallLibrary.StdCallCallback`

Nested classes/interfaces inherited from interface com.sun.jna.Library
`com.sun.jna.Library.Handler`

Field Summary
`static User32` | `INSTANCE`

Fields inherited from interface com.sun.jna.win32.StdCallLibrary
`FUNCTION_MAPPER, STDCALL_CONVENTION`

Fields inherited from interface com.sun.jna.Library
`OPTION_ALLOW_OBJECTS, OPTION_CALLING_CONVENTION, OPTION_FUNCTION_MAPPER, OPTION_INVOCATION_MAPPER, OPTION_STRUCTURE_ALIGNMENT, OPTION_TYPE_MAPPER`

Method Summary
`WinDef.LRESULT` | `CallNextHookEx(WinUser.HHOOK hhk, int nCode, WinDef.WPARAM wParam, com.sun.jna.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` | `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, com.sun.jna.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, com.sun.jna.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, com.sun.jna.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(java.lang.String lpClassName, java.lang.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.
`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` | `GetLayeredWindowAttributes(WinDef.HWND hwnd, com.sun.jna.ptr.IntByReference pcrKey, com.sun.jna.ptr.ByteByReference pbAlpha, com.sun.jna.ptr.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.
`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, com.sun.jna.ptr.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.
`WinDef.HICON` | `LoadIcon(WinDef.HINSTANCE hInstance, java.lang.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, java.lang.String name, int type, int xDesired, int yDesired, int load)` This function loads an icon, cursor, or bitmap.
`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).
`int` | `ReleaseDC(WinDef.HWND hWnd, WinDef.HDC hDC)` This function releases a device context (DC), freeing it for use by other applications.
`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.
`int` | `SetWindowLong(WinDef.HWND hWnd, int nIndex, int dwNewLong)` This function changes an attribute of the specified window.
`com.sun.jna.Pointer` | `SetWindowLong(WinDef.HWND hWnd, int nIndex, com.sun.jna.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.
`com.sun.jna.Pointer` | `SetWindowLongPtr(WinDef.HWND hWnd, int nIndex, com.sun.jna.Pointer dwNewLongPtr)` The SetWindowLongPtr function changes an attribute of the specified 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` | `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` | `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.

Field Detail

### INSTANCE

    static final User32 INSTANCE

Method Detail

### GetDC

    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. The display device context can be used in subsequent graphics display interface (GDI) functions to draw in the client area of the window.

  Parameters:
    `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.
  Returns:
    The handle the device context for the specified window's client area indicates success. NULL indicates failure. To get extended error information, call GetLastError.

### ReleaseDC

    int ReleaseDC(WinDef.HWND hWnd,
                  WinDef.HDC hDC)

  This function releases a device context (DC), freeing it for use by other applications. The effect of ReleaseDC depends on the type of device context.

  Parameters:
    `hWnd` - Handle to the window whose device context is to be released.
    `hDC` - Handle to the device context to be released.
  Returns:
    The return value specifies whether the device context is released. 1 indicates that the device context is released. Zero indicates that the device context is not released.

### FindWindow

    WinDef.HWND FindWindow(java.lang.String lpClassName,
                           java.lang.String lpWindowName)

  This function retrieves the handle to the top-level window whose class name and window name match the specified strings. This function does not search child windows.

  Parameters:
    `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.
  Returns:
    A handle to the window that has the specified class name and window name indicates success. NULL indicates failure. To get extended error information, call GetLastError.

### GetClassName

    int GetClassName(WinDef.HWND hWnd,
                     char[] lpClassName,
                     int nMaxCount)

  This function retrieves the name of the class to which the specified window belongs.

  Parameters:
    `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.
  Returns:
    The number of characters copied to the specified buffer indicates success. Zero indicates failure. To get extended error information, call GetLastError.

### GetGUIThreadInfo

    boolean GetGUIThreadInfo(int idThread,
                             WinUser.GUITHREADINFO lpgui)

  Retrieves information about the active window or a specified graphical user interface (GUI) thread.

  Parameters:
    `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.
  Returns:
    If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.

### GetWindowInfo

    boolean GetWindowInfo(WinDef.HWND hWnd,
                          WinUser.WINDOWINFO pwi)

  The GetWindowInfo function retrieves information about the specified window.

  Parameters:
    `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.
  Returns:
    If the function succeeds, the return value is nonzero. If the function fails, the return value is zero.

### GetWindowRect

    boolean GetWindowRect(WinDef.HWND hWnd,
                          WinDef.RECT rect)

  This function 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` - 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.
  Returns:
    Nonzero indicates success. Zero indicates failure. To get extended error information, call GetLastError.

### GetWindowText

    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. If the specified window is a control, the text of the control is copied.

  Parameters:
    `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.
  Returns:
    The length, in characters, of the copied string, not including the terminating null character, indicates success. Zero indicates that the window has no title bar or text, if the title bar is empty, or if the window or control handle is invalid. To get extended error information, call GetLastError. This function cannot retrieve the text of an edit control in another application.

### GetWindowTextLength

    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. If the specified window is a control, the function retrieves the length of the text within the control.

  Parameters:
    `hWnd` - Handle to the window or control.
  Returns:
    The length, in characters, of the text indicates success. Under certain conditions, this value may actually be greater than the length of the text. Zero indicates that the window has no text. To get extended error information, call GetLastError.

### GetWindowModuleFileName

    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.

  Parameters:
    `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.
  Returns:
    The return value is the total number of TCHARs copied into the buffer.

### GetWindowThreadProcessId

    int GetWindowThreadProcessId(WinDef.HWND hWnd,
                                 com.sun.jna.ptr.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.

  Parameters:
    `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.
  Returns:
    The return value is the identifier of the thread that created the window.

### EnumWindows

    boolean EnumWindows(WinUser.WNDENUMPROC lpEnumFunc,
                        com.sun.jna.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. EnumWindows continues until the last top-level window is enumerated or the callback function returns FALSE.

  Parameters:
    `lpEnumFunc` - Long pointer to an application-defined callback function.
    `data` - Specifies an application-defined value to be passed to the callback function.
  Returns:
    Nonzero indicates success. Zero indicates failure. To get extended error information, call GetLastError.

### EnumChildWindows

    boolean EnumChildWindows(WinDef.HWND hWnd,
                             WinUser.WNDENUMPROC lpEnumFunc,
                             com.sun.jna.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. EnumChildWindows continues until the last child window is enumerated or the callback function returns FALSE.

  Parameters:
    `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.
  Returns:
    If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError. If EnumChildProc returns zero, the return value is also zero. In this case, the callback function should call SetLastError to obtain a meaningful error code to be returned to the caller of EnumChildWindows.

### EnumThreadWindows

    boolean EnumThreadWindows(int dwThreadId,
                              WinUser.WNDENUMPROC lpEnumFunc,
                              com.sun.jna.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. EnumThreadWindows continues until the last window is enumerated or the callback function returns FALSE. To enumerate child windows of a particular window, use the EnumChildWindows function.

  Parameters:
    `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.
  Returns:
    If the callback function returns TRUE for all windows in the thread specified by dwThreadId, the return value is TRUE. If the callback function returns FALSE on any enumerated window, or if there are no windows found in the thread specified by dwThreadId, the return value is FALSE.

### FlashWindowEx

    boolean FlashWindowEx(WinUser.FLASHWINFO pfwi)

  The FlashWindowEx function flashes the specified window. It does not change the active state of the window.

  Parameters:
    `pfwi` - Pointer to the FLASHWINFO structure.
  Returns:
    The return value specifies the window's state before the call to the FlashWindowEx function. If the window caption was drawn as active before the call, the return value is nonzero. Otherwise, the return value is zero.

### LoadIcon

    WinDef.HICON LoadIcon(WinDef.HINSTANCE hInstance,
                          java.lang.String iconName)

  This function loads the specified icon resource from the executable (.exe) file associated with an application instance.

  Parameters:
    `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.
  Returns:
    A handle to the newly loaded icon indicates success. NULL indicates failure. To get extended error information, call GetLastError.

### LoadImage

    WinNT.HANDLE LoadImage(WinDef.HINSTANCE hinst,
                           java.lang.String name,
                           int type,
                           int xDesired,
                           int yDesired,
                           int load)

  This function loads an icon, cursor, or bitmap.

  Parameters:
    `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.
  Returns:
    The handle of the newly loaded image indicates success. NULL indicates failure. To get extended error information, call GetLastError.

### DestroyIcon

    boolean DestroyIcon(WinDef.HICON hicon)

  This function destroys an icon and frees any memory the icon occupied.

  Parameters:
    `hicon` - Handle to the icon to be destroyed. The icon must not be in use.
  Returns:
    Nonzero indicates success. Zero indicates failure. To get extended error information, call GetLastError.

### GetWindowLong

    int GetWindowLong(WinDef.HWND hWnd,
                      int nIndex)

  This function retrieves information about the specified window. GetWindowLong also retrieves the 32-bit (long) value at the specified offset into the extra window memory of a window.

  Parameters:
    `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.
  Returns:
    The requested 32-bit value indicates success. Zero indicates failure. To get extended error information, call GetLastError.

### SetWindowLong

    int SetWindowLong(WinDef.HWND hWnd,
                      int nIndex,
                      int dwNewLong)

  This function changes an attribute of the specified window. SetWindowLong also sets a 32-bit (LONG) value at the specified offset into the extra window memory of a window.

  Parameters:
    `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.
  Returns:
    The previous value of the specified 32-bit integer indicates success. Zero indicates failure. To get extended error information, call GetLastError.

### SetWindowLong

    com.sun.jna.Pointer SetWindowLong(WinDef.HWND hWnd,
                                      int nIndex,
                                      com.sun.jna.Pointer dwNewLong)

  This function changes an attribute of the specified window. SetWindowLong also sets a 32-bit (LONG) value at the specified offset into the extra window memory of a window. Do not use this version on Windows-64.

  Parameters:
    `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.
  Returns:
    The previous value of the specified 32-bit integer indicates success. Zero indicates failure. To get extended error information, call GetLastError.

### GetWindowLongPtr

    BaseTSD.LONG_PTR GetWindowLongPtr(WinDef.HWND hWnd,
                                      int nIndex)

  The GetWindowLongPtr function retrieves information about the specified window. The function also retrieves the value at a specified offset into the extra window memory.

  Parameters:
    `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.
  Returns:
    If the function succeeds, the return value is the requested value. If the function fails, the return value is zero. To get extended error information, call GetLastError. If SetWindowLong or SetWindowLongPtr has not been called previously, GetWindowLongPtr returns zero for values in the extra window or class memory.

### SetWindowLongPtr

    BaseTSD.LONG_PTR SetWindowLongPtr(WinDef.HWND hWnd,
                                      int nIndex,
                                      BaseTSD.LONG_PTR dwNewLongPtr)

  The SetWindowLongPtr function changes an attribute of the specified window. The function also sets a value at the specified offset in the extra window memory.

  Parameters:
    `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.
  Returns:
    If the function succeeds, the return value is the previous value of the specified offset. If the function fails, the return value is zero. To get extended error information, call GetLastError. If the previous value is zero and the function succeeds, the return value is zero, but the function does not clear the last error information. To determine success or failure, clear the last error information by calling SetLastError(0), then call SetWindowLongPtr. Function failure will be indicated by a return value of zero and a GetLastError result that is nonzero.

### SetWindowLongPtr

    com.sun.jna.Pointer SetWindowLongPtr(WinDef.HWND hWnd,
                                         int nIndex,
                                         com.sun.jna.Pointer dwNewLongPtr)

  The SetWindowLongPtr function changes an attribute of the specified window. The function also sets a value at the specified offset in the extra window memory.

  Parameters:
    `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.
  Returns:
    If the function succeeds, the return value is the previous value of the specified offset. If the function fails, the return value is zero. To get extended error information, call GetLastError. If the previous value is zero and the function succeeds, the return value is zero, but the function does not clear the last error information. To determine success or failure, clear the last error information by calling SetLastError(0), then call SetWindowLongPtr. Function failure will be indicated by a return value of zero and a GetLastError result that is nonzero.

### SetLayeredWindowAttributes

    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.

  Parameters:
    `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.
  Returns:
    If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.

### GetLayeredWindowAttributes

    boolean GetLayeredWindowAttributes(WinDef.HWND hwnd,
                                       com.sun.jna.ptr.IntByReference pcrKey,
                                       com.sun.jna.ptr.ByteByReference pbAlpha,
                                       com.sun.jna.ptr.IntByReference pdwFlags)

  The GetLayeredWindowAttributes function retrieves the opacity and transparency color key of a layered window.

  Parameters:
    `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.
  Returns:
    If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.

### UpdateLayeredWindow

    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.

  Parameters:
    `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.
  Returns:
    If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.

### SetWindowRgn

    int SetWindowRgn(WinDef.HWND hWnd,
                     WinDef.HRGN hRgn,
                     boolean bRedraw)

  This function sets the window region of a window. The window region determines the area within the window where the system permits drawing. The system does not display any portion of a window that lies outside of the window region.

  Parameters:
    `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.
  Returns:
    Nonzero indicates success. Zero indicates failure. To get extended error information, call GetLastError.

### GetKeyboardState

    boolean GetKeyboardState(byte[] lpKeyState)

  The GetKeyboardState function copies the status of the 256 virtual keys to the specified buffer.

  Parameters:
    `lpKeyState` - Pointer to the 256-byte array that receives the status data for each virtual key.
  Returns:
    If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.

### GetAsyncKeyState

    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.

  Parameters:
    `vKey` - Specifies one of 256 possible virtual-key codes.
  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.

### SetWindowsHookEx

    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. You would install a hook procedure to monitor the system for certain types of events. These events are associated either with a specific thread or with all threads in the same desktop as the calling thread.

  Parameters:
    `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.
  Returns:
    If the function succeeds, the return value is the handle to the hook procedure. If the function fails, the return value is NULL. To get extended error information, call GetLastError.

### CallNextHookEx

    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. A hook procedure can call this function either before or after processing the hook information.

  Parameters:
    `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.
  Returns:
    This value is returned by the next hook procedure in the chain. The current hook procedure must also return this value. The meaning of the return value depends on the hook type.

### CallNextHookEx

    WinDef.LRESULT CallNextHookEx(WinUser.HHOOK hhk,
                                  int nCode,
                                  WinDef.WPARAM wParam,
                                  com.sun.jna.Pointer lParam)

  The CallNextHookEx function passes the hook information to the next hook procedure in the current hook chain. A hook procedure can call this function either before or after processing the hook information.

  Parameters:
    `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.
  Returns:
    This value is returned by the next hook procedure in the chain. The current hook procedure must also return this value. The meaning of the return value depends on the hook type.

### UnhookWindowsHookEx

    boolean UnhookWindowsHookEx(WinUser.HHOOK hhk)

  The UnhookWindowsHookEx function removes a hook procedure installed in a hook chain by the SetWindowsHookEx function.

  Parameters:
    `hhk` - Handle to the hook to be removed. This parameter is a hook handle obtained by a previous call to SetWindowsHookEx.
  Returns:
    If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.

### GetMessage

    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.

  Parameters:
    `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.
  Returns:
    Nonzero indicates that the function retrieves a message other than WM_QUIT. Zero indicates that the function retrieves the WM_QUIT message, or that lpMsg is an invalid pointer. To get extended error information, call GetLastError.

### PeekMessage

    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.

  Parameters:
    `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.
  Returns:
    Nonzero indicates success. Zero indicates failure.

### TranslateMessage

    boolean TranslateMessage(WinUser.MSG lpMsg)

  This function 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 the GetMessage or PeekMessage function.

  Parameters:
    `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.
  Returns:
    Nonzero indicates that the message is translated, that is, a character message is posted to the thread's message queue. If the message is WM_KEYDOWN or WM_SYSKEYDOWN, the return value is nonzero, regardless of the translation. Zero indicates that the message is not translated, that is, a character message is not posted to the thread's message queue.

### DispatchMessage

    WinDef.LRESULT DispatchMessage(WinUser.MSG lpMsg)

  This function dispatches a message to a window procedure. It is typically used to dispatch a message retrieved by the GetMessage function.

  Parameters:
    `lpMsg` - Pointer to an MSG structure that contains the message.
  Returns:
    The return value specifies the value returned by the window procedure. Although its meaning depends on the message being dispatched, the return value generally is ignored.

### PostMessage

    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. Messages in a message queue are retrieved by calls to the GetMessage or PeekMessage function.

  Parameters:
    `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.

### PostQuitMessage

    void PostQuitMessage(int nExitCode)

  This function indicates to Windows that a thread has made a request to terminate (quit). It is typically used in response to a WM_DESTROY message.

  Parameters:
    `nExitCode` - Specifies an application exit code. This value is used as the wParam parameter of the WM_QUIT message.

### GetSystemMetrics

    int GetSystemMetrics(int nIndex)

  The GetSystemMetrics function retrieves various system metrics (widths and heights of display elements) and system configuration settings. All dimensions retrieved by GetSystemMetrics are in pixels.

  Parameters:
    `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.
  Returns:
    If the function succeeds, the return value is the requested system metric or configuration setting. If the function fails, the return value is zero. GetLastError does not provide extended error information.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD