Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
procedure OpenMyForm;
var
Options: TfrmOptions;
begin
Options := TfrmOptions.Create(Application); //could also be nil
try
Options.LoadMyData;
Options.ShowModal;
finally
Options.Release;
end;
end;
procedure TCustomForm.WMQueryEndSession(var Message: TWMQueryEndSession);
begin
Message.Result := Integer(CloseQuery);
end;
procedure TForm1.FormCreate (Sender: TObject);
begin
Application.HookMainWindow (HookProc)
end;
function TForm1.HookProc (var message: TMessage) : Boolean;
begin
result := False;
if message.Msg = WM_ENDSESSION then
begin
if WordBool (message.WPARAM) then
begin
{ Windows is closing down - clean up!! }
{ This should execute all ExitProcs, close windows and call destructors.. }
Halt
{ This should close things down properly, }
{ but do we have enough time to handle any posted messages before Windows }
{ is already down?? This will result in a PostQuitMessage that might }
{ never arrive! }
{ This doesn't always work - avoid it }
{ Close;}
end
end
end;