WinDestroyPointer
Appearance
This function destroys a pointer or icon.
Syntax
WinDestroyPointer(hptrPointer)
Parameters
- hptrPointer (HPOINTER) - input
- Handle of pointer to be destroyed.
Returns
- rc (BOOL) - returns
- Success indicator.
- TRUE: Successful completion
- FALSE: Error occurred.
Errors
Possible returns from WinGetLastError
- PMERR_INVALID_HPTR (0x101B)
- An invalid pointer handle was specified.
Remarks
A pointer can only be destroyed by the thread that created it.
The system pointers and icons must not be destroyed.
Example Code
This example destroys a bit-map pointer, created by either WinCreatePointer or WinCreatePointerIndirect, once the window has received a close message (WM_CLOSE).
#define INCL_WINPOINTERS /* Window Pointer Functions */
#define INCL_GPIBITMAPS /* Graphics Bit-map Functions */
#include <os2.h>
#define IDP_BITMAP 1
HPS hps; /* presentation-space handle */
HWND hwnd; /* window handle */
HPOINTER hptr; /* bit-map pointer handle */
HBITMAP hbm; /* bit-map handle */
BOOL fSuccess; /* success indicator */
case WM_CREATE:
hps = WinBeginPaint(hwnd, NULLHANDLE, NULL);
hbm = GpiLoadBitmap(hps, 0L, IDP_BITMAP, 64L, 64L);
WinEndPaint(hps);
hptr = WinCreatePointer(HWND_DESKTOP, hbm,
TRUE, /* use true (system) pointer */
0, 0); /* hot spot offset (0,0) */
case WM_CLOSE:
fSuccess = WinDestroyPointer(hptr);
Related Functions
- WinCreatePointer
- WinCreatePointerIndirect
- WinDrawPointer
- WinLoadPointer
- WinQueryPointer
- WinQueryPointerInfo
- WinQueryPointerPos
- WinQuerySysPointer
- WinQuerySysPointerData
- WinSetPointer
- WinSetPointerPos
- WinSetSysPointerData
- WinShowPointer