#NoTrayIcon
#Persistent
SetBatchLines, -1
Process, Priority,, High
; 1. Путь к твоей иконке (загружаем в память заранее)
IconPath := "C:\Users\sasha\Downloads\2026\gta6.ico"
hIcon := 0
if FileExist(IconPath) {
hIcon := DllCall("LoadImage", "Ptr", 0, "Str", IconPath, "UInt", 1, "Int", 32, "Int", 32, "UInt", 0x10, "Ptr")
}
; 2. Быстрый перехват: проверяем каждые 15 мс до первого появления
Loop {
if WinExist("ahk_exe GTA5.exe") {
WinSetTitle, ahk_exe GTA5.exe,, Grand Theft Auto VI
if (hIcon) {
SendMessage, 0x80, 0, hIcon,, ahk_exe GTA5.exe ; Small Icon
SendMessage, 0x80, 1, hIcon,, ahk_exe GTA5.exe ; Big Icon
}
break
}
Sleep, 15
}
; 3. Микро-цикл удержания на первые 15 секунд (чтобы лаунчер Rockstar не вернул старую иконку)
StartTime := A_TickCount
while (A_TickCount - StartTime < 15000) {
if WinExist("ahk_exe GTA5.exe") {
WinSetTitle, ahk_exe GTA5.exe,, Grand Theft Auto VI
if (hIcon) {
PostMessage, 0x80, 0, hIcon,, ahk_exe GTA5.exe
PostMessage, 0x80, 1, hIcon,, ahk_exe GTA5.exe
}
}
Sleep, 50
}
ExitApp