1)OnOK()或OnCancel()只对窗口程序有用
2)PostQuitMessage(0);//最常用
3)exit(1);//据说已经不常用了
4)ExitProcess(0);
5)SendMessage(WM_CLOSE);
6)((CMainFrame*)AfxGetMainWnd())->SendMessage(WM_CLOSE);
BOOL DestroyWindow(
HWND hWnd // handle to window to destroy