mfc嵌入CEF浏览器后,如何禁用鼠标右键?

蓝之羽520 2018-03-27 04:07:41
mfc工程嵌入cef3浏览器,成功加载H5网页,但我想在mfc上实现禁用右键,而不是H5网页里面禁用右键,该如何实现啊?
...全文
1326 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
蓝之羽520 2018-03-28
  • 打赏
  • 举报
回复
引用 1 楼 zgl7903 的回复:

BOOL CSDI6App::PreTranslateMessage(MSG* pMsg) 
{
  // TODO: Add your specialized code here and/or call the base class
  
  switch(pMsg->message)
  {
  case(WM_RBUTTONDOWN):
  case(WM_RBUTTONUP):
  case(WM_RBUTTONDBLCLK):
    {
      return TRUE;
    }
  }
  
  return CWinApp::PreTranslateMessage(pMsg);
}

我试过这个,没有起到效果,不知道是不是客户区被网页占据的原因
蓝之羽520 2018-03-28
  • 打赏
  • 举报
回复
引用 3 楼 oyljerry 的回复:
[quote=引用 2 楼 u014385680 的回复:] [quote=引用 1 楼 zgl7903 的回复:]

BOOL CSDI6App::PreTranslateMessage(MSG* pMsg) 
{
  // TODO: Add your specialized code here and/or call the base class
  
  switch(pMsg->message)
  {
  case(WM_RBUTTONDOWN):
  case(WM_RBUTTONUP):
  case(WM_RBUTTONDBLCLK):
    {
      return TRUE;
    }
  }
  
  return CWinApp::PreTranslateMessage(pMsg);
}

我试过这个,没有起到效果,不知道是不是客户区被网页占据的原因[/quote] 点到网页中去了,右键就需要脚本拦截[/quote] 就是只能在H5网页里面设置禁用右键了吗?
oyljerry 2018-03-28
  • 打赏
  • 举报
回复
引用 2 楼 u014385680 的回复:
[quote=引用 1 楼 zgl7903 的回复:]

BOOL CSDI6App::PreTranslateMessage(MSG* pMsg) 
{
  // TODO: Add your specialized code here and/or call the base class
  
  switch(pMsg->message)
  {
  case(WM_RBUTTONDOWN):
  case(WM_RBUTTONUP):
  case(WM_RBUTTONDBLCLK):
    {
      return TRUE;
    }
  }
  
  return CWinApp::PreTranslateMessage(pMsg);
}

我试过这个,没有起到效果,不知道是不是客户区被网页占据的原因[/quote] 点到网页中去了,右键就需要脚本拦截
zgl7903 2018-03-27
  • 打赏
  • 举报
回复

BOOL CSDI6App::PreTranslateMessage(MSG* pMsg) 
{
  // TODO: Add your specialized code here and/or call the base class
  
  switch(pMsg->message)
  {
  case(WM_RBUTTONDOWN):
  case(WM_RBUTTONUP):
  case(WM_RBUTTONDBLCLK):
    {
      return TRUE;
    }
  }
  
  return CWinApp::PreTranslateMessage(pMsg);
}

3,055

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC HTML/XML
社区管理员
  • HTML/XML社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧