In functionLRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
I get hwnd , then I have to pass it to many other functions through parameters, and this clutters up the code. Maybe make a global variable Hwnd , let other functions use it? Otherwise, I read the theory that global variables are dangerous, but in this case, perhaps this is justified?
|
Hwnd, it is easy to confuse with dozens of other hwnd small letters. It is better to give a more speaking name, which will reflect which window hwnd. And if it is installed in CALLBACK, be careful not to start using it before the callback occurred. - Mike