Наши проекты:
Журнал · Discuz!ML · Wiki · DRKB · Помощь проекту |
||
ПРАВИЛА | FAQ | Помощь | Поиск | Участники | Календарь | Избранное | RSS |
[18.191.174.168] |
|
Сообщ.
#1
,
|
|
|
Как в API записать что-нибудь в реестр?
|
Сообщ.
#2
,
|
|
|
Following are the functions used with the registry:
RegCloseKey RegConnectRegistry RegCreateKey RegCreateKeyEx RegDeleteKey RegDeleteValue RegEnumKey RegEnumKeyEx RegEnumValue RegFlushKey RegGetKeySecurity RegLoadKey RegNotifyChangeKeyValue RegOpenKey RegOpenKeyEx RegQueryInfoKey RegQueryMultipleValues RegQueryValue RegQueryValueEx RegReplaceKey RegRestoreKey RegSaveKey RegSetKeySecurity RegSetValue RegSetValueEx RegUnLoadKey |
Сообщ.
#3
,
|
|
|
HKEY g_hKey;
//создание ключа void RegInit(char *psz) { DWORD dwDisposition; LONG res = RegCreateKeyEx( HKEY_CURRENT_USER, // handle to open key psz, // subkey name 0, // reserved NULL, // class string REG_OPTION_NON_VOLATILE, // special options KEY_ALL_ACCESS, // desired security access NULL, // inheritance &g_hKey, // key handle &dwDisposition // disposition value buffer ); if (res != ERROR_SUCCESS) { ReportLastError("RegInit", res); } } //считывание значения DWORD RegGetVal(char *pszName, DWORD dwDefault) { DWORD dwData; DWORD dwSize = sizeof(DWORD); LONG lr = RegQueryValueEx( g_hKey, pszName, NULL, NULL, (LPBYTE)&dwData, &dwSize ); if (lr != ERROR_SUCCESS) return dwDefault; return dwData; } //установка значения void RegSetVal(char *pszName, DWORD dwVal) { DWORD dwSize = sizeof(DWORD); LONG lr = RegSetValueEx( g_hKey, pszName, NULL, REG_DWORD, (LPBYTE)&dwVal, dwSize); } |