Support Forums
[TUT]Enable and Disable TaskManger in vb.net [TUT] - Printable Version

+- Support Forums (https://www.supportforums.net)
+-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87)
+--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18)
+---- Forum: Visual Basic and the .NET Framework (https://www.supportforums.net/forumdisplay.php?fid=19)
+---- Thread: [TUT]Enable and Disable TaskManger in vb.net [TUT] (/showthread.php?tid=23880)



[TUT]Enable and Disable TaskManger in vb.net [TUT] - HB Virus - 12-16-2011

Enable.
Code:
Dim systemRegistry As RegistryKey = Registry.CurrentUser.CreateSubKey("Software\Microsoft\Windows\CurrentVersion\Policies\System")
        systemRegistry.SetValue("DisableTaskMgr", 0)
        systemRegistry.Close()
        SendStatus("Enabled TaskManger")

Disable.
Code:
Dim systemRegistry As RegistryKey = Registry.CurrentUser.CreateSubKey("Software\Microsoft\Windows\CurrentVersion\Policies\System")
        systemRegistry.SetValue("DisableTaskMgr", 1)
        systemRegistry.Close()
        SendStatus("Disabled TaskManger")


Have fun.



RE: [TUT]Enable and Disable TaskManger in vb.net [TUT] - ★Cooldude★ - 12-18-2011

Import

Code:
Imports Microsoft.Win32

Function

Code:
Function ToggleTaskManager(ByVal State As Integer)
        Try
            Dim systemRegistry As RegistryKey = Registry.CurrentUser.CreateSubKey("Software\Microsoft\Windows\CurrentVersion\Policies\System")
            If State = 0 Then
                systemRegistry.SetValue("DisableTaskMgr", 1)
                systemRegistry.Close()
            ElseIf State = 1 Then
                systemRegistry.SetValue("DisableTaskMgr", 0)
                systemRegistry.Close()
            End If
            Return True
        Catch ex As Exception
            Return False
        End Try
    End Function

Enable Task Manager

Code:
ToggleTaskManager(1)

Disable Task Manager

Code:
ToggleTaskManager(0)



RE: [TUT]Enable and Disable TaskManger in vb.net [TUT] - OVO™ - 12-18-2011

Thanks, although this is very simple it helped me! Smile


RE: [TUT]Enable and Disable TaskManger in vb.net [TUT] - Virtuous - 12-18-2011

Import

Code:
Imports Microsoft.Win32

Function

Code:
Function ToggleTaskManager(ByVal State As Integer)
        If Not State = 0 Or State = 1 Then
            Try
                Dim systemRegistry As RegistryKey = Registry.CurrentUser.CreateSubKey("Software\Microsoft\Windows\CurrentVersion\Policies\System")
                systemRegistry.SetValue("DisableTaskMgr", State)
                systemRegistry.Close()
                Return True
            Catch ex As Exception
                Return False
            End Try
        Else
            Return False
        End If
    End Function

Usage

Code:
ToggleTaskManager(1/0)

Less code. Same function. Just saying..


RE: [TUT]Enable and Disable TaskManger in vb.net [TUT] - euverve - 12-19-2011

You could also try using Winlock to disable some of Windows settings...

Link:
Code:
http://www.supportforums.net/showthread.php?tid=18700