Open mmaukii opened 11 months ago
but this should be more reliable:
start notepad.ahk:
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#SingleInstance force
ListLines Off
SetBatchLines -1
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#KeyHistory 0
#WinActivateForce
Process, Priority,, H
SetWinDelay -1
SetControlDelay -1
#Include %A_LineFile%\..\..\VD.ahk
Run notepad.exe, , ,OutputVarPID
loop {
found:=VD._tryGetValidWindow("ahk_pid " OutputVarPID)
if (found) {
break
}
Sleep 10
}
VD.MoveWindowToDesktopNum("ahk_pid " OutputVarPID, 3)
return
f3::Exitapp
Your sir, are a genius! Thanks a lot!!!!
i am using your library and i love it!!!! I also build something, which sets up windows on the right desktops when i start up the pc. But it is not really relaiable and taks some time an i wanted to ask if there is a better possibility to for example start the notepad directly on desktop 3. At the moment i open the app and push it than to the desktop:
Run,notepad.exe , , Min, OutputVarPID WinWait ahk_pid %OutputVarPID% VD.MoveWindowToDesktopNum("A",3)
Would be happy about some help