禁止标题栏的双击事件

重载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);  
  }

 

posted on 2011-01-31 15:30  carekee  阅读(1481)  评论(0编辑  收藏  举报