Results 1 to 38 of 38

Thread: Controling services in vb

Hybrid View

  1. #1
    Hyperactive Member Capp's Avatar
    Join Date
    May 2005
    Location
    Texas
    Posts
    409

    Re: Controling services in vb

    Sounds good to me. If you want, just PM me when you get back and we'll resume.

    Take care
    AmazingAntivirus.com
    Remote Data Backups


    Please Mark your Thread "Resolved", if the query is solved...

    If a post has helped you then Please Rate it!

  2. #2

    Thread Starter
    Junior Member
    Join Date
    Jan 2007
    Location
    St Cloud, Minnesota
    Posts
    20

    Re: Controling services in vb

    im back from spring break. is it simple as just a few declarations and a few lines of code to pause/continue a service? or is it pretty complicated?

  3. #3
    Hyperactive Member Capp's Avatar
    Join Date
    May 2005
    Location
    Texas
    Posts
    409

    Re: Controling services in vb

    Telling VB to pause, stop or continue a service is not that much code and isn't that difficult. You could use Shell method I listed above.

    But, getting VB to recognize if the service's status is not that simple.

    My recommendation is to use the code posted in the link above.


    Look at the first section in blue (API Declarations). You can just copy and paste this directly into a module in your program.

    Look at the second section in blue (Module). Copy this and paste it at the bottom of the same module you posted the API Declarations in.

    The 3rd section is the code for 4 separate command buttons. The 1st button Stops the service. In this case, it's the "Scheduling" service. The 2nd button Starts it. The 3rd button Pauses it and the 4th button will tell you the current status of the service.

    You would only need to change the name of the service and viola'.

    Let me know if you have any more questions
    AmazingAntivirus.com
    Remote Data Backups


    Please Mark your Thread "Resolved", if the query is solved...

    If a post has helped you then Please Rate it!

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Jan 2007
    Location
    St Cloud, Minnesota
    Posts
    20

    Re: Controling services in vb

    Thanks Capp, ill post if i have any questions

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Jan 2007
    Location
    St Cloud, Minnesota
    Posts
    20

    Re: Controling services in vb

    Slowly, but surely. Is this what its sposed to look like? Im getting a compile error about comments in the declare functions line.
    Attached Files Attached Files
    Last edited by lokeycmos; Mar 13th, 2007 at 04:21 PM.

  6. #6
    Hyperactive Member Capp's Avatar
    Join Date
    May 2005
    Location
    Texas
    Posts
    409

    Re: Controling services in vb

    Quote Originally Posted by lokeycmos
    Slowly, but surely. Is this what its sposed to look like? Im getting a compile error about comments in the declare functions line.

    Not quite...

    What you need to do is click on the Projects menu, Click Add Module.

    Paste the API declarations and the bit titled "Module" in the module you just added. Make sure the API declarations are at the top.

    Take out all the code except for the command button from the form level..
    AmazingAntivirus.com
    Remote Data Backups


    Please Mark your Thread "Resolved", if the query is solved...

    If a post has helped you then Please Rate it!

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Jan 2007
    Location
    St Cloud, Minnesota
    Posts
    20

    Re: Controling services in vb

    Sweet, i got it going. Thanks for all your help Capp! Now ill just modify it for my liking. By the way, Whats a module? we never learned that in school either. How do i change my post to 'Resolved'?.................

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width