basically, I have no idea what all the codes mean(other than #include <windows.h>)
can we go over it?
maybe someone can write comments beside all the codes
thanks
basically, I have no idea what all the codes mean(other than #include <windows.h>)
can we go over it?
maybe someone can write comments beside all the codes
thanks
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Put simply...yes. That's what's needed to open a blank window afaik. You can check out a book that helped me (idk if it's still the best one?) Charles Petzold Programming Windows 5th Edition. Quite big and a bit pricey but very good. I got a copy on eBay.
Your code gives a declaration of a window message handler function, then comes to the part where Windows enters your program (the WinMain part) then it creates a window class and then registers it.
Then it creates the window. Then it enters the message loop which makes use of your window message handler function to process messages generated by any interaction with the window. The last part is where the window message handling function is defined.
In your case your code only handles (explicitly) one message which is the destroy message that closes the window.
If you don't know what any of that means it's time to do some work and reading
call ShowWindow,
```
HWND hWnd = CreateWindowW(L"myWindowClass",L"My Window",WS_EX_OVERLAPPEDWINDOW | WS_VISIBLE,100,100,500,500, NULL,NULL,NULL,NULL);
ShowWindow(hWnd, SW_SHOWNORMAL);
```