# GetWindowRgn

### C# Signature:

```cs
[DllImport("user32.dll")]
static extern int GetWindowRgn(IntPtr hWnd, IntPtr hRgn);

//Region Flags - The return value specifies the type of the region that the function obtains. It can be one of the following values.
const int ERROR           = 0;
const int NULLREGION      = 1;
const int SIMPLEREGION    = 2;
const int COMPLEXREGION   = 3;
```

### VB.NET Signature:

```cs
<DllImport("user32.dll")> _
Private Shared Function GetWindowRgn(ByVal hWnd As IntPtr, ByVal hRgn As IntPtr) As Integer
End Function
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://pinvokeisalive.gitbook.io/pinvoke/desktopfunctions/user32/getwindowrgn.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
