About Windows Services

  • Thread starter Water Cooler v2
  • Start date
W

Water Cooler v2

I want to run a service at the background but also provide some user
interface for editing some configuration options. In this regard, my
questions are:

1. Can a Windows Service have a UI along with it?
2. Can I associate a NotifyIcon (systray icon) with a Web service?
3. Can a Windows service be such that it runs only on a particular
Windows account on the domain? I mean can it use Windows Authentication
to see if it must start up on a particular login or not?
 
G

Guest

my replies below
I want to run a service at the background but also provide some user
interface for editing some configuration options. In this regard, my
questions are:
1. Can a Windows Service have a UI along with it?

No in general, service is not appropriate for UI, besides it breaks security
design.
Willy has more to say about this, it's his area, see there for example
http://groups.google.com/group/micr..._frm/thread/be1f927b5b960c4b/6fb8559c0936aa07
You can create UI and service separately and communicate between them
2. Can I associate a NotifyIcon (systray icon) with a Web service?

You app shold have any visual form to became systray icon. If you wrote a UI
wrapper for WS then you can minimize it to tray
3. Can a Windows service be such that it runs only on a particular
Windows account on the domain? I mean can it use Windows Authentication
to see if it must start up on a particular login or not?

In the property of service you can specify under with account it should start

--
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 
W

Water Cooler v2

2. Can I associate a NotifyIcon (systray icon) with a Web service?


Sorry. That was a typo. The second question is:

2. Can I associate a NotifyIcon (systray icon) with a Windows service?
 
O

Olof Lagerkvist

Water said:
I want to run a service at the background but also provide some user
interface for editing some configuration options. In this regard, my
questions are:

[...]

Generally the best solution is to create the service without UI parts
and instead create a separate application to run in the users logon
sessions and some kind of IPC mechanism (e.g. pipes or sockets) between
the UI and the service.

This way you can support multiple logon sessions, such as Fast User
Switching in XP, Terminal Services and Remote Desktop for Administration
on Windows Servers and the new logon sessions on Vista. If you choose to
create the UI directly in an interactive service it can only interact
with the console session, session 0, and this session is not visible on
Vista.
 
C

Claes Bergefall

Others have given you answers to your questions, but I'm just wondering if a
service is really what you want. Your questions seems to indicate that you
want something that starts automatically when someone logs on (with a
systray icon, UI etc). If so, a service is not what you're looking for. Use
a normal application instead and put a setting in the registry to start it
automatically when someone logs on.

/claes
 

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

Top