|
-
August 17th, 2011, 09:54 PM
#1
Getting the handle of the top most window
How can I get the topmost window handle.
i have set the window position as follows:
pWnd->SetWindowPos(&wndTopMost , 0,0, 0, 0, SWP_NOSIZE);
I need to check if pWnd is topmost many times in the program. If it is not on top, I will set the window position as above.
How can I check that?
Thanks in advance.
-
August 18th, 2011, 03:53 AM
#2
Re: Getting the handle of the top most window
A topmost window has WS_EX_TOPMOST extended style set.
Code:
DWORD dwExStyle = pWnd->GetExStyle();
if(WS_EX_TOPMOST & dwExStyle)
{
// topmost window
// ...
}
Note: you may want to add SWP_NOMOVE flag in SetWindowPos, as well.
-
August 18th, 2011, 11:41 AM
#3
Re: Getting the handle of the top most window
 Originally Posted by zuhrs
I need to check if pWnd is topmost many times in the program. If it is not on top, I will set the window position as above.
Don't do it! It is VERY annoying!
Vlad - MS MVP [2007 - 2012] - www.FeinSoftware.com
Convenience and productivity tools for Microsoft Visual Studio:
FeinWindows - replacement windows manager for Visual Studio, and more...
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
|