Hello @KevinL ,
After reproducing the issue on my end, I understand your concern.
CreateWindowExA sends WM_NCCREATE and WM_CREATE during the call itself, before it gets a chance to return anything. So when Windows tries to call your procedure at address 0x00000000, the Access Violation may stop everything right there, which could be why CreateWindowExA never gets to return NULL or set a GetLastError code.
I suggest you can check lpfnWndProc before calling RegisterClassA. This way you could catch the problem early, where you still have control:
// Guard before RegisterClassA
if (!wc.lpfnWndProc) {
// handle the error yourself here
}
Hope this clarifies your question. If you found my answer helpful, thank you in advance for following this guide to give feedback.
Thank you.