• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 334
  • Last Modified:

OnActivate event of TApplication in CBuilder

How can I control the behaviour of my application when the user presses ALT+TAB and my application becomes active? I should write code in the OnActivate Event of the TApplication object, but I don't know how I can get this event into my code. I don't want the OnActivate event of the Form object, because that one doesn't work in this case.
1 Solution
Next is sceleton of code:

class TMainForm : public TForm
void __fastcall ApplicationActivate(TObject* Sender);
void __fastcall ApplicationDeactivate(TObject* Sender);

void __fastcall TMainForm::FormCreate(TObject* Sender)
Application->OnActivate = ApplicationActivate;
Application->OnDeactivate = ApplicationDeactivate;
I hope, it helps. Alex

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now