User32InvalidateRect(SafeHandle, IntPtr, Boolean) Method

Adds a rectangle to the specified window's update region.

The update region represents the portion of the window's client area that must be redrawn.

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 InvalidateRect(
	SafeHandle hWnd,
	ref IntPtr refRect,
	bool erase
)

Parameters

hWnd  SafeHandle
A handle to the window whose update region has changed.

If this parameter is Zero, the system invalidates and redraws all windows, not just the windows for this application, and sends the WM_EraseBkgnd and WM_NcPaint messages before the function returns.

Setting this parameter to Zero is not recommended.

refRect  IntPtr
A NativeRectangle structure that contains the client coordinates of the rectangle to be added to the update region.

If this parameter is , the entire client area is added to the update region.

erase  Boolean

[Missing <param name="erase"/> documentation for "M:DevCase.Win32.NativeMethods.User32.InvalidateRect(System.Runtime.InteropServices.SafeHandle,System.IntPtr@,System.Boolean)"]

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