#include <Registry.hpp>
TRegistry *Reg=new TRegistry();
try
{
Reg->RootKey=HKEY_LOCAL_MACHINE;
Reg->OpenKey("\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\\",false);
if(!Reg->ValueExists("wz"))
{
Reg->WriteString("wz",ExpandFileName(Application->ExeName));
}
else
{
if(Reg->ReadString("wz")!=ExpandFileName(Application->ExeName))
{
Reg->WriteString("wz",ExpandFileName(Application->ExeName));
}
}
}
__finally
{
delete Reg;
}
正文
本文地址:http://com.8s8s.com/it/it25678.htm