How can I send a message to a Windows Service?

I need to send a message to a Windows Service while it's running.

I'm sending the message from a c# app, and the windows service is running as SYSTEM and is also a C# app.

Anyway of communicating with it will do...
Who is Participating?
naveenkohliConnect With a Mentor Commented:
Scratch my last comment :-)
Did not read the end of your question... its a C# app

you can host a remoting object in your service and let your client app talk to it.
you can do a PostThreadMessage... using win api

what exactly are you trying do do?
how are the 2 apps related?

saltedAuthor Commented:
Well, the service starts a task every 12 hours, and the application provides a small UI to the service's properties, such as how often it should run, starting/stopping the service etc.

I want to be able to force the service to start running a task now, via the application.

Changing the settings is done by changing registry entries - which the service checks for when next starting a task.
Look into MSMQ.  A reliable way to communicate with your service
Is service a .Net service or Win32 ??
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.