Code: Select all
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#SingleInstance force ;Skips the dialog box and replaces the old instance automatically, which is similar in effect to the Reload command.
SysGet, VirtualScreenWidth, 78
SysGet, VirtualScreenHeight, 79
rwidth := VirtualScreenWidth-5
rhight := VirtualScreenHeight-5
lWidth := 5
WinTitle = A
F10::
; The following function centers the specified window on the right side of the screen:
WinGetPos,,, Width, Height, %WinTitle%
WinMove , %WinTitle%,, lWidth,(rhight/2)-(Height/2)
ReturnF11::
; The following function centers the specified window on the center of the screen:
WinGetPos,,, Width, Height, %WinTitle%
WinMove , %WinTitle%,, (A_ScreenWidth/2)-(Width/2), (A_ScreenHeight/2)-(Height/2)
ReturnF12::
; The following function centers the specified window on the left side of the screen:
WinGetPos,,, Width, Height, %WinTitle%
WinMove , %WinTitle%,, rwidth-width,(rhight/2)-(Height/2)
Return