3

How can I do it? It's an external window, not from my program. Thanks

2 Answers 2

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.

Sign up to request clarification or add additional context in comments.

Comments

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().

1 Comment

duh, im so dumb. I actually had the impression that function would exist but never cared to look for it. Thanks!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.