注册表编程
发布时间: 2023-03-21 22:53:46
① c语言修改注册表
给你一个参考,
这个是往注册表的开机启动项里添加开机启动的,(比如qq),只给你主要代码。这个你可以网络,注册表操作函数就那些,网络下,再看下msdn就会了》》
hkey
hkey;
tchar
childkey[256]=text("software\\microsoft\\windows\\currentversion\\run");
tchar
keyvalue[256]=text("c:\\program
files\\tencent\\qq\\bin\\qq.exe");
tchar
keyname[256]="qq";
if(error_success!=regopenkeyex(hkey_local_machine,childkey,0,key_create_sub_key,&hkey))
{
messagebox(null,text("failed
to
open
the
key
..."),text("failed!!!"),mb_ok);
}
if(error_success==regsetvalue(hkey_local_machine,childkey,reg_sz,keyvalue,strlen(keyvalue)))
{
messagebox(null,text("sucess
to
write
a
value
into
the
currentversion
.
"),text("sucess!!!"),mb_ok);
}
regclosekey(hkey);
希望对您有所帮助........
热点内容