65,208
社区成员
发帖
与我相关
我的任务
分享#include <windows.h>
#include <iostream>
#include <malloc.h>
#include <stdio.h>
#include <tchar.h>
//#include <Winreg.h>
using namespace std;
void main(void)
{
HKEY m_hKey = NULL;
DWORD dwSize = 0;
DWORD dwValue = 0;
LONG ret = RegOpenKeyEx(HKEY_CURRENT_USER, _T("SOFTWARE\\Sunj"), 0, KEY_QUERY_VALUE, &m_hKey);
if (ret != ERROR_SUCCESS)
{
ret = RegCreateKeyEx(HKEY_CURRENT_USER, _T("SOFTWARE\\Sunj"), 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &m_hKey, NULL);
if (ret == ERROR_SUCCESS)
{
cout < < "success" < < endl;
}
}
}