User32GetUpdateRect(SafeHandle, NativeRectangle, Boolean) Method

Retrieves the coordinates of the smallest rectangle that completely encloses the update region of the specified window.

GetUpdateRect(IntPtr, NativeRectangle, Boolean) retrieves the rectangle in logical coordinates. If there is no update region, GetUpdateRect(IntPtr, NativeRectangle, Boolean) retrieves an empty rectangle (sets all coordinates to zero).

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

Parameters

hWnd  SafeHandle
A handle to the window whose update region is to be retrieved.
refRect  NativeRectangle
A NativeRectangle that receives the coordinates, in device units, of the enclosing rectangle.

An application can set this parameter to to determine whether an update region exists for the window.

If this parameter is , GetUpdateRect(IntPtr, NativeRectangle, Boolean) returns nonzero if an update region exists, and zero if one does not. This provides a simple and efficient means of determining whether a WM_Paint message resulted from an invalid area.

erase  Boolean

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

Return Value

Boolean
If the update region is not empty, the return value is .

If there is no update region, the return value is .

To get extended error information, call GetLastWin32Error.

Remarks

See Also