Run Member Function
| Overview | How Do I | | Tutorial
A framework application spends most of its time in the member function of class . After initialization, WinMain calls Run to process the message loop.
Run cycles through a message loop, checking the message queue for available messages. If a message is available, Run dispatches it for action. If no messages are available — often the case — Run calls OnIdle to do any idle-time processing that you or the framework may need done. If there are no messages and no idle processing to do, the application waits until something happens. When the application terminates, Run calls ExitInstance. The figure The Message Loop in OnIdle Member Function shows the sequence of actions in the message loop.
Message dispatching depends on the kind of message. For more information, see Messages and Commands in the Framework.