Wednesday, February 24, 2010

A Simpler Time

After overcoming the shortcomings of the Timers::Timer object and its non-exposure of the remaining interval, I have run into a new annoying point with using WinForms.  So, my task is to simply ensure that only one instance of Wall Flype is allowed to run at any one time.  In Win32 programming the main function provided a lovely parameter hprevInstance, which held a handle to a running instance of the application.  This parameter could easily be checked against the hInstance parameter to ensure that the system did not have two instances of the application running.  This is no longer the case with WinForms.  I had to use a Mutex to disallow the second instance usage of the code that allows it to start.  This was simple to implement, but I am still perplexed about restoring the main instance from a minimized state.  Doing a bit of searching I came across a native function from the user32.dll, ShowWindow that is supposed to change the windows state.  So far it has failed to do its job.

Regardless of being able to restore the main instance window from the minimized state, I have suppressed attempts to run a second instance of the application which was my main goal.  Aside from this work I have found an icon to replace the default and I have selected 6 images (1680x1050 resolution) from Chris Gin's gallery on InterfaceLIFT.com.  I set up the images to install under the application directory with the path AppDir\Wallpaper\Chris_Gin.  I will give other images I include in the pack a similar path.  The next release is almost here! :D

No comments:

Post a Comment