WinShowPointer: Difference between revisions
Appearance
WinShowPointer created |
No edit summary |
||
(10 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
This function adjusts the pointer display level to show or hide a pointer. | |||
=== | == Syntax == | ||
WinShowPointer(hwndDeskTop, fShow); | |||
== | == Parameters == | ||
;''hwndDeskTop'' ([[HWND]]) - input: Desktop-window handle. | |||
:HWND_DESKTOP: The desktop-window handle. | |||
:Other: The specified desktop-window handle. | |||
[[ | ;''fShow'' ([[BOOL]]) - input: Level-update indicator. | ||
:TRUE: Decrement pointer display level by one. (The pointer level is not decremented to a negative value.) | |||
:FALSE: Increment pointer display level by one. | |||
== | == Returns == | ||
;''rc'' ([[BOOL]]) - returns: Display-level-updated indicator. | |||
:TRUE: Pointer display level successfully updated. | |||
:FALSE: Pointer display level not successfully updated. | |||
=== | == Errors == | ||
Possible returns from [[WinGetLastError]] | |||
;PMERR_INVALID_HWND (0x1001) | |||
:An invalid window handle was specified. | |||
== | == Remarks == | ||
The pointer display level determines whether the pointer is shown. If it is zero, the pointer is visible, but if it is greater than zero, the pointer is not visible. The initial setting of the pointer display level is dependent on the capabilities of the device. If a pointing device exists, the initial setting of the pointer display level is zero, otherwise it is one. The existing pointer display level can be obtained by using the [[WinQuerySysValue]] function with ''iSysValue'' set to SV_POINTERLEVEL. | |||
== | == Example Code == | ||
Declaration: | |||
<PRE> | |||
#define INCL_WINPOINTERS /* Or use INCL_WIN, INCL_PM */ | |||
#include <os2.h> | |||
HWND hwndDeskTop; /* Desktop-window handle. */ | |||
BOOL fShow; /* Level-update indicator. */ | |||
BOOL rc; /* Display-level-updated indicator. */ | |||
= | rc = WinShowPointer(hwndDeskTop, fShow); | ||
</PRE> | |||
This example obtains the pointer handle from the desktop window handle and hides the pointer. | |||
<pre> | |||
#define INCL_WINPOINTERS | |||
#define INCL_WINDESKTOP | |||
#include <os2.h> | |||
HPOINTER hpointer; | |||
HWND hwnd; | |||
=== | hpointer = WinQueryPointer(HWND_DESKTOP); | ||
WinShowPointer(hwnd, FALSE); | |||
</pre> | |||
== Related Functions == | |||
* [[WinCreatePointer]] | |||
* [[WinCreatePointerIndirect]] | |||
* [[WinDestroyPointer]] | |||
* [[WinDrawPointer]] | |||
* [[WinLoadPointer]] | |||
* [[WinQueryPointer]] | |||
* [[WinQueryPointerInfo]] | |||
* [[WinQueryPointerPos]] | |||
* [[WinQuerySysPointer]] | |||
* [[WinQuerySysPointerData]] | |||
* [[WinSetPointer]] | |||
* [[WinSetPointerPos]] | |||
* [[WinSetSysPointerData]] | |||
[[Category:Win]] |
Latest revision as of 16:37, 15 May 2025
This function adjusts the pointer display level to show or hide a pointer.
Syntax
WinShowPointer(hwndDeskTop, fShow);
Parameters
- hwndDeskTop (HWND) - input
- Desktop-window handle.
- HWND_DESKTOP: The desktop-window handle.
- Other: The specified desktop-window handle.
- fShow (BOOL) - input
- Level-update indicator.
- TRUE: Decrement pointer display level by one. (The pointer level is not decremented to a negative value.)
- FALSE: Increment pointer display level by one.
Returns
- rc (BOOL) - returns
- Display-level-updated indicator.
- TRUE: Pointer display level successfully updated.
- FALSE: Pointer display level not successfully updated.
Errors
Possible returns from WinGetLastError
- PMERR_INVALID_HWND (0x1001)
- An invalid window handle was specified.
Remarks
The pointer display level determines whether the pointer is shown. If it is zero, the pointer is visible, but if it is greater than zero, the pointer is not visible. The initial setting of the pointer display level is dependent on the capabilities of the device. If a pointing device exists, the initial setting of the pointer display level is zero, otherwise it is one. The existing pointer display level can be obtained by using the WinQuerySysValue function with iSysValue set to SV_POINTERLEVEL.
Example Code
Declaration:
#define INCL_WINPOINTERS /* Or use INCL_WIN, INCL_PM */ #include <os2.h> HWND hwndDeskTop; /* Desktop-window handle. */ BOOL fShow; /* Level-update indicator. */ BOOL rc; /* Display-level-updated indicator. */ rc = WinShowPointer(hwndDeskTop, fShow);
This example obtains the pointer handle from the desktop window handle and hides the pointer.
#define INCL_WINPOINTERS #define INCL_WINDESKTOP #include <os2.h> HPOINTER hpointer; HWND hwnd; hpointer = WinQueryPointer(HWND_DESKTOP); WinShowPointer(hwnd, FALSE);