User32SetWindowRgn(SafeHandle, SafeHandle, Boolean) Method

Sets the window region of a window.

The window region determines the area within the window where the system permits drawing.

The system does not display any portion of a window that lies outside of the window region

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("User32.dll", SetLastError = true)]
public static bool SetWindowRgn(
	SafeHandle hWnd,
	SafeHandle hRgn,
	bool redraw
)

Parameters

hWnd  SafeHandle
A handle to the window whose window region is to be set.
hRgn  SafeHandle
A handle to a region. The function sets the window region of the window to this region.

If hRgn is Zero, the function sets the window region to Zero.

redraw  Boolean
Specifies whether the system redraws the window after setting the window region. If bRedraw is TRUE, the system does so; otherwise, it does not.

Typically, you set redraw to if the window is visible.

Return Value

Boolean
If the function succeeds, the return value is .

If the function fails, the return value is .

To get extended error information, call GetLastWin32Error.

Remarks

See Also