I’m working on an application which I think would be better suited to being a Windows service. The only issue I have come up against in planning to convert it is that it has a window which displays activity. Now I know it’s bad practice (and deprecated in Win7) to show a GUI from a service so my question is, what is the best way to show progress?
My first idea was a polling method using RPC and MIDL but an operation could start and finish in a second or two it would be very inaccurate to using polling.
What are my other options for this?
Thanks,
J
EDIT: My question is more about the communication method, I plan to split it into the service and a task tray icon but I want to display a window with progress bars to show the progress of tasks running in the service but polling would be too slow unless it was sub-second which seems a waste, is there a way to push progress to the task tray app?
Create a service that does the work, and an optional GUI application that, if running, sits in the system tray and allows you to open a window watching the progress. You can communicate the progress over e.g. shared memory or named pipes – but remember that the service is running while noone is logged in, so it should in no way depend on being able to display progress.
Push mechanisms: