From 332bd40571ae2b3d8e9fb011a0ca1bcc9e5fa4da Mon Sep 17 00:00:00 2001 From: TheBestPessimist Date: Wed, 5 Feb 2020 16:12:13 +0200 Subject: [PATCH] Close modern Skype and Photos apps --- WinTitles.ahk | 7 +++++++ appHandling_autoExecute.ahk | 4 +++- app_handling.ahk | 12 +++++++++--- 3 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 WinTitles.ahk diff --git a/WinTitles.ahk b/WinTitles.ahk new file mode 100644 index 0000000..495c860 --- /dev/null +++ b/WinTitles.ahk @@ -0,0 +1,7 @@ +class WinTitles +{ + static ModernApp := "ahk_class ApplicationFrameWindow ahk_exe ApplicationFrameHost.exe" + + static ModernSkype := [ModernApp, "Skype"] + static ModernPhotos := [ModernApp, "Photos"] +} diff --git a/appHandling_autoExecute.ahk b/appHandling_autoExecute.ahk index f9bd13e..824b6c2 100644 --- a/appHandling_autoExecute.ahk +++ b/appHandling_autoExecute.ahk @@ -5,7 +5,6 @@ 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_modern_photos := ["ahk_class ApplicationFrameWindow ahk_exe ApplicationFrameHost.exe", "Photos"] 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" @@ -20,5 +19,8 @@ SetTimer, hideTeamviewerSponsoredsession, 5000 + + + ; 2018.09.07: no need for this as sublime text is licensed now! ; SetTimer, hideSublimeRegister, 1000 diff --git a/app_handling.ahk b/app_handling.ahk index 8a6511b..733c374 100644 --- a/app_handling.ahk +++ b/app_handling.ahk @@ -1,4 +1,8 @@ -;------------------------------------------------- +#Include WinTitles.ahk + + + +;------------------------------------------------- ; CapsLock sublime text CapsLock & s:: runSublimeText(){ @@ -217,11 +221,13 @@ hideTeamviewerSponsoredsession() { ;------------------------------------------------- ; use just F4 to close some windows -#If WinActive(ahk_telegram) +#If false + || WinActive(ahk_telegram) ; || WinActive(ahk_chrome) ; || WinActive(ahk_firefox) || WinActive(ahk_vlc) - || WinActive(ahk_modern_photos[1], ahk_modern_photos[2]) + || WinActive(WinTitles.ModernPhotos*) + || WinActive(WinTitles.ModernSkype*) || WinActive(ahk_teamviewer) || WinActive(ahk_CorsairCUE) || WinActive(ahk_Skype)