#include #include #include #pragma comment(lib, "C:\borland\bcc55\Lib\PSDK\shlwapi.lib") void SystemRegistryKind(void) { HKEY hKey; DWORD ValueType; DWORD ValueSize; char Value[1000]; /* レジストリキーのオープン */ RegOpenKeyEx( HKEY_CURRENT_USER, "Software\\test2", 0, KEY_ALL_ACCESS, &hKey); ValueSize = 1000; /* レジストリ値の取得 */ SHGetValue( hKey, "sub", "string", &ValueType, Value, &ValueSize); /* 結果の表示 */ if(ValueType == REG_SZ) printf("%s\n", Value); /* 終了 */ RegCloseKey(hKey); } int main(void) { SystemRegistryKind(); return 0; }