This example draws a pointer loaded using WinLoadPointer in response to a paint message (WM_PAINT).
#define INCL_WINPOINTERS /* Window Pointer functions */ #include <os2.h> HPS hps; /* Presentation-space handle */ HWND hwnd; /* Window handle */ HPOINTER hptr; /* Pointer handle */ BOOL fSuccess; /* Success indicator */ ULONG ulHalftone=DP_NORMAL; /* Draw with normal shading */ ULONG idPointer=ID_MYPOINTER; /* Identifier of pointer in */ /* executable resources */ case WM_CREATE: hptr = WinLoadPointer(HWND_DESKTOP, NULLHANDLE, idPointer); case WM_PAINT: hps = WinBeginPaint(hwnd, NULLHANDLE, NULL); WinStretchPointer(hps, 100, 100, 16, 16, hptr, ulHalftone); WinEndPaint(hps);