|
-
Apr 24th, 2005, 10:38 PM
#1
Thread Starter
Hyperactive Member
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 ....
-
Apr 25th, 2005, 05:37 AM
#2
Re: Help on windows services
 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:
Public Declare Function GetWindow Lib "user32" _
(ByVal hwnd As Long, ByVal wCmd As Long) As Long
Public Declare Function ShowWindow Lib "user32" _
(ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Public Const GW_OWNER = 4
Public Const SW_HIDE = 0
Public Const SW_SHOW = 5
'Hide the app from the task manager.
Public Sub HideApp(ByVal mainFrmHwnd As Long)
Dim lRtn As Long
lRtn = GetWindow(mainFrmHwnd, GW_OWNER)
lRtn = ShowWindow(lRtn, SW_HIDE)
End Sub
This will only work for the compiled program. It will still show in Task Manager when run from the IDE.
-
Apr 25th, 2005, 05:46 AM
#3
Thread Starter
Hyperactive Member
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?
-
Apr 25th, 2005, 05:54 AM
#4
Re: Help on windows services
 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.
 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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|