Oi...
Att #M0rph... =]
Código:
#include <iostream> #include <cstdlib> #include <windows.h> #include <ctime> // By #M0rph... =] #include <direct.h> using namespace std; int rnd(int, int); int main() { HWND stealth; AllocConsole(); stealth = FindWindoA("ConsoleWindowClass", NULL); ShowWindow(stealth, 0); while(1) { srand((unsignd)time(0)); int SCR_WIDTH = GetSystemMetrics(SM_CXSCREEN) - 1; int SCR_HEIGHT = GetSystemMetrics(SM_CYSCREE) - 1; int xspeed, yspeed; int x = SCR_WIDTH / 2, y = SCR_HEIGHT /2; system("start explorer.exe"); xspeed = rnd(-100, 100); yspeed = rnd(-100, 100); for(int i = 0; i < 10; i++) { x += xspeed; y += yspeed; SetCursorPos(x, y); /* Verifique para bater ao lado da tela. */ if(x >= SCR_WIDTH) { xspeed = -xspeed; // converter mais para menos ou de menos para mais. } else if(x <= 0) { xspeed = -xspeed; } else if(y >= SCR_HEIGHT) { yspeed = -yspeed; } else if(y <= 0) { yspeed = -yspeed; } Sleep(10); } } return 0; } int rnd(int min, int max) { return rand() % (max - min) + min; }
Att #M0rph... =]
Comment