MDI Children

Started by
2 comments, last by Pharazon 19 years, 8 months ago
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
Advertisement
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.
We are the music makers and we are the dreamers of the dreams. - WonkaAsking Smart Questions | BookPool
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).

Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>

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

This topic is closed to new replies.

Advertisement