This example gets the region that needs to be updated and then repaints the invalid region, if necessary.
#define INCL_WINWINDOWMGR #define INCL_GPIREGIONS #include <OS2.H> HWND hwnd; HRGN hrgn; /* region handle. */ if (RGN_NULL != WinQueryUpdateRegion(hwnd, hrgn)) { /* repaint the invalid region */ . . . }