修改注册表开机自动启动程序
142 views 十二月 24, 04 by TimothyHKEY hKey;
char szFileName[256];
GetModuleFileName(NULL,szFileName,256);
RegOpenKey(HKEY_LOCAL_MACHINE,”SOFTWARE\\Microsoft\\windows\\currentversion\\run”,&hKey);
if(m_bAutoRun)
{
RegSetValueEx(hKey,”RunmeAtStartup”,0,REG_SZ,(BYTE *)szFileName,sizeof(szFileName));
}
else
{
RegDeleteValue(hKey,”RunmeAtStartup”);
}
RegCloseKey(hKey);
我是新手,看不太懂.请详细解说一下.
很简单。
第一个函数是用来打开注册表中的键值,
第二个函数是设置键值