How can I send a message to a Windows Service?

Posted on 2006-05-02
Last Modified: 2008-02-01
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...
Question by:salted
    LVL 11

    Expert Comment

    you can do a PostThreadMessage... using win api

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


    Author Comment

    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.
    LVL 12

    Expert Comment

    Look into MSMQ.  A reliable way to communicate with your service
    LVL 23

    Expert Comment

    Is service a .Net service or Win32 ??
    LVL 23

    Accepted Solution

    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.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
    Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now