共用方式為


CWinApp::m_nCmdShow

對應於視窗的 nCmdShow 傳遞參數至 WinMain

int m_nCmdShow;

備註

當您呼叫應用程式的主視窗的 CWnd::ShowWindow 時,您應該透過 m_nCmdShow 做為引數。 m_nCmdShow 是型別 int的公用變數。

範例

   // The following code fragment is taken from CMyApp::InitInstance.
   // CMyApp is derived from CWinApp.

    // The main window has been initialized, so show and update it
   // using the nCmdShow parameter passed to the application when it
   // was first launched.
   // pMainFrame is the main MDI frame window of our app and is derived 
   // from CMDIFrameWnd.
    pMainFrame->ShowWindow(m_nCmdShow);
    pMainFrame->UpdateWindow();

需求

Header: afxwin.h

請參閱

參考

CWinApp 類別

階層架構圖