B
BillAtWork
Hi,
Found some code to do this but seems to be causing a stack overflow due to a
loop somewhere. Code is:
....
public event EventHandler Minimize;
....
//in form constructor
....
this.Minimize += new EventHandler(Form1_Minimize);
....
void Form1_Minimize(object sender, EventArgs e)
{
this.ShowInTaskbar = false; //System tray app - no taskbar icon
when minimized. It gets turned back on elsewhere.
}
protected override void WndProc(ref Message msg)
{
const int WM_SIZE = 0x0005;
const int SIZE_MINIMIZED = 1;
if ((msg.Msg == WM_SIZE) && ((int)msg.WParam == SIZE_MINIMIZED)
&& (this.Minimize != null))
{
this.Minimize(this, EventArgs.Empty);
}
base.WndProc(ref msg);
}
Any ideas?
Thanks!
Found some code to do this but seems to be causing a stack overflow due to a
loop somewhere. Code is:
....
public event EventHandler Minimize;
....
//in form constructor
....
this.Minimize += new EventHandler(Form1_Minimize);
....
void Form1_Minimize(object sender, EventArgs e)
{
this.ShowInTaskbar = false; //System tray app - no taskbar icon
when minimized. It gets turned back on elsewhere.
}
protected override void WndProc(ref Message msg)
{
const int WM_SIZE = 0x0005;
const int SIZE_MINIMIZED = 1;
if ((msg.Msg == WM_SIZE) && ((int)msg.WParam == SIZE_MINIMIZED)
&& (this.Minimize != null))
{
this.Minimize(this, EventArgs.Empty);
}
base.WndProc(ref msg);
}
Any ideas?
Thanks!