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. Other Discussions
  3. Article Writing
  4. How to Convert Process to Service

How to Convert Process to Service

Scheduled Pinned Locked Moved Article Writing
jsontutorial
7 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.
  • C Offline
    C Offline
    Cmania
    wrote on last edited by
    #1

    Hi What I wanna no is that can a compiled exe when double clicked is launched as SERVICE is there any API related to that hope somebody will reply soon!!

    pitchu

    S 1 Reply Last reply
    0
    • C Cmania

      Hi What I wanna no is that can a compiled exe when double clicked is launched as SERVICE is there any API related to that hope somebody will reply soon!!

      pitchu

      S Offline
      S Offline
      scott_hackett
      wrote on last edited by
      #2

      I'll assume that you're talking about managed code here. Regular applications have an entry point that gets called when they are run. Services, on the other hand, may not be started by double clicking them because they typically don't have that standard application entry point. Instead, they have an entry point that the service control manager (SCM) understands. The SCM is what starts and stops service processes. It's fairly easy to convert one to the other. However, does your app have a user interface (this even includes message boxes)? If so, it's not a good candidate to run as a service. If you want to see how to make a service, there's a good template service project in VS. There's also a good article here[[^](http://a good article here)] on how to make a version of a service that can be debugged.

      C 1 Reply Last reply
      0
      • S scott_hackett

        I'll assume that you're talking about managed code here. Regular applications have an entry point that gets called when they are run. Services, on the other hand, may not be started by double clicking them because they typically don't have that standard application entry point. Instead, they have an entry point that the service control manager (SCM) understands. The SCM is what starts and stops service processes. It's fairly easy to convert one to the other. However, does your app have a user interface (this even includes message boxes)? If so, it's not a good candidate to run as a service. If you want to see how to make a service, there's a good template service project in VS. There's also a good article here[[^](http://a good article here)] on how to make a version of a service that can be debugged.

        C Offline
        C Offline
        Cmania
        wrote on last edited by
        #3

        Thnks for comment But what im trying to do is that im writing a program (say a program which never allows Solitare application to execute as im lab Administrator) but i want that program to be loaded as service for 2 reasons: 1. I dont want it to be enlisted in Task Manager 2. I want to learn to create services and convert process to service and vice-versa hoping some reply soon

        pitchu

        D 1 Reply Last reply
        0
        • C Cmania

          Thnks for comment But what im trying to do is that im writing a program (say a program which never allows Solitare application to execute as im lab Administrator) but i want that program to be loaded as service for 2 reasons: 1. I dont want it to be enlisted in Task Manager 2. I want to learn to create services and convert process to service and vice-versa hoping some reply soon

          pitchu

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          This is better handled by Group Policy, not an application. You can't stop an .EXE from launching, you can only scan the Process list once in a while and quit the app if you find it.

          wasim ahmad bhat wrote:

          1. I dont want it to be enlisted in Task Manager

          Services don't hide from Task Manager. There's nothing you can do to hide from the Task List.

          wasim ahmad bhat wrote:

          2. I want to learn to create services and convert process to service and vice-versa

          Then learn how to write Console apps. You can use them to test the main code of your service, then, if done properly, you can write the service manager code around that. There really isn't any path to "convert" an app to a service or the other way around. Both types of applications are purpose written to be what they are, and do not lend themselves to be "converted" as you put it.

          Dave Kreskowiak Microsoft MVP - Visual Basic

          C 1 Reply Last reply
          0
          • D Dave Kreskowiak

            This is better handled by Group Policy, not an application. You can't stop an .EXE from launching, you can only scan the Process list once in a while and quit the app if you find it.

            wasim ahmad bhat wrote:

            1. I dont want it to be enlisted in Task Manager

            Services don't hide from Task Manager. There's nothing you can do to hide from the Task List.

            wasim ahmad bhat wrote:

            2. I want to learn to create services and convert process to service and vice-versa

            Then learn how to write Console apps. You can use them to test the main code of your service, then, if done properly, you can write the service manager code around that. There really isn't any path to "convert" an app to a service or the other way around. Both types of applications are purpose written to be what they are, and do not lend themselves to be "converted" as you put it.

            Dave Kreskowiak Microsoft MVP - Visual Basic

            C Offline
            C Offline
            Cmania
            wrote on last edited by
            #5

            Agreed I have 2 search the process list and quit the application Thanks for letting me know that there is no way to convert service to process and vice-versa Further, Im confused with those services loaded by svchost.exe which is not shown by task manager. im trying to do the same thing but how i dont know. Can u post some little code in VB6(preferably as im in fine touch now) or VC++ of the SERVICE and a methode to invoke it

            pitchu

            D 1 Reply Last reply
            0
            • C Cmania

              Agreed I have 2 search the process list and quit the application Thanks for letting me know that there is no way to convert service to process and vice-versa Further, Im confused with those services loaded by svchost.exe which is not shown by task manager. im trying to do the same thing but how i dont know. Can u post some little code in VB6(preferably as im in fine touch now) or VC++ of the SERVICE and a methode to invoke it

              pitchu

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              VB6 can't make a service. It can make a normal Windows app, but it has to be written specially to be able to run LIKE a service using a 3rd party control. You can find out more here[^]. SVCHOST is a generic service "shell", or host process, that loads and executes services in .DLL files. A single instance of SVCHOST can host multiple services at the same time. These types of services you would have to write in VC++.

              Dave Kreskowiak Microsoft MVP - Visual Basic

              C 1 Reply Last reply
              0
              • D Dave Kreskowiak

                VB6 can't make a service. It can make a normal Windows app, but it has to be written specially to be able to run LIKE a service using a 3rd party control. You can find out more here[^]. SVCHOST is a generic service "shell", or host process, that loads and executes services in .DLL files. A single instance of SVCHOST can host multiple services at the same time. These types of services you would have to write in VC++.

                Dave Kreskowiak Microsoft MVP - Visual Basic

                C Offline
                C Offline
                Cmania
                wrote on last edited by
                #7

                Lots of Thanks A Nice and Resourceful link Hats OFF It will take me a week to purely understand the content Stay tuned Again LOTS OF THANKS By the way would u like 2 help me in my older question Difference in various types of DLLs as i hav no reply for that yet

                pitchu

                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