Es problema del unicode el delphi. Si se fuerza a usar AnsiChar funcionará. Este problema no ocurre en C, posiblemente esté mas declarada la API.
Prueba este código que si funciona en Berlin y funcionará en tu versión de delphi:
Código Delphi
[-]
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
Timer1: TTimer;
procedure FormCreate(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
function Execute(CommandLine: AnsiString): cardinal;
public
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
function TForm1.Execute(CommandLine: AnsiString): cardinal;
var
SI: TStartupInfoA;
PI: TProcessInformation;
begin
ZeroMemory(@SI, sizeof(TStartupInfoA));
SI.cb:= sizeof(SI);
SI.dwFlags:= STARTF_USESHOWWINDOW or STARTF_USEPOSITION;
SI.wShowWindow:= SW_SHOW;
Result:= 0;
if CreateProcessA(0, PAnsiChar(CommandLine), nil, nil, false, 0, nil, nil, SI, PI) then
begin
WaitForInputIdle(PI.hProcess, 10000);
Visible:= false;
WaitForSingleObject(PI.hProcess,INFINITE);
GetExitCodeProcess(PI.hProcess, Result);
CloseHandle(PI.hProcess);
CloseHandle(PI.hThread);
end
else
Result:= $FFFFFFFF;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
ShowWindow(Handle, SW_MAXIMIZE);
WindowState:= wsMaximized;
FormStyle:= fsStayOnTop;
BorderStyle:= bsNone;
Label1.Caption:= '"LOADING GAME"';
Label1.Font.Size:= 30;
Label1.Font.Style:= [fsBold];
Timer1.Interval:= 2000;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
Timer1.Enabled:= false;
Execute('cmd.exe');
Visible:= True;
Label1.Caption:= 'NOS VAMOS';
Update;
Sleep(500);
Close;
end;
end.
He añadido discretas mejoras y pasado a PAnsiChar.
Saludos.