[英]Autohotkey: Identify Google Chrome vs Google Chromium
I can't seem to figure this out 我似乎无法弄清楚
On autohotkey, there's documentation on how to identify a window / program running. 在自动热键上,有关于如何识别正在运行的窗口/程序的文档 。
Google Chrome and Google Chromium both use the same ahk_class
and the same .exe name of chrome.exe
Google Chrome和Google Chromium都使用相同的ahk_class
和chrome.exe
相同的.exe名称。
How does one use something like winTitle
or winGet
to distinguish the difference? 如何使用诸如winTitle
或winGet
类的东西来区分差异? I tried looking into PID values but they don't seem to be consistent. 我尝试查看PID值,但它们似乎不一致。
EDIT via WinSpy++ 通过WinSpy ++ 编辑
Using winspy++, I ran a simple experiment. 使用winspy ++,我进行了一个简单的实验。 2 Chromium Windows and 2 Chrome Windows so I can have a control group. 2个Chromium Windows和2个Chrome Windows,因此我可以有一个控制组。 Differences: 区别:
0F2C0000
, Chromium shows A2820000
0F2C0000
:Chrome显示0F2C0000
,Chromium显示A2820000
00003528 (13608)
, Chromium shows 00001B74 (7028)
进程ID:铬显示00003528 (13608)
,铬显示00001B74 (7028)
00003524 (13604)
, Chromium 00000220 (544)
线程ID:Chrome显示00003524 (13604)
,Chromium 00000220 (544)
In this case you have two possibilities to distinguish between the two programs: 在这种情况下,您有两种可能性可以区分这两个程序:
(1) Using SetTitleMatchMode 2 and the part of the title that all windows of this program have in common: (1)使用SetTitleMatchMode 2和该程序的所有窗口共同拥有的标题部分:
SetTitleMatchMode 2
If WinExist("- Chromium")
WinActivate
(2) Using " ahk_exe Path ": (2)使用“ ahk_exe路径 ”:
If WinExist("ahk_exe full_path_of_the_executable_chrome.exe")
WinActivate
To get the full path of the active window process use this: 要获取活动窗口进程的完整路径,请使用以下命令:
F1::
WinGet, Path, ProcessPath, A
MsgBox, %Path%
return
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.