Ik heb nu dit, maar er gebeurd niets.
Hoe krijg ik het voor elkaar dat de function HandleAppEvent uitgevoerd wordt ?
Code:
unit Unit1;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.Memo.Types,
FMX.Controls.Presentation, FMX.ScrollBox, FMX.Memo,
FMX.Platform; //TBV TEST
type
TForm1 = class(TForm)
Memo1: TMemo;
private
{ Private declarations }
public
{ Public declarations }
function HandleAppEvent(AAppEvent: TApplicationEvent; AContext: TObject): Boolean;
end;
var
Form1: TForm1;
implementation
{$R *.fmx}
//------------------------------------------------------------------------------
//https://stackoverflow.com/questions/28834798/how-can-i-keep-my-application-in-the-foreground
function TForm1.HandleAppEvent(AAppEvent: TApplicationEvent; AContext: TObject): Boolean;
begin
Memo1.Lines.Add('---');
case AAppEvent of
TApplicationEvent.FinishedLaunching: Memo1.Lines.Add('1 Finished Launching');
TApplicationEvent.BecameActive: Memo1.Lines.Add('2 Became Active'); ///
TApplicationEvent.WillBecomeInactive: Memo1.Lines.Add('3 Will Become Inactive'); ///
TApplicationEvent.EnteredBackground: Memo1.Lines.Add('4 Entered Background');
TApplicationEvent.WillBecomeForeground: Memo1.Lines.Add('5 Will Become Foreground');
TApplicationEvent.WillTerminate: Memo1.Lines.Add('6 Will Terminate');
TApplicationEvent.LowMemory: Memo1.Lines.Add('7 Low Memory');
end;
Result := True;
end;
//------------------------------------------------------------------------------
end.
Bookmarks