-
March 13th, 2009, 05:07 PM
#1
How do I determine if a window is hidden?
I can't seen to find the right search terms to find the answer to this problem if it has been answered already.
Given a CWnd (or HWND), how do I determine if that window is hidden (as in SW_HIDE) or not?
-
March 13th, 2009, 05:11 PM
#2
Re: How do I determine if a window is hidden?
By the way, this is what I've tried so far, and it does not work because showCmd is SW_SHOWNORMAL when the window is hidden.
Code:
WINDOWPLACEMENT WindowPlacement;
WindowPlacement.length = sizeof(WindowPlacement);
MyWindow.GetWindowPlacement(&WindowPlacement);
bool IsWindowHidden = (WindowPlacement.showCmd == SW_HIDE);
-
March 13th, 2009, 05:15 PM
#3
Re: How do I determine if a window is hidden?
Did you try CWnd::IsWindowVisible?
Victor Nijegorodov
-
March 13th, 2009, 05:28 PM
#4
Re: How do I determine if a window is hidden?
CWnd::IsWindowVisible is exactly what I needed. I'm sorry for missing the obvious answer. I was too focused on finding if a window was hidden. Thank you.
-
August 21st, 2012, 10:54 PM
#5
Re: How do I determine if a window is hidden?
IsWindowVisible will return false, if is has been SW_SHOWn but its parent is hidden
to find out whether the window itself would be visible if its parent was visible would be
(::GetWindowLong(hWnd, GWL_STYLE) & WS_VISIBLE) == WS_VISIBLE;
-
August 22nd, 2012, 02:49 AM
#6
Re: How do I determine if a window is hidden?
Originally Posted by dmjalund
IsWindowVisible will return false, if is has been SW_SHOWn but its parent is hidden
to find out whether the window itself would be visible if its parent was visible would be
(::GetWindowLong(hWnd, GWL_STYLE) & WS_VISIBLE) == WS_VISIBLE;
Didn't you read the OP?
Originally Posted by Monolith
Given a CWnd (or HWND), how do I determine if that window is hidden (as in SW_HIDE) or not?
So, Monolith didn't ask whether the WS_VISIBLE style is currently set or not but whether window is visible or not (hidden)!
Thus as OP already confirmed more than three years ago (!):
Originally Posted by Monolith
CWnd::IsWindowVisible is exactly what I needed!
Victor Nijegorodov
-
August 26th, 2012, 03:58 AM
#7
Re: How do I determine if a window is hidden?
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|