方法一:
添加 WM_LBUTTONDOWN 的消息映射
void CTest6Dlg::OnLButtonDown(UINT nFlags, CPoint point)
{
PostMessage(WM_NCLBUTTONDOWN, HTCAPTION, 0);
CDialog::OnLButtonDown(nFlags, point);
}
方法二:
添加 WM_NCHITTEST 的消息映射
注意:在classwizard->message中找不到WM_NCHITTEST的,需要在选项卡class info->message filter中选择window后该消息才会出现在message中。
void CTest6Dlg::OnNCHitTest(CPoint point)
{
return HTCAPTION;
// return CDialog::OnNCHitTest(point);
}
添加 WM_LBUTTONDOWN 的消息映射
void CTest6Dlg::OnLButtonDown(UINT nFlags, CPoint point)
{
PostMessage(WM_NCLBUTTONDOWN, HTCAPTION, 0);
CDialog::OnLButtonDown(nFlags, point);
}
方法二:
添加 WM_NCHITTEST 的消息映射
注意:在classwizard->message中找不到WM_NCHITTEST的,需要在选项卡class info->message filter中选择window后该消息才会出现在message中。
void CTest6Dlg::OnNCHitTest(CPoint point)
{
return HTCAPTION;
// return CDialog::OnNCHitTest(point);
}