注冊表編程
發布時間: 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);
希望對您有所幫助........
熱點內容