EP_SplashScreenShow
The EP_SplashScreenShow function forces showing of a splash screen. If the Splash Screen is already shown, the function does nothing. It returns a handle of the Splash Screen window, you may place your own controls onto this window. Splash Screen feature should be enabled, otherwise the function will fail, see MISCELLANEOUS - Splash Screen.
Return Value
The function returns the handle of the splash screen window, or zero if it fails.
Definition
Show/Hide C++ function definition
extern "C" __declspec( dllimport ) __stdcall int EP_SplashScreenShow();
Show/Hide Delphi function definition
function EP_SplashScreenShow : Cardinal;
Show/Hide Visual Basic function definition
Public Declare Function EP_SplashScreenShow Lib "enigma_ide.dll" () As Long
Show/Hide C# (.NET) function definition
public class Enigma_IDE
{
[DllImport("enigma_ide.dll", CallingConvention = CallingConvention.StdCall)]
public static extern int EP_SplashScreenShow();
}
Examples
Show/Hide Delphi function example
unit test_unit;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, CommCtrl, ExtCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
lbTime: TLabel;
btnClose: TButton;
tTimer: TTimer;
procedure btnCloseClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure tTimerTimer(Sender: TObject);
private
FProgressHandle : dword;
FPercent : integer;
public
end;
var
Form1: TForm1;
implementation
uses enigma_ide;
{$R *.dfm}
procedure TForm1.btnCloseClick(Sender: TObject);
begin
Close;
end;
procedure TForm1.FormShow(Sender: TObject);
var
wnd : dword;
begin
lbTime.Caption := TimeToStr(Now);
wnd := EP_SplashScreenShow;
if wnd <> 0 then
begin
FPercent := 0;
FProgressHandle := CreateWindowEx(0, PROGRESS_CLASS, nil, WS_CHILD or WS_VISIBLE, 20, 350, 490, 30, wnd, 0, 0, nil);
SendMessage(FProgressHandle, PBM_SETRANGE, 0, MAKELPARAM(0, 100));
SendMessage(FProgressHandle, PBM_SETSTEP, 1, 0);
tTimer.Enabled := true;
end;
end;
procedure TForm1.tTimerTimer(Sender: TObject);
begin
if FPercent >= 100 then
begin
tTimer.Enabled := false;
DestroyWindow(FProgressHandle);
EP_SplashScreenHide;
SetForegroundWindow(Self.Handle);
end;
SendMessage(FProgressHandle, PBM_STEPIT, 0, 0);
inc(FPercent);
end;
end.
See examples in the Examples\SplashScreen folder.