Jump to content

WinQueryCapture

From EDM2
Revision as of 01:42, 9 April 2025 by Martini (talk | contribs) (Created page with "This function returns the handle of the window that has the pointer captured. ==Syntax== WinQueryCapture(hwndDesktop) ==Parameters== ;hwndDesktop (HWND) - Input: Desktop-window handle. :HWND_DESKTOP: The desktop-window handle. :Other: Specified desktop-window handle. ==Returns== ;hwnd (HWND) - Returns: Handle of the window with the pointer captured. :;NULLHANDLE: No window has the pointer captured, or an error occurred. :;Handle: Handle of the window with the poi...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This function returns the handle of the window that has the pointer captured.

Syntax

WinQueryCapture(hwndDesktop)

Parameters

hwndDesktop (HWND) - Input
Desktop-window handle.
HWND_DESKTOP: The desktop-window handle.
Other: Specified desktop-window handle.

Returns

hwnd (HWND) - Returns
Handle of the window with the pointer captured.
NULLHANDLE
No window has the pointer captured, or an error occurred.
Handle
Handle of the window with the pointer captured.

Errors

Possible returns from WinGetLastError:

PMERR_INVALID_HWND (0x1001)
An invalid window handle was specified.

Example Code

#define INCL_WININPUT /* Or use INCL_WIN, INCL_PM, */
#include <os2.h>

HWND     hwndDesktop; /* Desktop-window handle. */
HWND     hwnd;        /* Handle of the window with the pointer captured. */

hwnd = WinQueryCapture(hwndDesktop);

This function returns the handle of the window that has the pointer captured.

#define INCL_WININPUT
#define INCL_WINWINDOWMGR
#include <OS2.H>
HWND hwnd;   /* handle of window that has pointer captured */

hwnd = WinQueryCapture(HWND_DESKTOP);  /* window that has   */
                                     /* pointer captured */

Related Functions