Check these:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms633530(v=vs.85).aspx[
^]
http://stackoverflow.com/questions/1061246/how-can-i-check-if-a-window-has-ws-visible-to-set-or-if-is-visible[
^]
This quote from first link is crucial:
"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."
From the second link a solution:
"One nuance to be aware of. IsWindowVisible will return the true visibility state of the window, but that includes the visibility of all parent windows as well.
If you need to check the WS_VISIBLE flag for a specific window you can do GetWindowLong(hWnd, GWL_STYLE) and test for WS_VISIBLE."