Is HWND visible?

These damned users and their minimized windows.

In C #, if I have an HWND window, is there a way to find out if this is visible on the desktop?

+4
source share
3 answers

The GetWindowPlacement function returns a WINDOWPLACEMENT that has a showCmd field:

Sets the current window display state.

The details of this are read as if you were setting the state of the window, but I suspect this is because they were copied from another place and not updated.

+5
source

Here is the Visible property, but it checks the visibility flag, it does not tell you whether the window is closed by another window or from the screen, etc. This is much more complicated. Raymond Chen has a few tips:

http://blogs.msdn.com/oldnewthing/archive/2003/09/02/54758.aspx

http://blogs.msdn.com/oldnewthing/archive/2003/08/29/54728.aspx

+3
source
 bool isHwndVisible = Control.FromHandle(handle).Visible 
0
source

All Articles