Ok. Te presento un programita que se ejecuta maximizado mostrando un Label que dice "LOADING GAME" al arrancar. Luego Ejecuta "Notepad.exe" y se esconde. Al cerrar Notepad, el programita se termina.
Espero que esta sea la idea de lo que quieres hacer.
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: String): cardinal;
public
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
function TForm1.Execute(CommandLine: String): cardinal;
var
SI: TStartupInfo;
PI: TProcessInformation;
begin
ZeroMemory(@SI, sizeof(TStartupInfo));
SI.cb:= sizeof(SI);
SI.dwFlags:= STARTF_USESHOWWINDOW or STARTF_USEPOSITION or STARTF_USESIZE;
SI.wShowWindow:= SW_SHOW;
Result:= 0;
if CreateProcess(nil, PCHAR(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
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
Execute('Notepad.exe');
Visible:= True;
Label1.Caption:= 'NOS VAMOS';
Update;
Sleep(500);
Close;
end;
end.
Saludos.