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. Name of this service

Name of this service

Scheduled Pinned Locked Moved C / C++ / MFC
questiontutorial
3 Posts 2 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.
  • B Offline
    B Offline
    Bernhard Hofmann
    wrote on last edited by
    #1

    Hi Anyone know how to determine the name of the service that starts an executable? Let's say I have an executable that is called Service.exe and I register it as Service1 and Service2. How can I tell which service was started when the SCM starts the executable? Thanks Bernhard

    2 1 Reply Last reply
    0
    • B Bernhard Hofmann

      Hi Anyone know how to determine the name of the service that starts an executable? Let's say I have an executable that is called Service.exe and I register it as Service1 and Service2. How can I tell which service was started when the SCM starts the executable? Thanks Bernhard

      2 Offline
      2 Offline
      224917
      wrote on last edited by
      #2

      One kludge way is to, provide different command line parameters while registering the services.


      suhredayan
      There is no spoon.

      B 1 Reply Last reply
      0
      • 2 224917

        One kludge way is to, provide different command line parameters while registering the services.


        suhredayan
        There is no spoon.

        B Offline
        B Offline
        Bernhard Hofmann
        wrote on last edited by
        #3

        That seems to be the kludge I'll go for. Additional parameters will specify the service name and exe name. This will make a copy of the exe, register the service, and make a registry entry that links the exe name to the service name. Then, at run time, I can get the module (exe) name, look up the service name in the registry, and then determine the registry key for that service's parameters. X| This is neither elegant nor something to be proud of, but time is money. Thanks Don't worry, nobody lives forever.

        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