C'est tout simple, imposible de retrouver les post sur les fonctions creatprocess() ou qqc dans le genre... (Ou autre ...)
Si qqn a plus de chance que moi ...
Merci
Version imprimable
C'est tout simple, imposible de retrouver les post sur les fonctions creatprocess() ou qqc dans le genre... (Ou autre ...)
Si qqn a plus de chance que moi ...
Merci
Thanks but,Citation:
Envoyé par joellel
Please, not in english.
I don't understand !!
L'anglais c'est la base de l'informatique ;)Citation:
Envoyé par miron
Toutes les docs de réference sont en anglais. :roll:
Faudrait que tu t'y met un jour à l'anglais :mrgreen:
Je viens d'avoir mon Partiel d'anglais,(TOEIC) alors mare, mais j'aissai, mais deja que l'info est dur en francais alors l'anglais !!!Citation:
Envoyé par AjJi
Je prefere renoncer je crois...
Bon je me lance.
Ayant dechifré la doc http://msdn.microsoft.com/library/de...ateprocess.asp
et en ayant sortit un bout de code aparament erroné, je me demandais si qqn serais en mesure de me doner un exemple de ligne de code permettant de lancer un programme WIN32 CONSOLLE APPS a partir dun chemin conu et de lancer ce nouveaux programme a partir d'un autre chemin , comme si on le lancai directement via un "double clic".
Merci.
PS : voila la ligne :
Avec Createprossess :Avec Shell exec :Code:CreateProcess(dossier_temp,NULL,NULL,NULL,FALSE,NORMAL_PRIORITY_CLASS,NULL,"\"C:\\Program Files\\PPB\\Laby\"",NULL,NULL);
(dossier_temp contien l@ du programme a lancer)Code:ShellExecute(hwnd,"open",dossier_temp,NULL,NULL,SW_HIDE);
Oui, la documentation peut te donner un exemple : http://msdn.microsoft.com/library/de..._processes.asp.Citation:
Envoyé par miron
La seule différence avec ton cas (spécifier un répertoire de démarrage), c'est qu'il ne faudra pas passer NULL comme avant-avant-dernier argument.
J'ai error267.Citation:
Envoyé par David.Schris
avecoù dossier_temp contien l@ du programme a demarer.Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 PROCESS_INFORMATION pi; LPTSTR szCmdline=_tcsdup(TEXT(dossier_temp)); 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) szCmdline, // 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 "\"C:\\Program Files\\PPB\\Laby\"", // Use parent's starting directory &si, // Pointer to STARTUPINFO structure &pi ) // Pointer to PROCESS_INFORMATION structure ) { printf( "CreateProcess failed (%d).\n", GetLastError() ); } // Wait until child process exits. WaitForSingleObject( pi.hProcess, INFINITE ); // Close process and thread handles. CloseHandle( pi.hProcess ); CloseHandle( pi.hThread );
Aije fait une grossiere erreur?
C'est bon j'ai trouvé.
Pour l'historique je post le bon code ou du moin un qui fonctionne :Merci a tous pour vos reponsses.Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31 STARTUPINFO si; PROCESS_INFORMATION pi; LPTSTR szCmdline=_tcsdup(TEXT(dossier_temp)); 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) szCmdline, // 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 "C:\\Program Files\\PPB\\Laby\\", // Use Other starting directory &si, // Pointer to STARTUPINFO structure &pi ) // Pointer to PROCESS_INFORMATION structure ) { printf( "CreateProcess failed (%d).\n", GetLastError() ); } // Wait until child process exits. WaitForSingleObject( pi.hProcess, INFINITE ); // Close process and thread handles. CloseHandle( pi.hProcess ); CloseHandle( pi.hThread );
Le commentaire est faux.Citation:
Envoyé par miron
Effectivement.Citation:
Envoyé par David.Schris
Merci.