vc 自定义dialog可拉伸区域

来源:互联网 发布:网络扫描仪 使用方法 编辑:程序博客网 时间:2024/05/19 20:00

UINT CMoveTestDlg::OnNcHitTest(CPoint point)

{

// TODO: Add your message handler code here and/or call default

CRect rc; CRect test; GetClientRect(&rc);

test.left = rc.Width() - 5;

test.right = rc.right;

test.top = rc.Height() - 5;

test.bottom = rc.bottom;

ClientToScreen(&test);

ClientToScreen(&rc);

if(test.PtInRect(point))

{

return HTBOTTOMRIGHT;

} else

{

return rc.PtInRect(point) ? HTCAPTION : CDialog::OnNcHitTest(point);

}

return CDialog::OnNcHitTest(point);

}

原创粉丝点击