![]() |
ShellExecuteEx -> dcc32.exe
Hallo
Ich habe noch nie was mit ShellExecuteEx gemacht nun probiere ich ein wenig rum und bin auf ![]() gestossen. Ich starte eine eine Batch das funktioniert auch gut.
Delphi-Quellcode:
Aber schöner wärs schon mit der folgenden function,
dummyPath := '"' + ExePath + 'RC\MakeResDll.bat' + '"';
iCE:= shellapi.shellExecute(0, 'open', pChar(dummyPath), nil, nil, SW_MAXIMIZE); ich bekomme auch ein ShellExecuteEx(@Sei) = true hin nur wird die dll nicht erstellt. Ich übergebe FileName = Pfad + dcc32.exe Directory = Ausgabepfad Parameter = Pfad von File .dpr Verb = '' = Nil; CmdShow = 1;
Delphi-Quellcode:
Meine Frage gibt es eine Möglichkeit das das cmd Fenster nicht geschlossen wird
function ShellExecAndWait(const FileName, Directory, Parameters, Verb: string; CmdShow: Integer): Boolean;
var Sei: TShellExecuteInfo; begin FillChar(Sei, SizeOf(Sei), #0); Sei.cbSize := SizeOf(Sei); Sei.fMask := SEE_MASK_DOENVSUBST or SEE_MASK_FLAG_NO_UI or SEE_MASK_NOCLOSEPROCESS; Sei.lpFile := PCharOrNil(FileName); Sei.lpDirectory := PCharOrNil(Directory); Sei.lpParameters := PCharOrNil(Parameters); Sei.lpVerb := PCharOrNil(Verb); Sei.nShow := CmdShow; Result := ShellExecuteEx(@Sei); if Result then begin WaitForInputIdle(Sei.hProcess, INFINITE); WaitForSingleObject(Sei.hProcess, INFINITE); CloseHandle(Sei.hProcess); end; end; um zu sehen was ich falsch mache oder mache ich generell einen Denkfehler |
AW: ShellExecuteEx -> dcc32.exe
Schreib als letzte Zeile in die Batch-Datei ein "pause" (ohne Anführungszeichen).
|
AW: ShellExecuteEx -> dcc32.exe
DeddyH
Das ist nett, nur ich möchte es eben nicht als Batch ausführen sondern mit ShellExecuteEx, ich möchte verstehen wie diese function funktioniert mit einem dcc32 aufruf. |
AW: ShellExecuteEx -> dcc32.exe
Eigentlich ganz einfach
Vielleicht nützt es ja mal jemanden
Delphi-Quellcode:
function PCharOrNil(const AString: string): PChar;
begin if AString = '' then Result := nil else Result := PChar(AString); end; function ShellExecAndWait(const FileName, Directory, Parameters, Verb: string; CmdShow: Integer): Boolean; var SEI: TShellExecuteInfo; begin FillChar(SEI, SizeOf(SEI), #0); SEI.cbSize := SizeOf(SEI); SEI.fMask := SEE_MASK_DOENVSUBST or SEE_MASK_FLAG_NO_UI or SEE_MASK_NOCLOSEPROCESS; SEI.lpFile := PCharOrNil(FileName); // Filename SEI.lpDirectory := PCharOrNil(Directory); // Directory SEI.lpParameters := PCharOrNil(Parameters); // Parameters SEI.lpVerb := PCharOrNil(Verb); // Verb SEI.nShow := CmdShow; // How display the CMD Window Result := ShellExecuteEx(@SEI); if Result then begin WaitForInputIdle(SEI.hProcess, INFINITE); WaitForSingleObject(SEI.hProcess, INFINITE); CloseHandle(SEI.hProcess); end; end; procedure TForm1.Button2Click(Sender: TObject); const Dcc32Path = 'D:\Users\xyz\Documents\RAD Studio\MyProjects\SetWinIcon\Debug\SetIcon.d\RC\cfg\dcc32.exe'; DprPath = 'D:\Users\xyz\AppData\Local\Temp\RC\justtest.dpr'; OutPutPath = 'D:\Users\xyz\Pictures'; begin if ShellExecAndWait(Dcc32Path , OutPutPath , DprPath ,'open', 1) then self.Color := clGreen else self.Color := clFuchsia; end; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 07:18 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz