Results 1 to 4 of 4

Thread: Help on windows services

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2004
    Location
    Philippines
    Posts
    285

    Unhappy Help on windows services

    hi everyone, i wnated run my program so that it cannot be terminated from the task manager. i ran it as a service. in my windows 2000 machine, it worked perfectly fine. users cannot close my program by using the task manager. but when i ran it in XP, any system services can be terminated from the task manager is this really the right behavior of win XP? pls help ....

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Help on windows services

    Quote Originally Posted by guyjasper
    is this really the right behavior of win XP? pls help ....
    Yes...You could try to hide it from the task manager.
    VB Code:
    1. Public Declare Function GetWindow Lib "user32" _
    2.  (ByVal hwnd As Long, ByVal wCmd As Long) As Long
    3. Public Declare Function ShowWindow Lib "user32" _
    4. (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
    5.  
    6. Public Const GW_OWNER = 4
    7. Public Const SW_HIDE = 0
    8. Public Const SW_SHOW = 5
    9.  
    10. 'Hide the app from the task manager.
    11. Public Sub HideApp(ByVal mainFrmHwnd As Long)
    12.     Dim lRtn As Long    
    13.     lRtn = GetWindow(mainFrmHwnd, GW_OWNER)
    14.     lRtn = ShowWindow(lRtn, SW_HIDE)
    15. End Sub
    This will only work for the compiled program. It will still show in Task Manager when run from the IDE.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2004
    Location
    Philippines
    Posts
    285

    Re: Help on windows services

    i think that would only hide my app from the applications tab in the task manager. if you go to the processes tab, it will still show. so you mean to say that in XP, i can terminate even those system critical processes? isn't there any windows policy i can set so that i could prevent users from doing this?

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Help on windows services

    Quote Originally Posted by guyjasper
    i think that would only hide my app from the applications tab in the task manager. if you go to the processes tab, it will still show.
    Yes, this is true.
    Quote Originally Posted by guyjasper
    so you mean to say that in XP, i can terminate even those system critical processes? isn't there any windows policy i can set so that i could prevent users from doing this?
    This is a good question, and one worth exploring. I don't have the necessary permissions to set policies on the computers at work (only Admins can do that).

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