
转载:http://blog.sina.com.cn/s/blog_4ad042e50102dwv0.html
重载DefWindowProc,在里面截获WM_NCLBUTTONDBLCLK消息进行处理:
LRESULT CDlg::DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
// TODO: Add your specialized code here and/or call the base class
if( message == WM_NCLBUTTONDBLCLK && (INT)wParam == HTCAPTION )
{
return 0;
}
return CDialog::DefWindowProc(message, wParam, lParam);
}
>>>>>>>>>
重载DefWindowProc()函数,过滤WM_NCLBUTTONDBLCLK在HTCAPTION区的响应即可:
LRESULT CMain::DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
// TODO: Add your specialized code here and/or call the base class
switch(message)
{
case WM_NCLBUTTONDBLCLK:
if(HTCAPTION==wParam)
{
return 0;
}
}
return CWnd::DefWindowProc(message, wParam, lParam);
}
{
// TODO: Add your specialized code here and/or call the base class
switch(message)
{
case WM_NCLBUTTONDBLCLK:
if(HTCAPTION==wParam)
{
return 0;
}
}
return CWnd::DefWindowProc(message, wParam, lParam);
}