16,472
社区成员
发帖
与我相关
我的任务
分享
void CxxxxxDlg::OnMoving(UINT fwSide, LPRECT pRect)
{
CDialog::OnMoving(fwSide, pRect);
// TODO: Add your message handler code here
#if 1
#define MOSTLEFT 100
#define MOSTTOP 100
#define MOSTRIGHT 1050
#define MOSTBOTTOM 750
CRect rect;
GetWindowRect(&rect);
afxDump << *pRect << "\n";
if(pRect->left <=MOSTLEFT)
{
pRect->left=MOSTLEFT;
pRect->right=MOSTLEFT+rect.Width();
}
if(pRect->right >=MOSTRIGHT)
{
pRect->right=MOSTRIGHT;
pRect->left=MOSTRIGHT-rect.Width();
}
if(pRect->top <=MOSTTOP)
{
pRect->top=MOSTTOP;
pRect->bottom=MOSTTOP+rect.Height();
}
if(pRect->bottom >=MOSTBOTTOM)
{
pRect->bottom=MOSTBOTTOM;
pRect->top=MOSTBOTTOM-rect.Height();
}
#endif
}