User32MapWindowPoints(IntPtr, IntPtr, NativeRectangle, UInt32) Method
Converts (maps) a set of points from a coordinate space relative to one window to a coordinate space relative to another window.
Namespace: DevCase.Win32.NativeMethodsAssembly: 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 NativeRectangle refRect,
uint cPoints = 2
)
<DllImportAttribute("User32.dll", SetLastError := true>]
Public Shared Function MapWindowPoints (
hWndFrom As IntPtr,
hWndTo As IntPtr,
<OutAttribute> ByRef refRect As NativeRectangle,
Optional cPoints As UInteger = 2
) As Integer
Dim hWndFrom As IntPtr
Dim hWndTo As IntPtr
Dim refRect As NativeRectangle
Dim cPoints As UInteger
Dim returnValue As Integer
returnValue = User32.MapWindowPoints(hWndFrom,
hWndTo, refRect, cPoints)
public:
[DllImportAttribute(L"User32.dll", SetLastError = true)]
static int MapWindowPoints(
IntPtr hWndFrom,
IntPtr hWndTo,
[InAttribute] [OutAttribute] NativeRectangle% refRect,
unsigned int cPoints = 2
)
[<DllImportAttribute("User32.dll", SetLastError = true)>]
static member MapWindowPoints :
hWndFrom : IntPtr *
hWndTo : IntPtr *
refRect : NativeRectangle byref *
?cPoints : uint32
(* Defaults:
let _cPoints = defaultArg cPoints 2
*)
-> int
No code example is currently available or this language may not be supported.
- 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 NativeRectangle
-
A NativeRectangle structure, in which case the cPoints parameter should be set to 2.
- cPoints UInt32 (Optional)
-
The number of NativePoint structures in the array pointed to by the refRect parameter.
This value should be always 2UI.
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.