[Mono-winforms-list] Another NotifyIcon Issue

palamangelus palamangelus at gmail.com
Wed Apr 26 10:30:57 EDT 2006

I'm having issues with the NotifyIcon, if anyone has a spare moment to offer
some suggestions.

I'm running winXP SP2, with cygwin, mono 1.1.15, gtk#2.8 (also installed
separately). I also have sharpE and aston shell installed (was using them
but the notifyicon code wouldn't work, so I switched back to explorer as my
shell). After having trouble getting gtkSharpNotification to work, I
switched to winforms (very familiar with winforms, and the notification icon
is more than half the project I'm working on (a win32/osX app for internal

I pulled out the test case of sw-notifyicon.cs and notify.ico and compiled
them in a cygwin bash window. The test cases ran fine with :
sw-notifyicon.exe, but when I ran it with mono sw-notifyicon.exe (which is
essential since I'll need to get it to run on osX - although macpack won't
work so I can't test) two things happened; 1) the icon didn't appear in the
tray, although a blank area for the icon appeared and was able to react to
events, and 2) the menu failed with the following dump (the first line is
the console.write to the MouseMove event). Any help is appreciated. 

swf-notifyicon: MouseMove event

Unhandled Exception: System.NullReferenceException: Object reference not set
an instance of an object
in <0x0032d> System.Windows.Forms.MenuTracker:.ctor
(System.Windows.Forms.Menu t
in <0x00096> System.Windows.Forms.MenuTracker:TrackPopupMenu
ms.Menu menu, Point pnt)
in <0x0006b> System.Windows.Forms.ContextMenu:Show
 control, Point pos)
in (wrapper remoting-invoke-with-check)
System.Windows.Forms.ContextMenu:Show (S
in <0x000a3> System.Windows.Forms.NotifyIcon+NotifyIconWindow:HandleMouseUp
tem.Object sender, System.Windows.Forms.MouseEventArgs e)
in <0x00225> System.Windows.Forms.NotifyIcon+NotifyIconWindow:WndProc
ndows.Forms.Message m)
in <0x00014> System.Windows.Forms.Control+ControlNativeWindow:WndProc
ndows.Forms.Message m)
in <0x0011e> System.Windows.Forms.NativeWindow:WndProc (IntPtr hWnd, Msg
msg, In
tPtr wParam, IntPtr lParam)
in (wrapper native-to-managed) System.Windows.Forms.NativeWindow:WndProc
in <0x00000> <unknown method>
in (wrapper managed-to-native)
in <0x0005a> System.Windows.Forms.XplatUIWin32:GetMessage
MSG msg, IntPtr hWnd, Int32 wFilterMin, Int32 wFilterMax, Boolean blocking)
in <0x00018> System.Windows.Forms.XplatUIWin32:GetMessage
MSG msg, IntPtr hWnd, Int32 wFilterMin, Int32 wFilterMax)
in <0x0001e> System.Windows.Forms.XplatUI:GetMessage
(System.Windows.Forms.MSG m
sg, IntPtr hWnd, Int32 wFilterMin, Int32 wFilterMax)
in <0x0067a> System.Windows.Forms.Application:RunLoop (Boolean Modal,
dows.Forms.ApplicationContext context)
in <0x00024> System.Windows.Forms.Application:Run (System.Windows.Forms.Form
in <0x0047d> MWFTestApplication.MainWindow:Main (System.String[] args)
View this message in context: http://www.nabble.com/Another-NotifyIcon-Issue-t1512096.html#a4102402
Sent from the Mono - WinForms forum at Nabble.com.

More information about the Mono-winforms-list mailing list