重载WM_NCHITTEST,然后将OnNcHitTest里内容修改为:
UINT nHitTest = CDialog::OnNcHitTest(point);
if ((nHitTest == HTCLIENT) && (::GetAsyncKeyState (MK_LBUTTON) < 0))
nHitTest = HTCAPTION;
return nHitTest。
方法二:
重载WM_LBUTTONDOWN,在OnLButtonDown中添加:
PostMessage(WM_NCLBUTTONDOWN,HTCAPTION,MAKELPARAM(pointx, pointy))。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)