我正在尝试使用-app标志打开一个Chrome实例,然后移动该窗口并通常使用它。这是我的代码:
#!NumpadMult::
{
Gui, Show , w260 h150, Window title
Gui, Add, Edit, w100 vCustomUrl, http://
Gui, Add, Button, default, OK ; The label ButtonOK (if it exists) will be run when the button is pressed.
ButtonOk:
Gui, Submit
Gui, Destroy
URL = %customUrl%
MyWidth = 639
MyHeight = 389
Run C:\Program Files (x86)\Google\Chrome\Application\chrome.exe --app=data:text/html`,<html><body><script>window.resizeTo(%MyWidth%`,%MyHeight%)`;window.location='%URL%'`;</script></body></html>
return
}
这是迄今为止我发现打开Chrome窗口并移动它的最佳方式,因为我无法弄清楚如何在特定的Chrome窗口上实际运行WinWait而我不知道标题。如果我试着拥有 Run
吐出一个 pid
, pid
与任何现有的Chrome进程相同,因此我获得的窗口不一定是我创建的窗口。
有任何想法吗?如果需要,我很乐意提供更多信息。
尝试WinWaitCreated()函数。 autohotkey.com/boards/viewtopic.php?t=1274
—
user3419297