Si revisas el código llegarás a esta línea:
Código Delphi
[-]
Win32Check(CreateProcess(nil, 'NOTEPAD.EXE', nil, nil, FALSE,
CREATE_NEW_CONSOLE, nil, nil, StartInfo, ProccesInfo));
Sustituye NOTEPAD.EXE por cualquier otro programa que quieras; Puedes incluir el path para mayor seguridad.
Otra opción es sustituir el procedimiento entero por este otro, a ver si este te devuelve algun mensaje de error:
Código Delphi
[-]
procedure TfrmMain.Button1Click(Sender: TObject);
var
StartInfo: STARTUPINFO;
ProccesInfo: PROCESS_INFORMATION;
hNotepad: HWND;
begin
ZeroMemory(@StartInfo, SizeOf(STARTUPINFO));
with StartInfo do
begin
cb := SizeOf(STARTUPINFO);
dwFlags := STARTF_USESHOWWINDOW;
wShowWindow := SW_HIDE;
end;
try
Win32Check(CreateProcess(nil, 'c:\winnt\_NOTEPAD.EXE', nil, nil, FALSE,
CREATE_NEW_CONSOLE, nil, nil, StartInfo, ProccesInfo));
hNotepad := FindThreadWindow(ProccesInfo.dwThreadId, 0, nil, nil);
if hNotepad <> 0 then begin
Windows.SetParent(hNotepad, sbSpool.Handle);
ShowWindow(hNotepad, SW_SHOW);
end
else begin
MessageDlg('No se ha encontrado la aplicación funcionando...', mtError, [mbOK], 0);
end;
except
on E:Exception do begin
MessageDlg(Format('Se ha producido un error: %s' ,[E.Message]), mtError, [mbOK], 0);
end;
end;
end;