Click to See Complete Forum and Search --> : HowTo limit the minimal size of window during the usage of a program???


September 22nd, 1999, 05:25 AM
Hi, friends,
i have a problem about the size of framewindow.

My program shows several images with the same size .They are lined regularly . Now when the user resizes the framewindow, namely reduces the width, there should be at least one image to be showed im view area.

I have inserted following codes in CMyView::OnSize().


CRect rect;
GetClientRect(&rect);

if (rect.right <= IMAGEWIDTH)
//IMAGEWIDTH is a macro for the width of the image
{
//SetWindowPos(NULL,0,0,IMAGEWIDTH,rect.bottom,SWP_NOMOVE);
MoveWindow(0,0,IMAGEWIDTH,rect.bottom,TRUE);
return;
}





Now the client area is correctly configured. When the size of the window is per mouse reduced, there is at least one image to be shown in the window.

But the minimal size of the framewindow is lesser than the size of client area. A part of the image is not showed.

How can i limit the minimal size of window during the usage , not at the beginning of the program??

Thanx, ur Softchen

AZur
September 22nd, 1999, 05:30 AM
handle WM_GETMINMAXINFO