Click to See Complete Forum and Search --> : Resizible Window?


JohnIdol
November 20th, 2007, 05:40 AM
Hi All,

I am looking at the possible styles of the WNDCLASS/EX and there's nothing to make the window not resizable (and to grey out the maximize icon).

Any hint?

Thanks!

JI

henky@nok.co.id
November 20th, 2007, 05:52 AM
Try to add following code in PreCreateWindow(CREATESTRUCT & cs).

cs.style &= ~WS_MAXIMIZEBOX;

JohnIdol
November 20th, 2007, 05:58 AM
thanks but I am not using MFCs, so I don't have any PreCreateWindow.

I guess it would be the same if I added that code when populating the WNDCLASS structure manually.

JohnIdol
November 20th, 2007, 06:03 AM
Nope, it doesn't work (it crashes quite bad into the debugger).

I partially solved setting the DWORD style to WS_DLGFRAME when creating the window, but that wasn't exactly what I wanted.

Any help woul dbe appreciated.

Regards,

JI

Marc G
November 20th, 2007, 10:24 AM
Try the WS_EX_DLGMODALFRAME style and remove the WS_SIZEBOX style.

JohnIdol
November 20th, 2007, 10:50 AM
Thanks, but it seems to achieve the same result of WS_DLGFRAME (I don't have any WS_SIZEBOX set).

I could live with this, but what if I need the minimize icon but I don't want the maximize one?

This should be straightforward enough (just a property in the .NET frameworks), but I guess it's not at this point!

Thanks!

JI

Martin O
November 20th, 2007, 01:10 PM
It has to do with the WS_THICKFRAME style. If your window uses that style, it will be sizable. If it doesn't it wont. This probably should have shown up in a search of this forum:

http://www.codeguru.com/forum/showthread.php?t=432936

Marc G
November 21st, 2007, 04:31 AM
Try the combination of the following styles: WS_DLGFRAME | WS_MINIMIZEBOX | WS_SYSMENU
This should give a non resizable border, with a minimize box.

JohnIdol
November 21st, 2007, 12:12 PM
Martin O:
Thanks for the hint.

Marc:
it works like charme!

Thank you :)