Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writeing and reading from registry

Status
Not open for further replies.

MgBTask

Programmer
Sep 6, 2000
4
SE
Hey all!!

I need to create a string in window register. How do i do it? Also i want to be able to see if that string exists or not. Then I want to be able to read that string...

Could someone give me a quick code?
 
{
TRegistry *Reg = new TRegistry(NULL);
try {
Reg->RootKey = HKEY_CURRENT_USER;
if Reg->OpenKey('\Software\Microsoft\Windows\CurrentVersion\RunOnce',
True)
Reg->WriteString('MyApp','"' + ParamStr(0) + '"');
}__finally {
Reg->CloseKey;
delete Reg;
};
}
Hope this code snippet helps you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top