[Mono-bugs] [Bug 81667][Min] New - Crash from NotifyIcon.HideSystray on Form exit if not fully configured

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri May 18 07:19:40 EDT 2007

Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by andyhume32 at yahoo.co.uk.


--- shadow/81667	2007-05-18 07:19:40.000000000 -0400
+++ shadow/81667.tmp.16293	2007-05-18 07:19:40.000000000 -0400
@@ -0,0 +1,93 @@
+Bug#: 81667
+Product: Mono: Class Libraries
+Version: 1.2
+OS Details: XP SP2
+Status: NEW   
+Priority: Minor
+Component: Windows.Forms
+AssignedTo: toshok at ximian.com                            
+ReportedBy: andyhume32 at yahoo.co.uk               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+Summary: Crash from NotifyIcon.HideSystray on Form exit if not fully configured
+Take a form containing containing a NotifyIcon instance, with _no_ icon 
+set i.e. the NotifyIcon.Icon properrty not set.  When the form is opened, 
+not 'used' (no clicks on it etc), then closed the application exits with 
+the runtime termination below.
+Mono 1.2.4. (installer).  Tested only on Windows XP SP2, where it always 
+  at (wrapper managed-to-native) 
+  at (wrapper managed-to-native) 
+  at System.Windows.Forms.XplatUIWin32.CreateWindow 
+(System.Windows.Forms.CreateParams) [0x0006b] in 
+  at System.Windows.Forms.XplatUI.CreateWindow 
+(System.Windows.Forms.CreateParams) [0x00000] in 
+  at System.Windows.Forms.NativeWindow.CreateHandle 
+(System.Windows.Forms.CreateParams) [0x0000d] in 
+  at System.Windows.Forms.Control.CreateHandle () [0x0003f] in 
+  at System.Windows.Forms.Form.CreateHandle () [0x00000] in 
+  at System.Windows.Forms.Control.get_Handle () [0x0002b] in 
+  at (wrapper remoting-invoke-with-check) 
+System.Windows.Forms.Control.get_Handle () <0xffffffff>
+  at System.Windows.Forms.NotifyIcon.HideSystray () [0x00013] in 
+  at System.Windows.Forms.NotifyIcon.Dispose (bool) [0x0000b] in 
+  at System.ComponentModel.Component.Finalize () [0x00000] in 
+  at (wrapper runtime-invoke) System.Object.runtime_invoke_void 
+(object,intptr,intptr,intptr) <0xffffffff>
+This application has requested the Runtime to terminate it in an unusual 
+Please contact the application's support team for more information.
+I attach a simple repro, compile with:
+gmcs NotifyIconNoIconForm.cs /r:System.Drawing /r:System.Windows.Forms
+Run it with --debug, see the form, and immediately close it.  See the 
+If the form is opened and the button is clicked, the fault does not occur.
+If the Icon property is set the problem again does not occur (even if 
+form isn’t clicked).  To show this pass a .ico (etc?) filename on the 
+command line.
+(Note a second fault, in that Icon..ctor(String filename) needs write-
+access to open the file.
+And a third, that the order of the properties is important, Visible must 
+be set after Icon.  I'll create two new bugs for those two).

More information about the mono-bugs mailing list