The window needs painting. This is done asynchronously on the drawing thread. The window update region is copied into a local region and passed to the drawing thread. The window must be validated now (to prevent further unnecessary paint messages).
#define INCL_WINWINDOWMGR #include <OS2.H> HRGN hrgnUpdate; HPS hps; HWND hwnd; /* Window needs paint */ case WM_PAINT: /* assume we stop any asynchronous drawing. */ /* by posting a message to the asynchronous */ /* drawing thread. */ hrgnUpdate=(HRGN)GpiCreateRegion(hps, /* Create empty region */ 0L, (PRECTL)NULL); WinQueryUpdateRegion(hwnd, /* Save the window update */ hrgnUpdate); /* region. */ WinValidateRect(hwnd, /* Validate window now to */ (PRECTL)NULL, /* stop more paint msgs */ TRUE); /* assume a message is posted to the drawing thread, passing */ /* the update region: (MPARAM)hgrnUpdate. */ mr = (MRESULT) 0L; /* Message processed */ break; /* End window painting */