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);
}
本文介绍了一个窗口操作处理函数OnNcHitTest的具体实现细节,该函数用于确定鼠标点击位置相对于窗口的位置,以便进行拖动等交互操作。通过设置特定区域的响应方式来实现窗口右下角的调整功能。

5410

被折叠的 条评论
为什么被折叠?



