This example uses WinEndPaint to end the update of a region and release the presentation space obtained by WinBeginPaint.
#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);