This static function implements the window procedure.
WindowProc uses the default message map (declared with BEGIN_MSG_MAP) to direct messages to the appropriate handlers. If necessary, WindowProc calls DefWindowProc for additional message processing. If the final message is not handled, WindowProc does the following:
Performs unsubclassing if the window was unsubclassed.
Calls OnFinalMessage before the window is destroyed.
You can override WindowProc to provide a different mechanism for handling messages.