if ($answer_counter == 1): ?>
endif; ?>
MyWidth = 639
MyHeight = 389
InputBox, customUrl, Custom Url, Enter an URL., , 1000, 120
if ErrorLevel
return
run % "chrome.exe" ( winExist("ahk_class Chrome_WidgetWin_1") ? " --new-window " : " " ) customUrl ; https://autohotkey.com/board/topic/82062-open-google-chrome-in-new-instance/
ID := WinWaitCreated("ahk_class Chrome_WidgetWin_1")
WinWait, ahk_id %ID%
WinMove, ahk_id %ID%,,,,%MyWidth%,%MyHeight%
IfWinNotActive, ahk_id %ID%, ,WinActivate,ahk_id %ID%
return
WinWaitCreated( WinTitle:="", WinText:="", Seconds:=0, ExcludeTitle:="", ExcludeText:="" ) {
; HotKeyIt - http://ahkscript.org/boards/viewtopic.php?t=1274
static Found := 0, _WinTitle, _WinText, _ExcludeTitle, _ExcludeText
, init := DllCall( "RegisterShellHookWindow", "UInt",A_ScriptHwnd )
, MsgNum := DllCall( "RegisterWindowMessage", "Str","SHELLHOOK" )
, cleanup:={base:{__Delete:"WinWaitCreated"}}
If IsObject(WinTitle) ; cleanup
return DllCall("DeregisterShellHookWindow","PTR",A_ScriptHwnd)
else if (Seconds <> MsgNum){ ; User called the function
Start := A_TickCount, _WinTitle := WinTitle, _WinText := WinText
,_ExcludeTitle := ExcludeTitle, _ExcludeText := ExcludeText
,OnMessage( MsgNum, A_ThisFunc ), Found := 0
While ( !Found && ( !Seconds || Seconds * 1000 < A_TickCount - Start ) )
Sleep 16
Return Found,OnMessage( MsgNum, "" )
}
If ( WinTitle = 1 ; window created, check if it is our window
&& ExcludeTitle = A_ScriptHwnd
&& WinExist( _WinTitle " ahk_id " WinText,_WinText,_ExcludeTitle,_ExcludeText))
WinWait % "ahk_id " Found := WinText ; wait for window to be shown
}