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 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
|
#define _WIN32_WINNT 0x0500
#include <windows.h>
#include <iostream>
#include <conio.h>
#include <stdlib.h>
using namespace std;
int main(void)
{
HWND console = GetConsoleWindow();
RECT r;
GetWindowRect(console, &r);
MoveWindow(console, r.left, r.top, 1200, 720, TRUE);
system("title Mousemove v1.2");
double timeout=0, i=0, seconds=0;
char out;
cout<<"How long are you going to be out?\nwrite a number between 1 and 60(1 for 1min, 60 for 60min)\n";
cin>>timeout;
system("cls");
cout<<"\t\t\t STARTED\nthe program will be running for "<<timeout<<" minute/s\nyou have now 20 second to go to the window you want";
Sleep(20000);
while(true){
Sleep(3000);
system("cls");
cout<<"\t\t\t STARTED\nthe program will be running for "<<timeout<<" minute/s\n";
seconds=seconds+3;
cout<<seconds<<" sec have passed";
Sleep(3000);
system("cls");
cout<<"\t\t\t STARTED\nthe program will be running for "<<timeout<<" minute/s\n";
seconds=seconds+3;
cout<<seconds<<" sec have passed";
Sleep(3000);
system("cls");
cout<<"\t\t\t STARTED\nthe program will be running for "<<timeout<<" minute/s\n";
seconds=seconds+3;
cout<<seconds<<" sec have passed";
Sleep(3000);
system("cls");
cout<<"\t\t\t STARTED\nthe program will be running for "<<timeout<<" minute/s\n";
seconds=seconds+3;
cout<<seconds<<" sec have passed";
Sleep(3000);
system("cls");
cout<<"\t\t\t STARTED\nthe program will be running for "<<timeout<<" minute/s\n";
seconds=seconds+3;
cout<<seconds<<" sec have passed CLICK";
i++;
MOUSEINPUT click[2] {{0, 0, 0, MOUSEEVENTF_LEFTDOWN, 0, NULL},
{0, 0, 0, MOUSEEVENTF_LEFTUP, 0, NULL}};
INPUT mouse_click[2] {{INPUT_MOUSE, click[0]}, {INPUT_MOUSE, click[1]}};
SendInput(2, mouse_click, sizeof(mouse_click[0]));
if(i==timeout*4){
system("cls");
cout<<"\nFINISH\n";
cout<<"please enter 'e' to exit\n";
cin>>out;
if(out == 'e'){
exit(0); //here is where I ask for help
}
}
}
return 0;
}
|