直接代码
#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;
}