Register window before creating it in win32 programming-Collection of common programming errors
When we register a window, we must create it before we register another window.
This is just not true. The only important thing is that you cannot create a window of some class unless that class is already registered.
It is also common to do it otherwise in practice, and I cannot see any reason why it should be considered best practice. Many real programs register all window classes they might need in runtime during their initialization, and then arbitrarily just create the windows ad-hoc during application’s lifetime.