Hi,
Use the code below for just that, note that I included both declarations and
code, the code can be inserted in the constructor ( part of it can be
inserted by the designer )
[DllImport("user 32.dll")]
public static extern int SetWindowLong( IntPtr window, int index, int
value);
[DllImport("user 32.dll")]
public static extern int GetWindowLong( IntPtr window, int index);
const int GWL_EXSTYLE = -20;
const int WS_EX_TOOLWINDO W = 0x00000080;
const int WS_EX_APPWINDOW = 0x00040000;
normalIcon = new Icon(this.GetTy pe(),"Normal.ic o");
this.notifyIcon 1 = new System.Windows. Forms.NotifyIco n(this.componen ts);
notifyIcon1.Ico n = normalIcon;
notifyIcon1.Con textMenu = this.contextMen u1;
notifyIcon1.Vis ible = true;
this.WindowStat e = System.Windows. Forms.FormWindo wState.Minimize d;
this.Visible = false;
this.ShowInTask bar = false;
iconTimer.Start ();
int windowStyle = GetWindowLong(H andle, GWL_EXSTYLE);
SetWindowLong(H andle, GWL_EXSTYLE, windowStyle | WS_EX_TOOLWINDO W);
cheers,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"VMI" <VM*@discussion s.microsoft.com > wrote in message
news:6B******** *************** ***********@mic rosoft.com...
How difficult is it to hide my program in the system tray? It's not
something
that's required, but it'd look to add it since the program will be writing
an
ascii file every minute. And it wouldn't too elegant to have it in the
taskbar.
Thanks.