CWnd::IsWindowVisible

BOOL IsWindowVisible( ) const;

Return Value

Nonzero if CWnd is visible (has the WS_VISIBLE style bit set, and parent window is visible). Because the return value reflects the state of the WS_VISIBLE style bit, the return value may be nonzero even though CWnd is totally obscured by other windows.

Remarks

Determines the visibility state of the given window.

A window possesses a visibility state indicated by the WS_VISIBLE style bit. When this style bit is set with a call to the ShowWindow member function, the window is displayed and subsequent drawing to the window is displayed as long as the window has the style bit set.

Any drawing to a window that has the WS_VISIBLE style will not be displayed if the window is covered by other windows or is clipped by its parent window.

Example

// This example uses the CWnd::IsWindowVisible() function to
// determine if a dialog box is visible. If it is not, it calls
// CWnd::ShowWindow with the SW_SHOWNORMAL command.

void CSomeClass::DisplayDlgWindow()
{
   if(!m_myDlg.IsWindowVisible())
   {
      m_myDlg.ShowWindow(SW_SHOWNORMAL);
   }
}

// This example uses the CWnd::IsWindowVisible() function to
// determine if a dialog box is visible. If it is, it calls
// CWnd::ShowWindow with the SW_HIDE command.

void CSomeClass::HideDlgWindow()
{
   if(m_myDlg.IsWindowVisible())
   {
      m_myDlg.ShowWindow(SW_HIDE);
   }
}

CWnd OverviewClass MembersHierarchy Chart

See Also   CWnd::ShowWindow, ::IsWindowVisible