Partager via


CCommandLineInfo::m_nShellCommand

Indique l'ordre d'environnement pour cette instance de l'application.

m_nShellCommand;

Notes

Le type de cette donnée membre est le type énuméré suivant, qui est défini dans la classe d' CCommandLineInfo .

enum{

FileNew,

FileOpen,

FilePrint,

FilePrintTo,

FileDDE,

AppRegister,

AppUnregister,

RestartByRestartManager,

FileNothing = -1

};

Pour obtenir une brève description de ces valeurs, consultez la liste suivante.

  • CCommandLineInfo::FileNew indique qu'aucun nom de fichier n'a été trouvé sur la ligne de commande.

  • CCommandLineInfo::FileOpen indique qu'un nom de fichier a été trouvé dans la ligne de commande et qu'aucune des indicateurs suivants n'a été trouvée sur la ligne de commande : /p, /pt, /dde.

  • CCommandLineInfo::FilePrint indique que la balise d' /p a été trouvée sur la ligne de commande.

  • CCommandLineInfo::FilePrintTo indique que la balise d' /pt a été trouvée sur la ligne de commande.

  • CCommandLineInfo::FileDDE indique que la balise d' /dde a été trouvée sur la ligne de commande.

  • CCommandLineInfo::AppRegister indique que la balise d' /Register ou d' /Regserver a été trouvée sur la ligne de commande et l'application a été demandée de l'enregistrement.

  • CCommandLineInfo::AppUnregister indique qu'il a demandé l'application d' /Unregister ou d' /Unregserver d'annuler l'enregistrement.

  • CCommandLineInfo::RestartByRestartManager indique que l'application a été redémarrée par le gestionnaire de redémarrage.

  • CCommandLineInfo::FileNothing arrête l'affichage d'une nouvelle fenêtre MDI enfant au démarrage.Par conception, les applications générées par l'Assistant MDI d'application affichent une nouvelle fenêtre enfant au démarrage.Pour désactiver cette fonctionnalité, une application peut utiliser CCommandLineInfo::FileNothing comme une commande d'environnement lorsqu'il appelle ProcessShellCommand.ProcessShellCommand est appelé par InitInstance( ) de toutes les classes dérivées par CWinApp .

Exemple

// 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;

Configuration requise

Header: afxwin.h

Voir aussi

Référence

Classe de CCommandLineInfo

Graphique de la hiérarchie

CCommandLineInfo::m_strFileName

CCommandLineInfo::m_strPrinterName

CCommandLineInfo::m_strDriverName

CCommandLineInfo::m_strPortName

CWinApp::ProcessShellCommand