CHtmlView屏蔽右键菜单、禁止显示I型指针以及禁止选择

 BOOL CRightView::PreTranslateMessage(MSG* pMsg)
{
 // TODO: 在此添加专用代码和/或调用基类
 int nVirtKey;

 //屏蔽右键菜单
 if ((pMsg->message == WM_RBUTTONDOWN) ||
  (pMsg->message == WM_RBUTTONDBLCLK))
  return TRUE;

 //禁止招标标显示I型指针
 HCURSOR curIbeam = LoadCursor( NULL, IDC_IBEAM );
 if ( GetCursor() == curIbeam )
 {
  HCURSOR curArrow = LoadCursor( NULL, IDC_ARROW );
  SetCursor( curArrow );
 }

 //禁止选择
 if ( pMsg->message == WM_MOUSEMOVE )
 {
  nVirtKey = GetKeyState( VK_LBUTTON );
  if ( nVirtKey & 0x8000 )
  {
   return TRUE;
  }
 }
 
 return CHtmlView::PreTranslateMessage(pMsg);
}

你可能感兴趣的:(null)