My goal is to call a very simple C++ program from python, see below. The program generates a couple of random numbers and then moves the mouse and clicks. I would like to be able to call it from python with a few inputs(the python side I understand), but i don't understand what I must add to the C++ code to allow it to accept these inputs.
Any help is greatly appreciated.
I'm not sure if this matters, but im using Bloodshed Dev-C++, on a mac within parallels.
here is the C++ code
#include <windows.h>
#include <ctime>
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE dummy, LPSTR lpCmdLine, int nShowCmd)
{
//Pixel Counts
int FoldX = 429;
int CCX = 559;
int BRX= 685;
int Width=90;
int Y1=526;
int Height=33;
srand((unsigned)time(0));
int XFudge=rand()%Width;
//Combine pixel count with the randomly generated number
srand((unsigned)time(0));
int YFudge=rand()%Height;
int X=FoldX+XFudge;
int Y=Y1+YFudge;
SetCursorPos(X,Y);
mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP,
X,
Y,
0,
0
);
return 0;
return 0;
}
from python i would like to be able to call this small app, but be able to change where the mouse clicks, i.e. change how X, and Y are defined.