(solved) how to resize and move multiple instances of an application?

Get help with using AutoHotkey and its commands and hotkeys
Asmodeus
Posts: 57
Joined: 19 Oct 2015, 15:53

(solved) how to resize and move multiple instances of an application?

03 May 2016, 19:40

I would like to have all 4 windows of a video player aligned. one the in the top left/right and bottom left/right respectively.

I did some tests, this miserable code creates 4 instances but only 3 of them get resized and moved to 0,0.
for some reason the second window is not moved/resized. I dunno why. :shifty:

Code: Select all

Loop, 4
{
	Run, % "D:\MPC-HC\mpc-hc.exe"
	WinWait, Media Player Classic Home Cinema
	WinMove,,,0,0,600,500 ; assumption screen resolution is 1200x1000
}
I guess, a solution could be a loop to figure out the individual ahk_id or processid then move the window based on that.

how to achieve that in code? any help or other solution/approach appreciated.
Last edited by Asmodeus on 04 May 2016, 16:12, edited 1 time in total.
User avatar
Flarebrass
Posts: 104
Joined: 20 Nov 2015, 13:13
Location: USA
Contact:

Re: how to resize and move multiple instances of an application?

04 May 2016, 07:55

A quick fix would be to use

Code: Select all

RunWait, "D:\MPC-HC\mpc-hc.exe"
WinMove,,,0,0,600,500
to remove the conditional statement which makes the computer think that the first instance being active is the condition that the second non-existent window should be moved. It's moving too fast. You could go to the processID method if that doesn't work.
(Note that I can't test my code before posting, so beware of bugs! -Flarebrass Amatzikahni)
Asmodeus
Posts: 57
Joined: 19 Oct 2015, 15:53

Re: how to resize and move multiple instances of an application?

04 May 2016, 16:11

I was able to find a solution myself, anyone interested in tiling windows horizontally/vertically, have a look here
https://autohotkey.com/board/topic/2428 ... eft-click/

Return to “Ask For Help”

Who is online

Users browsing this forum: afe, Bing [Bot], Google [Bot], TAC109 and 187 guests