This example calls WinQuerySysPointer to get a handle to the system pointer, and then loads an application-defined pointer. After it has finished using the application-defined pointer, it restores the system pointer.
#define INCL_WINPOINTERS #include <OS2.H> #define IDP_CROSSHAIR 900 HWND hptrDefault, hptrCrossHair; /* get the system pointer */ hptrDefault = WinQuerySysPointer(HWND_DESKTOP, SPTR_ARROW, FALSE); /* load an application-defined pointer */ hptrCrossHair = WinLoadPointer(HWND_DESKTOP, (ULONG)0, IDP_CROSSHAIR); /* change the pointer to the application pointer */ WinSetPointer(HWND_DESKTOP, hptrCrossHair); /* restore the system pointer */ WinSetPointer(HWND_DESKTOP, hptrDefault);