protected override void WndProc(ref Message m)
{
const int WM_SYSCOMMAND = 0x0112;
const int SC_MINIMIZE = 0xF020;
switch (m.Msg)
{
case (WM_SYSCOMMAND):
if ((int)m.WParam == SC_MINIMIZE)
{
//System.Diagnostics.Trace.WriteLine("Minimizing the form now.");
}
else
{
base.WndProc(ref m);
}
break;
default:
base.WndProc(ref m);
break;
}
}