Visual C problème

M

Moof

Guest
Comment puis-je exécuter un fichier EXE externes à partir de Visual C , pour le Bloc-notes par exemple??

 
Moof a écrit:

Comment puis-je exécuter un fichier EXE externes à partir de Visual C , pour le Bloc-notes par exemple??
 
Salut,
Utilisez la fonction CreateProcess () API Windows, son recommandée par Microsoft pour le lancement de toute nouvelle demande.
En savoir plus sur CreateProcess sur MSDN.

 
de manière simple

ShExecInfo SHELLEXECUTEINFO = (0);
ShExecInfo.cbSize = sizeof (SHELLEXECUTEINFO);
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
ShExecInfo.hwnd = NULL;
ShExecInfo.nShow = SW_SHOW;
ShExecInfo.lpVerb = NULL;
ShExecInfo.lpFile = "Notepad.exe"
ShExecInfo.lpParameters = "c: \ text.txt \";
ShExecInfo.lpDirectory = NULL;

ShExecInfo.hInstApp = NULL;
ShellExecuteEx (& ShExecInfo);

 
Simpler Way

CreateProcess ("Notepad.exe", NULL, NULL, NULL, FALSE, 0, NULL, NULL, NULL, NULL);

<img src="http://www.edaboard.com/images/smiles/icon_smile.gif" alt="Sourire" border="0" />
 

Welcome to EDABoard.com

Sponsor

Back
Top