Click here to Skip to main content
15,884,176 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hello,

I have Client Application when it runs, it shows in system tray of windows. I have WCF service to interact with this client application. This WCF service hosted in Windows service.

Now, I want to run my client application whenever Windows service starts? Is this possible?

So, when windows service started, my client application runs in system tray in windows, and when it stops, client application can be removed.

The ideal example would be antivirus icon we will see in system tray whenever system is up.

Any suggestion, examples would be highly appreciated.

Thank you !
Posted
Updated 11-Aug-14 11:35am
Comments
[no name] 11-Aug-14 17:35pm    
System.Diagnostics.Process
solanki.viral 11-Aug-14 17:41pm    
any example?
[no name] 11-Aug-14 18:31pm    
Yes there is. Plenty of examples all over the internet. Start with looking at the example contained within the documentation.

The service is generally started during the startup of Windows. And it is not at all necessary that a user is logged in at that point of time.
Consequently, you ought to start your client application with the user-login. I.e. you add a link to your application in the StartUp folder of the Program Menu.
The application can find out if the service is running by either System.Diagnostics.Process.GetProcessesByName or queryingthe Servcie Controller. If your service does not run, it can stop itself. Note that it cannot be started when you start your service later on.
 
Share this answer
 
I did not find example I am looking for. If you can provide me some links, would be appreciate.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900