JavaScript EditorFree JavaScript Editor     Ajax Editor 

Main Page
  Previous Section Next Section

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?

Also, to be complete, there is the old RegisterClass() function, which is used to register a class based on the older structure WNDCLASS.

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.

      Previous Section Next Section

    JavaScript EditorAjax Editor     JavaScript Editor