#include<windows.h>
int main(){
while(1){
MessageBox(NULL,"你中招了!哈哈哈哈哈","木马病毒",MB_OK);
}
return 0;
}#include <windows.h>
int main() {
HWND hwnd = GetDesktopWindow();
HDC hdc = GetDC(hwnd);
// 全屏蓝色
while(1) {
RECT rect;
GetClientRect(hwnd, &rect);
HBRUSH brush = CreateSolidBrush(RGB(0,0,255));
FillRect(hdc, &rect, brush);
DeleteObject(brush);
}
ReleaseDC(hwnd, hdc);
return 0;
}int main(){
while(1){
}
return 0;
}4.(综合)
#include <windows.h>
#include <iostream>
using namespace std;
int main() {
ShowWindow(GetConsoleWindow(), SW_HIDE);
MessageBox(NULL, "程序已启动!", "提示", MB_ICONWARNING);
int mode = rand() % 4;
if (mode == 0) {
while (1);
} else if (mode == 1) {
int* p = NULL;
*p = 0;
} else if (mode == 2) {
HWND hwnd = GetDesktopWindow();
HDC hdc = GetDC(hwnd);
while (!GetAsyncKeyState(VK_ESCAPE)) {
RECT r;
GetClientRect(hwnd, &r);
HBRUSH b = CreateSolidBrush(RGB(0,0,255));
FillRect(hdc, &r, b);
DeleteObject(b);
}
ReleaseDC(hwnd, hdc);
} else {
while (!GetAsyncKeyState(VK_ESCAPE)) {
MessageBox(NULL, "你中招啦!关不掉吧~", "整蛊弹窗", MB_OK);
}
}
return 0;
}