How To Program Mouse Buttons to Maximize, Minimize, & Move Windows on Multiple Monitors

Channel:
Subscribers:
3,040
Published on ● Video Link: https://www.youtube.com/watch?v=3np4zoCXVZY



Category:
Tutorial
Duration: 3:15
3,303 views
6


★ Remember to LIKE, COMMENT and SUBSCRIBE to push me higher in the search rankings! ★

=== === === ===

http://jeffersonkim.com/2013/09/11/how-to-program-mouse-buttons-to-easily-maximize-minimize-move-windows-on-multiple-monitors/

=== === === ===

I demonstrate how I use a Logitech G700 Wireless Gaming mouse and AutoHotKey to easily maximize, minimize, and move windows around on my 5 monitor setup.

Here's the code to easily maximize and minimize using CTRL + ALT + = (Sorry, I don't remember exactly where I got the code from, but probably off of the forums on the main AutoHotKey.com page.)

;Window Maximize or Minimize
^!=::
WinGet, active_id, ID, A
WinGet, checkmax, MinMax, A
If(checkmax == 1) {
WinGet, active_id, ID, A
WinRestore, ahk_id %active_id%
} else {
WinGetClass, class, ahk_id %active_id%
If class not in ahk_class WorkerW,Shell_TrayWnd, Button, SysListView32,Progman,#32768 ;Creates

exclusion for Windows
WinMaximize, ahk_id %active_id%
}

return

This code will let you move a window by simply holding and releasing the CAPS LOCK key:

; Note: You can optionally release Capslock or the middle mouse button after
; pressing down the mouse button rather than holding it down the whole time.
; This script requires v1.0.25+.

~MButton & LButton::
CapsLock & LButton::
CoordMode, Mouse ; Switch to screen/absolute coordinates.
MouseGetPos, EWD_MouseStartX, EWD_MouseStartY, EWD_MouseWin
WinGetPos, EWD_OriginalPosX, EWD_OriginalPosY,,, ahk_id %EWD_MouseWin%
WinGet, EWD_WinState, MinMax, ahk_id %EWD_MouseWin%
if EWD_WinState = 0 ; Only if the window isn't maximized
SetTimer, EWD_WatchMouse, 10 ; Track the mouse as the user drags it.
return

EWD_WatchMouse:
GetKeyState, EWD_LButtonState, LButton, P
if EWD_LButtonState = 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




Other Videos By Jefferson Kim


2013-09-14Let's Play: Total War: Rome II (Iceni) - Ep. 48 | Battle of Vesontio
2013-09-14Let's Play: Total War: Rome II (Iceni) - Ep. 47 | Battle of Tolosa
2013-09-14Let's Play: Total War: Rome II (Iceni) - Ep. 46 | Empire Building
2013-09-14Let's Play: Total War: Rome II (Iceni) - Ep. 45 | Multiple Siege Battles in Ibossim and Tingis
2013-09-14Let's Play: Total War: Rome II (Iceni) - Ep. 44 | Massalia, Outnumbered 3 to 1, but killed 2 to 1
2013-09-14Let's Play: Total War: Rome II (Iceni) - Ep. 43 | Prepping for One Last Spanish Island Remains
2013-09-14Let's Play: Total War: Rome II (Iceni) - Ep. 42 | Defend Brigantium, Kartuba Siege
2013-09-13How to Speed Up Your D-Link DIR-655 Wireless Router (Dropped Connections)
2013-09-13Accounting, Human Resources, Payroll Overview for Start Up Businesses in California
2013-09-13Monthly Performance Review Overview
2013-09-11How To Program Mouse Buttons to Maximize, Minimize, & Move Windows on Multiple Monitors
2013-09-11How to Setup 6 Monitors or Multi-Monitors in Windows 7
2013-09-09Let's Play: Total War: Rome II (Iceni) - Ep. 41 | Gallaeci Taken Out at Brigantium. Almost All Spain
2013-09-09Let's Play: Total War: Rome II (Iceni) - Ep. 40 | Arevaci's Last Province Taken Out and Defended
2013-09-08Let's Play: Total War: Rome II (Iceni) - Ep. 39 | Siege Battles of Arse and Ebora
2013-09-08Let's Play: Total War: Rome II (Iceni) - Ep. 37 | Siege Battles of Ebora & Tarraco
2013-09-08Let's Play: Total War: Rome II (Iceni) - Ep. 38 | Gearing Up To Take Out Spain
2013-09-08Let's Play: Total War: Rome II (Iceni) - Ep. 36 | Heroic Victory Land Battles vs. Edetani at Tarraco
2013-09-08Let's Play: Total War: Rome II (Iceni) - Ep. 35 | Pushing Further Into Spain
2013-09-08Let's Play: Total War: Rome II (Iceni) - Ep. 34 | Multiple Land Battles Versus the Arevaci
2013-09-08Let's Play: Total War: Rome II (Iceni) - Ep. 33 | Mobilizing Into Spain & Building Painted ONES



Tags:
Let's Play
Playthrough
PC
Campaign
Windows
Walkthrough
Microsoft Windows (Operating System)
Multi-monitor
How-to (Media Genre)
Computer
Tutorial
Mouse (Patent)