Mike Mella
Mike Mella

Reputation: 79

How to dock a window the the left using autohotkey?

In Windows 7, you can drag a window to the leftmost screen position and it will dock itself there, expanding to the full height of the screen and half its width.

Is there an easy way to do this using AutoHotKey?

Upvotes: 2

Views: 1103

Answers (3)

cviejo
cviejo

Reputation: 4398

A bit late but I just had the same problem, needed to integrate window docking in a chain of AHK commands. This worked for me:

Send {LWin down}{Left}{LWin up}

If you're using Alt or Ctrl in your shortkey, you'll need to use KeyWait like:

KeyWait Ctrl
Send {LWin down}{Left}{LWin up}
return

Upvotes: 3

Mike Mella
Mike Mella

Reputation: 79

I decided the best way to do it - especially since I have two monitors and might want a window docked to a specific one - is to dock it manually first, then get the coordinates and width/height of the docked window using Window Spy. Then I can use the WinMove command to send it to that position.

Upvotes: 0

Chris McCabe
Chris McCabe

Reputation: 1030

Emmm, not sure if this is what you're looking for but windowskey+left will dock the current window on the left. You don't even need autohotkey to do it.

Upvotes: 1

Related Questions