[Gtk-sharp-list] TrayIcon on Windows

Phillip Dyer p85dyer at gmail.com
Fri Oct 27 10:27:48 EDT 2006

    I created a system tray icon using these:

        [DllImport("shell32.Dll")] private static extern bool 
Shell_NotifyIcon(NotifyCommand cmd, ref NotifyIconData data);

        [DllImport("user32.Dll")] private static extern System.IntPtr 
LoadImage(System.IntPtr hinst,string lpszName,ImageFlags Iflags,int 
cxDesired,int cyDesired,FuLoadFlags Lflags);

        [DllImport("user32.Dll")] private static extern bool 
DestroyIcon(System.IntPtr hIcon);


    I hope someone else has a better way of creating it, as I had to use 
WinForms to create a hidden window and attach it to, and I don't have a 
proper right-click menu set up on my tray icon.

More thorough instructions here: 

Good Luck,


Thomas Krieger wrote:

>i try the TrayIcon tutorial on the mono homepage 
>But in Windows is no Namespace "Egg" implemented. How is the status of 
>the windows implementation at this point?
>Is there already a possibility to generate an tray icon with mono and 
>gtk# under win32?
>Thanks in advance!
>Best Regards
>Thomas Krieger
>Gtk-sharp-list maillist  -  Gtk-sharp-list at lists.ximian.com

More information about the Gtk-sharp-list mailing list