Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. how to send a custom message to a window service?

how to send a custom message to a window service?

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sunyw_2006
    wrote on last edited by
    #1

    Hello everyone: Please help me how to send a custom message to a window service? Thanks. -Freehawk

    V N 2 Replies Last reply
    0
    • S sunyw_2006

      Hello everyone: Please help me how to send a custom message to a window service? Thanks. -Freehawk

      V Offline
      V Offline
      Viorel
      wrote on last edited by
      #2

      I think you should first check if it is practically possible to create a hidden window from a service. Since the service normally is started before the user enters the system, I suppose it will be impossible to create the helper window on early stage. You should try to create the window after the user logs in. If you manage to create a helper hidden window from your service, then you can use the WM_COPYDATA message to send messages from your application to service. Otherwise, if you do not found a solution, I am afraid you have to use a thing called Inter-process Communication (IPC). There is a series of methods: sockets, shared memory, pipes and others, that you have to investigate.

      1 Reply Last reply
      0
      • S sunyw_2006

        Hello everyone: Please help me how to send a custom message to a window service? Thanks. -Freehawk

        N Offline
        N Offline
        Nibu babu thomas
        wrote on last edited by
        #3

        sunyw_2006 wrote:

        Please help me how to send a custom message to a window service?

        Nishant Sivakumar has written a nice article on Windows Service. Apart from that take a look at ControlService and SERVICE_USER_DEFINED_CONTROL.


        Nibu thomas A Developer Programming tips[^]  My site[^]

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups