我知道可以用winget来获取ahk脚本的WinTitle,但此方法需要遍历所有ahk脚本并筛选,
有没有更便捷的方法?
能直接得到自身脚本的HWND吗?
Moderators: tmplinshi, arcticir
-
- Posts: 16
- Joined: 31 Jan 2015, 09:28
能直接得到自身脚本的HWND吗?
Autohotkey2
Re: 能直接得到自身脚本的HWND吗?
通过脚本的 PID 来获取。
Code: Select all
Gui, Add, Text, w500 h500,
Gui, Show,, aaa
; DetectHiddenWindows, On ; 检测隐藏窗口
WinGetTitle, scriptTitle, % "ahk_pid " DllCall("GetCurrentProcessId")
MsgBox, % scriptTitle
ExitApp
Who is online
Users browsing this forum: No registered users and 5 guests