Autor Beitrag
DOCa Cola
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 64

Vista x64
D2007
BeitragVerfasst: Mi 11.08.04 15:46 
Meine frage, wie kann ich eine externe applikation starten und dabei einen parameter übergeben aber das ganze OHNE shellexecute. das liegt daran das die exe datei die ich starten will garkeine exe endung hat. also sie heißt z.B applikation.ex1 und shellexecute wird damit wohl nicht ziehen, oder?

gruß DOCa Cola
Udontknow
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2596

Win7
D2006 WIN32, .NET (C#)
BeitragVerfasst: Mi 11.08.04 15:47 
Hast du es ausprobiert?

Cu,
Udontknow
maxk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1696
Erhaltene Danke: 1

Win XP, Debian Lenny
Delphi 6 Personal
BeitragVerfasst: Mi 11.08.04 15:51 
Dann nimm doch einfach Suche in: Delphi-Forum, Delphi-Library CREATEPROCESS.

_________________
Ein Computer wird das tun, was Du programmierst - nicht das, was Du willst.
DOCa Cola Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 64

Vista x64
D2007
BeitragVerfasst: Mi 11.08.04 15:52 
ja, gerade nochmal probiert, tut sich garnichts
DOCa Cola Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 64

Vista x64
D2007
BeitragVerfasst: Mi 11.08.04 15:53 
maxk hat folgendes geschrieben:
Dann nimm doch einfach Suche in: Delphi-Forum, Delphi-Library CREATEPROCESS.


ich schaus mir mal an, thx
hermit.de
Hält's aus hier
Beiträge: 8



BeitragVerfasst: Di 07.09.04 00:48 
Hallöchen,
ich dacht' ich hätt'.....und so habe ich doch tatsächlich den Beitrag, der hier rein sollte,
bei einem anderen geschrieben!

Nunja. Ich habe ihn doch noch gefunden.

Deine Lösung die da ist:
ausblenden volle Höhe Delphi-Quelltext
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:
32:
33:
34:
35:
procedure ExecuteFile(const AFilename: string; AParameter, ACurrentDir: string; AWait: Boolean);
var
  si: TStartupInfo;
  pi: TProcessInformation;
begin
  if Length(ACurrentDir) = 0 then
    begin
      ACurrentDir := ExtractFilePath(AFilename);
      if ACurrentDir[Length(ACurrentDir)] = '' then
        Delete(ACurrentDir, Length(ACurrentDir), 1);
    end;
  FillChar(si, SizeOf(si), 0);
  with si do
    begin
      cb := SizeOf(si);
      dwFlags := STARTF_USESHOWWINDOW;
      wShowWindow := SW_NORMAL;
    end;
  FillChar(pi, SizeOf(pi), 0);
  if Length(AParameter) = 0 then
    AParameter := Format('"%s"', [AFilename])
  else
    AParameter := Format('"%s" "%s"', [AFilename, AParameter]);
  if CreateProcess(nil, PChar(AParameter), nilnil, False,
    CREATE_DEFAULT_ERROR_MODE or CREATE_NEW_CONSOLE or
    NORMAL_PRIORITY_CLASS, nil, PChar(ACurrentDir), si, pi) then
    begin
      try
        if AWait then WaitForSingleObject(pi.hProcess, INFINITE);
      finally
        CloseHandle(pi.hProcess);
        CloseHandle(pi.hThread);
      end;
    end;
end;


AFilename ist die Exe
AParameter der zu übergebende Parameter
ACurrentDir das Verzeichniss der Exe (kann wegfallen, wenn exe mit konpletten Pfad angegeben wird)
AWait warten auf Ende


ev. mit dem Format-String noch probieren ( beim 2. "%s" ohne Anführungszeichen)
ansonsten tut das bei mir auch so.

hermit :D