电脑蓝屏(伪)

直接代码

#include<bits/stdc++.h>
#include<windows.h>
using namespace std;

void full_screen()
{   
    HWND hwnd = GetForegroundWindow();
    int cx = GetSystemMetrics(SM_CXSCREEN);         
    int cy = GetSystemMetrics(SM_CYSCREEN);          

    LONG l_WinStyle = GetWindowLong(hwnd,GWL_STYLE);   
    SetWindowLong(hwnd,GWL_STYLE,(l_WinStyle | WS_POPUP | WS_MAXIMIZE) & ~WS_CAPTION & ~WS_THICKFRAME & ~WS_BORDER);

    SetWindowPos(hwnd, HWND_TOP, 0, 0, cx, cy, 0);
}

void SetFont(int size) {
	CONSOLE_FONT_INFOEX cfi; 
	cfi.cbSize = sizeof cfi; 
	cfi.dwFontSize.Y = size;  
	SetCurrentConsoleFontEx(GetStdHandle(STD_OUTPUT_HANDLE), TRUE, &cfi); 
	CONSOLE_FONT_INFO consoleCurrentFont; 
}

int main(){
	
	int temp;
	full_screen();
	system("title ");
	system("color 9F");
	cout << "\33[?25l" << endl << endl;
	
	SetFont(35);
	cout << "          :(" << endl << endl;
	
	cout << "          Your PC ran into a problem and needs to restart" << endl;
	cout << "          We're just collecting some error into, and then we'll restart for you" << endl << endl;
	
	for(int i = 0;i <= 100;i+=4){
		
		srand((unsigned)time(NULL));
		
		cout << "          " << i << "% complete";
		temp = rand()%(1000-0+1)+0;
		Sleep(temp);
		
		if(i==100){
			break;
		}
		
		cout << "\r" << "\33[K";
		
	}
	system("cls");
	
	while(true) {
		if(MessageBox(NULL,"Error!","Error",MB_ICONHAND|MB_ABORTRETRYIGNORE)==IDABORT){
			MessageBox(NULL,"The problem has been resolved!","Error",MB_ICONASTERISK|MB_OK);
			return 0; 
		}
		cout << "There are still issues" << endl;
		Sleep(500);
		system("cls");
		for(int j = 1;j <= 10;j++){
			cout << "Searching for issues." << endl;
			Sleep(100);
			system("cls");
			cout << "Searching for issues.." << endl;
			Sleep(100);
			system("cls");
			cout << "Searching for issues..." << endl;
			Sleep(100);
			system("cls");
		}
		cout << "The problem cannot be solved!" << endl;
		
		
	}
    return 0;
}

  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值