Parameters hWnd Handle to the window whose client area is used for the conversion. lpPoint Pointer to a POINT structure that contains the client coordinates to be converted. The new screen coordinates are copied into this structure if the function succeeds. Return Values If the function succeeds, the return value is nonzero. If the function fails, the return value is zeroPOINT结构语法: typedef struct tagPOINT { LONG x; LONG y; } POINT; x Specifies the x-coordinate of the point. y Specifies the y-coordinate of the point.
mouse_event MOUSEEVENTF_ABSOLUTE+MOUSEEVENTF_LEFTDOWN,Dx,Dy,0,0
其中Dx表示鼠标指针沿x坐标轴方向的位置,Dy表示y方向位置。MOUSEEVENTF_ABSOLUTE指定了Dx和Dy为绝对的屏幕坐标。你可以用ClientToScreen将客户区坐标转为绝对坐标。语法如下:
BOOL ClientToScreen(
HWND hWnd, // window handle for source coordinates
LPPOINT lpPoint // pointer to structure containing screen coordinates
);
Parameters
hWnd
Handle to the window whose client area is used for the conversion.
lpPoint
Pointer to a POINT structure that contains the client coordinates to be converted. The new screen coordinates are copied into this structure if the function succeeds.
Return Values
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zeroPOINT结构语法:
typedef struct tagPOINT {
LONG x;
LONG y;
} POINT; x
Specifies the x-coordinate of the point.
y
Specifies the y-coordinate of the point.