Working example and Function
Gui New, +HwndhGUI +LabelGui_ +Resize Gui %hGUI%:Show, w500 h500 MsgBox The Gui client area will now be covered with a new black gui Gui New, +HwndhGUI2 -Caption +ToolWindow +AlwaysOnTop Gui %hGUI2%:Color, 000000 Client := WinGetClientPos( hGUI ) Gui %hGUI2%:Show, % "x" Client.X " y" Client.Y " w" Client.W " h" Client.H OnMessage( 0x03, "GuiChanged" ) OnMessage( 0x05, "GuiChanged" ) return Gui_Close: ExitApp WinGetClientPos( Hwnd ) { VarSetCapacity( size, 16, 0 ) DllCall( "GetClientRect", UInt, Hwnd, Ptr, &size ) DllCall( "ClientToScreen", UInt, Hwnd, Ptr, &size ) x := NumGet(size, 0, "Int") y := NumGet(size, 4, "Int") w := NumGet( size, 8, "Int" ) h := NumGet( size, 12, "Int" ) return { X: x, Y: y, W: w, H: h } } GuiChanged() { global hGUI,hGUI2 Client := WinGetClientPos( hGUI ) Gui %hGUI2%:Show, % "x" Client.X " y" Client.Y " w" Client.W " h" Client.H }
I've seen other functions like this, but none ( that I found ) gave both the position and size.I was aiming for functionality similar to WinGetPos.