cwolgamott
Programmer
Hello. I am modifying some forms in Delphi. I need to close the splash screen that appears at the beginning when it is first loaded when the next form appears. Here is the code that I am currently trying:
procedure Tfsplash.FormShow(Sender: TObject);
const
InfoNum = 1;
InfoStr: array[1..InfoNum] of string = ('FileVersion');
var
S: string;
n, Len, i: DWORD;
Buf: PChar;
Value: PChar;
Value2: array[1..InfoNum] of PChar;
begin
S := Application.ExeName;
n := GetFileVersionInfoSize(PChar(S), n);
if n > 0 then
begin
Buf := AllocMem;
//Memo1.Lines.Add('VersionInfoSize = ' + IntToStr);
GetFileVersionInfo(PChar(S), 0, n, Buf);
for i := 1 to InfoNum do
if (VerQueryValue(Buf, PChar('StringFileInfo\040904E4\' + InfoStr), Pointer(Value), Len)) then
label4.Caption := 'Version: ' + value;
//Memo1.Lines.Add(InfoStr + ' = ' + Value);
FreeMem(Buf, n);
end
else
label4.caption := 'Version n/a';
end;
procedure Tfsplash.FormClose(Sender: TObject);
begin
fsplash.Hide;
fsplash.Free;
end;
However, I am new to Delphi and am unsure of where to call FormClose in the Object Inspector. I would greatly appreciate any suggestions. Thank you.
procedure Tfsplash.FormShow(Sender: TObject);
const
InfoNum = 1;
InfoStr: array[1..InfoNum] of string = ('FileVersion');
var
S: string;
n, Len, i: DWORD;
Buf: PChar;
Value: PChar;
Value2: array[1..InfoNum] of PChar;
begin
S := Application.ExeName;
n := GetFileVersionInfoSize(PChar(S), n);
if n > 0 then
begin
Buf := AllocMem;
//Memo1.Lines.Add('VersionInfoSize = ' + IntToStr);
GetFileVersionInfo(PChar(S), 0, n, Buf);
for i := 1 to InfoNum do
if (VerQueryValue(Buf, PChar('StringFileInfo\040904E4\' + InfoStr), Pointer(Value), Len)) then
label4.Caption := 'Version: ' + value;
//Memo1.Lines.Add(InfoStr + ' = ' + Value);
FreeMem(Buf, n);
end
else
label4.caption := 'Version n/a';
end;
procedure Tfsplash.FormClose(Sender: TObject);
begin
fsplash.Hide;
fsplash.Free;
end;
However, I am new to Delphi and am unsure of where to call FormClose in the Object Inspector. I would greatly appreciate any suggestions. Thank you.