Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dialog resizing

Status
Not open for further replies.

newbiepg

Programmer
Joined
Nov 6, 2002
Messages
181
Location
IN
We had created a dialog box that could be resized
now i have to put a check.
If the user tries to reduce the height or width below a
certain size, the dialog should not resize,
like the color palette in adobe pagemaker.
I had created a function that would resize the box back
to the minimum sizes if the user resized it too small
but it creates a flicker that we cant use

Any ideas?
 
remove WS_THICKFRAME from the dialog's window style.

Ion Filipski
1c.bmp

ICQ: 95034075
AIM: IonFilipski
filipski@excite.com
 
Or; if you want it to be sizable:

Handle the WM_SIZING event rather then the WM_SIZE event and prevent from being smaller than minimum by adjusting the RECT parameter (lParam). This should prevent the flickering.....

Greetings,
Rick
 
guys thanks
I found a solution using DefWindowProc

this was the solution

LRESULT Classname:: DefWindowProc(UINT message, WPARAMwParam, LPARAM lParam)
{
if(message == WM_getminmaxinfo)
{
MINMAXINFO* minMa = (MINMAXINFO*)lParam;
POINT pt;
pt.x = 100;//some min size for width
pt.y = 100;
minMa->ptMinTrackSize = pt;
}
return CDialog : DefWindowProc(message, wParam,lParam);
}
 
You can also do the samething by intercepting the WM_GETMINMAXINFO message and implementing an over-riding function. An example is given below:


void CMainFrame::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI)
{
// TODO: Add your message handler code here and/or call default
lpMMI->ptMinTrackSize.x = 1000;
lpMMI->ptMinTrackSize.y = 800;
CFrameWnd::OnGetMinMaxInfo(lpMMI);
}

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top