O'Reilly logo

Microsoft® Visual Basic® .NET Programmer's Cookbook by Matthew MacDonald

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Create a Windows Service That Uses a System Tray Icon

Problem

You want to create a Windows service that uses some type of user interface, such as a system tray icon.

Solution

If possible, do not implement any user interface in a Windows service. As a last resort, enable desktop interaction using the Computer Management console.

Discussion

Microsoft guidelines discourage user interfaces with any Windows service application. Adding a user interface can lead to security risks and can prevent the service from running at all if the required permission isn’t granted. In fact, Windows services should be able to run with absolutely no user intervention—there might not even be a user logged on to the computer.

In cases where you do need a user interface to configure ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required