Michael Williams wrote:
Thanks again for the info, but I believe you're misunderstanding my request (or, as is very possible, I'm not wording it correctly). I need to create an application that *becomes* a Windows System Service, and registers itself with the operating system to run as a System Service.

Yep, Aaron's code will do exactly this for you. In your program simply create a Service object with your service details and set the Service's executable file to be the executable that's running (available from the command line args(), for instance). Then install (and/or start) the Service and exit. Yes?

Of course, since your program will be used to install a service (namely, itself) and also run as a service you'll want to probably want to have it react to command-line parameters for the different actions. For example, an "/install" parameter indicates it should install itself as a service and then exit, or no command-line parameters means it should just run.

Also, for an authoritative resource on windows services you can see the MSDN here:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/services.asp

jp

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to