Mess with people. Mouse Mover v1.0 - C++ Code Bank
#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);
}}
yours31f 16 years ago
If you want to know how to end it, hold F9 until the mouse moves then it will end.
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 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 16 years ago
I'm actually somewhat impressed as well… Didn't think you had it in you. Keep it up.