如何做一个窗口能够用鼠标拖放其大小,但到达某个大小时就不能用鼠标拖放其大小
解决方案 »
- 求 新编WIN32API参考大全.CHM 完整版!!!
- 已经知道bitmapinfo如何得到Cbitmap
- 有这类的源码么?万分感谢~!
- 想学习一下skinmagic的源代码
- 如何在文本框中光标所在的位置添加数据和将鼠标选中的部分字符用另外的字符替换掉?
- 发送消息,接受消息??
- 哪有中文MSDN下载?先谢谢
- 关于MFC的深层问题,向高手请教!!!十万火急!!!立刻给分!!!
- 如何用CComQIPtr来更改WebBrowse中的Radio的check与否?==>
- 谁能说出现在还有什么技术方向是以后将要流行的,比如P2P之类的,并最好阐述原因,有道理即给分
- =============Msdn 2002如何关联到VC6.0上=========
- 这样该如何实现? 有关socket,代理服务器
http://www.vckbase.com/bbs/prime/viewprime.asp?id=289
http://www.vckbase.com/bbs/prime/viewprime.asp?id=376
http://www.codeproject.com/dialog/easysize.asp
void CxxxWnd::OnSizing(UINT fwSide, LPRECT pRect)
{
int minWidth = 300;
int minHeight = 250;
switch(fwSide)
{
case WMSZ_BOTTOM:
{
if(pRect->bottom - pRect->top < minHeight)
{
pRect->bottom = pRect->top + minHeight;
}
}
break;
case WMSZ_BOTTOMLEFT:
{
if(pRect->bottom - pRect->top < minHeight)
{
pRect->bottom = pRect->top + minHeight;
} if(pRect->right - pRect->left < minWidth)
{
pRect->left = pRect->right - minWidth;
}
}
break;
case WMSZ_BOTTOMRIGHT:
{
if(pRect->bottom - pRect->top < minHeight)
{
pRect->bottom = pRect->top + minHeight;
} if(pRect->right - pRect->left < minWidth)
{
pRect->right = pRect->left + minWidth;
}
}
break; case WMSZ_TOP:
{
if(pRect->bottom - pRect->top < minHeight)
{
pRect->top = pRect->bottom - minHeight;
}
}
break;
case WMSZ_TOPLEFT:
{
if(pRect->bottom - pRect->top < minHeight)
{
pRect->top = pRect->bottom - minHeight;
} if(pRect->right - pRect->left < minWidth)
{
pRect->left = pRect->right - minWidth;
}
}
break;
case WMSZ_TOPRIGHT:
{
if(pRect->bottom - pRect->top < minHeight)
{
pRect->top = pRect->bottom - minHeight;
} if(pRect->right - pRect->left < minWidth)
{
pRect->right = pRect->left + minWidth;
}
}
break; case WMSZ_LEFT:
{
if(pRect->right - pRect->left < minWidth)
{
pRect->left = pRect->right - minWidth;
}
}
break;
case WMSZ_RIGHT:
{
if(pRect->right - pRect->left < minWidth)
{
pRect->right = pRect->left + minWidth;
}
}
break;
default:
break;
} CxxxParent::OnSizing(fwSide, pRect);
// TODO: Add your message handler code here
}
The framework calls this member function whenever Windows needs to know the maximized position or dimensions, or the minimum or maximum tracking size.afx_msg void OnGetMinMaxInfo(
MINMAXINFO* lpMMI
);
Parameters
lpMMI
Points to a MINMAXINFO structure that contains information about a window's maximized size and position and its minimum and maximum tracking size. For more about this structure, see the MINMAXINFO structure.
Res
The maximized size is the size of the window when its borders are fully extended. The maximum tracking size of the window is the largest window size that can be achieved by using the borders to size the window. The minimum tracking size of the window is the smallest window size that can be achieved by using the borders to size the window. Windows fills in an array of points specifying default values for the various positions and dimensions. The application may change these values in OnGetMinMaxInfo.Note This member function is called by the framework to allow your application to handle a Windows message. The parameters passed to your function reflect the parameters received by the framework when the message was received. If you call the base-class implementation of this function, that implementation will use the parameters originally passed with the message and not the parameters you supply to the function.