> For the complete documentation index, see [llms.txt](https://pinvokeisalive.gitbook.io/pinvoke/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pinvokeisalive.gitbook.io/pinvoke/desktopfunctions/user32/getclientrect.md).

# GetClientRect

### C# Signature:

```cs
[DllImport("user32.dll")]
static extern bool GetClientRect(IntPtr hWnd, out RECT lpRect);
```

### VB Signature:

```cs
<DllImport("user32.dll", CharSet:=CharSet.Auto)> _
Private Shared Function GetClientRect(ByVal hWnd As System.IntPtr, _
   ByRef lpRECT As RECT) As Integer
    ' Leave function empty     
End Function
```

### Tips & Tricks:

```cs
public static RECT GetClientRect(IntPtr hWnd)
{
    RECT result;
    GetClientRect(hWnd, out result);
    return result;
}

Usage
RECT clientRect = GetClientRect(handle);
```
