Réponse acceptée !
ouai mais ca c pour lancé un prog, mais po de réponse pour la fermeture.... donc pour le lancement...
tu as ShellExecute(NULL,"open",temp2,0,0,SW_SHOWNORMAL);
ou (conseiller)
STARTUPINFO si; PROCESS_INFORMATION pi;
ZeroMemory( &si, sizeof(si) ); si.cb = sizeof(si); ZeroMemory( &pi, sizeof(pi) );
// Start the child process. if( !CreateProcess( NULL, // No module name (use command line). (LPSTR)temp2, // Command line. NULL, // Process handle not inheritable. NULL, // Thread handle not inheritable. FALSE, // Set handle inheritance to FALSE. 0, // No creation flags. NULL, // Use parent's environment block. NULL, // Use parent's starting directory. &si, // Pointer to STARTUPINFO structure. &pi ) // Pointer to PROCESS_INFORMATION structure. ) // Wait until child process exits. WaitForSingleObject( pi.hProcess, INFINITE );
// Close process and thread handles. CloseHandle( pi.hProcess ); CloseHandle( pi.hThread );
pour la fermeture dépend de plein de chose....
c peut etre un peu compliquer mais va voir une de mes source hide unhide(énumération des processus, tu pouras trouver ton bonheur fais correspondre le chemin de ton prog), ou BP Manager (ici c la maniere la plus simple pour quiter un process, mais c a partir du titre du prog) youpi :)
|