Click to See Complete Forum and Search --> : Resize issue -


.pcbrainbuster
November 18th, 2007, 12:12 PM
Sup guys,

How could you code a program to stop the user from resizing it if it goes below a certain value?

Thanks.

JohnCz
November 18th, 2007, 05:37 PM
Handle WM_GETMINMAXINFO message. Lookup MSDN for message parameters you will have to modify.

.pcbrainbuster
November 19th, 2007, 01:10 PM
I find out that I need to edit a MINMAXINFO structure and did but it did not work :( Can I please have an example in which the window's height and width doesn't go under 500?

Thanks.

JohnCz
November 19th, 2007, 01:57 PM
What did you edit end what did not work?
Post relevant code.

.pcbrainbuster
November 19th, 2007, 03:36 PM
I just don't know how to send the structure, SendMessage, initialization or some other form of whatever. :( That's why I am asking for a example.

Thanks.

Marc G
November 20th, 2007, 05:39 AM
In your WindowProc add something like:

case WM_GETMINMAXINFO:
{
MINMAXINFO* pMinMaxInfo = reinterpret_cast<MINMAXINFO*>(lParam);
pMinMaxInfo->ptMinTrackSize.x = 300; // min width
pMinMaxInfo->ptMinTrackSize.y = 200; // min height
}
return 0;