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

Parameters

hWnd  IntPtr
A handle to the window whose update region is to be retrieved.
refRect  Rectangle
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.IntPtr,System.Drawing.Rectangle@,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