This example responds to an application defined message (IDM_FILL) and uses WinGetClipPS to obtain and associate a cached presentation space with a window, where the PS is clipped to the children of the window.
#define INCL_WINWINDOWMGR /* Window Manager Functions */ #include <os2.h> HWND hwnd; /* PS window */ HWND hwndClip; /* clipping window */ RECTL rcl; /* update region */ HPS hps; /* presentation-space handle */ case IDM_FILL: hps = WinGetClipPS(hwnd, /* handle of the PS window */ hwndClip, /* handle of clipping window */ PSF_CLIPCHILDREN); /* clipping flags */ WinFillRect(hps, &rcl, CLR_WHITE); WinReleasePS(hps);