Jump to content
  • Advertisement
Sign in to follow this  
Kincaid

mdi child window always on top, how ???

This topic is 3666 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, i have an mdi application, so a main window, mdi area, and x mdi client windows. I want each of these children to have a button 'always on top'. i have searched this extensively on google and keep finding two 'solutions' 1: use SetWindowPos with HWND_TOPMOST / HWND_NOTOPMOST which, simply, doens't work for as far as i can tell... 2: make the window not an mdi child, using setParent; which, sounds ok (but a little overkill), however its not as simple as simply calling SetParent. The callbacks return e.g. DefaulMDIChildProc, and it uses MDI messages, so, as I understand it, it would (also) mean switching, and maintaining two callbacks, one for each of the states of the window. (if this is the way, how can you, most simply, switch the state of an window between mdi-child and toolwindow, without loss of functionality) to be clear, Im AM able to force a window on top of the others (modal) (SetFocus or something) BUT, this also makes it the active window and captures it etc. What I want is, for every mdi child, to have the option to ALWAYS stay on top, BUT being passive (but funcions normally, and activates when the user clicks on it etc). ALSO when antoher mdichild is MAXIMIZED, I would still like another one (smaller) to be visible on top. anyone any ideas ??? (to paint the picture, its an editor with x viewports (determined by howmany the user openend). I would like to have e.g. one viewport maximized, while another (smaller) one keeps visible, depicting e.g. a top view of the scene. Of course i would like to keep working in the maximized window (maintaining capture there) and also have to option to operate on the smaller viewport (getting capture there(as normal)). the moment i click 'always on top' off, the smaller viewport should function as normally as hide when other are focused/maximized. thanx in advance

Share this post


Link to post
Share on other sites
Advertisement
The simple solution is not not make these windows MDI childs but rather normal windows. Then you can use HWND_TOPMOST. I dont believe topmost MDI children are supported.

Share this post


Link to post
Share on other sites
i dont want to be negative or anything, but it seems youre missing the question....
HWND_TOPMOST simply doesn't suffice the goals im aiming for (as I see it, otherwise explain why, and how, it does)

Making it a none mdi client, comes with its own problems, and its there that I ask the questions. I am aware of the general approach employed in this tactic, im looking for details.


Share this post


Link to post
Share on other sites
Having one MDI child visible over all others, even one which is maximized, is not possible. Therefore the window which you want to be visible over all MDI children cannot be an MDI child.

I'm sorry, when I said HWND_TOPMOST I mean to say WS_EX_TOPMOST. WS_EX_TOPMOST works just fine for normal windows - it does not have an effect on MDI children, however, since MDI children are not top-level windows. If you want a window to show over all others you should make it a normal (ie. top-level) window and give it the WS_EX_TOPMOST flag

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!