[Gtk-sharp-list] TrayIcon on Windows

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


Thomas,
   
    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: 
http://www.codeproject.com/Purgatory/Shell_NotifyIconEx.asp

Good Luck,

-Phil

Thomas Krieger wrote:

>Hello,
>
>i try the TrayIcon tutorial on the mono homepage 
>(http://www.mono-project.com/GtkSharpNotificationIcon)
>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
>http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
>
>  
>


More information about the Gtk-sharp-list mailing list