- Статус
- Оффлайн
- Регистрация
- 19 Авг 2017
- Сообщения
- 355
- Реакции
- 118
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Код:
#include <windows.h>
#define SCREEN(x) GetSystemMetrics(*x == 'X' ? SM_CXSCREEN : SM_CYSCREEN)
LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);
char szClassName[ ] = "WindowsApp";
const char * BSOD_TEXT[] = {
"-A problem has been detected and Windows has been shut down to prevent damage",
"-to your computer.",
"*The problem seems to have been caused by the following file: SPCMDCON.SYS",
"*PAGE_FAULT_IN_NONPAGED_AREA",
"*If this is the first time you've seen this Stop error screen,",
"-restart your computer. If this screen appears again, follow",
"-these steps:",
"*Check to make sure any new hardware or software is properly installed.",
"*If this is a new installation, ask your hardware or software manufacturer",
"-for any Windows updates you may need",
"*If problems continue, disable or remove any newly installed hardware",
"-or software. Disable BIOS memory options such as caching or shadowing.",
"*If you need to use Safe Mode to remove or disable components, restart",
"-your computer, press F8 to select Advanced Startup Options, and then",
"-select Safe Mode.",
"*Technical Information:",
"**** STOP: 0x00000050 (0xFD3094C2,0x00000001,0xFBFE7617,0x00000000)",
"**** SPCMDCON.SYS - Address FBFE7617 base at FBFE5000, DateStamp 3d6dd67c"
};
void PRINT_TEXT(HDC hDC){
unsigned char k = 0;
unsigned short y_co = 30;
while(k <= 17){
if(BSOD_TEXT[k][0] == '*') y_co += 23;
TextOut(hDC,10,y_co+(k*23),BSOD_TEXT[k]+1,lstrlen(BSOD_TEXT[k])-1);
k++;
}
}
int WINAPI WinMain (HINSTANCE hThisInstance,
HINSTANCE hPrevInstance,
LPSTR lpszArgument,
int nFunsterStil){
HWND hwnd;
MSG messages;
WNDCLASSEX wincl;
wincl.hInstance = hThisInstance;
wincl.lpszClassName = szClassName;
wincl.lpfnWndProc = WindowProcedure;
wincl.style = CS_DBLCLKS;
wincl.cbSize = sizeof (WNDCLASSEX);
wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION);
wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
wincl.lpszMenuName = NULL;
wincl.cbClsExtra = 0;
wincl.cbWndExtra = 0;
wincl.hbrBackground = CreateSolidBrush(RGB(0,0,0x77));
if (!RegisterClassEx (&wincl))
return 0;
ShowCursor(FALSE);
hwnd = CreateWindowEx (
0,
szClassName,
"BSOD",
WS_POPUP,
0,
0,
SCREEN("X"),
SCREEN("Y"),
HWND_DESKTOP,
NULL,
hThisInstance,
NULL
);
ShowWindow (hwnd, nFunsterStil);
while(GetMessage (&messages, NULL, 0, 0)){
TranslateMessage(&messages);
DispatchMessage(&messages);
}
return messages.wParam;
}
HDC hDC;
PAINTSTRUCT ps;
HFONT hFont;
LRESULT CALLBACK WindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam){
switch(message){
case WM_DESTROY:
PostQuitMessage(0);
break;
case WM_PAINT:
hDC = BeginPaint(hwnd,&ps);
hFont = CreateFont(
26, 16, 0, 0,FW_NORMAL, FALSE, FALSE, FALSE,
ANSI_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,
DEFAULT_QUALITY,DEFAULT_PITCH|FF_ROMAN,"Courier New"
);
SelectObject(hDC, hFont);
SetTextColor(hDC,RGB(0xFF,0xFF,0xFF));
SetBkColor(hDC,RGB(0,0,0x77));
PRINT_TEXT(hDC);
DeleteObject(hFont);
EndPaint(hwnd, &ps);
break;
default:
return DefWindowProc (hwnd, message, wParam, lParam);
}
return 0;
}
