Registriert seit: 20. Feb 2004
Ort: Noch unterm Mond
126 Beiträge
|
Re: ShellExecute startet das Programm nicht...
22. Feb 2004, 21:12
Sorry, bin Anfänger ...
Damit gehts auch nicht:
Delphi-Quellcode:
function WinExec32AndWait(const Cmd: string; const CmdShow: Integer): Cardinal;
var
sui : TStartupInfo;
pi : TProcessInformation;
begin
Result := Cardinal($FFFFFFFF);
ZeroMemory(@sui,sizeof(TStartupInfo)); sui.cb := SizeOf(TStartupInfo);
sui.dwFlags := STARTF_USESHOWWINDOW;
sui.wShowWindow := CmdShow;
if(CreateProcess(nil,pchar(Cmd),nil,nil,False,NORMAL_PRIORITY_CLASS,nil,nil,sui,pi)) then
begin
WaitForInputIdle(pi.hProcess, INFINITE);
if(WaitForSingleObject(pi.hProcess, INFINITE) = WAIT_OBJECT_0) then
begin
{$IFDEF DELPHI3}
if not GetExitCodeProcess(pi.hProcess, Integer(Result)) then
{$ELSE}
if not GetExitCodeProcess(pi.hProcess, Result) then
{$ENDIF DELPHI3}
Result := Cardinal($FFFFFFFF);
end;
CloseHandle(pi.hThread);
CloseHandle(pi.hProcess);
end;
end;
procedure TForm6.GroupBox3Click(Sender: TObject);
var ChildExitCode: Cardinal;
begin
ChildExitCode := WinExec32AndWait('"C:\DRPEncFiles\DVD2AVIDRPEnc.exe"', SW_NORMAL);
if ChildExitCode = $FFFFFFFF then
ShowMessage('Delphi 6 konnte nicht gestartet werden.');
end;
CU
DRPEnc
|
|
Zitat
|