For Programmers: Free Programming Magazines  


Home > Archive > C# > September 2005 > What is the evnet for windows minimize









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author What is the evnet for windows minimize
Maziar Aflatoun

2005-09-02, 6:58 pm

Hi,

I'm having a hard time finding the event that fires when form minimize
button is clicked. Any help would be greatly appreciated.

thanks
Maz


Jan Bannister

2005-09-09, 6:59 pm

Hi Maziar,

It's Resize

Jan

GadgetGuy

2005-09-15, 6:59 pm

Override the forms WndProc method to trap the SC_MINIMIZE message, eg.
Hope this helps
GG



const int WM_SYSCOMMAND = 0x112;
const int SC_CLOSE = 0xF060;
const int SC_MINIMIZE = 0xF020;

protected override void WndProc(ref Message m)
{
if (m.Msg == WM_SYSCOMMAND)
{
// override form minimize button
if (m.WParam.ToInt32() == SC_MINIMIZE)
{
// custom code here
return;
}
}
base.WndProc (ref m);
}



"Maziar Aflatoun" <maz00@rogers.com> wrote in message
news:ScydnZgyzu0LNYXeRVn-3Q@rogers.com...
> Hi,
>
> I'm having a hard time finding the event that fires when form minimize
> button is clicked. Any help would be greatly appreciated.
>
> thanks
> Maz
>
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com