找到Chrome浏览器的窗口句柄 [英] Find the Window handle for a Chrome Browser
问题描述
我发现了一些代码,可以将浏览器放在最前面,即使它最小化了。
我不知道如何获取浏览器的hwnd。
我已经看了一下FindWindow API函数,但是你需要classname和windowname。
我发现我需要的类名是Chrome_WidgetWin_1
windowname会根据浏览器中打开的内容而不断变化。
我认为这个窗口中的一个'children'具有类名WrapperNativeWindowClass
我不确定是否可以使用它来查找原始父级。
任何人都可以建议如何找到chrome浏览器的窗口句柄(使用VBA)吗?
Chrome / Chromium运行会话(多进程,处理渲染/进程外iframe以及离线浏览器应用程序和(标准)扩展)
$ b
显示以下内容(可能与您的类似)class显示 I have found some code to bring the browser to the front, even if it was minimized.
I don't however know how to get the hwnd for the browser. I have had a look at the FindWindow API function, but you need the classname and windowname.
I have found that the classname I require is "Chrome_WidgetWin_1"
The windowname though would be constantly changing depending on what was open in the browser. I think one of the 'children' of this window has a classname of "WrapperNativeWindowClass"
I'm not sure if I can use this to find the original parent. Can anyone advise on how to find the window handle of a chrome browser (using VBA)?
NirSoft's excellent WinExplorer tool (among many many others) shows the following (probably similar to yours) class displays
这篇关于找到Chrome浏览器的窗口句柄的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
NirSoft 的优秀 WinExplore r 工具(包括许多其他工具)
< a href =https://i.stack.imgur.com/8nSPC.jpg =nofollow noreferrer>
尝试查找
Chrome_WidgetWin_1
和 Chrome_RenderWidgetHostHWND
A typical Chrome/Chromium run session (multi-process, handling rendering/out of process iframes and offline-browser-applications and (standard) extensions.
try looking for both
Chrome_WidgetWin_1
and Chrome_RenderWidgetHostHWND