複製鏈接
請複製以下鏈接發送給好友

CloseAllDocuments

鎖定
演示函數原型: theApp->CloseAllDocuments(TRUE)。
外文名
CloseAllDocuments
功    能
調用這個函數在退出之前關閉所有打開的文檔

目錄

CloseAllDocuments信息介紹

類: CWinApp
頭文件:
afxwin.h
語法:
void CloseAllDocuments(BOOL bEndSession); [1] 
參數:
bEndSession 指定Windows會話是否要結束。如果為TRUE,則會話結束;否則為FALSE,會話不結束。
説明:
在調用CloseAllDocuments之前要調用HideApplication.

CloseAllDocuments示例

/**********************************************
演示函數原型: theApp->CloseAllDocuments(TRUE);
程序功能説明: 關閉所有打開的文檔並結束會話。
************************************************/
//派生類
class CMyApp: public CWinApp  
{  public:  CTestApp( );  
CString str;//添加的對話框變量  
...  }
//CMyApp類型指針theApp 
...  }
CMyApp *theApp=(CMyApp *)AfxGetApp( );
//關閉所有打開的文檔並結束會話
theApp->CloseAllDocuments(TRUE);
參考資料
  • 1.    MSDN windows高級編程指南