Last active
October 19, 2022 13:33
-
-
Save ethaniel/e4844f87c632928a17845f8f35fc31cc to your computer and use it in GitHub Desktop.
AutoHotKey script to minimize the TeamViewer side panel when I connect to a computer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Save this file somewhere (I keep it on my desktop) as min_teamviewer.ahk and run it once | |
; It will create a shortcut in the Startup folder, so it will be loaded automatically on system reboot | |
#SingleInstance Force | |
;LWin:: | |
;RWin:: | |
DetectHiddenText, on | |
; the line below adds a shortcut to the script in the Startup folder, so it starts automatically when the computer restarts | |
FileCreateShortcut, %A_ScriptFullPath%, %A_Startup%\My AHK Script.lnk, %A_ScriptDir% | |
Loop | |
{ | |
; Wait for the side panel to appear (it has ahk_class of TV_ControlWin, can check with Window Spy tool). | |
WinWait, ahk_class TV_ControlWin,, 1 | |
if ErrorLevel | |
{ | |
} else { | |
; Get width of the side panel | |
WinGetPos, , , Width, , ahk_class TV_ControlWin | |
; If width is more than 200 pixels, it means that the side panel is shown | |
IfGreater, Width, 200 | |
{ | |
; Click on the button (Window Spy says that it has ClassNN of Button9) to minimize the panel (makes it slide to the right) | |
ControlClick, Button9, ahk_class TV_ControlWin | |
} | |
} | |
; Sleep 3 seconds | |
Sleep, 3000 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment