A Windows Service and the Desktop

  • Thread starter Thread starter Blaz
  • Start date Start date
B

Blaz

I have a windows service that does some stuff. It runs a couple of
batch files. After the successful execution of a batch file I need to
display some sort of notification to the end user that the job did
infact complete successfully.(Note: Once the jobs are completed the
service simply keeps checking a folder on the network for more files
to process, if it doesnt find them it just sits and does nothing. It
checks every minute and works quite well)

I am hitting a dead end in every direction in terms of notification.

Is there anyway a service can display any sort of notification to the
user's desktop? I know I could convert the service to an actual
application and just run it from the system tray but I want to make
sure there is no other way before I do that.

Thanks.
 
Blaz,

You could have your service interact with the destkop. However, this is
generally a bad idea.

An alternative to what you are doing is have your service wait for
notifications from another application (through remoting most likely) to do
its work.

However, given that the service would do nothing but wait for a
notification from one other app to do its work, there is no point in making
it a service, if all it is going to service is your app. You are probably
better of making it a tray application.

Hope this helps.
 
Another way to look at it is.... does it really have to notify the user in
this way. Could it not write its transactions to a log file and have a
seperate windows application that the end user can run to look at the log
file to see whats going on. Without knowing exactly what the service is
doing, if there are alot of files going in the directory the user would be
getting a popup message every minute (which could be annoying).

It may be way off what your looking for but its only a thought thats all.

Nicholas Paldino said:
Blaz,

You could have your service interact with the destkop. However, this is
generally a bad idea.

An alternative to what you are doing is have your service wait for
notifications from another application (through remoting most likely) to do
its work.

However, given that the service would do nothing but wait for a
notification from one other app to do its work, there is no point in making
it a service, if all it is going to service is your app. You are probably
better of making it a tray application.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Blaz said:
I have a windows service that does some stuff. It runs a couple of
batch files. After the successful execution of a batch file I need to
display some sort of notification to the end user that the job did
infact complete successfully.(Note: Once the jobs are completed the
service simply keeps checking a folder on the network for more files
to process, if it doesnt find them it just sits and does nothing. It
checks every minute and works quite well)

I am hitting a dead end in every direction in terms of notification.

Is there anyway a service can display any sort of notification to the
user's desktop? I know I could convert the service to an actual
application and just run it from the system tray but I want to make
sure there is no other way before I do that.

Thanks.
 
Back
Top