This example uses WinBeginPaint to obtain and associate a presentation space with the update region of a window so that redrawing can take place.
#define INCL_WINWINDOWMGR /* Window Manager Functions */ #include <os2.h> HWND hwnd; /* parent window */ RECTL rcl; /* update region */ HPS hps; /* presentation-space handle */ case WM_PAINT: hps = WinBeginPaint(hwnd, /* handle of the window */ NULLHANDLE, /* get a cache presentation space */ &rcl); /* receives update rectangle */ WinFillRect(hps, &rcl, CLR_WHITE); WinEndPaint(hps);