This code is what probably everybody in this thread is looking for and its a pure AHK solution without .NET-Frameworks. Just start and hit Win+C to enable / disable.
Formatted for
AutoIt with the GeSHI Syntax Highlighter [
copy or print]
#SingleInstance,Force
#NoEnv
; Mouse Rectangle Lock / Release
#c::
{
SetTimer, KeepLock, Off
VarSetCapacity(Rect, 16) ; Define var size
NumPut(0, Rect, 0) ; Left
NumPut(0, Rect, 4) ; Top
NumPut(1600, Rect, 8) ; Right
NumPut(1200, Rect, 12) ; Bottom
SetTimer, KeepLock, 50
}
KeepLock:
{
ActiveOld := Active
}
Bye