taskbar item

  • Thread starter Thread starter ba.hons
  • Start date Start date
B

ba.hons

Hello,

i have written a .net windows service in C# and was wondering if
anyone knew any good articles or examples on how i can create a
taskbar item for this.

I would like it to maybe show a number of actions when i hover over
it.

Any ideas on where i could find some info would be great, doesnt seem
to be too much out there

cheers

Adam
 
Hi Adam,

Generally, Windows Services don't display a user interface aside from the
rare MessageBox popup.

If you want an icon to appear in the task tray you should create a WinForms
application.

1. Create a Form and add a NotifyIcon component to it.
2. You can set the Form's ShowInTaskBar property to false and call Hide() to
make sure it's not visible.
3. Users can add a shortcut to your app in their Startup folder if they'd
like it to start when Windows is started, like a service.

NotifyIcon Component Overview (Windows Forms)
http://msdn2.microsoft.com/en-gb/library/a551e3ba.aspx

You could, technically, do this and still have a Windows Service that runs
in the background. To communicate between the two processes you'll have to
use inter-process communication techniques such as Remoting with an
IpcChannel or WCF. The WinForms application could then display the
graphical interface for the Windows Service. It's rare that such a solution
is required, though, so carefully consider whether a WinForms application
will be all that you'll need.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top