网站首页  词典首页

请输入您要查询的函数:

 

术语 mapwindowpoints
释义 MapWindowPoints
语法:
int MapWindowPoints(
__in HWND hWndFrom,
__in HWND hWndTo,
__inout LPPOINT lpPoints,
__in UINT cPoints
);
MapWindowPoints功能
该MapWindowPoints函数转换(图)一组点的坐标空间上是相对的一个窗口坐标空间上是相对的另一个窗口。
参数
hWndFrom [in]
一个句柄,从该点转换窗口。如果此参数为NULL或HWND_DESKTOP,各点推定为在屏幕坐标。
hWndTo [in]
一个句柄,哪些点转换窗口。如果此参数为NULL或HWND_DESKTOP,点转换为屏幕坐标。
lpPoints [ in , out ]
对一个Point结构的数组指针,包含点集的转换。各点的设备单位。此参数也可以指向一个RECT结构,在这种情况下cPoints参数应设置为2。
cPoints [in]
在数组中指出联网结构的数目由lpPoints参数。
返回值
如果函数成功,低返回值的字是像素的数目增加了横向协调各源点,以计算横向协调各目的地。 (添加除此之外,如果正是一个hWndFrom和hWndTo镜像,然后每个结果横坐标乘以-1。)高字是像素数的垂直每个源点坐标为垂直坐标计算每个目的地。
如果函数失败,返回值是零。呼叫SetLastError之前调用此方法来区分合法的“零错误返回值”返回值。
备注
如果hWndFrom或hWndTo(或两者)的镜像窗口(即拥有WS_EX_LAYOUTRTL扩展样式)和两点正是在lpPoints通过,MapWindowPoints将演绎这两点是一个矩形,并可能自动交换该矩形的左,右领域以确保左不大于权利。如果任何其他积分超过2号码是lpPoints通过,然后MapWindowPoints将正确地图上的各点的坐标分别,所以如果您在一个指针传递给超过一个lpPoints矩形阵列,新的矩形可能会他们离开现场大于权利。因此,要保证正确的矩形坐标转换,则必须调用一次一个矩形指针MapWindowPoints,如以下示例所示:
矩形钢筋混凝土[10];
对于(整合酶= 0;“(sizeof(区局)/ sizeof(区局[0]));我+ +)
(
MapWindowPoints(hWnd1,hWnd2,(LPPOINT)(&遥控[一]),(sizeof(矩形)/ sizeof(点)));
)
此外,如果您需要映射两个独立的精确点,不希望矩形的逻辑应用的MapWindowPoints他们,以保证正确的结果,您必须调用一次一个时间点的指针MapWindowPoints,如以下示例所示:
点角[2];
MapWindowPoints(hWnd1,hWnd2,&角[0],1);
MapWindowPoints(hWnd1,hWnd2,&角[1],1);
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinuser.h(头文件:winuser.h)
LibraryUser32.lib
DLLUser32.dll
参见
坐标空间和转换概述
坐标空间与变换函数
ClientToScreen

RECT
ScreenToClient
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月11日
==英文原文==MapWindowPoints Function
The MapWindowPoints function converts (maps) a set of points from a coordinate space relative to one window to a coordinate space relative to another window.
Syntax
int MapWindowPoints(
__in HWND hWndFrom,
__in HWND hWndTo,
__inout LPPOINT lpPoints,
__in UINT cPoints
);
Parameters
hWndFrom [in]
A handle to the window from which points are converted. If this parameter is NULL or HWND_DESKTOP, the points are presumed to be in screen coordinates.
hWndTo [in]
A handle to the window to which points are converted. If this parameter is NULL or HWND_DESKTOP, the points are converted to screen coordinates.
lpPoints [in, out]
A pointer to an array of POINT structures that contain the set of points to be converted. The points are in device units. This parameter can also point to a RECT structure, in which case the cPoints parameter should be set to 2.
cPoints [in]
The number of POINT structures in the array pointed to by the lpPoints parameter.
Return Value
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 zero. Call SetLastError prior to calling this method to differentiate an error return value from a legitimate "0" return value.
Remarks
If hWndFrom or hWndTo (or both) are mirrored windows (that is, have WS_EX_LAYOUTRTL extended style) and precisely two points are passed in lpPoints, MapWindowPoints will interpret those two points as a RECT and possibly automatically swap the left and right fields of that rectangle to ensure that left is not greater than right. If any number of points other than 2 is passed in lpPoints, then MapWindowPoints will correctly map the coordinates of each of those points separately, so if you pass in a pointer to an array of more than one rectangle in lpPoints, the new rectangles may get their left field greater than right. Thus, to guarantee the correct transformation of rectangle coordinates, you must call MapWindowPoints with one RECT pointer at a time, as shown in the following example:

RECT rc[10];
for(int i = 0; i < (sizeof(rc)/sizeof(rc[0])); i++)
{
MapWindowPoints(hWnd1, hWnd2, (LPPOINT)(&rc[i]), (sizeof(RECT)/sizeof(POINT)) );
}
Also, if you need to map precisely two independent points and don't want the RECT logic applied to them by MapWindowPoints, to guarantee the correct result you must call MapWindowPoints with one POINT pointer at a time, as shown in the following example:

POINT pt[2];
MapWindowPoints(hWnd1, hWnd2, &pt[0], 1);
MapWindowPoints(hWnd1, hWnd2, &pt[1], 1);
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinuser.h (include Windows.h)
LibraryUser32.lib
DLLUser32.dll
See Also
Coordinate Spaces and Transformations Overview
Coordinate Space and Transformation Functions
ClientToScreen
POINT
RECT
ScreenToClient
Send comments about this topic to Microsoft
Build date: 7/11/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd145046(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 9:24:02