C/C++蓝屏整人代码
创始人
2024-12-27 03:10:05
0


文章目录

📒程序效果

📒具体步骤

1.隐藏任务栏

2.调整cmd窗口大小

3.调整cmd窗口屏幕颜色

4.完整代码

📒代码详解 


🚀欢迎互三👉:程序猿方梓燚 💎💎

🚀关注博主,后期持续更新系列文章

🚀如果有错误感谢请大家批评指出,及时修改

🚀感谢大家点赞👍收藏⭐评论✍  

 

📒程序效果

📒具体步骤

1.隐藏任务栏

在任务栏上右击,点击属性(R),弹出如图对话框,勾选选自动隐藏任务栏(u)

2.调整cmd窗口大小

按win+R,输入“cmd”按回车键,弹出一个黑色窗口,如图,点击属性,上方菜单选择布局,大家按自己电脑的尺寸调整,占满全屏即可,这我就不多说了。

3.调整cmd窗口屏幕颜色

窗口大小调整好之后,上方菜单选择颜色,字体颜色默认白色,应该无需改动,屏幕颜色选择蓝色。

4.完整代码
#include  #include  #include  #include #include  // 全屏/隐藏标题栏 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_TOPMOST, 0, 0, cx, cy, SWP_FRAMECHANGED); }  // 隐藏光标 void HideTheCursor() { 	CONSOLE_CURSOR_INFO cciCursor;  	HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);  	if (GetConsoleCursorInfo(hStdOut, &cciCursor)) { 		cciCursor.bVisible = FALSE; 		SetConsoleCursorInfo(hStdOut, &cciCursor); 		SetConsoleCursorInfo(hStdOut, &cciCursor); 	} }  using namespace std;  int main() {  	full_screen();  	HideTheCursor();  	for (double i = 0; i <= 100; i += 0.01) {  		HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);  		cout << "A problem has been detected and Windows has been shut down to prevent damage to your computer.\n\n"; 		cout << "*** STOP: 0x0000000A (0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF)\n\n"; 		cout << "Error code 0x0000000A indicates an IRQL_NOT_LESS_OR_EQUAL error.\n"; 		cout << "This typically occurs when a driver attempts to access a memory location at an incorrect IRQL level.\n"; 		cout << "The IRQL (Interrupt Request Level) is a hardware-related priority level used by the CPU to handle interrupts.\n"; 		cout << "When a driver operates at an IRQL that's too high for the memory access it's attempting,\n"; 		cout << "it can cause this critical error and potentially crash the system.\n"; 		cout << "If this is the first time you've seen this Stop error screen, restart your computer.\n"; 		cout << "If this screen appears again, follow these steps:\n"; 		cout << "Check to make sure any new hardware or software is properly installed.\n"; 		cout << "If this is a new installation, ask your hardware or software manufacturer for any Windows updates you might need.\n"; 		cout << "If problems continue, disable or remove any newly installed hardware or software. Disable BIOS memory options such as caching or \nshadowing.\n"; 		cout << "If you need to use Safe Mode to remove or disable components, restart your computer, press F8 to select Advanced Startup Options, \nand then select Safe Mode.\n"; 		cout << "Technical Information:\n"; 		cout << "*** BEGINNING OF DUMP OF PHYSICAL MEMORY\n"; 		cout << "*** MEMORY.DMP\n"; 		cout << "*** END OF DUMP OF PHYSICAL MEMORY\n";  		// 增加一些延迟,使效果更明显 		Sleep(50); 		system("cls");  		/* 		while (i == 100) { 					system("shutdown -s -f -t 0"); 				} 		 				cout << "Shutting down loading......" << fixed << setprecision(2) << i << "%" << endl; 		*///以上是蓝屏一段时间后自动关机代码,可以删掉  	}  	return 0; }

📒代码详解 

  1. 包含的头文件:

    • :提供了与 Windows 操作系统相关的功能和接口。
    • :用于输入输出操作。
    • :用于格式化输出。
    •  和 :C 标准库的头文件,提供了一些基本的输入输出和通用功能。
  2. full_screen 函数:

    • 它获取当前前台窗口的句柄 hwnd
    • 通过 GetSystemMetrics 函数获取屏幕的宽度 cx 和高度 cy
    • 获取当前窗口的样式 l_WinStyle,然后修改样式,使其全屏、弹出式显示,去除标题栏、边框和框架。
    • 使用 SetWindowPos 函数将窗口设置为全屏并置顶。
  3. HideTheCursor 函数:

    • 定义了一个 CONSOLE_CURSOR_INFO 类型的变量 cciCursor
    • 获取标准输出句柄 hStdOut
    • 如果能够获取控制台光标的信息,将其可见性设置为 FALSE 以隐藏光标。
  4. main 函数:

    • 调用 full_screen 函数使窗口全屏。
    • 调用 HideTheCursor 函数隐藏光标。
    • 通过一个循环不断输出一系列模拟的 Windows 错误提示信息。
    • 在每次输出后使用 Sleep(50) 函数暂停 50 毫秒,然后使用 system("cls") 清屏,以实现不断刷新输出的效果。

 

相关内容

热门资讯

今天上午!中至上饶辅助!一贯存... 今天上午!中至上饶辅助!一贯存在有开挂辅助攻略(有挂技巧)-哔哩哔哩中至上饶辅助脚本下载中分为三种模...
三分钟辅助器外挂!aapoke... 三分钟辅助器外挂!aapoker插件下载,wepoker透视脚本免费下载(有挂总结)-哔哩哔哩1、很...
现场直击!wepoker透视有... 现场直击!wepoker透视有吗!总是真的有开挂辅助软件(有挂猫腻)-哔哩哔哩1、这是跨平台的wep...
七分钟辅助器外挂!wepoke... 七分钟辅助器外挂!wepoker辅助器安装包定制,wpk模拟器多开(有挂透明挂)-哔哩哔哩wepok...
第3分钟辅助器外挂!安装不了w... 第3分钟辅助器外挂!安装不了wepoker,wpk可以透视挂吗(有挂分析)-哔哩哔哩1、进入到wpk...
截至发稿!蜀山四川破解版安卓版... 截至发稿!蜀山四川破解版安卓版!原来确实有开挂辅助器(果真有挂)-哔哩哔哩1、每一步都需要思考,不同...
4分钟辅助器外挂!智星菠萝透视... 4分钟辅助器外挂!智星菠萝透视,wepoker辅助器怎么弄(有挂教程)-哔哩哔哩wepoker辅助器...
经核实!潮汕汇游戏辅助!都是真... 经核实!潮汕汇游戏辅助!都是真的是有开挂辅助插件(有挂技术)-哔哩哔哩1、任何潮汕汇游戏辅助透视是真...
4分钟辅助器外挂!aapoke... 4分钟辅助器外挂!aapoker透视脚本入口,德普之星辅助工具如何打开(有挂分享)-哔哩哔哩小薇(辅...
据监测!神途游戏辅助软件!都是... 据监测!神途游戏辅助软件!都是真的是有开挂辅助工具(果真有挂)-哔哩哔哩;1、神途游戏辅助软件破解器...