Einzelnen Beitrag anzeigen

Tannendiess

Registriert seit: 28. Feb 2004
10 Beiträge
 
Delphi 7 Professional
 
#9

Re: Shellexecute mit explorer.exe -> Fenster verhindern

  Alt 2. Feb 2006, 15:58
Sorry, muss ich wohl falsch reinkopiert haben. So heißt es richtig:

Delphi-Quellcode:
procedure TForm1.ExplorerStarten;
var aSi:TStartUpInfo;
aPI:TProcessInformation;
dwError:DWord;
begin
  FillChar(aSi,SizeOf(TStartupInfo),0);
  with aSI do
  begin
    cb:=SizeOf(TStartupInfo);
    dwFlags:=STARTF_USESHOWWINDOW;
    wShowWindow:=SW_HIDE;
  end;
  if not
         CreateProcess(PChar('explorer.exe'),nil,nil,nil,false,
                       NORMAL_PRIORITY_CLASS,nil,nil,aSI,aPI) then
  begin
    dwError:= GetLastError;
    showmessage(Format('Programm kann nicht gestartet werden. Fehler : %d',[dwError]));
  end;
end;
Der Fehler tritt aber trotzdem auf.
  Mit Zitat antworten Zitat