Einzelnen Beitrag anzeigen

st18061974

Registriert seit: 5. Feb 2003
52 Beiträge
 
Delphi 5 Enterprise
 
#10

Re: den Windows Explorer im Arbeitsverzeichnis öfnnen

  Alt 5. Okt 2005, 18:55
@marabu

Supi ... so klappts. Ich hab´s jetzt so gemacht.

Delphi-Quellcode:
pfad:=ExtractFilePath(ParamStr(0));
explorer:=IncludeTrailingPathDelimiter(GetEnvironmentVariable('WINDIR'))+'explorer.exe';
ShellExecute(GetDeskTopWindow,'open',PChar(explorer),pchar('/e,'+pfad),nil,SW_SHOWNORMAL);
application.terminate;
Ich hatte einen anderen weg benutzt um %windir%/explorer.exe zu bekommen. Auf diese Weise ging der Eplorer immer nur in C:\Windows auf und das ohne 'Ordnerbaum'.

Delphi-Quellcode:
function ExpandEnvStr(const szInput: string): string;
const
  MAXSIZE = 32768;
begin
    SetLength(Result,MAXSIZE);
    SetLength(Result,ExpandEnvironmentStrings(pchar(szInput),
      @Result[1],length(Result)));
end;

---------------
AUFRUF DANN PER
---------------

explorer:=ExpandEnvStr('%windir%')+'\explorer.exe';
  Mit Zitat antworten Zitat