This example calls WinLoadPointer to load an application-defined pointer. When processing the WM_MOUSEMOVE message, the loaded pointer is displayed by calling WinSetPointer.

#define INCL_WININPUT
#define INCL_WINPOINTERS
#include <OS2.H>
#define IDP_CROSSHAIR 900

HPOINTER hptrCrossHair;
USHORT   msg;

switch(msg)
{
 case WM_CREATE:
     hptrCrossHair = WinLoadPointer(HWND_DESKTOP,
                       (ULONG)0,           /* load from .exe file    */
                       IDP_CROSSHAIR);  /* identifies the pointer */

 case WM_MOUSEMOVE:
     WinSetPointer(HWND_DESKTOP, hptrCrossHair);
}


[Back] [Next]