This code opens a new chrome tab and place whole chrome window behind all other running programs:
Browser = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
URL = "http://cyberforum.ru"
Name = Mid(Browser, InStrRev(Browser, "\") + 1)
For Each P In GetObject("winmgmts:\\.\root\CIMV2")._
ExecQuery("Select ParentProcessID from Win32_Process Where Name = '" & Name & "'")
PID = P.ParentProcessID : If InStr(PIDs & " ", " " & PID & " ") Then Exit For
PIDs = PIDs & " " & PID
Next
With CreateObject("WScript.Shell")
Set Exe = .Exec(Browser & " " & URL)
If IsEmpty(PID) Then PID = Exe.ProcessID Else WSH.Sleep 1000
Do : A = .AppActivate(PID) : Loop Until A
.SendKeys "%{Esc}"
End With
How can I do the same thing with Autohotkey?