Comment lancer un exe avec CreateProcess qui soit sans ID processus père (enfin pas celui de l'exe appelant) ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12 ZeroMemory(@StartupInfo, Sizeof(StartupInfo)); StartupInfo.cb := Sizeof(StartupInfo); StartupInfo.dwFlags := STARTF_USESHOWWINDOW; StartupInfo.wShowWindow := SW_SHOWNORMAL; if CreateProcess(PChar('C:\Documents and Settings\moi\Bureau\App test\Project2.exe'), nil, nil, nil, False, 0, nil, nil, StartupInfo, ProcessInfo) then begin ... Application.Terminate; end; end;
Après avoir lancé cet exe (et fait 2 ~ 3 choses), mon application appelante se ferme.
Mon problème, c'est qu'il reste une fenêtre fantôme de mon application appelante jusqu'à ce que le deuxième exe soit fermé. J'en ai déduit que c'était le lien avec le processus père qui faisait ça.
Comment rendre l'exe lancé réellement autonome ?
Partager