I am developing an application for WM5.0 in C#. Is there any method by which
i can get the minimize event,means when i click on the "X" button on the form
can i get that event?? and if yes in which function i'll be receiving that
event?

Re: how to capture "X" and "OK" button event on a window form? by Fabien

Fabien
Fri May 18 04:42:24 CDT 2007

Hi,

Try to override the OnDeactivate event.
protected override void OnDeactivate(EventArgs e)
{
// Your code
}

BR

Fabien Decret
Windows Embedded Consultant

ADENEO (ADESET)
http://www.adeneo.adetelgroup.com/|http://fabdecret.blogspot.com/

On 18 mai, 05:55, vjsharma_27 <vjsharm...@discussions.microsoft.com>
wrote:
> I am developing an application for WM5.0 in C#. Is there any method by which
> i can get the minimize event,means when i click on the "X" button on the form
> can i get that event?? and if yes in which function i'll be receiving that
> event?



RE: how to capture "X" and "OK" button event on a window form? by srhartone

srhartone
Fri Jun 01 16:46:02 CDT 2007

Have you tried hooking the WM_CLOSE event using an IMessageFilter class. The
OnDeactivated will always fire even when displaying a messagebox or clicking
the start menu etc.

--
Simon Hart
http://srhartone.blogspot.com


"vjsharma_27" wrote:

> I am developing an application for WM5.0 in C#. Is there any method by which
> i can get the minimize event,means when i click on the "X" button on the form
> can i get that event?? and if yes in which function i'll be receiving that
> event?
>