When the application loads and the Show on desktop option is OFF, the application crashes with an invalid argument exception.
I've examined the source and the reasons for this crash are twofold:
1. In the constructor, DrawBorders never checks to see if the window is visible, or if it has any size. Thus when it is invisible it has a ClientSize of 0,0 and the Bitmap is being initialized with a size of 0,0 - this is invalid. The simple thing to do here is to check for an invisible window.
2. In the primary drawing routine (called from the timer elapsed event), we get the same issue because again it is trying to draw to a window with a client size height of 0, even though the window is marked as visible. You'll notice that the window caption shows up in the lower left corner of the screen. To get rid of this window we need to re-hide it because the .NET framework attempts to set it as visible after the constructor executes (that is, Application.Run() calls the Show() function).
To solve these problems in general you should not only check whether the window is visible, but also check that the show menu item checked property is set to false after the LoadConfiguration function.
I've got the same issue here with version 1.5.2873. When the Desktop Meter is disabled and I then start/restart FreeMeter it simply crashes with the following stacktrace:
Message: Ungültiger Parameter.
Stack trace:
bei System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format)
bei FreeMeter.Form1.Form1_Borders()
bei FreeMeter.Form1..ctor()
bei FreeMeter.Form1.Main()
As a workaround setting the WindowIsVisible property in config.xml to true helps in means of that FreeMeter does not crash as long as you don't close it again with the Desktop Meter being set to hidden... but since I do only use the tray icon feature of FreeMeter I have to do this every time I reboot my machine. So thats kind of annoying.
When hibernating this problem obviously does not occur though. :-)