Code: Select all
; Borderless window macro
; Version 1.0 by BurnShady
; This script works with any version of Warcraft III and should work for all future and old releases of AHK.
; To download AHK, visit : http://www.autohotkey.com/
;
; Setup guide for windows:
; 1) Make a shortcut of your Frozen Throne.exe
; 2) Right click shortcut -> properties
; 3) Under target, add -window to the back
; 4) Mine looks like this, but your path should be different (including quotes): "C:\Users\BurnShady\Games\Warcraft III\Frozen Throne.exe" -window
; 5) Load Warcraft III using that shortcut
; 6) Open Borderless Macro.exe or Borderless Macro.ahk
; Hotkeys:
; Windows + F11 turns any window into borderess fullscreen
; Windows + F12 turns a borderless fullscreen window into windowed mode
; Cursor window lock is mainly for dual screen users
; Windows + F10 locks the cursor inside the Warcraft III window.
; Windows + F9 unlocks the cursor from the window. (You can also just alt tab)
; If you have any questions, PM Burn on entgaming.net
#SingleInstance force
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Persistent ; Stay open in background
;#################################### USEFUL LITTLE MACROS ############################################
^!r::reload ;Ctrl + Alt + R = Reloads the script
Break:: ;PauseBreak = button suspends and pauses the script
suspend
pause
return
^!e::edit ;Ctrl + Alt + E - Edit the script
^SPACE:: Winset, Alwaysontop, toggle, A ;Control + space = Toggles the window to always be on top
#g::Run http://www.google.com/search?q=%clipboard% ;Windows + G = Googles whatever is copied on your clipboard with your default browser.
#f12::
WinGetTitle, currentWindow, A
IfWinExist %currentWindow%
{
WinSet, Style, +0x800000
WinSet, Style, +0x40000
WinSet, Style, +0xC00000
WinMove, , , 0, 0, (A_ScreenWidth/2), A_ScreenHeight-42
}
return
#f11:: ;Turns the window into fullscreen with windows + F11
WinGetTitle, currentWindow, A
IfWinExist %currentWindow%
{
WinSet, Style, -0xC00000,a ; remove the titlebar and border(s)
WinSet, Style, -0x40000,a ; remove sizing border
WinMove, a, , 0, 0, A_ScreenWidth, A_ScreenHeight ; move the window to 0,0 and resizes it to fullscreen width
}
return
#f10::
LockMouseToWindow("Warcraft III")
Return
#f9::
LockMouseToWindow()
Return
LockMouseToWindow(llwindowname="")
{
VarSetCapacity(llrectA, 16)
WinGetPos, llX, llY, llWidth, llHeight, %llwindowname%
If (!llWidth AND !llHeight) {
DllCall("ClipCursor")
Return, False
}
Loop, 4 {
DllCall("RtlFillMemory", UInt,&llrectA+0+A_Index-1, UInt,1, UChar,llX >> 8*A_Index-8)
DllCall("RtlFillMemory", UInt,&llrectA+4+A_Index-1, UInt,1, UChar,llY >> 8*A_Index-8)
DllCall("RtlFillMemory", UInt,&llrectA+8+A_Index-1, UInt,1, UChar,(llWidth + llX)>> 8*A_Index-8)
DllCall("RtlFillMemory", UInt,&llrectA+12+A_Index-1, UInt,1, UChar,(llHeight + llY) >> 8*A_Index-8)
}
DllCall("ClipCursor", "UInt", &llrectA)
Return, True
}
return
; ############ ADD YOUR OWN MACROS UNDER HERE #############
; ############ MACROS UNDER HERE WILL ONLY WORK WHEN WAR3 IS AN ACTIVE WINDOW #############
#IfWinActive, Warcraft III ahk_class Warcraft III
;Message macros:
!9::Sendinput {enter}/w clan.enterprise {!}g island defense{Enter}{Enter}/whois entid{Enter} ;Does /whois and requests lobby status
^!+a::clipboard =  ;copies the apple to clipboard
!2::clipboard = [ENT] island defense # ;copies partial game name to clipboard
!4::sendinput ^{enter}take cover{enter} ;Sends "take cover" to allies
!8::Sendinput {Enter}-cam 180{Enter}{Enter}/fps{Enter} ;Turns on FPS counter + cam macro
#f12:: ;Make borderless window bordered, works for all windows
WinGetTitle, currentWindow, A
IfWinExist %currentWindow%
{
WinSet, Style, +0x800000
WinSet, Style, +0x40000
WinSet, Style, +0xC00000
WinMove, , , 0, 0, (A_ScreenWidth/2), A_ScreenHeight-42 ;resizes window to half screen width and screen heigh - 42 pixels.
}
return
#f11:: ;Turn window into a borderless window
WinGetTitle, currentWindow, A
IfWinExist %currentWindow%
{
WinSet, Style, -0xC00000,a ; remove the titlebar and border(s)
WinSet, Style, -0x40000,a ; remove sizing border
WinMove, a, , 0, 0, A_ScreenWidth, A_ScreenHeight ; move the window to 0,0
}
return
;Inventory macros
!q::Send {Numpad7} ;alt + q for inventory top left
!w::Send {Numpad8} ;alt + w for inventory top right
!a::Send {Numpad4} ;alt + a for inventory left
!s::Send {Numpad5} ;alt + s for inventory right
!z::Send {Numpad1} ;alt + z for inventory bottom left
!x::Send {Numpad2} ;alt + x for inventory bottom right