How to display progress in a WinForm app for a running Service.

Answered How to display progress in a WinForm app for a running Service.

  • Friday, September 21, 2012 1:50 PM
     
     

    I'm developing an app that needs to run in the background and run at all times. ("Engine").  So far, Engine was created as a Windows Service app.  I have also created a second WinForm app ("Monitor") to control and monitor this service.  Monitor will start automatically but be minimized to the system tray.  Notify Icon will display current status.  User can right click icon to start/stop Engine or double click to show Monitor.  Subsequently, when Monitor is "minimized", it collapses back to system tray.

    When Monitor is displayed, I want it to display running activites... (similar to what I would see during a complete backup like the files being copied, progress meter etc...).  I know that a service exposes certain properties like Status (Running, Starting, Stopping) , but I want to display my own info.

    My question is... How do I code this in the service and winform app to be able to intercept such a stream of information.  Can I bind or display info from an event log? Create an Event and Handler? 

    I really only want to capture what is happening while form is visible and don't want to save all the details.  I will save more general info in event log like Starts / Stops / Results.

    A quick code sample in either VB or C# for Service / Handler would be great or just describe library / technique to use.


    Ed

All Replies