Hi all:
I have this, and I am trying to combine it altogether and send the array of INPUT to Sendinput, but I don't know how!
How do I do it?
Thx
#include <iostream>
#include <windows.h>
#include <ctime>
using namespace std;
void main()
{
Sleep(3000);
INPUT input;
input.type = INPUT_MOUSE;
input.mi.dx = 0;
input.mi.dy = 0;
input.mi.dwFlags = MOUSEEVENTF_RIGHTDOWN;
input.mi.time = 10;
input.mi.time = 0;
SendInput(1, &input, sizeof(input));
Sleep(50);
input.type = INPUT_MOUSE;
input.mi.dx = 100;
input.mi.dy = 0;
input.mi.dwFlags = MOUSEEVENTF_MOVE;
input.mi.time = 10;
SendInput(1, &input, sizeof(input));
Sleep(50);
input.type = INPUT_MOUSE;
input.mi.dx = 0;
input.mi.dy = 0;
input.mi.dwFlags = MOUSEEVENTF_RIGHTUP;
input.mi.time = 0;
SendInput(1, &input, sizeof(input));
return;
}
Last edited on
I got a weird problem:
this code, although it looks very similar, it crashes lol
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
#include <iostream>
#include <windows.h>
#include <ctime>
using namespace std;
void main()
{
Sleep(4000);
LPINPUT input;
input[0].type = INPUT_MOUSE;
input[0].mi.dx = 0;
input[0].mi.dy = 0;
input[0].mi.mouseData = 0;
input[0].mi.dwFlags = MOUSEEVENTF_RIGHTDOWN;
input[0].mi.time = 0;
input[0].mi.dwExtraInfo = GetMessageExtraInfo();
input[1].type = INPUT_MOUSE;
input[1].mi.dx = 0;
input[1].mi.dy = 0;
input[1].mi.mouseData = 0;
input[1].mi.dwFlags = MOUSEEVENTF_RIGHTUP;
input[1].mi.time = 0;
input[1].mi.dwExtraInfo = GetMessageExtraInfo();
SendInput(2, input, sizeof(input));
cout << "done" << endl;
Sleep(1000);
return;
}
|
I think maybe input[1] isn't the way to access this array LPINPUT?
thx
Last edited on