CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
IBM Rational 系统开发最佳实践工具包 WebSphere MQ 最佳实践 TOP 15
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  VC/MFC >  HTML/XML

用CHtmlView做浏览器web编辑器中无法输入回车的问题?难道就没人做过浏览器,遇到这个问题?!!!

楼主coolzdp7(fds)2006-03-17 18:08:12 在 VC/MFC / HTML/XML 提问

当载入的页面中含有设为编辑模式的div或者iframe,  
  则无法输入回车!!!  
   
  确实有这个问题。下了微软的那个MFCIE的例子也是这样。  
   
  没有人做过浏览器么?没碰到这个问题? 问题点数:100、回复次数:5Top

1 楼debehe(躯壳)回复于 2006-03-18 00:30:08 得分 0

获取不到事件?  
  http://www.mctainsh.com/COM/HtmlCtrlEvents.aspx  
  http://support.microsoft.com/kb/q253915/Top

2 楼coolzdp7(fds)回复于 2006-03-20 20:01:29 得分 0

快捷键能获取!  
  难道就没人遇到过么?Top

3 楼jiangsheng(蒋晟.Net[MVP])回复于 2006-03-21 07:40:48 得分 100

Short   answer:   override   PreTranslateMessage   as   follows  
  BOOL   CIEAutomationView::PreTranslateMessage(MSG*   pMsg)    
  {  
  //   TODO:   Add   your   specialized   code   here   and/or   call   the   base   class  
  if   (pMsg->message   ==   WM_KEYDOWN   &&   (pMsg->wParam   ==   VK_RETURN   ||    
  pMsg->wParam   ==   VK_ESCAPE))    
          {    
                  ::TranslateMessage(pMsg);    
          }    
          return   CHtmlView::PreTranslateMessage(pMsg);  
  }  
   
  Long   answer:   I   don't   know   why   this   works.  
   
  The   problem   occurs   only   when   MFCIE   runs   a   DHTML   editor   and   the   editor   has   the   focus.   Otherwise   CHtmlView   correctly   intercepts   keystrokes   even   though   the   PreTranslateMessage()   trick   is   absent.    
   
  http://www.microsoft.com/mind/0499/faq/faq0499.asp   suggested   calling   Win   32   API   IsDialogMessage(),   which   is   even   worse.   The   problem   is   that   the   enter   key   got   eaten   in   some   cases,   but   not   in   all   cases   as   described   in   the   article.   IDocHostUIHandler::TranslateAccelerator   is   called   and   get   ignored   somewhere   inside   the   message   handler   only   when   the   editor   has   the   focus.Top

4 楼coolzdp(unreal张师傅)回复于 2006-03-21 09:15:26 得分 0

Thanks!  
  蒋老大就是牛!  
   
  我昨晚下个MYIE早期的源代码看,它并没有这样做。  
  不过也解决了这个问题!  
  我对com不熟,也看不懂一些地方。  
   
  不过解决了就好。慢慢学习吧呵呵!  
  Top

5 楼jiangsheng(蒋晟.Net[MVP])回复于 2006-03-24 07:43:01 得分 0

update:   This   program   does   not   exist   in   MFC7.0.Top

相关问题

  • python编辑器中如何输入源程序呀?一打回车就会出现>>>,如何能象普通编辑器那样呀?
  • cb6的编辑器不能响应回车键!请问为什么?
  • CHtmlView中载入的网页采用iframe编辑模式无法输入回车?
  • CHtmlView中载入的网页采用iframe编辑模式无法输入回车?
  • 请问如何在多行编辑器中加一个回车?char(13)好像不行
  • text框中输入回车
  • 市面上比较流行的在线编辑器比如,htmlarea等编辑器都具有html输入功能,这会不会有漏洞?
  • 编辑器
  • php编辑器
  • HTML编辑器

关键词

  • 浏览器
  • chtmlview
  • pmsg
  • pretranslatemessage
  • 问题
  • 人

得分解答快速导航

  • 帖主:coolzdp7
  • jiangsheng

相关链接

  • Visual C++类图书
  • Visual C++类源码下载

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo