|
-
Oct 28th, 2006, 03:21 PM
#1
Thread Starter
Member
[2005] Disabling users from ending my application
I've written an application to control user usage of a computer based on time, that was easy but, how can I protect my application so that user can't use the task manager to end it?
Note that I still want the user to access the task manager.
-
Oct 28th, 2006, 06:25 PM
#2
Re: [2005] Disabling users from ending my application
I dont know if you can, unless maybe running the app under an admin user or something and see if a regular user that doesnt have permissions are allowed to close it.
Controlling access by time can be done through the regular windows admin functions and user policy, though, and should actually be done instead... its what user and group policies are for...
-
Oct 29th, 2006, 01:29 AM
#3
Hyperactive Member
Re: [2005] Disabling users from ending my application
well, your getting into a grey area here by doing this, but you can disable the task manager through the registry. I have done it before, but not sure which key it is.
-
Oct 29th, 2006, 03:40 PM
#4
Re: [2005] Disabling users from ending my application
Using a GPO would probably be your best bet since you still need to allow access to the TM.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Oct 29th, 2006, 03:47 PM
#5
Fanatic Member
Re: [2005] Disabling users from ending my application
Disable the task manager and make your own task manager
-
Oct 29th, 2006, 03:52 PM
#6
Re: [2005] Disabling users from ending my application
Better still, in 2005 you have the FormClosing event of a form with a closing e argument that you can determine the reason why its closing.
Check for the TaskManagerClosing as the e.CloseReason value and cancel the action.
VB Code:
Private Sub Form1_FormClosing(sender as Object, e as FormClosingEventArgs) Handles Form1.FormClosing
If e.CloseReason = TaskManagerClosing Then
e.Cancel = True
End If
End Sub
Note, using this technique can lead to trouble closing your app if there is an error or some undesired behavior where the form either doesnt have or isnt working to close the form and you really do need to close it. In such a case your app will not be closable and you would have to reboot or logoff.
Last edited by RobDog888; Oct 29th, 2006 at 03:56 PM.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Oct 29th, 2006, 06:47 PM
#7
Re: [2005] Disabling users from ending my application
If you use RobDog's method, instead of just canceling the close, maybe you prompt for a password. If the correct password is given, you close it, if not, it stays open.
-
Oct 29th, 2006, 06:49 PM
#8
Re: [2005] Disabling users from ending my application
Good suggestion, I like it! 
I was worried about not being able to close the app yourself when you really need to like non-responses and program hangs etc.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Oct 29th, 2006, 09:07 PM
#9
Re: [2005] Disabling users from ending my application
Here is an example on how to catch the ctrl alt delete combo, and react to the task manager.
DisableTaskMgr
EDIT: But you want to still be able to use the task manager.
What level of access to the task manager is acceptable?
For example you can disable the right click that allows the user to Terminate the process. And disable the end process button ofcourse.
Last edited by TTn; Oct 29th, 2006 at 09:18 PM.
-
Oct 29th, 2006, 09:16 PM
#10
Re: [2005] Disabling users from ending my application
Referring to the right click: they can also select the process and click on the "End Process" button. 
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Oct 29th, 2006, 09:24 PM
#11
Re: [2005] Disabling users from ending my application
It looks funny now, because I appended my post, just as you were posting. Hehe.
This is a specific question, which needs more than protection against the closing event. I'm sure there are a few other details, that need to be protected.
-
Oct 30th, 2006, 02:30 PM
#12
Thread Starter
Member
Re: [2005] Disabling users from ending my application
 Originally Posted by Negative0
If you use RobDog's method, instead of just canceling the close, maybe you prompt for a password. If the correct password is given, you close it, if not, it stays open.
Thank you guys, it seemed to be the best solution for this.
-
Oct 30th, 2006, 03:04 PM
#13
Thread Starter
Member
Re: [2005] Disabling users from ending my application
I've just tried closing the application with RobDog code using the Task Manager; it works fine the first time you end it, but if the user keep ending the task it will eventually get ended!
-
Oct 30th, 2006, 03:08 PM
#14
Re: [2005] Disabling users from ending my application
How do you mean? Like rapid clicking or something?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Nov 1st, 2006, 12:52 PM
#15
Thread Starter
Member
Re: [2005] Disabling users from ending my application
By clicking the End Process several time the application will get stuck and the End Program dialog box will pop up then just by clicking the End Now button will terminate my application.
-
Nov 1st, 2006, 01:04 PM
#16
Re: [2005] Disabling users from ending my application
This is why you need to use GPO. Windows 2k and after are designed to separate the OS from 3rd party software to prevent situations like the one you are trying to intentionally create. Use RobDog's method, but also use a GPO. The GPO will catch nearly everything, RobDog's will be the failsafe.
-
Nov 10th, 2006, 12:40 AM
#17
Re: [2005] Disabling users from ending my application via TaskMgr
For parental control purposes only please.
Hide a process
Last edited by TTn; Dec 17th, 2006 at 04:27 PM.
-
Nov 10th, 2006, 01:43 AM
#18
Re: [2005] Disabling users from ending my application
PHP Code:
taskkill /f /im whatever.exe
from the cmd will still kill the whatever app. Even if you delete it, it can be downloaded again. If it is not XP, there are enough vbs snippets out there offering the same functionality. One is even from MS itself.
CMD can be opened from the task manager (you said you still need it). Even if you somehow disable the Run there, any executable can be started form mIRC for example. And mIRC can be installed even on a guest account
-
Nov 10th, 2006, 07:03 AM
#19
Re: [2005] Disabling users from ending my application
taskkill /f /im whatever.exe
from the cmd will still kill the whatever app.
True, providing that they know the name of the executable file.
In my example, you can't see the executable process in the task manager.
taskkill /f /im WhatsMyName.exe
Is fairly inoperable.
-
Nov 10th, 2006, 07:11 AM
#20
Re: [2005] Disabling users from ending my application
Come on man, anyone knowing about taskkill would at least know about HijackThis as well - able to show/export as text the running processes among other things
-
Nov 10th, 2006, 07:19 AM
#21
Re: [2005] Disabling users from ending my application
Come on man, anyone knowing about taskkill would at least know about HijackThis as well - able to show/export as text the running processes among other things
That's the point,... along with RobDogg's suggestion, this works in most situations, so that most "end users" are unaware.
-
Nov 10th, 2006, 07:24 AM
#22
Re: [2005] Disabling users from ending my application
That is true of course, kadem should simply know what to expect and not just implement partial security. Personally I'd go with more than one services that monitor the app and restart it if needed. I had a pretty bitter experience with some trojan swarm and they were using the same tactic, restarting (in my case redownloading) each other as soon as one gets deleted/stopped by the user.
-
Nov 10th, 2006, 07:39 AM
#23
Re: [2005] Disabling users from ending my application
I agree, with extra protection here.
It's ironic to come full circle, and find that levels of security, can be learned from a malware, or a trojan etc!
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
|