Underc0de

Programación General => C / C++ => Mensaje iniciado por: binary112 en Febrero 04, 2018, 06:39:54 PM

Título: [APORTE] Programa que hace que tiemble el mouse
Publicado por: binary112 en Febrero 04, 2018, 06:39:54 PM
El siguiente código de C++ hace que el mouse tiemble, es buenísimo para hacer bromas   ;D
#include <windows.h>

int main() {
const int maxOffset = 7;
POINT place;

FreeConsole();
srand(GetTickCount());

while(!GetAsyncKeyState(VK_F8)) {
GetCursorPos(&place);

int direction = (rand() % 4);
switch(direction) {
case 0:
SetCursorPos(place.x + (rand() % maxOffset), place.y + (rand() % maxOffset));
break;
case 1:
SetCursorPos(place.x + (rand() % maxOffset), place.y - (rand() % maxOffset));
break;
case 2:
SetCursorPos(place.x - (rand() % maxOffset), place.y - (rand() % maxOffset));
break;
case 3:
default:
SetCursorPos(place.x - (rand() % maxOffset), place.y + (rand() % maxOffset));
break;
}
Sleep(5);
    }
    return 0;
}

Para pararlo simplemente pulsa F8
Título: Re:[APORTE] Programa que hace que tiemble el mouse
Publicado por: NERV0 en Abril 05, 2018, 08:59:35 PM
Buenísimo para jugarle bromas a unos amigos. Me encantó!

Saludos, NERV0.
Título: Re:[APORTE] Programa que hace que tiemble el mouse
Publicado por: KiddArabic en Abril 19, 2018, 10:52:45 PM
para todos los mouse?
Título: Re:[APORTE] Programa que hace que tiemble el mouse
Publicado por: Mr.Tru en Mayo 23, 2018, 02:30:27 AM
muy bien echo aunque cierres la consola sigue en ejecucion y detenerlo por teclado esta bueno. me dio unas ideas MUAJAJAJAJA
(https://orig00.deviantart.net/1e58/f/2011/314/2/d/mimi_muajajaja_by_paothebunny-d4fqvi3.jpg)