What does it mean by "Registering a Window Class"? Why is it needed?
winapi
Solution
When a window is created (throw CreateWindow/Ex), it must be associated with a particular class. That class must first be registered with the system. MSDN simply states:
A process must register a window class before it can create a window of that class.
It is needed because that is how the API defines it. The documentation does not elaborate on what goes on under the covers because that is unnecessary information for a programmer (and the exact implementation can change in updates). You are programming against the interface, not the implementation.
Problem
In win32 API programming, there is a concept like "Registering a Window class". It is done using the functions `RegisterClass()` or `RegisterClassEx()`. What does it actually mean by the term "Register"? Why is it needed?