User32MapWindowPoints(IntPtr, IntPtr, Rectangle, UInt32) Method

Converts (maps) a set of points from a coordinate space relative to one window to a coordinate space relative to another window.

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 int MapWindowPoints(
	IntPtr hWndFrom,
	IntPtr hWndTo,
	out Rectangle refRect,
	uint cPoints = 2
)

Parameters

hWndFrom  IntPtr
A handle to the window from which points are converted.

If this parameter is Zero or HWND_DESKTOP, the points are presumed to be in screen coordinates.

hWndTo  IntPtr
A handle to the window to which points are converted.

If this parameter is Zero or HWND_DESKTOP, the points are converted to screen coordinates.

refRect  Rectangle
A Rectangle structure, in which case the cPoints parameter should be set to 2.
cPoints  UInt32  (Optional)
The number of Point structures in the array pointed to by the refRect parameter.

This value should be always 2UI.

Return Value

Int32
If the function succeeds, the low-order word of the return value is the number of pixels added to the horizontal coordinate of each source point in order to compute the horizontal coordinate of each destination point.

(In addition to that, if precisely one of hwndFrom and hwndTo is mirrored, then each resulting horizontal coordinate is multiplied by -1.)

The high-order word is the number of pixels added to the vertical coordinate of each source point in order to compute the vertical coordinate of each destination point.

If the function fails, the return value is 0.

Remarks

See Also