Registering the Windows Class
Now that the Windows class is defined and stored in winclass, you must tell Windows about the new class. This is accomplished via the function RegisterClassEx(), which simply takes a pointer to the new class definition, like this:
Notice that I'm not using the class name, which is "WINCLASS1" in the case of our example. For RegisterClassEx(), you must use the actual structure holding the class because at the point before the call to the function, Windows does not yet know of the existence of the new class. Get it?
Once the class is registered, we are free to create the window with it. Let's see how to do that, and then revisit the details of the event handler and main event loop to see what kind of processing needs to be done for a Windows application to work.