Link to home
Start Free TrialLog in
Avatar of salted
salted

asked on

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...
Avatar of Agarici
Agarici
Flag of Romania image

you can do a PostThreadMessage... using win api

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

hth,
A.
Avatar of salted
salted

ASKER

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 ??
ASKER CERTIFIED SOLUTION
Avatar of naveenkohli
naveenkohli

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial