How can I do it? It's an external window, not from my program. Thanks
Asked
Active
Viewed 8,812 times
2 Answers
13
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.
... It sounds like you don't need to do this for your case, but adding this for future reference in case others run across this question.

user229044
- 232,980
- 40
- 330
- 338
11
Do you have an HWND
to the window? If not, then you will need to obtain the window handle somehow, for example through FindWindow()
(or FindWindowEx()
).
Once you have the HWND
to the window, call IsWindowVisible()
.

Greg Hewgill
- 951,095
- 183
- 1,149
- 1,285
-
1duh, im so dumb. I actually had the impression that function would exist but never cared to look for it. Thanks! – devoured elysium Jun 30 '09 at 00:45