Could we maybe add something to AHK which wraps GetClientRect and pulls the values from the struct?
Currently, you need to use DllCall to get the client rect of a non-AHK window.
Jnizm has a function here, but I feel this should be built into AHK and it seems like it would be technically trivial.
GetClientRect equivalent Topic is solved
Re: GetClientRect equivalent
In AutoHotkey_H you can:
Code: Select all
Gui, Show, W200 H200
Gui, +LastFound
; Get some window. In this case, the GUI we just created.
hwnd := WinExist()
; Retrieve the width (w) and height (h) of the client area.
GetClientRect(hwnd,(rc:=Struct("Int left,top,right,bottom"))[])
MsgBox % "Width = " rc.right " Height = " rc.bottom
ExitApp
Re: GetClientRect equivalent
Yeah, but even that is a bit much for your average newbie to wrap their head around.
You should be able to to it using the same kind of syntax that you would with WinGetPos
You should be able to to it using the same kind of syntax that you would with WinGetPos
Re: GetClientRect equivalent
It's already on one of my TODO lists. I have a few of those...
Re: GetClientRect equivalent Topic is solved
WinGetClientPos was added in v2.0-a084, and is not planned for v1. There is also Gui.GetClientPos() in v2.0-a111+.