有了IWebBrowser2*,如何得到其Internet Explorer_Server窗口句柄?

专制的网站 2012-02-03 04:02:38
网上搜了一下,基本以下两种方式:
http://topic.csdn.net/t/20060607/15/4806765.html
http://hi.baidu.com/edward_sim/blog/item/ef813c89e3762db90f244419.htmlhttp://msdn.microsoft.com/en-us/library/aa752126(v=vs.85).aspx
发现上面两种方式的代码得到的值是一样的(这里我称为 hwndA),但并不是 Internet Explorer_Server的窗口句柄 ......
用SPY++检测到 Internet Explorer_Server的窗口句柄(这里我称为 hwndB)


然后就发现,hwndB 的parent 的 parent 是 hwndA ...

请问 :除了枚举子窗口的方式外 ,如何获得相应 Internet Explorer_Server窗口句柄??
...全文
73 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
专制的网站 2012-02-05
  • 打赏
  • 举报
回复
那就枚举或遍历吧...
fishion 2012-02-04
  • 打赏
  • 举报
回复
IWebBrowser2::HWND Property

--------------------------------------------------------------------------------

Gets the handle of the Microsoft Internet Explorer main window.

What's New for Windows Internet Explorer 7
For compatibility reasons, this method returns a handle to the top-level window frame, consistent with previous versions of Internet Explorer. However, due to tabbed browsing in Internet Explorer 7, this window handle is not logically the same as in previous versions.


应该还是得遍历
oyljerry 2012-02-03
  • 打赏
  • 举报
回复
直接用Spy++查看一下关系,估计没有直接获取的方式,还是要获取子窗口或遍历

3,055

社区成员

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

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