/ Published in: C++
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
AnsiString GetRegistryValue(AnsiString KeyName, AnsiString ValueName) { AnsiString S; TRegistry *Registry = new TRegistry(KEY_READ); try { Registry->RootKey = HKEY_LOCAL_MACHINE; if (Registry->OpenKey(KeyName, true)) S = Registry->ReadString(ValueName); Registry->CloseKey(); } __finally { delete Registry; } return S; } //---------------------------------------------------------------------------