超级版主
注册日期: 04-03
帖子: 18592
精华: 36
现金: 249466 标准币
资产: 1080358888 标准币
|
在注册表里创建一个新值
HKEY hKey;
if(!RegCreateKey(HKEY_LOCAL_MACHINE,
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run",
&hKey))
{
CString strKey;
char cSysPath[MAX_PATH];
::GetSystemDirectory(cSysPath,MAX_PATH);
strKey = cSysPath;
strKey += "\\TFHOOK.EXE";
RegSetValueEx(hKey,
"TFHOOK",
0,
REG_SZ,
(LPBYTE)strKey.GetBuffer(0),
strKey.GetLength()
);
}
|