Advertisement

window size?

Started by July 29, 2000 05:35 AM
7 comments, last by Quantum 24 years, 4 months ago
how do i change the size of a win32 window? i want to stop the user from resizing the window.. thx
come on someone, help me plz
Advertisement
There''s a flag that removes the Maximize and Minimize buttons...can''t tell you more...

Metus

Ethereal
Or you could put in an onresize event handler... and try and figure something out that you could put in there... maybe resize the window yourself..

Nick - Head Designer, Llamasoft.net

--
Visit our website...

Llamasoft.net
Games, goodies and ingenuity
Nick - Head Designer, Llamasoft.net--Visit our website...Llamasoft.netGames, goodies and ingenuity
i already caught WM_SIZE in the event handler, and was wondering if anyone KNEW how to resize the window myself... sigh... thx anyways

i would look in the MSDN but i had to format and the MSDN cd is with a friend atm..oh well
easy one!
it goes like this:

SendMessage( hWnd, WM_SIZE, SIZE_RESTORED, ( LPARAM )( Width, Height ) );

But since you capture the WM_SIZE Messages, maybe this won''t work. Then you should somehow find a way to do it.
btw, am I right that you want to prevent the user from resizing the window with the mouse? If so, you should create the window with WS_OVERLAPPED style. Then the mouse cursor doesn''t change to ''resize'' style when over the window''s border.
When you applied these changes, you should stop capturing the WM_SIZE message, because you don''t need to anymore, and on the other hand, preventing Messages from being sent to the standard message handler can sometimes cause, let''s say, unwanted results. Only do so if you really know what you''re doing!

Hope this helps

pi~
Jan PieczkowskiBrainwave Studios
Advertisement
stupid me... the answer was simple all along.
i simply changed the window flags to
WS_OVERLAPPED|WS_VISIBLE|WS_SYSMENU|WS_MINIMIZEBOX|WS_MAXIMIZEBOX

and all was fine...
u can prevent user from changing window size manualy like that:


SIZE size;
size.cx = your window width;
size.cy = your window height;

case WM_SIZE:
{
SetWindowPos(hwnd,NULL,NULL,NULL,size.cx,size.cy,SWP_NOMOVE | SWP_NOZORDER);
}break;

while the SWP_NOMOVE flag tells the function to ignore the x and y values and the SWP_NOZORDER tells the function to ignore the second parameter.

and hwnd is your window handle.


hopes its help


------------------------------- Goblineye Entertainment------------------------------

Xeno: thats what i originally wanted to know, but i found a better way of doing it anyway
oh well, thx anyway, ill prolly use that one day....

This topic is closed to new replies.

Advertisement