Jump to content
  • Advertisement
Sign in to follow this  
Aprosenf

Child window styles

This topic is 5455 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

I'm trying to create a program which has a main window with a bunch of child windows. For the main window, I'm using the WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_VISIBLE styles, and for each of the child windows, I'm using the WS_OVERLAPPEDWINDOW | WS_CHILD | WS_CLIPSIBLINGS | WS_HSCROLL | WS_VSCROLL | WS_VISIBLE styles. However, when the child windows are created, they are never in focus (i.e. have a gray title bar), but I can move them around and resize them. However, if I click to move or resize a child window that is behind another child window, it gets moved or resized as I hold the mouse down, but it stays behind the other child until I release the mouse. What window styles should I be using, and do I need to do anything special in the child window procedure to get normal child behavior? I.e. I want the foremost child to be in focus (have non-grayed title bar), and a child window should come immediately into focus when clicked instead of when the mouse is released.

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Since you're describing a UI that uses child windows that have all of the normal aspects of a desktop-level window (titlebar, resizable, active/inactive, etc.) it sounds like what you want is an MDI-based app.

If so, what you probably want to do is to create an additional MDICLIENT classed window that sits between your desktop-level (frame) window and your child windows. The child windows would then be created via CreateMDIWindow calls or via CreateWindowEx calls using the WS_EX_MDICHILD extended style. And the MDICLIENT window would handle all of its children's windowing re: activation/deactivation, minimizing, maximizing, etc.

IIRC, there's a nice writeup on MDI-based UIs in the MSDN docs.

Share this post


Link to post
Share on other sites
Yes, I want to do an MDI-type program, but I don't want to deal with all of that nasty interfacing with MDI. I just want to create a bunch of child windows that know how to behave properly, and I'll handle all of the rest of the functionality myself.

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!