473,398 Members | 2,165 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Windows Service.. System Tray

Hello all,

I have created a windows service and now I would like to have a
configuration page in the system tray. Basically an icon I can click on
which will just interact with an XML file. What is the best way to do this?

1. How do I use the System Tray and add an icon on it. Yes, probably
basic.. and I can do it with VB but have never tried with C#.

Andrew Mueller
Nov 15 '05 #1
2 12943
Actually, the NotifyIcon class provides this
functionality in .NET

This is one important point here: You should
not interact with the UI when you're a windows
service.

This is:
a.) Because of security (what if the user on
the UI has less privileges then you? You give
them access to a higher-privileged process)

b.) Which UI do you connect to? What if it's a
terminal services server with 10 users
connected in and no one is physically
at the main console (Console0).

You should develop a standalone WinForms app
with a notifyicon and all that goodness that
uses remoting to communicate with the service.

Make sure the service has a way to configure
what Windows users can even connect, and then
once in, what they can configure. That gets
pretty complicated, so I'll leave it up to
you to decide what you're going to do
exactly (not integrate with AD, just have
your own user/pass, or try to use AD
integration, whatever).

-c

"Rob Tillie" <Ro********@student.tul.edu> wrote in message
news:un*************@tk2msftngp13.phx.gbl...
I believe it's not part of the .NET framework yet... must be on google
somewhere... some wrapper usong P/Invoke for this...

Greetz,
-- Rob.

Andrew Mueller wrote:
Hello all,

I have created a windows service and now I would like to have a
configuration page in the system tray. Basically an icon I can click on which will just interact with an XML file. What is the best way
to do this?

1. How do I use the System Tray and add an icon on it. Yes,
probably basic.. and I can do it with VB but have never tried with C#.
Andrew Mueller


Nov 15 '05 #2
Andrew, there is a very good example posted on the gotdotnet.com site
under the user samples section. If you haven't been there then you are
missing out bigtime!

"Andrew Mueller" <am******@instechnet.com> wrote in message news:<uP*************@tk2msftngp13.phx.gbl>...
Hello all,

I have created a windows service and now I would like to have a
configuration page in the system tray. Basically an icon I can click on
which will just interact with an XML file. What is the best way to do this?

1. How do I use the System Tray and add an icon on it. Yes, probably
basic.. and I can do it with VB but have never tried with C#.

Andrew Mueller

Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Lalit | last post by:
Hi Friends, I have developed a Windows service. Now i need icon for this service in systray and context menu fo this icon. Can i do this? With regards, Lalit
6
by: Action | last post by:
I can add a systray icon in normal windows application... but when i do it in windows service, the systray icon just don't show up is that because i don't have any "component" to contain the...
1
by: manuel.ricca | last post by:
Hello, I'm just starting to code a windows service in C#. My service needs to create multiple threads, each one responding to TAPI events. Then I will need to have a client connect to it for...
3
by: Billy Cormic | last post by:
Hello, I am trying to create a windows service. Can anyone give me an idea how to create an icon on the systems tray for the service? Thanks, Billy
1
by: =?Utf-8?B?VzFsZDBuZTc0?= | last post by:
I need to create a Windows Service, which will be hosting a couple of worker classes, each in there own thread. I will be creating a tray Icon (Notify Icon) and a windows form to manage this...
2
by: =?Utf-8?B?Sm9uIEphY29icw==?= | last post by:
Not only does the "solution" have a service app and installer, it has a Tray Icon app that allows a user to send custom commands to the service. The installer launches the service and the tray...
9
by: dm3281 | last post by:
Hello -- I plan on writing a C# service using VS2005. If I want my service to have a tray icon, is this typically done from within my service or do/should I create a controller application and...
3
by: DaveL | last post by:
Hi All I have a windows application that needs to run 24/7 in the SysTray How to Start this on Start up When ever the machine is re-started etc I also need to run as a Different User that has...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.