I think I solved the problem:
Code:
WinGet, hwnd , ID, A
WinGetPos, , , , Window_Height, ahk_id %hwnd%
VarSetCapacity(rcClient, 16, 0) ; rcClient Structure
DllCall("user32\GetClientRect","uint", hwnd ,"uint",&rcClient)
rcClient_x := NumGet(rcClient, 0)
rcClient_y := NumGet(rcClient, 4)
rcClient_r := NumGet(rcClient, 8)
rcClient_b := NumGet(rcClient, 12)
VarSetCapacity(pwi, 68, 0)
DllCall("GetWindowInfo", "UInt", hwnd, "UInt", &pwi)
;border width
bx := NumGet(pwi, 48)
;border height
by := NumGet(pwi, 52)
RealX := bx
RealY := Window_Height - by - rcClient_b
RealWidth := rcClient_r
RealHeight := rcClient_b
msgbox RealX=%RealX%|RealY=%RealY%|RealWidth=%RealWidth%|RealHeight=%RealHeight%
return
note: you cannot get this info trough spy
