unknown مدير بخش ويژوال بيسيك
Joined: 05 Dec 2004 Posts: 439 Location: Tehran
|
Posted: Mon Jul 04, 2005 6:24 pm Post subject: |
|
|
از کار انداختن Windows Task Manager
فقط یک CheckBox روی فرمتان قرار داده و کد زیر را در فرم کپی کنید.
|
Private Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Private Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpData As Any, ByVal cbData As Long) As Long
Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
Private Const REG_SZ = 1
Private Const REG_BINARY = 3
Private Const REG_DWORD = 4
Private Const HKEY_CURRENT_USER = &H80000001
Private Sub SaveStringWORD(hKey As Long, strPath As String, strValue As String, strData As String)
'----------------------------------------------------------------------------
'Argument : Handlekey, Name of the Value in side the key
'Return Value : Nil
'Function : To store the value into a key in the Registry
'Comments : None
'----------------------------------------------------------------------------
Dim Ret
'Create a new key
RegCreateKey hKey, strPath, Ret
'Set the key's value
RegSetValueEx Ret, strValue, 0, REG_DWORD, CLng(strData), 4
'close the key
RegCloseKey Ret
End Sub
Private Sub Check1_Click()
SaveStringWORD HKEY_CURRENT_USER, "software\microsoft\windows\currentversion\policies\system", "DisableTaskMgr", Val(Check1.Value)
End Sub
Private Sub Form_Load()
Check1.Caption = "Disable Task Manager"
End Sub |
|
|