Thread: NT Service - researching...

  1. #1
    Registered User
    Join Date
    Mar 2002
    Posts
    2

    NT Service - researching...

    Greetings everyone,

    I've got a project for work that needs to be an NT Service that will eventually become a XP Service when the company moves to it. Here are some of the things I have to learn in programming this service:

    1) Creating a service - I've done some research of this already and have a very, very basic understanding.
    2) Creating a socket and communicating to another application on the PC & to a server. This has been done already in C program we have, so it could be just copied...
    3) Find a way to see if a specific application is running. I've also done some research on this too, but only found something that is close to the task manager of the processes...need to have it show the FULL path & aguments of that process if possible.
    4) Able to have this application start up another application. Again, we've done this in another app, so I could copy that.

    I've got quite a task laid out to accomplish and I'm looking for any resources, code samples, books, web sites that would discuss this kind of stuff I'm looking to do. If you have any information to help me with my process in creating this service, I would greatly appreciate it.

    Thanks, Michael

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793

    Re: NT Service - researching...

    Originally posted by schu777

    1) Creating a service - I've done some research of this already and have a very, very basic understanding.
    This is a good start.....also there is a MSDN article thats quite good (but I dont have a link)

    http://www.codeproject.com/system/windowsservices.asp


    2) Creating a socket and communicating to another application on the PC & to a server. This has been done already in C program we have, so it could be just copied...
    Yeah....if you need help there's loads of winsock links on this board.......


    3) Find a way to see if a specific application is running. I've also done some research on this too, but only found something that is close to the task manager of the processes...need to have it show the FULL path & aguments of that process if possible.
    You could try FindWindow()


    4) Able to have this application start up another application. Again, we've done this in another app, so I could copy that.
    CreateProcess() or ShellExecute() are good for this.

  3. #3
    Registered User
    Join Date
    Mar 2002
    Posts
    2
    Thanks for the info...will have to research it.

    I did forget one other thing...a timer of some sort. I need to have a timer that would fire off an event to see if an application is running or not.

    Thanks!!

  4. #4
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Originally posted by schu777
    Thanks for the info...will have to research it.

    I did forget one other thing...a timer of some sort. I need to have a timer that would fire off an event to see if an application is running or not.

    Thanks!!
    Simple....look up SetTimer()

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Perfect number and divisors
    By Lissa in forum C Programming
    Replies: 31
    Last Post: 10-24-2008, 01:36 PM
  2. running my program as service
    By daher in forum Windows Programming
    Replies: 5
    Last Post: 09-05-2008, 12:30 PM
  3. Starting a NT service through an application?
    By crazyfish in forum Windows Programming
    Replies: 2
    Last Post: 06-06-2005, 10:56 PM
  4. NT Service problems - loop
    By nickname_changed in forum Windows Programming
    Replies: 0
    Last Post: 07-09-2003, 12:54 AM
  5. nt service
    By vicky in forum Windows Programming
    Replies: 2
    Last Post: 09-22-2001, 10:22 AM