I've been having some trouble trying to limit the size of my window. I want it so that the user cannot make the window smaller than 400x500. When responding to WM_SIZING messages, my results are less than satisfactory. It seems that the WM_SIZING message is only sent every 55ms, so my limits aren't always enforced at 400x500. Thanks
Posted on 2000-11-22 21:49:00 by martin
Here's a working example from a program I'm currently writing. I'm not sure if WM_MOVING needs to be there, but I've just always written it that way, and copy+paste saves so much time. :) .elseif uMsg==WM_SIZING || uMsg==WM_MOVING mov edi,lParam assume edi:PTR RECT ; lParam = lpRect mov eax,.left mov ebx,.right sub ebx,eax ; Calculate window width .if ebx<360 mov .left,eax ; Probably unneccesary add eax,360 mov .right,eax .endif mov eax,.top mov ebx,.bottom sub ebx,eax .if ebx<307 mov .top,eax ; Probably unneccessary add eax,307 mov .bottom,eax .endif assume edi:NOTHING Since this code comes directly from a working program, I can vouch from here to the end of the earth that it will work! You may have to change the values around a bit, and tweak it a little to make it more optmized, but at least it's a start. Hope this helps!
Posted on 2000-11-23 02:04:00 by Racso
Apparently, this is the right way to do this. .ELSEIF uMsg==WM_GETMINMAXINFO mov edx,lParam lea edx,(MINMAXINFO PTR ).ptMinTrackSize mov (POINT PTR ).x,MAXWINDOWWIDTH mov (POINT PTR ).y,MAXWINDOWHEIGHT
Posted on 2000-11-23 11:58:00 by martin