mouse_event (and SendInput, which is the preferred API to use for input) have a couple of tricky bits, it s a good idea to
read the MSDN page for mouse_event fully and carefully before using it - pay attention to the small print: in particular, the x and y values are not pixels, so you can t just put in values you get from GetCursorPos.
恰如其分,0-0是底层左上角,因此,底层左边的点将大致位于屏幕的同一地区,但比你更远的地方,比照该信标使用的实际单位更差:因此,它似乎可以在北顿附近(假定位于屏幕底部)工作,但就其他价值而言,它似乎会点击,与你看到的相似。
来自MSDN:
dx [in]
Type: DWORD
The mouse s absolute position along the x-axis or its amount of motion since the last mouse event was generated, depending on the setting of MOUSEEVENTF_ABSOLUTE. Absolute data is specified as the mouse s actual x-coordinate; relative data is specified as the number of mickeys moved. A mickey is the amount that a mouse has to move for it to report that it has moved.
首先,你们需要《谅解备忘录》的旗帜。 但这并非全部:
Remarks
...
If MOUSEEVENTF_ABSOLUTE value is specified, dx and dy contain normalized absolute coordinates between 0 and 65,535. The event procedure maps these coordinates onto the display surface. Coordinate (0,0) maps onto the upper-left corner of the display surface, (65535,65535) maps onto the lower-right corner.
......因此,在将目标坐标转至本份标书之前,你需要适当规模。