CreateProcess Récupérer le résultat
Bonjour,
Je voudrais récupérer le résultat d'une commande, par exemple ping localhost.
La commande se lance bien, mais comment faire pour récuperer ce résultat.
Voici le bout de mon code pour lancer un process :
Code:
1 2 3 4 5 6 7 8 9 10 11
|
STARTUPINFO si;
ZeroMemory(&si, sizeof(si));
si.dwFlags = STARTF_USESHOWWINDOW;
si.wShowWindow = SW_NORMAL;
PROCESS_INFORMATION pi;
if (!CreateProcess(NULL, "ping localhost", NULL, NULL, true, HIGH_PRIORITY_CLASS, NULL, NULL, &si, &pi)){
wxMessageBox("Erreur", _T("Infos"), wxOK | wxICON_INFORMATION | wxCENTRE, this);
} |
Le résultat doit etre dans une variable... Pour ensuite la retravailler.
Merci