Every script has a hidden main window, and its ahk_class is autohotkey.This code can list all running AHK script. How to modify the main window's class name, and hide the script?
Code: Select all
WinGet, AHKWinList, List, ahk_class AutoHotkey
Code: Select all
WinGet, AHKWinList, List, ahk_class AutoHotkey
egocarib wrote:I don't think you can modify the window's classname. And the window is already hidden. What do you mean when you ask how to "hide the script"?
Code: Select all
DetectHiddenWindows, on
WinGet, AHKWinList, List, ahk_class AutoHotkey
Loop, %AHKWinList%
{
AHKWinHWND := AHKWinList%A_Index%
WinGetTitle, AHKWinTitle, ahk_id %AHKWinHWND%
WinGet, AHKWinProcessPath, ProcessPath, ahk_id %AHKWinHWND%
MsgBox, % "脚本标题:" AHKWinTitle "`n脚本进程路径:" AHKWinProcessPath
}
return
egocarib wrote:Ah, okay.
I am not sure. The topic linked below suggests that you can change the class name if your script is complied (.exe), but not if it is run uncompiled (.ahk)
https://autohotkey.com/board/topic/1091 ... ahk-class/
Code: Select all
DetectHiddenWindows, on
WinGet, AHKWinList, List, ahk_class AutoHotkey
Loop, %AHKWinList%
{
AHKWinHWND := AHKWinList%A_Index%
WinGetTitle, AHKWinTitle, ahk_id %AHKWinHWND%
If InStr(AHKWinTitle, ""A_ScriptFullPath "")
continue
WinGet, AHKWinProcessPath, ProcessPath, ahk_id %AHKWinHWND%
scripts .= AHKWinTitle . A_Tab . AHKWinProcessPath "`n"
}
MsgBox %scripts%
return
Users browsing this forum: dunnerca, Google [Bot] and 145 guests