VC如何禁止双击标题栏 - WM_NCLBUTTONDBLCLK消息

重载DefWindowProc()函数,过滤WM_NCLBUTTONDBLCLK在HTCAPTION区的响应即可:

#define   WM_NCLBUTTONDBLCLK   0x00A3
LRESULT CMainFrame::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 CFrameWnd::DefWindowProc(message, wParam, lParam);
}

你可能感兴趣的:(button)