如果获取webbrowser中网页中光标的位置

Rainday_Ye 2006-08-26 12:16:46
如果网页中有文本框.并且正在编辑.如果获取光标的位置.
如何捕获光标移动的消息. 解决问题.分数不够可以再加.
不要用javascrip实现.
...全文
398 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
universee 2006-08-26
  • 打赏
  • 举报
回复
mk
蒋晟 2006-08-26
  • 打赏
  • 举报
回复
Use the createRange method of the IHTMLSelectionObject object to return an IHTMLTxtRange object that represents the currently selected text and elements in the active document. Use the createTextRange method of the IHTMLInputTextElement object to return an IHTMLTxtRange object that represents the text range of the desired text input element. Use IHTMLTxtRange::inRange to determin if the cursor is in the input. If so, call IHTMLTxtRange::moveStart and IHTMLTxtRange::moveEnd with the unit parameters set to textedit to retrive the location of the selection.
Rainday_Ye 2006-08-26
  • 打赏
  • 举报
回复
to jiangsheng(蒋晟.Net[MVP])
i have solved this problem using IHTMLCaret interface.
thanks all the same :)

18,356

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 网络编程
c++c语言开发语言 技术论坛(原bbs)
社区管理员
  • 网络编程
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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