As shown above, the Microsoft Foundation Classes supply a WinMain function that provides several standard Windows actions for you:
Windows application and instance initialization.
Registration of several standard window classes.
A message loop.
The Microsoft Foundation Classes also supply several ways to customize or override the standard facilities and behavior. You can:
Write your own WinMain function and substitute it at link time for the WinMain provided by the Microsoft Foundation Classes.
Call a global AfxRegisterWndClass function to register your own window classes.
Override member functions such as InitApplication, InitInstance, OnIdle, Run, and ExitInstance in your derived application class.
Make your program a Multiple Document Interface (MDI) application.
Add dialog boxes, menus, and accelerators.