能直接得到自身脚本的HWND吗?

Post a reply


In an effort to prevent automatic submissions, we require that you complete the following challenge.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :| :mrgreen: :geek: :ugeek: :arrow: :angel: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbup: :thumbdown: :salute: :wave: :wtf: :yawn: :facepalm: :bravo: :dance: :beard: :morebeard: :xmas: :HeHe: :trollface: :cookie: :rainbow: :monkeysee: :monkeysay: :happybday: :headwall: :offtopic: :superhappy: :terms: :beer:
View more smilies

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: 能直接得到自身脚本的HWND吗?

Re: 能直接得到自身脚本的HWND吗?

Post by RobertL » 15 Apr 2015, 01:54

帮助 目录\基本用法和语法\变量和表达式\内置变量\脚本属性\A_ScriptHwnd

Re: 能直接得到自身脚本的HWND吗?

Post by tmplinshi » 11 Apr 2015, 06:11

通过脚本的 PID 来获取。

Code: Select all

Gui, Add, Text, w500 h500, 
Gui, Show,, aaa

; DetectHiddenWindows, On ; 检测隐藏窗口
WinGetTitle, scriptTitle, % "ahk_pid " DllCall("GetCurrentProcessId")
MsgBox, % scriptTitle
ExitApp

能直接得到自身脚本的HWND吗?

Post by ZeronoFreya » 10 Apr 2015, 10:39

我知道可以用winget来获取ahk脚本的WinTitle,但此方法需要遍历所有ahk脚本并筛选,
有没有更便捷的方法?

Top