shark wrote:
Hi
I have simple question. How to catch the event when my main application
window is being minimized or sent to background by another application (no
its own window)
Thanks
Shark
In System.Windows.Forms.Form
there are functions like
OnDeactivate(EventArgs e)
I think you need find the right functions to override, do something like
that.
protected override OnDeactivate(EventArgs e)
{
base.OnDeactivate(e);
//Do your stuff here..
}
Here is what it says in MSDN..
Raising an event invokes the event handler through a delegate. For more
information, see Raising an Event.
The OnDeactivate method also allows derived classes to handle the event
without attaching a delegate. This is the preferred technique for
handling the event in a derived class.
Notes to Inheritors: When overriding OnDeactivate in a derived class, be
sure to call the base class's OnDeactivate method so that registered
delegates receive the event.