作者mesak (米沙)
看板EzHotKey
標題[AHK-] 抓取目前視窗座標
時間Sat May 28 02:27:31 2011
請問該如何 取得 目前視窗 的相對座標
也就是 Windows Spy 的 In Active Window
#C::
;ControlClick, x1214 y128 , %active_title% , , , , NA
;MouseGetPos, xpos, ypos
WinGetPos, X, Y, Width, Height, Calculator
MsgBox, Calculator is at %X%`,%Y%
ArrayCount += 1 ; Keep track of how many items are in the array.
ArrayX%ArrayCount% = %X% ; Store this line in the next array element.
ArrayY%ArrayCount% = %Y%
Return
不知道為什麼這樣取出來的數值都怪怪的
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 112.104.133.246
1F:→ fossil313:因為組合得太奇怪了...大概只需要mousegetpos 05/28 09:04