鼠标在2个坐标之间的范围内一个个点的移动并点击,不断循环如何做,求大神帮忙,最好能写个源代码
我想用C++用鼠标在(370, 270 ) (457 329)这个范围内从370, 270 这个初始坐标开始从左到右,从上到下每隔2位移动下,就是i=i+2这种,每移动到新位置,执行我的指令,然后判断,如果判断为真,跳出循环,如果不为真,移动到下1个位置,直到(457 329)终止,如果找到最后判断也不为真,则继续从初始坐标开始循环,新人,求大神能给个详细的代码哦
[解决办法]
LineDDA
The LineDDA function determines which pixels should be highlighted for a line defined by the specified starting and ending points.
BOOL LineDDA(
int nXStart, // x-coordinate of line's starting point
int nYStart, // y-coordinate of line's starting point
int nXEnd, // x-coordinate of line's ending point
int nYEnd, // y-coordinate of line's ending point
LINEDDAPROC lpLineFunc, // pointer to callback function
LPARAM lpData // pointer to application-defined data
);
Parameters
nXStart
Specifies the x-coordinate of the line's starting point.
nYStart
Specifies the y-coordinate of the line's starting point.
nXEnd
Specifies the x-coordinate of the line's ending point.
nYEnd
Specifies the y-coordinate of the line's ending point.
lpLineFunc
Pointer to an application-defined callback function. For more information, see the LineDDAProc callback function.
lpData
Pointer to the application-defined data.
Return Values
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero.
Windows NT: To get extended error information, callGetLastError.
Remarks
The LineDDA function passes the coordinates for each point along the line, except for the line's ending point, to the application-defined callback function. In addition to passing the coordinates of a point, this function passes any existing application-defined data.
The coordinates passed to the callback function match pixels on a video display only if the default transformations and mapping modes are used.
QuickInfo
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in wingdi.h.
Import Library: Use gdi32.lib.
See Also
Lines and Curves Overview, Line and Curve Functions, LineDDAProc
[解决办法]
LineDDAProc
The LineDDAProc function is an application-defined callback function used with the LineDDA function. It is used to process coordinates. The LINEDDAPROC type defines a pointer to this callback function. LineDDAProc is a placeholder for the application-defined function name.
VOID CALLBACK LineDDAProc(
int X, // x-coordinate of point being evaluated
int Y, // y-coordinate of point being evaluated
LPARAM lpData // pointer to application-defined data
);
Parameters
X
Specifies the x-coordinate of the current point.
Y
Specifies the y-coordinate of the current point.
lpData
Pointer to the application-defined data.
Remarks
An application registers a LineDDAProc function by passing its address to the LineDDA function.
QuickInfo
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in wingdi.h.
Import Library: User-defined.
See Also
Lines and Curves Overview, Line and Curve Functions, LineDDA