書き込み
#define REG_SUB_KEY "SOFTWARE\\RIJN_G\\TEST"
void RegLogWrite(
LPCSTR file, // [i]
DWORD line ) // [i]
{
DWORD res = 0;
HKEY hKey = NULL;
//==== キーをオープン ====//
if(RegCreateKeyEx(HKEY_LOCAL_MACHINE, REG_SUB_KEY, 0, _T(""), REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &res) == ERROR_SUCCESS)
{
//==== 情報書き込み ====//
RegSetValueEx(hKey, _T("FILE"), 0, REG_SZ, (BYTE *)file, strlen(file));
RegSetValueEx(hKey, _T("LINE"), 0, REG_DWORD, (BYTE *)&line, sizeof(DWORD));
//==== キーを閉じる ====//
RegCloseKey(hKey);
}
}