|
-
Aug 19th, 2005, 01:31 AM
#1
[RESOLVED] How do I find out if a window is Always On Top?
SetWindowPos is used to actually set it as always on top. I want to know if it already is. I'm thinking I need to check its z-order or something, but I don't know how.
-
Aug 19th, 2005, 01:48 AM
#2
Frenzied Member
Re: How do I find out if a window is Always On Top?
WindowStyle if I'm correct.. GetForegroundWindow and check the hwnd for style properties.
-
Aug 19th, 2005, 01:53 AM
#3
Re: How do I find out if a window is Always On Top?
Thanks. I should have thought of that. You still need to use SetWindowPos to actually make it on top (SetWindowLong doesn't work) but you can get/set a flag saying whether it is always on top.
In case anyone's wondering it is 0x8h.
-
Aug 19th, 2005, 01:55 AM
#4
Frenzied Member
Re: [RESOLVED] How do I find out if a window is Always On Top?
There is one slight bug in it though; Modal windows of Foreground apps might be seen as the most-top window. so make sure you pick the parent if you have modals
-
Aug 19th, 2005, 01:59 AM
#5
Re: [RESOLVED] How do I find out if a window is Always On Top?
That's strange, I notice (with Spy++) that a topmost window has 0x8h set for both GWL_STYLE and GWL_EXSTYLE (where it is WS_EX_TOPMOST). Weird.
How can I check if it is modal (as opposed to topmost only)?
-
Aug 19th, 2005, 02:03 AM
#6
Frenzied Member
Re: [RESOLVED] How do I find out if a window is Always On Top?
Ehe, now that's a good one.. So far the only thing I could get working with a 80% probability is to check the parent and check the parent if it also has TOPMOST. If so, you got a modal window on top of a TOP_MOST window.
-
Aug 19th, 2005, 02:07 AM
#7
Re: [RESOLVED] How do I find out if a window is Always On Top?
I made two forms, set one as topmost and then launched the other one as modal, and it came out behind the topmost one
-
Aug 19th, 2005, 02:10 AM
#8
Frenzied Member
Re: [RESOLVED] How do I find out if a window is Always On Top?
Lol, I had that problem soo many times 
You'll have to set the TOP_MOST for the Modal window too in the on_load.
-
Aug 19th, 2005, 02:12 AM
#9
Re: [RESOLVED] How do I find out if a window is Always On Top?
That's what I though. Therefore, following that logic, shouldn't checking if WS_EX_TOPMOST is set always return a correct result?
-
Aug 19th, 2005, 02:15 AM
#10
Frenzied Member
Re: [RESOLVED] How do I find out if a window is Always On Top?
Not 100% sure if it always returns the correct value. I always check both properties just to be really sure
-
Aug 19th, 2005, 02:17 AM
#11
Re: [RESOLVED] How do I find out if a window is Always On Top?
All I have is the window handle. I'm creating a window class for easy access to VB form-style properties for any window
-
Aug 19th, 2005, 02:29 AM
#12
Frenzied Member
Re: [RESOLVED] How do I find out if a window is Always On Top?
The window handle is the key to a lot of stuff, just check if it has children or parents that remain within the ThunderMain
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
|