Code: Select all
MoveWindowUnderMouseCursor(Except:="Progman WorkerW Shell_TrayWnd") { ; By SKAN on D38S/D38S
Local ; @ autohotkey.com/boards/viewtopic.php?t=80416
MouseGetPos,,, hWnd
WinGetClass, Class, % "ahk_id" . WinExist("ahk_id" . hWnd)
If ( DllCall("IsZoomed", "Ptr",hWnd) || InStr(" " . Except . " ", " " . Class . " ", True) )
Return
WinActivate
WinWaitActive,,, 0
PostMessage, 0x112, 0xF010 ; WM_SYSCOMMAND, SC_MOVE
SendEvent ^{Down}
}
#NoEnv
#SingleInstance, Force
^#RButton:: MoveWindowUnderMouseCursor()
Usage:
Run the script.
Use Hotkey Ctrl+Win+Right click when the mouse cursor is (anywhere) over your target window.
Release keys/mouse button and move mouse to relocate the window.
Left click (or press Enter) to confirm or Esc to Cancel.
Notes:
This script can move windows including those that don't have a caption
To move window of an elevated process, the script should also be run elevated.