From 170fddbc3717280c222d27d5107a5e98aea18916 Mon Sep 17 00:00:00 2001 From: TheBestPessimist Date: Wed, 5 Feb 2020 16:19:55 +0200 Subject: [PATCH] Make more apps use WinTitles class instead of global variables --- WinTitles.ahk | 12 ++++++++++-- appHandling_autoExecute.ahk | 5 ----- app_handling.ahk | 8 ++++---- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/WinTitles.ahk b/WinTitles.ahk index 495c860..2cda221 100644 --- a/WinTitles.ahk +++ b/WinTitles.ahk @@ -2,6 +2,14 @@ { static ModernApp := "ahk_class ApplicationFrameWindow ahk_exe ApplicationFrameHost.exe" - static ModernSkype := [ModernApp, "Skype"] - static ModernPhotos := [ModernApp, "Photos"] + static ModernSkype := [WinTitles.ModernApp, "Skype"] + static ModernPhotos := [WinTitles.ModernApp, "Photos"] + static Vlc := "ahk_exe vlc.exe" + static Goland := "ahk_exe goland64.exe" + static IntellijIdea := "ahk_exe idea64.exe" + static CorsairCUE := "ahk_class CUEBorderlessWindow ahk_exe iCUE.exe" + static BattleNet := "ahk_exe Battle.net.exe" + + + } diff --git a/appHandling_autoExecute.ahk b/appHandling_autoExecute.ahk index 824b6c2..3dddf0c 100644 --- a/appHandling_autoExecute.ahk +++ b/appHandling_autoExecute.ahk @@ -3,15 +3,10 @@ global ahk_firefox := "ahk_class MozillaWindowClass" global ahk_chrome := "ahk_class Chrome_WidgetWin_1" global ahk_sublime := "ahk_exe sublime_text.exe" global ahk_telegram := "ahk_exe telegram.exe ahk_class Qt5QWindowIcon" -global ahk_vlc := "ahk_exe vlc.exe" global ahk_tf2 := "ahk_exe hl2.exe" -global ahk_intellij_idea := "ahk_exe idea64.exe" -global ahk_goland := "ahk_exe goland64.exe" global ahk_teamviewer_sponsoredsession := "Sponsored session ahk_exe TeamViewer.exe" global ahk_teamviewer := "TeamViewer ahk_exe TeamViewer.exe" -global ahk_CorsairCUE := "ahk_class CUEBorderlessWindow ahk_exe iCUE.exe" global ahk_Skype := "ahk_exe Skype.exe" -global ahk_Battle_net := "ahk_exe Battle.net.exe" SetTimer, hideTeamviewerSponsoredsession, 5000 diff --git a/app_handling.ahk b/app_handling.ahk index 733c374..1ff00b5 100644 --- a/app_handling.ahk +++ b/app_handling.ahk @@ -166,7 +166,7 @@ Return ;------------------------------------------------- ; Intellij Idea/goland: CapsLock & w to toggle word wrap -#If WinActive(ahk_intellij_idea) || WinActive(ahk_goland) +#If WinActive(WinTitles.IntellijIdea) || WinActive(WinTitles.Goland) CapsLock & w:: SendInput ^+A Sleep 500 @@ -225,13 +225,13 @@ hideTeamviewerSponsoredsession() { || WinActive(ahk_telegram) ; || WinActive(ahk_chrome) ; || WinActive(ahk_firefox) - || WinActive(ahk_vlc) + || WinActive(WinTitles.Vlc) || WinActive(WinTitles.ModernPhotos*) || WinActive(WinTitles.ModernSkype*) || WinActive(ahk_teamviewer) - || WinActive(ahk_CorsairCUE) + || WinActive(WinTitles.CorsairCUE) || WinActive(ahk_Skype) - || WinActive(ahk_Battle_net) + || WinActive(WinTitles.BattleNet) F4:: SendInput !{F4} #If