This example creates a pointer from a bit map during the creation of the window (WM_CREATE). The bit map (id IDP_BITMAP in the EXE file) is loaded via GpiLoadBitmap.
#define INCL_WINPOINTERS /* Window Pointer Functions */ #define INCL_GPIBITMAPS /* Graphics bit map Functions */ #include <os2.h> HPS hps; /* presentation-space handle */ HWND hwnd; /* window handle */ HPOINTER hptr; /* bit-map pointer handle */ HBITMAP hbm; /* bit-map handle */ 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) */