Bonjour à tous,

J'utilise un méthode pour lancer un ShellExecute et attendre la fin de l'opération pour continuer.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
 
var
  vSEInfo   : TShellExecuteInfo;
begin
  //Initialisation de la structure ShellExecuteInfo
  ZeroMemory(@vSEInfo, SizeOf(vSEInfo));
 
  //Remplissage de la structure ShellExecuteInfo
  vSEInfo.cbSize       := SizeOf(vSEInfo);
  vSEInfo.fMask        := SEE_MASK_NOCLOSEPROCESS  or SEE_MASK_FLAG_NO_UI;
  vSEInfo.Wnd          := vHandle;
  vSEInfo.lpVerb       := PWideChar(vOperation);
  vSEInfo.lpFile       := PWideChar(vFichier);
  vSEInfo.lpParameters := PWideChar(vParametres);
  vSEInfo.lpDirectory  := PWideChar(vRepertoire);
  vSEInfo.nShow        := vAffichage;
  ExitCode := 1;
  //Execution
  if ShellExecuteEx(@vSEInfo) then
  begin
    //ShellExecuteEx OK : attendre la fin du process
    Result := WaitForSingleObject(vSEInfo.hProcess, vDuree);
    GetExitCodeProcess(vSEInfo.hProcess, ExitCode);
  end
  else
  begin
    //ShellExecuteEx KO : renvoyer l'erreur
    Result := GetLastError();
  end;
  CloseHandle(vSEInfo.hProcess);
end;
Sous XP, pas de problèmes, mais sous vista, je reste bloqué sur mon appel à ShellExecuteEx (L'appli bloque ... indéfiniment comme si c'était une boucle). Ceci vient du SEE_MASK_NOCLOSEPROCESS car un autre mask ne me bloque pas. J'ai trouvé sur internet plusieurs problèmes avec vista et shellexecuteex mais jamais celui là !

Quelqu'un aurait une idée pour me sortir de ce mauvais pas car c'est extrêmement gênant !