When I first tried the Easy Window Dragging script I was a bit disappointed by the fact that you have to invoke a second key for the activation. I had hoped it would turn your mouse into something more powerful. Following is an adaptation of the original EWD script (credit for that goes to whoever the original author was, website nor script mention him or her...). With this adaptation it is possible to easily drag a window using just the right mouse button, without the right mouse button losing its native function (invoking a context menu).
I hope this works as well for you as it does for me. In case of any problems, please post a message and I'll try to fix it.
; Easy Windows Dragging V2 (requires XP/2k/NT) ; Author: songsoverruins ; Thanks to the original author of this script, this is merely a perfection of it ; Normally, a window can only be dragged by clicking on its title bar. This script extends that so that any point ; inside a window can be dragged with the right mouse button. ; This script requires v1.0.25+. RButton:: Loop { If A_TimeSinceThisHotkey > 200 ; If the right mouse button has been held for Break ;more than 200ms else ; stop this loop and start with the actual EWD code. GetKeyState, RButtonState, RButton, P ; Else, check what the current state of the button is If RButtonState = U ; If it has been released in the meantime a click was { ; intended by the user, so send that. And exit this Send, {RButton} ;script. Exit } else ; else, if the button is still depressed, continue continue ; the loop until one of the two above conditions is ;met. } ; This extra check for the buttonstate within the window ; 0-200 ms is done to make sure this script doesn't block ; the native function of the right mouse button, which is ; is sending a click! If instead ~RButton would have been ; used as hotkey, the click is carried along to the end of ; the script, resulting in the (intended) displacement of ; your window but also an (unintended) right mouse click ; after the window is in its new position. CoordMode, Mouse ; Switch to screen/absolute coordinates. MouseGetPos, EWD_MouseStartX, EWD_MouseStartY, EWD_MouseWin WinGetPos, EWD_OriginalPosX, EWD_OriginalPosY,,, ahk_id %EWD_MouseWin% SetTimer, EWD_WatchMouse, 10 ; Track the mouse as the user drags it. return EWD_WatchMouse: GetKeyState, EWD_RButtonState, RButton, P if EWD_RButtonState = U ; Button has been released, so drag is complete. { SetTimer, EWD_WatchMouse, off return } GetKeyState, EWD_EscapeState, Escape, P if EWD_EscapeState = D ; Escape has been pressed, so drag is cancelled. { SetTimer, EWD_WatchMouse, off WinMove, ahk_id %EWD_MouseWin%,, %EWD_OriginalPosX%, %EWD_OriginalPosY% return } ; Otherwise, reposition the window to match the change in mouse coordinates ; caused by the user having dragged the mouse: CoordMode, Mouse MouseGetPos, EWD_MouseX, EWD_MouseY WinGetPos, EWD_WinX, EWD_WinY,,, ahk_id %EWD_MouseWin% SetWinDelay, -1 ; Makes the below move faster/smoother. WinMove, ahk_id %EWD_MouseWin%,, EWD_WinX + EWD_MouseX - EWD_MouseStartX, EWD_WinY + EWD_MouseY - EWD_MouseStartY EWD_MouseStartX := EWD_MouseX ; Update for the next timer-call to this subroutine. EWD_MouseStartY := EWD_MouseY return