• 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.
0
upanishadiii
Asked:
upanishadiii
1 Solution
 
AlexVirochovskyCommented:
Next is sceleton of code:

class TMainForm : public TForm
{
....
private:
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
0

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