How can I display a system tray icon for C# window service.?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Services run in a different window station than the logged in user, so you can’t have a system tray icon for them. From https://learn.microsoft.com/en-us/dotnet/framework/windows-services/introduction-to-windows-service-applications:
Here are a couple of links about how to write to the system tray. You’ll need another application to interface with the service, since the service can’t directly have an icon in the system tray.
How can I make a .NET Windows Forms application that only runs in the System Tray?
and
http://msdotnetsupport.blogspot.com/2008/02/cnet-application-windows-system-tray.html