Wozu try-finally? Wie lautet der Rückgabewert von ShellExecute?
Delphi-Quellcode:
procedure TForm1.Timer1Timer(Sender: TObject);
var
errorcode: Integer;
begin
Progressbar1.Position := Progressbar1.Position +1;
Application.ProcessMessages;
if Progressbar1.Position = 100
then
begin
Timer1.Enabled := False;
Progressbar1.Position := 0;
errorcode := ShellExecute(
Handle, '
open', '
C:\Programme\test\test.exe',
nil,
nil, SW_SHOW);
if errorcode > 32
then
ShowMessage('
Fehler: ' + IntToStr(errorcode));
end;
end;