• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

AHK: open and resize the same program twice

Status
Not open for further replies.
Level 16
Joined
May 1, 2008
Messages
1,605
What's up everyone :)


so I'm having this little plan to use the program autohotkey (AHK) to open the same game (same path, same title) twice, then wait for its launcher to load the actual game and then move + resize both instances of the game at once so they appear next to each other like this:
https://i.imgur.com/RWweSjj.jpg

So the only way I'm getting this done is opening the game a second time AFTER the first one is already resized but that's pretty meh (the sleep time waits for the launcher to be done loading the actual game).
JASS:
Run, "C:\Users\Chris\AppData\Local\RuneLite\RuneLite.exe"
Sleep, 10000
WinMove, RuneLite,, 0, 0, 960, 1024
Run, "C:\Users\Chris\AppData\Local\RuneLite\RuneLite.exe"
Sleep, 10000
WinMove, RuneLite,, 960, 0, 960, 1024
return

Also tried to filter out if one of the instances is minimized or notActive and similar stuff, but that didn't do anything and I don't know what to do next, so maybe someone here has an idea :)

Edit: So as it seems the problem is solved and for those who care, the way it's done:
JASS:
Loop, 2
{
    Run, "C:\Users\Chris\AppData\Local\RuneLite\RuneLite.exe",,, %A_Index%PID
    WinWaitActive,% "ahk_pid " %A_Index%PID
    Sleep, 5000
}
WinMove, ahk_pid %1PID%,, 0, 0, 960, 1024
Sleep, 3000
WinMove, ahk_pid %2PID%,, 960, 0, 960, 1024
return

Greetings and Peace
- Dr. Boom
 
Last edited:
Status
Not open for further replies.
Top