The IsWindowVisible function determines whether a specified window, its parent window, its owner's parent window, and so on, are visible. A window is declared visible if it is not the child of another window that is hidden. Note that a window created by CreateWindow, but not yet shown by ShowWindow or SetWindowPos, is not visible.
BOOL IsWindowVisible(
[in] HWND hWnd
);
| Parameter | Type | Description |
|---|---|---|
hWnd |
[in] HWND |
A handle to the window to be tested. |
| Type | Description |
|---|---|
BOOL |
If the function succeeds, the return value is one of the following values:
|
A window is considered visible if it's not the child of another window that is hidden. This means that even if a window itself has not had ShowWindow(hWnd, SW_HIDE) called on it, it can still be considered invisible if its parent window is hidden.
You can use IsWindowVisible to determine whether a window is visible, regardless of whether it is minimized, maximized, or displayed normally. It is more reliable than checking window styles, as styles can be changed dynamically.
CreateWindow but not yet shown using ShowWindow or SetWindowPos is considered invisible.
| Minimum supported client | Windows 2000 Professional |
|---|---|
| Minimum supported server | Windows 2000 Server |
| Header | winuser.h |
| Library | User32.lib |
| DLL | User32.dll |