|
// *********************************************************
// レジストリキーの作成
// *********************************************************
BOOL LboxReg::Create( HKEY hRoot, LPCTSTR lpSubKey )
{
LONG nRet;
HKEY hNew;
DWORD dwDisposition;
nRet = RegCreateKeyEx(
hRoot,
lpSubKey,
0,
NULL,
REG_OPTION_NON_VOLATILE,
KEY_ALL_ACCESS,
NULL,
&hNew,
&dwDisposition
);
if ( nRet == ERROR_SUCCESS ) {
if ( dwDisposition == REG_OPENED_EXISTING_KEY ) {
RegCloseKey( hNew );
}
else {
RegCloseKey( this->hKey );
this->hKey = hNew;
}
return true;
}
return false;
}
| |