

.And @Hassan you can close other thread the Minimize to tray I solved it.#include "stdafx.h
#include <iostream>
#include <windows.h>
#include <string>
#include <ctime>
using namespace std;
int main()
{
system("color 3b"); //Changes the color of the screen.
int x;
int y;
int sleeptime;
int clickamount;
cout << "Text \n"; //Displays text.
cout << endl << endl; //Creates (x2) (enter's) two new lines.
cout << "Text" << endl << "Same credits as last time." << endl << endl;
cout << "X Cord: ";
cin >> x; //Gets information for int x.
cout << "Y Cord: ";
cin >> y;
cout << "How many times to click: ";
cin >> clickamount;
cout << "Please (:P )enter (Seconds) in time between clicks: ";
cin >> sleeptime;
cout << "X: ";
cout << x;
cout << " Y: ";
cout << y;
cout << " Sleep: ";
cout << sleeptime;
cout << " Clicks: ";
cout << clickamount;
for(int i = 0; i<clickamount; i++){ //Loop saying this int i is at the value 0. If it is < the clickamount varible than go to cin.get, else add 1 to int i and redo.
Sleep(sleeptime * 1000); //Sleep for the sleeptime and * by 1000 so it is in seconds.
SetCursorPos(x,y); //Put the mouse at the cordinates
mouse_event(MOUSEEVENTF_LEFTDOWN, x, y, 0, 0); //Left mouse button down
mouse_event(MOUSEEVENTF_LEFTUP, x, y, 0, 0); //Left mouse button up
keybd_event(VK_F12,0x7B,0 , 0); // F12 Press
keybd_event(VK_F12,0x9d,KEYEVENTF_KEYUP,0); // F12 Release
if(GetAsyncKeyState(VK_ESCAPE)){ //If button Escape is pressed than it will do.
exit(0); // EXIT THE PROGRAM
}
}
cout << endl;
cout << "Program is finished..." << endl;
cout << "Program shutting down in 5 minutes.";
Sleep(300 * 1000); //Makes the program sleep for 5 minutes.
exit(0);
cin.get(); //Keeps the information on the screen.
cin.get();
return 0;
}
