Jump to content

WinQueryCursorInfo

From EDM2
Revision as of 00:33, 7 April 2024 by Martini (talk | contribs) (Created page with "This function obtains information about any current cursor. ==Syntax== WinQueryCursorInfo(hwndDeskTop, pcsriCursorInfo); ==Parameters== ;hwndDeskTop (HWND) - input :Desktop-...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This function obtains information about any current cursor.

Syntax

WinQueryCursorInfo(hwndDeskTop, pcsriCursorInfo);

Parameters

hwndDeskTop (HWND) - input
Desktop-window handle.
HWND_DESKTOP
The desktop-window handle
Other
Specified desktop-window handle.
pcsriCursorInfo (PCURSORINFO) - output
Cursor information.
The values are equivalent to the parameters of the WinCreateCursor function except that ulrgf never includes the CURSOR_SETPOS option.
The size and position of the cursor are returned in window coordinates relative to the window identified by the parameter of the structure.

Returns

rc (BOOL) - returns
Current-cursor indicator.
TRUE
Cursor exists
FALSE
Cursor does not exist, pcsriCursorInfo is not updated by this call.

Errors

Possible returns from WinGetLastError

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

Remarks

Example Code

This example obtains information about any current cursor.

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


WinQueryCursorInfo(hwnd_DESKTOP,    /*  get cursor info  */
                   &cursorinfo);

Definition

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

HWND           hwndDeskTop;      /*  Desktop-window handle. */
PCURSORINFO    pcsriCursorInfo;  /*  Cursor information. */
BOOL           rc;               /*  Current-cursor indicator. */

rc = WinQueryCursorInfo(hwndDeskTop, pcsriCursorInfo);

Related Functions