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

方法一:

#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);

}


方法二:

BOOL CMainFrame::PreTranslateMessage(MSG* pMsg) 
{
if(pMsg->message == WM_NCLBUTTONDBLCLK)
{
return TRUE;
}

return CFrameWnd::PreTranslateMessage(pMsg);

}

BOOL CTestlDlg::PreTranslateMessage(MSG* pMsg) 
{
if(pMsg->message == WM_NCLBUTTONDBLCLK)
{
return TRUE;
}
return CDialog::PreTranslateMessage(pMsg);
}

你可能感兴趣的:(VC如何禁止双击标题栏 - WM_NCLBUTTONDBLCLK消息)