MFC 对话框 OnNcHitTest 消息拖动无标题窗口大小 经典
我在MFC 对话框OnNcHitTest 消息中
LRESULT CdragtestDlg::OnNcHitTest(CPoint point)
{
CRect rc;
GetClientRect(&rc);
CRect rc_bottom_right;
rc_bottom_right.left =rc.Width()-5;
rc_bottom_right.right = rc.right;
rc_bottom_right.top = rc.Height() -5;
rc_bottom_right.bottom = rc.bottom;
ClientToScreen(&rc_bottom_right);
//如果在右下角就可以拖动窗口大小
if( rc_bottom_right .PtInRect( point ) )
{
return HTBOTTOMRIGHT;
}
else
{
return HTCLIENT;
}
}
其中 窗口 style = pop border = none;
在delphi 和C++ builder中都是可以的
但是事实上不能改变窗口大小
请高人指教 谢谢
1