![]() |
ShellExecuteEx Fehler
Programmende abwarten
das versuche ich mit dem hier gefundenen Code das Problem ist das er bei mir zwar schonmal funtioniert hat aber im jetzigen Fall einfach zu zeitig das Programmende meldet
Delphi-Quellcode:
es handelt sich um ein Konsolenprogramm das das Videoformat umwandelt
function TForm1.Execute(FName :String): Boolean;
var SHELLINFO : TShellExecuteInfo; lpExitCode : Cardinal; begin Result := False; fillChar(SHELLINFO, SizeOf(SHELLINFO), #0); with SHELLINFO do begin cbSize := SizeOf(SHELLINFO); fMask := 64; Wnd := 0; lpVerb := nil; lpFile := PChar('engine.exe '); lpParameters := PChar('Temp.flv' + ' -o "'+FName+'"'+' -oac mp3lame -ovc x264'); lpDirectory := PChar(ExtractFilePath(Application.Exename)); nShow := SW_HIDE; end; try ShellExecuteEx(@SHELLINFO); if WaitForSingleObject(SHELLINFO.hProcess, 1000) = 0 then repeat Application.ProcessMessages; GetExitCodeProcess(SHELLINFO.hProcess, lpExitCode); until (lpExitCode <> STILL_ACTIVE); Result := True; except on E:Exception do showmessage(e.Message); end; end; Edit: hab das Problem mit "IsFileinUse" umgangen |
Alle Zeitangaben in WEZ +1. Es ist jetzt 07:30 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