Jump to content

WinShowPointer

From EDM2

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);

Related Functions