Jump to content

WinQueryCursorInfo: Difference between revisions

From EDM2
Created page with "This function obtains information about any current cursor. ==Syntax== WinQueryCursorInfo(hwndDeskTop, pcsriCursorInfo); ==Parameters== ;hwndDeskTop (HWND) - input :Desktop-..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 1: Line 1:
This function obtains information about any current cursor.  
This function obtains information about any current cursor.
 
==Syntax==
==Syntax==
  WinQueryCursorInfo(hwndDeskTop, pcsriCursorInfo);
  WinQueryCursorInfo(hwndDeskTop, pcsriCursorInfo)
 
==Parameters==
==Parameters==
;hwndDeskTop (HWND) - input
;hwndDeskTop (HWND) - input:Desktop-window handle.
:Desktop-window handle.
::HWND_DESKTOP:The desktop-window handle
:;HWND_DESKTOP
::Other:Specified desktop-window handle.
::The desktop-window handle  
;pcsriCursorInfo (PCURSORINFO) - output:Cursor information.
:;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 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.
:The size and position of the cursor are returned in window coordinates relative to the window identified by the parameter of the structure.
==Returns==
==Returns==
;rc (BOOL) - returns
;rc (BOOL) - returns:Current-cursor indicator.
:Current-cursor indicator.
::TRUE: Cursor exists
:;TRUE
::FALSE: Cursor does not exist, pcsriCursorInfo is not updated by this call.
::Cursor exists
 
:;FALSE
::Cursor does not exist, pcsriCursorInfo is not updated by this call.
==Errors==
==Errors==
Possible returns from WinGetLastError
Possible returns from WinGetLastError
;PMERR_INVALID_HWND (0x1001)
;PMERR_INVALID_HWND (0x1001):An invalid window handle was specified.
:An invalid window handle was specified.
==Remarks==


==Example Code==
==Example Code==
Line 32: Line 26:
#define INCL_WINCURSORS
#define INCL_WINCURSORS
#define INCL_WINWINDOWMGR
#define INCL_WINWINDOWMGR
#include <OS2.H>
#include <os2.h>
HWND hwnd;    /* handle of window that has pointer captured */
CURSORINFO cursorinfo;


HWND      hwnd;    /* handle of window that has pointer captured */
CURSORINFO cursorinfo;  /*  Cursor information. */
BOOL      rc;


WinQueryCursorInfo(hwnd_DESKTOP,    /*  get cursor info  */
WinQueryCursorInfo(hwnd_DESKTOP,    /*  get cursor info  */
                   &cursorinfo);
                   &cursorinfo);
</pre>
Definition
<pre>
#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);
</pre>
</pre>



Latest revision as of 20:42, 12 April 2024

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.

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;   /*  Cursor information. */
BOOL       rc;

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

Related Functions