Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

Mess with people. Mouse Mover v1.0 - C++ Code Bank


Mess with people. Mouse Mover v1.0
Randomly clicks on the screen after a random amount of time. To end it, hold F9 until the mouse moves then it is finished. OR end the process names whatever you name the program. IT will not show up in applications. :nin
                #include <windows.h>
#include <cstdlib> 
#include <ctime> 
#include <iostream>

#define KEYDOWN(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000) ? 1 : 0)

int WINAPI WinMain (HINSTANCE hThisInstance,
HINSTANCE hPrevInstance,
LPSTR lpszArgument,
int nFunsterStil)
{
HWND hwnd = FindWindow("ConsoleWindowClass",NULL);
ShowWindow(hwnd,SW_HIDE);

int screen_x, screen_y;
int direction_x = 10;
int direction_y = 10;
POINT cursor;
clock_t start;

screen_x = GetSystemMetrics(SM_CXSCREEN);
screen_y = GetSystemMetrics(SM_CYSCREEN);

while(!KEYDOWN(VK_F9))
{
    srand((unsigned)time(0)); 
    int x,y,wait; 
        x = (rand()%1000)+1;
        y = (rand()%1000)+1;


        wait = (rand()%10000)+1; 
// set the 10000 to 100 for it to go faster  



		Sleep(wait);
		mouse_event(MOUSEEVENTF_LEFTDOWN,x,y,0,0);
		mouse_event(MOUSEEVENTF_LEFTUP,x,y,0,0);
		SetCursorPos(x,y);
		Sleep(1);
}}


            
Comments
yours31f's avatar
yours31f 16 years ago

If you want to know how to end it, hold F9 until the mouse moves then it will end.

yours31f's avatar
yours31f 16 years ago

DESCRIPTION: What this program does it picks a random spot on the screen, waits a random amount of time, then goes to that spot and clicks. It is hidden from the ctrl+esc menu but not from processes. It will show up as whatever you name the program.


I did this to a teachers computer and they ended up called the tech lead and not a single one could find out how to stop it, or what it was.

ghost's avatar
ghost 16 years ago

smufkin@emily:~$ gcc -o wat wat.C wat.C:1:21: error: windows.h: No such file or directory wat.C:8: error: expected initializer before 'WinMain' :( nice code though, you're learning fast. I am impressed :)

ghost's avatar
ghost 16 years ago

I'm actually somewhat impressed as well… Didn't think you had it in you. Keep it up.

ghost's avatar
ghost 15 years ago

:vamp::vamp::vamp::vamp::vamp: