0
私は自分のマウスを置いた場所を記録してから正確な座標をクリックするようにしましたが、最後にはマウスが最後の場所でクリックしたのと同じ数のクリックをします。winapi mouse_event wrong coords
const int WAIT_INTERVAL = 5;
const int CLICK_POINTS = 5;
POINT mouse[CLICK_POINTS];
int clicks;
bool didGetPos;
for (int i = 1; i <= CLICK_POINTS; i++)
{
cout << i << " spot" << endl;
Sleep(3000);
didGetPos = GetCursorPos(&mouse[i - 1]);
if (!didGetPos)
{
break;
}
}
if (didGetPos)
{
for (int i = 0; i < CLICK_POINTS; i++)
{
for (int j = 0; j < clicks; j++)
{
mouse_event(MOUSEEVENTF_LEFTDOWN, mouse[i].x, mouse[i].y, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, mouse[i].x, mouse[i].y, 0, 0);
}
}
}
*この機能は置き換えられました。代わりにSendInputを使用してください。* –
Didnt help ..まだ同じ最後の場所 –
あなたのコードをSendInputの使用を示すように更新してください。誰かがあなたを助けるかもしれません。 –