I want to open a balloon tooltip using windows service. I can do it in Windows Forms. Is it possible using windows service ?
-
1https://stackoverflow.com/questions/4237225/allow-service-to-interact-with-desktop-in-windows – Blorgbeard Aug 31 '17 at 18:04
-
Possible duplicate of [Allow service to interact with desktop in Windows](https://stackoverflow.com/questions/4237225/allow-service-to-interact-with-desktop-in-windows) – jHilscher Aug 31 '17 at 18:06
-
In the mentioned post, it explains how to interact with windows. But how to open a balloon tooltip with interacting from service ? Sorry I am a newbie to C# – Sanjay Krishnan C B Aug 31 '17 at 18:25
2 Answers
I have implemented this service before and used a named pipe. Basically you create two applications.
- A windows service projects which acts as the Named Pipe Server
- A winforms application with a tray icon, a balloon and a Named Pipe Client
The windows service pushes messages towards the clients that are connected, could be multiple users on the systems running the winforms app.
The winforms app listens to messages on the pipe. Once the message comes in you can make the balloon pop up.
Here is a cool test project: https://www.codeproject.com/Tips/492231/Csharp-Async-Named-Pipes
Happy coding!

- 319
- 2
- 14
-
Thanks for you answer, But is there a way without another program running in parallel ? – Sanjay Krishnan C B Aug 31 '17 at 18:33
-
No there is not. A windows service is not meant to have a UI. Most services run under the service account and not under the user account that runs explorer.exe, thus the desktop ui. Why is it important to you to have it in one project? – Bert Sinnema Aug 31 '17 at 18:36
-
Trying to keep it as simple as possible. I will try this method. Thanks for sharing this post ! – Sanjay Krishnan C B Aug 31 '17 at 18:46
-
I understand. In this case you'll be better off splitting them up. Good luck! – Bert Sinnema Aug 31 '17 at 19:03
Not directly. A windows service does not run in the user's session, it runs in its own special "Service Session". Tooltips that show up in that session don't show up on the users desktop.
The way to get around this normally is to have a 2nd program that starts with the user's login and is not visible in the taskbar. That program uses some form of IPC (for example WCF) to talk to the service, the service can then tell the helper program to show a notification as needed.

- 124,994
- 33
- 282
- 431
-
I get the idea, but is there a way without another program running in parallel ? – Sanjay Krishnan C B Aug 31 '17 at 18:23
-
-