IsWindowVisible function

Expand
1 out of 1 rated this helpful - Rate this topic

IsWindowVisible function

Applies to: desktop apps only

Determines the visibility state of the specified window.

Syntax

BOOL WINAPI IsWindowVisible(
  __in  HWND hWnd
);

Parameters

hWnd [in]

Type: HWND

A handle to the window to be tested.

Return value

Type:

Type: BOOL

If the specified window, its parent window, its parent's parent window, and so forth, have the WS_VISIBLE style, the return value is nonzero. Otherwise, the return value is zero.

Because the return value specifies whether the window has the WS_VISIBLE style, it may be nonzero even if the window is totally obscured by other windows.

Remarks

The visibility state of a window is indicated by the WS_VISIBLE style bit. When WS_VISIBLE is set, the window is displayed and subsequent drawing into it is displayed as long as the window has the WS_VISIBLE style.

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

Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

Winuser.h (include Windows.h)

Library

User32.lib

DLL

User32.dll

See also

Reference
ShowWindow
Conceptual
Windows

 

 

Send comments about this topic to Microsoft

Build date: 5/5/2012

Did you find this helpful?
(1500 characters remaining)
Community Additions ADD
C# syntax
[DllImport("user32.dll", CharSet=CharSet.Auto)]
public static extern bool IsWindowVisible(IntPtr hWnd);
4/26/2009
vb.net syntax
<DllImport("user32.dll", CharSet:=CharSet.Auto)> _
Public Shared Function IsWindowVisible(ByVal hWnd As IntPtr) As Boolean End Function
4/26/2009