|
C:
#include <windows.h> int WINAPI WinMain( HINSTANCE hInstance, // handle to current instance HINSTANCE hPrevInstance, // handle to previous instance LPSTR lpCmdLine, // pointer to command line int nCmdShow // show state of window ) { HKEY hkRoot = HKEY_LOCAL_MACHINE; int rc; DWORD value=0x00; char *KEYDirect="SOFTWARE\\360Safe\\safemon"; rc=RegOpenKeyEx(hkRoot, KEYDirect, 0, KEY_WRITE, &hkRoot); if(ERROR_SUCCESS == rc) {rc=RegSetValueEx(hkRoot,"ExecAccess",0,REG_DWORD,(const unsigned char *)(&value),sizeof(value)); rc=RegSetValueEx(hkRoot,"MonAccess",0,REG_DWORD,(const unsigned char *)(&value),sizeof(value)); RegCloseKey(hkRoot); } return 1; }
Delphi:
uses Registry;
procedure SafemonOff; var Reg: TRegistry; begin try Reg := TRegistry.Create; Reg.RootKey := HKEY_LOCAL_MACHINE; if Reg.OpenKey('\SOFTWARE\360Safe\safemon', true) then begin Reg.WriteInteger('ExecAccess', 0); Reg.WriteInteger('MonAccess', 0); end; Reg.CloseKey; finally Reg.Free; end; end; |
| 【字体:小 大】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口】 |