1

Closed

Different problems/exceptions related to events list when restoring HDD Guardian program window minimized to tray

description

Under certain circumstances, HDD Guardian 0.7.2 beta 4 bugs out and throws an exception when it is being restored from being minimized to tray.
Depending on the particular view state when minimizing HDD Guardian to the tray, symptoms and exception types might differ.

So far, i have encountered two different bugs/exceptions, which both share most of the conditions and reproduction steps which are necessary to trigger them.

How to reproduce

  1. Make sure HDD Guardian is configured to minimize to tray.
  2. Open the window "Manage".
  3. In "Manage", switch to the "Events" view.
  4. Select a drive which has entries in the events list (temperature change events would do).
Depending on the further actions, different exceptions will be triggered. Continue either with 4.1 or 4.2 to produce the different exceptions.

4.1.
Minimize HDD Guardian to the tray. Restoring it from the tray will show an almost completely blank program window. Only the top main menu / tab bar is shown.
Trying to select any item in the top tab bar will cause an ArgumentOutOfRangeException (stack trace below).

4.2.
Another exception is being thrown if the view is changed from "Events" back to "S.M.A.R.T. attributes" (or any other view, i guess) before minimizing HDD Guardian to the tray.
Then trying to restore it from the tray will cause an ArgumentException (stack trace below).


Stack trace for ArgumentOutOfRangeException thrown in step 4.1:
System.ArgumentOutOfRangeException: InvalidArgument=Value of '-1' is not valid for 'index'.
Parameter name: index
   at System.Windows.Forms.TabControl.GetTabPage(Int32 index)
   at System.Windows.Forms.TabControl.SelectTab(Int32 index)
   at System.Windows.Forms.TabControl.SelectTab(TabPage tabPage)
   at hdd_guardian.HeadlessTabControl.SelectPage(TabPage p)
   at hdd_guardian.Main.extOverview_CheckedChanged(Object sender, EventArgs e)
   at System.Windows.Forms.RadioButton.OnCheckedChanged(EventArgs e)
   at hdd_guardian.MimicExplorer.ExplorerTab.OnCheckedChanged(EventArgs e)
   at System.Windows.Forms.RadioButton.set_Checked(Boolean value)
   at System.Windows.Forms.RadioButton.OnClick(EventArgs e)
   at System.Windows.Forms.RadioButton.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Stack trace for ArgumentExceptionthrown in step 4.2:
System.ArgumentException: Width must be greater than 0px.
   at System.Windows.Forms.DataVisualization.Charting.ChartPicture.InspectChartDimensions(Int32 width, Int32 height)
   at System.Windows.Forms.DataVisualization.Charting.ChartPicture.set_Width(Int32 value)
   at System.Windows.Forms.DataVisualization.Charting.Chart.OnResize(EventArgs e)
   at System.Windows.Forms.Control.OnSizeChanged(EventArgs e)
   at System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight)
   at System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height)
   at System.Windows.Forms.Control.SetBoundsCore(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
   at System.Windows.Forms.Control.System.Windows.Forms.Layout.IArrangedElement.SetBounds(Rectangle bounds, BoundsSpecified specified)
   at System.Windows.Forms.Layout.DefaultLayout.xLayoutDockedControl(IArrangedElement element, Rectangle newElementBounds, Boolean measureOnly, Size& preferredSize, Rectangle& remainingBounds)
   at System.Windows.Forms.Layout.DefaultLayout.LayoutDockedControls(IArrangedElement container, Boolean measureOnly)
   at System.Windows.Forms.Layout.DefaultLayout.xLayout(IArrangedElement container, Boolean measureOnly, Size& preferredSize)
   at System.Windows.Forms.Layout.DefaultLayout.LayoutCore(IArrangedElement container, LayoutEventArgs args)
   at System.Windows.Forms.Layout.LayoutEngine.Layout(Object container, LayoutEventArgs layoutEventArgs)
   at System.Windows.Forms.Control.OnLayout(LayoutEventArgs levent)
   at System.Windows.Forms.ScrollableControl.OnLayout(LayoutEventArgs levent)
   at System.Windows.Forms.Control.PerformLayout(LayoutEventArgs args)
   at System.Windows.Forms.Control.System.Windows.Forms.Layout.IArrangedElement.PerformLayout(IArrangedElement affectedElement, String affectedProperty)
   at System.Windows.Forms.Control.OnResize(EventArgs e)
   at System.Windows.Forms.Panel.OnResize(EventArgs eventargs)
   at System.Windows.Forms.Control.OnSizeChanged(EventArgs e)
   at System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight)
   at System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height)
   at System.Windows.Forms.Control.SetBoundsCore(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
   at System.Windows.Forms.TabPage.SetBoundsCore(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
   at System.Windows.Forms.Control.SetBounds(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
   at System.Windows.Forms.Control.set_Bounds(Rectangle value)
   at System.Windows.Forms.TabControl.ControlCollection.Add(Control value)
   at System.Windows.Forms.TabControl.TabPageCollection.Add(TabPage value)
   at System.Windows.Forms.TabControl.RecreateHandleCore()
   at System.Windows.Forms.Control.OnParentHandleRecreated()
   at System.Windows.Forms.TabControl.OnParentHandleRecreated()
   at System.Windows.Forms.Control.RecreateHandleCore()
   at System.Windows.Forms.Control.OnParentHandleRecreated()
   at System.Windows.Forms.Control.RecreateHandleCore()
   at System.Windows.Forms.Control.OnParentHandleRecreated()
   at System.Windows.Forms.Control.RecreateHandleCore()
   at System.Windows.Forms.Control.OnParentHandleRecreated()
   at System.Windows.Forms.Control.RecreateHandleCore()
   at System.Windows.Forms.TabControl.RecreateHandleCore()
   at System.Windows.Forms.Control.OnParentHandleRecreated()
   at System.Windows.Forms.TabControl.OnParentHandleRecreated()
   at System.Windows.Forms.Control.RecreateHandleCore()
   at System.Windows.Forms.Control.OnParentHandleRecreated()
   at System.Windows.Forms.Control.RecreateHandleCore()
   at System.Windows.Forms.TabControl.RecreateHandleCore()
   at System.Windows.Forms.Control.OnParentHandleRecreated()
   at System.Windows.Forms.TabControl.OnParentHandleRecreated()
   at System.Windows.Forms.Control.RecreateHandleCore()
   at System.Windows.Forms.Control.OnParentHandleRecreated()
   at System.Windows.Forms.Control.RecreateHandleCore()
   at System.Windows.Forms.Control.OnParentHandleRecreated()
   at System.Windows.Forms.Control.RecreateHandleCore()
   at System.Windows.Forms.TabControl.RecreateHandleCore()
   at System.Windows.Forms.Control.OnParentHandleRecreated()
   at System.Windows.Forms.TabControl.OnParentHandleRecreated()
   at System.Windows.Forms.Control.RecreateHandleCore()
   at System.Windows.Forms.Form.RecreateHandleCore()
   at System.Windows.Forms.Form.set_ShowInTaskbar(Boolean value)
   at hdd_guardian.Main.niTrayIcon_MouseDown(Object sender, MouseEventArgs e)
   at System.Windows.Forms.NotifyIcon.OnMouseDown(MouseEventArgs e)
   at System.Windows.Forms.NotifyIcon.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.NotifyIcon.WndProc(Message& msg)
   at System.Windows.Forms.NotifyIcon.NotifyIconNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Closed Apr 17 at 11:09 PM by Eruestan

comments

Eruestan wrote Feb 20 at 9:43 PM

Hi elgonzo!

Thank you for reporting this issue, it seems that all the exceptions where related to the main TabControl that was resize to 0x0 pixels; now I've set a minimum size and it seems that all problems are gones.
You can download the latest build from here, let me know if you discover other issues! ;)

Thanks,
Sam

elgonzo wrote Feb 20 at 11:25 PM

Oops... seems you made a little mistake when creating the new ZIP archive.
hddguardian_0.7.2_beta_5.zip contains the same files as hddguardian_0.7.2_beta_4.zip.

Eruestan wrote Feb 21 at 1:06 AM

Ops, sorry! :D
Now I've uploaded the correct archive! ;)

wrote Apr 17 at 11:09 PM