Writing a GUI for a WIndows Service

G

GregC

So I've written a program that runs as a Windows service; my question
is, what's the best way to write a GUI that can change settings.
Ideally I'd like an icon in the system tray that when I double click on
it it brings up a GUI where I can dynamically change settings and have
them immediately reflected in the running service. Should the GUI be
part of the same project? Any help is really appreciated!
 
N

Nicholas Paldino [.NET/C# MVP]

GregC,

No, it should absolutely NOT be part of the same project.

What you want to do is create a SEPARATE program for your GUI. Then,
you would expose some sort of communications port on your service (through
remoting, a socket, or whatever you think is best) and connect to that from
your program to make calls into your service.

Hope this helps.
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

Not part of the same project but of the same solution.

Take a look at ServiceController class and ExecuteCommand method
 
W

WTH

GregC,

No, it should absolutely NOT be part of the same project.

What you want to do is create a SEPARATE program for your GUI. Then,
you would expose some sort of communications port on your
service (through remoting, a socket, or whatever you think is best)
and connect to that from your program to make calls into your service.

Are you suggesting this because he's apparently relatively inexperienced
with services or because security concerns with 'interact with desktop'
options for a service? Just curious.

WTH
 

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