This example uses WinIsWindowVisible to query the visibility state of a window (i.e. the value of the WS_VISIBLE style bits) when the window is created, so that the window can be designated as visible, if necessary, by calling WinEnableWindowUpdate.

#define INCL_WINWINDOWMGR   /* Window Manager Functions */
#include <os2.h>

HWND    hwnd;               /* Parent window            */
BOOL  fSuccess;             /* Success indicator        */

case WM_CREATE:
     /* If the window has WS_VISIBLE off, set state to visible */
     if (!WinIsWindowVisible(hwnd))
        {
          /* Set the state to visible and cause the WM_PAINT message */
          fSuccess = WinEnableWindowUpdate(hwnd, TRUE);
        }


[Back] [Next]