Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Requires AutoHotkey v2.0
- ; Blokada uruchomienia jako admin
- if A_IsAdmin
- {
- MsgBox("Nie uruchamiaj tego skryptu jako administrator!", "Ostrzeżenie", 48)
- ExitApp
- }
- exePath := "C:\Program Files\Mozilla Thunderbird\thunderbird.exe"
- processName := "thunderbird.exe"
- if !FileExist(exePath)
- {
- MsgBox("Nie znaleziono pliku Thunderbird.exe pod ścieżką:`n" exePath, "Błąd", 16)
- ExitApp
- }
- pid := ProcessExist(processName)
- if pid
- {
- ; Sprawdzenie czy istnieje i jest widoczne okno Thunderbirda
- hwnd := WinExist("ahk_exe " processName)
- if hwnd && WinActive("ahk_id " hwnd)
- {
- ; Minimalizuj tylko jeśli okno jest widoczne
- WinMinimize("ahk_id " hwnd)
- }
- ; jeśli okno nie istnieje lub jest schowane do traya, nic nie robimy
- }
- else
- {
- Run(exePath)
- Sleep 3000
- hwnd := WinExist("ahk_exe " processName)
- if hwnd
- WinMinimize("ahk_id " hwnd)
- }
Advertisement
Add Comment
Please, Sign In to add comment