Test Foro de elhacker.net SMF 2.1

Programación => .NET (C#, VB.NET, ASP) => Programación General => Programación Visual Basic => Mensaje iniciado por: Karcrack en 7 Septiembre 2009, 17:48 PM

Título: [SRC] Deshabilitar Regedit *NUEVO METODO*
Publicado por: Karcrack en 7 Septiembre 2009, 17:48 PM
Metodo similar a este:
http://foro.elhacker.net/programacion_vb/src_deshabilitar_taskmgr_nuevo_metodo-t266708.0.html
Código (vb) [Seleccionar]
Option Explicit
'---------------------------------------------------------------------------------------
' Module    : mKillRegedit
' Author    : Karcrack
' Now$      : 07/09/09 17:25
' Used for? : Disable Regedit
' TestedOn  : Windows XP SP3
'---------------------------------------------------------------------------------------

'USER32
Private Declare Function CreateWindowEx Lib "USER32" Alias "CreateWindowExA" (ByVal dwExStyle As Long, ByVal lpClassName As String, ByVal lpWindowName As String, ByVal dwStyle As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hWndParent As Long, ByVal hMenu As Long, ByVal hInstance As Long, ByRef lpParam As Any) As Long
Private Declare Function RegisterClass Lib "USER32" Alias "RegisterClassA" (ByRef Class As WNDCLASS) As Long
Private Declare Function DefWindowProc Lib "USER32" Alias "DefWindowProcA" (ByVal Hwnd As Long, ByVal msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long

Private Type WNDCLASS
   style           As Long
   lpfnwndproc     As Long
   cbClsextra      As Long
   cbWndExtra2     As Long
   hInstance       As Long
   hIcon           As Long
   hCursor         As Long
   hbrBackground   As Long
   lpszMenuName    As String
   lpszClassName   As String
End Type

Public Sub DisableRegedit()
   Dim tWC     As WNDCLASS
 
   With tWC
       .style = &H6008
       .hInstance = App.hInstance
       .lpfnwndproc = GetPtr(AddressOf WndProc)
       .lpszMenuName = "#103"
       .lpszClassName = "RegEdit_RegEdit"
   End With
 
   If RegisterClass(tWC) Then
       Call CreateWindowEx(&H40000, "RegEdit_RegEdit", vbNullString, ByVal 0&, 0, 0, 0, 0, 0, 0, App.hInstance, ByVal 0&)
   End If
End Sub

Private Function WndProc(ByVal Hwnd As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
   WndProc = DefWindowProc(Hwnd, uMsg, wParam, lParam)
End Function

Private Function GetPtr(ByVal lPtr As Long) As Long
   GetPtr = lPtr
End Function


Saludos ;)



MOD: Se me olvidaba! Para ejecutar multiples instancias del Regedit pueden hacer esto:
regedit -m
Con lo que se saltarian esta 'deshabilitacion' :xD
Título: Re: [SRC] Deshabilitar Regedit *NUEVO METODO*
Publicado por: ssccaann43 © en 7 Septiembre 2009, 20:59 PM
Karcrack, excelente codigo... Igual al otro...!