Get a control position on screen Topic is solved
Get a control position on screen
Is it possible to get a control (for example button) position relative to entire screen? I tried GuiControl Get, Pos but it only gets a position relative to window.
Re: Get a control position on screen
WinGetPos for the window's screen x, y
the control's screen x, y are then the window's screen x, y + the control's relative x, y
the control's screen x, y are then the window's screen x, y + the control's relative x, y
Re: Get a control position on screen
ok, thanks!
Re: Get a control position on screen
Unfortunately I still have issues finding the position:
https://www.autohotkey.com/boards/viewtopic.php?f=76&t=65665
https://www.autohotkey.com/boards/viewtopic.php?f=76&t=65665
Re: Get a control position on screen Topic is solved
You could get the control's hWnd, and pass that to WinGetPos.
Code: Select all
q:: ;control get screen coordinates
ControlGet, hCtl, Hwnd,, Button1, A
WinGetPos, vWinX, vWinY, vWinW, vWinH, % "ahk_id " hCtl
MsgBox, % Format("x{} y{} w{} h{}", vWinX, vWinY, vWinW, vWinH)
return
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Re: Get a control position on screen
Thank you very much!
Who is online
Users browsing this forum: AlFlo, AudioBabble, chrisjordan, teadrinker and 134 guests