#NoTrayIcon
#Persistent
SetBatchLines, -1
Process, Priority,, High
IconPath := "C:\Users\sasha\Downloads\2026\gta6.ico"
hIcon := 0
if FileExist(IconPath) {
; Загружаем иконку больших размеров для панели задач
hIcon := DllCall("LoadImage", "Ptr", 0, "Str", IconPath, "UInt", 1, "Int", 256, "Int", 256, "UInt", 0x10, "Ptr")
}
Loop {
hwnd := WinExist("ahk_exe GTA5.exe")
if (hwnd) {
; 1. Меняем имя
WinSetTitle, ahk_id %hwnd%,, Grand Theft Auto VI
; 2. Меняем иконку НА УРОВНЕ КЛАССА ОКНА (GCLP_HICON = -14, GCLP_HICONSM = -34)
if (hIcon) {
DllCall("SetClassLongPtr", "Ptr", hwnd, "Int", -14, "Ptr", hIcon)
DllCall("SetClassLongPtr", "Ptr", hwnd, "Int", -34, "Ptr", hIcon)
PostMessage, 0x80, 0, hIcon,, ahk_id %hwnd%
PostMessage, 0x80, 1, hIcon,, ahk_id %hwnd%
}
break
}
Sleep, 10
}
; Короткое удержание
StartTime := A_TickCount
while (A_TickCount - StartTime < 10000) {
hwnd := WinExist("ahk_exe GTA5.exe")
if (hwnd && hIcon) {
WinSetTitle, ahk_id %hwnd%,, Grand Theft Auto VI
DllCall("SetClassLongPtr", "Ptr", hwnd, "Int", -14, "Ptr", hIcon)
}
Sleep, 50
}
ExitApp