Nytro Posted October 20, 2009 Report Share Posted October 20, 2009 Option Explicit'---------------------------------------------------------------------------------------' Module : mKillRegedit' Author : Karcrack' Now$ : 07/09/09 17:25' Used for? : Disable Regedit' TestedOn : Windows XP SP3'---------------------------------------------------------------------------------------'USER32Private 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 LongPrivate Declare Function RegisterClass Lib "USER32" Alias "RegisterClassA" (ByRef Class As WNDCLASS) As LongPrivate Declare Function DefWindowProc Lib "USER32" Alias "DefWindowProcA" (ByVal Hwnd As Long, ByVal msg As Long, ByVal wParam As Long, ByVal lParam As Long) As LongPrivate 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 StringEnd TypePublic 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 IfEnd SubPrivate 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 FunctionPrivate Function GetPtr(ByVal lPtr As Long) As Long GetPtr = lPtrEnd Function Quote Link to comment Share on other sites More sharing options...