Subscribe to How-To Geek

Recommended: Click Here to Run a Free Scan for Common PC Errors   [Sponsored Link]

Get the Linux Alt+Window Drag Functionality in Windows

One of my favorite features from Linux is the Alt + Window drag that allows you to move any window by holding down the Alt key and then just left-click dragging the window anywhere you'd like.

I set about to duplicate this functionality in Windows using my favorite automation tool, AutoHotkey. A short amount of browsing time later and I'd come up with a workable solution modified from this script.

An animation would work better here, but you can see that the mouse pointer is in the middle of the window:

image

By holding down the Alt key and dragging, I can move the window without having to click on the title bar:

image

Once you get used to this, you'll never want to go back, and because it's an AutoHotkey script I can bundle it together with all my other enhancements, such as assigning hotkeys to windows or the Hide Others script.

I've bundled a download together with the autohotkey script that you can use if you already have AutoHotkey installed, and also an executable file that you can use on any computer.

Download AltWindowDrag AutoHotkey Script & Executable

The Geek is the founder of How-To Geek and a geek enthusiast. When he's not coming up with great how-to articles, he's probably writing at his personal blog. This article was written on 11/24/07 and tagged with: Windows Vista, Vista Tips & Tweaks, Keyboard Ninja

Comments (13)

  1. Peter Blanked

    Not really a computer issue just a stupid question.

    How can I run more than one script without having my system-tray full of hotscript icons?

    I also tried to put all the scripts in one file but only the first script in that file will work.

  2. Noah Coad

    Awesome script!! Thanks! I added a "Send {alt}" after the button is released so focus doesn't stay on the menu bar. I love it. Keep the AutoHotKey scripts coming.

  3. Jon

    Dude, you rock. I love that feature from X-Window managers, I've used it for years together with other neat customisations. Once I spent entirely too much time customising my fvwm manager. I have been able to get this functionality on my Mac (with various extensions), and it's just super awesome to have it so easily with Windows Vista too. Cheers, Jon Dell'Oro

  4. Crash

    Very nice. I like it. However, I would like to see it embedded into the OS via the registry so there isnt any icon in the system tray.

    Other than that, I like it.

  5. Bojan K.

    Another great script that showcases the power and versatility of AutoHotkey, but this particular modification interferes with the function of Alt key in some Windows applications and renders it useless (for instance, setting the right loop locator in Propellerhead's Reason). My workaround for this problem is to assign this script's keystroke to left Win key by changing the line "Alt & LButton::" to "LWin & LButton::".

  6. The Geek

    Bojan,

    I noticed it was interfering with Photoshop for me… so I made the same change you did. =)

  7. starpause

    is something like this possible in winXP?

  8. jj rotane

    Oh my god, this is EXACTLY what I was looking for! (And I was only looking for 2 minutes and I found this page.) Been using Autohotkey for years, but there's so few good sites with sample scripts around. So again, thanks!

    PS: to starpause: Yes, you can use right this script in XP - I just had to update my Autohotkey to the latest version. Alternatively, the .exe file in the zip archive runs on XP anyway.

  9. jj rotane

    PPS: I just remapped "Alt & LButton::" to "~LButton & RButton::" so now you have to click left + right to move the window. Handy if you wanna use only one hand ;)

  10. islisis

    If you have performance problems, see also this standalone program linked from the virtuawin homepage
    http://virtuawin.sourceforge.n.....in32wm.zip

  11. imnotquitejack

    YES! You are awesome; this is exactly what I was looking for. Thanks!

  12. mon

    brilliant

  13. Dafin

    Thanks, eeePC701 uesrs love you!


Leave a Comment




Leave your friendly comment here. If you have a computer help question, leave it on the forums instead.

Note: Your comment may not show up immediately on the site.

Copyright © 2006-2008 HowToGeek.com. All Rights Reserved.