C++ Builder
| Главная | Уроки | Статьи | FAQ | Форум | Downloads | Литература | Ссылки | RXLib | Диски |

 
существование ключа Реестра
Alexander
Отправлено: 05.07.2006, 11:50


Не зарегистрирован







Как можно проверить существует ключ в реестре или нет
если можно пример
Заранее спасибо
olegenty
Отправлено: 05.07.2006, 12:30


Ветеран

Группа: Модератор
Сообщений: 2412



TRegistry::OpenKey
QUOTE

Opens a specified key.

bool __fastcall OpenKey(const AnsiString Key, bool CanCreate);

Description

Call OpenKey to make a specified key the current key. Key is the name of the key to open. If Key is NULL, the CurrentKey property is set to the key specified by the RootKey property.

CanCreate specifies whether to create the specified key if it does not exist. If CanCreate is true, the key is created if necessary.

Key is opened or created with the security access value specified by the Access property. OpenKey only creates non-volatile keys, A non-volatile key is stored in the registry and is preserved when the system is restarted.

OpenKey returns true if the key is successfully opened or created
Doga
Отправлено: 05.07.2006, 12:31


Мастер участка

Группа: Участник
Сообщений: 575



RegOpenKeyEx(...), RegQueryValueEx(...), RegCloseKey(...);

Описание и примеры в MSDN.
Чопек
Отправлено: 07.07.2006, 18:23


Не зарегистрирован








CODE

if(reg->KeyExists(AnsiString regKeyName) ) {

 your code...; }




Вернуться в Вопросы программирования в C++Builder