Sign in to follow this  
Pharazon

MDI Children

Recommended Posts

Oka. C++ is my language.. I've made an MDI, but on the children I do not want to have the Maximize box. Now I am having troubles with this. And I've found out a couple others have aswell. Now I did solve the problem, but it created another one. See I used the SetWindowLong api to change the Window style, I can do it that way and I can disable the maximize box, but then I get refresh problems on the forms with a lower ZOrder than one on top. It'll leave prints or trails of the form on top if you move the one on the bottom. Now I'm just curious if someone has figured out how to solve this. I use the CreateMDIWindow() function to create the MDI children. At first I used the MDICREATESTRUCT or what ever it was, but I found it easier to do it with the Create...() I try to specify the window style in the Create...() but even then, I can't get it without the Max box. Any help would be greatly appreciated. Thanks in advance. Phar

Share this post


Link to post
Share on other sites
Doing a bit of reading on MSDN, I've found that when calling CreateMDIWindow, if the MDI client window is created with the MDIS_ALLCHILDstyleS window style, then the dwstyle parameter of CreateMDIWindow can be any combination of the window styles used in the standard CreateWindow function (which would allow you to create the window without a maximize button).

When you tried to use SetWindowLong, how were you removing the maximize box style? It sounds like you were removing other styles in addition to the one that you intended to.

Share this post


Link to post
Share on other sites
After changing the style with SetWindowLong try using a SetWindowPos with SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED

This will redraw the nc area (as well as the caption with the buttons on top).

Share this post


Link to post
Share on other sites
Well I was removing just by stating these styles in the SetWindowLong:

WS_CHILD | WS_VISIBLE | WS_BORDER | WS_SYSMENU | WS_CAPTION

And that would be it..

EDIT::

Problem solved.. I used the MDIS_ALLCHILDstyleS, and it fixed my problem.. Thanks mate.

-Wish

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this