I changed my code from this:
if (!RegisterClassEx(&wc)) {
MessageBox(NULL, "Window Registration Failed!", "Error!", MB_ICONEXCLAMATION | MB_OK);
return 0;
}
to this:
if (!RegisterClassEx(&wc)) {
MessageBox(NULL, "Failed to register window class.", "Error", MB_ICONEXCLAMATION | MB_OK);
return 0;
}
and it causes failure of window creation
hwnd = CreateWindowEx(
WS_EX_CLIENTEDGE,
g_szClassName,
"The title of my window",
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT, 240, 120,
NULL, NULL, hInstance, NULL);
if (hwnd == NULL) {
MessageBox(NULL, "Failed to create a window.", "Error", MB_ICONEXCLAMATION | MB_OK);
return 0;
}
I honestly have no idea what to do