According to WinActive and Send I did this:
Code: Select all
if WinActive("ahk_exe steam.exe")
Send !+0
Code: Select all
if WinActive("ahk_exe steam.exe")
Send !+0
Code: Select all
WinWaitActive, ahk_exe steam.exe
Send !+0
Vielen Dank, it works.Rohwedder wrote: Hallo,
your script checks exactly once if a window of steam.exe is active, sends if so (Alt+Shift+0) , and then exits.
Perhaps:Code: Select all
WinWaitActive, ahk_exe steam.exe Send !+0
Code: Select all
XV := (A_ScreenWidth/2560)**1.1
YV := (A_ScreenHeight/1600)**1.1
GroupAdd, ResizedWin, ahk_exe telegram.EXE
GroupAdd, ResizedWin, ahk_exe Discord.EXE
GroupAdd, ResizedWin, ahk_exe WhatsApp.EXE
GroupAdd, ResizedWin, ahk_exe Notepad.EXE
GroupAdd, GameActive, ahk_exe DetroitBecomeHuman.EXE
GroupAdd, GameActive, ahk_exe ModernWarfare.EXE
GroupAdd, GameActive, ahk_exe TheAscent-Win64-Shipping.EXE
GroupAdd, GameActive, ahk_exe TheAscent.EXE
GroupAdd, GameActive, ahk_exe witcher3.EXE
GroupAdd, GameActive, ahk_exe r5apex.EXE
GroupAdd, GameActive, ahk_exe bf4.EXE
GroupAdd, GameActive, ahk_exe bf2042.EXE
GroupAdd, GameActive, ahk_exe Everspace2.EXE
GroupAdd, GameActive, ahk_exe ES2-Win64-Shipping.EXE
GroupAdd, GameActive, ahk_exe csgo.EXE
GroupAdd, GameActive, ahk_exe Human.EXE
GroupAdd, GameActive, ahk_exe cod.EXE
Steam := Resized := False
SetTimer, Windows, 250
Windows:
IF (!Steam And WinActive("ahk_exe steam.exe"))
{
Steam := True
Send !+0
}
Else IF (Steam And !WinActive("ahk_exe steam.exe"))
Steam := False
IF (!Resized And WinExist("ahk_group ResizedWin"))
{
Resized := True
WinMove, , , , , 1417*XV, 915*YV
}
Else IF (Resized And !WinExist("ahk_group ResizedWin"))
Resized := False
Return
#IfWinActive, ahk_group GameActive
*LWin::Return
<^Shift::return
^Esc::return
#If
It works perfectly. Don't know how to thank you. And didn't thought that combinig these scripts would be so complicated...Rohwedder wrote: Then (untested):