Figure 4: Sample ShutdownProcess on CApp-derived class

void CShutdownProcessTest1Dlg::OnShutdown() 
{
    // When the shutdown button on the test dialog 
    // is clicked, shutdown all loaded applications. 
    theApp.ShutdownProcess();
}