Witam
Właśnie czytałem sobie o symulowaniu ruchów myszą i natrafiłem na pewien problem i za bardzo nie wiem co jest nie tak.
No więc mam następujący kod:
#include <cstdlib>
#include <iostream>
#include <windows.h>
#include <windowsx.h>
using namespace std;
struct MOUSEINPUT
{
LONG dx;
LONG dy;
DWORD mouseData;
DWORD dwFlags;
DWORD time;
ULONG_PTR dwExtraInfo;
};
struct INPUT
{
DWORD type;
union
{
MOUSEINPUT mi;
};
};
int main(int argc, char *argv[])
{
INPUT Ruch;
ZeroMemory (&Ruch, sizeof(INPUT));
// ustawiamy kursor w środku ekranu
Ruch.type = INPUT_MOUSE;
Ruch.mi.dx = 200; // współ. pozioma
Ruch.mi.dy = 200; // współ. pionowa
Ruch.mi.dwFlags = MOUSEEVENTF_ABSOLUTE; // flagi
SendInput (1, &Ruch, sizeof(INPUT));
system("PAUSE");
return EXIT_SUCCESS;
}
Problemem jest to że nie wiem czemu kompilator (dev-c++) wywala mi błędy:
`INPUT_MOUSE' undeclared (first use this function)
`SendInput' undeclared (first use this function)
Co może być nie tak ?