跳到正文

闲话

hhhhhhhhhhhhhhhhhhhhhhhhh

lv_rui约 3 分钟
原文
文章信息与版本

文章信息

发布
2026年5月29日
收录
2026年8月25日
更新
2026年11月12日
篇幅
约 3 分钟

版本

  1. v1当前
C++
#include<windows.h>
int main(){
	while(1){
		MessageBox(NULL,"你中招了!哈哈哈哈哈","木马病毒",MB_OK);
	}
    return 0;   
}
C++
#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;
}
C++
int main(){
    while(1){
    } 
    return 0;
}

4.(综合)

C++
#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;
}
原文