共用方式為


CCommandLineInfo::m_nShellCommand

表示應用程式的這個執行個體的 Shell 命令。

m_nShellCommand;

備註

這個資料成員的型別會是下列列舉型別,在 CCommandLineInfo 類別中定義。

enum{

FileNew,

FileOpen,

FilePrint,

FilePrintTo,

FileDDE,

AppRegister,

AppUnregister,

RestartByRestartManager,

FileNothing = -1

};

如需這些值的簡短說明,請參閱下列清單。

  • CCommandLineInfo::FileNew 表示檔案名稱在命令列中找到。

  • CCommandLineInfo::FileOpen 表示檔案名稱在命令列中,且下列旗標都在命令列中找不到: /p/pt/dde

  • CCommandLineInfo::FilePrint 表示 /p 旗標在命令列中找到。

  • CCommandLineInfo::FilePrintTo 表示 /pt 旗標在命令列中找到。

  • CCommandLineInfo::FileDDE 表示 /dde 旗標在命令列中找到。

  • CCommandLineInfo::AppRegister 表示 /Register/Regserver 旗標在命令列中,且應用程式會需要登錄。

  • CCommandLineInfo::AppUnregister 表示 /Unregister/Unregserver 應用程式已要求移除註冊。

  • CCommandLineInfo::RestartByRestartManager 表示應用程式會重新啟動管理員重新啟動。

  • CCommandLineInfo::FileNothing 關閉新的 MDI 子視窗的啟動時顯示。 根據設計,應用程式精靈所產生的 MDI 應用程式啟動時顯示新的子視窗。 呼叫 ProcessShellCommand,若要關閉這個功能,應用程式可以使用 CCommandLineInfo::FileNothing ,當 Shell 命令。 ProcessShellCommand 由所有 CWinApp 衍生類別 InitInstance( ) 呼叫。

範例

// From CMyWinApp::InitInstance

// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);

// DON'T display a new MDI child window during startup!!!
cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;

// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
   return FALSE;

需求

Header: afxwin.h

請參閱

參考

CCommandLineInfo 類別

階層架構圖

CCommandLineInfo::m_strFileName

CCommandLineInfo::m_strPrinterName

CCommandLineInfo::m_strDriverName

CCommandLineInfo::m_strPortName

CWinApp::ProcessShellCommand