|
#include<windows.h>
#include<tchar.h>
#include<iostream>
using namespace std;
#pragma comment(lib,"Urlmon.lib")
int _tmain(int argc, TCHAR* argv[])
{
HKEY hKey = NULL;
TCHAR* lpszSubKey = _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run");
LONG lRet = RegOpenKeyEx(HKEY_LOCAL_MACHINE, lpszSubKey, 0, KEY_ALL_ACCESS,&hKey);
if (lRet == ERROR_SUCCESS)
{
wcout << "打开成功!" << endl;
}
else
{
wcout << "打开失败!" << endl;
}
return 0;
}
学习老师的课程时,使用RegOpenKeyEx时返回5说明没有权限,需要怎么更改权限呢 |
上一篇: 关于setfilepointer function下一篇: 软件操作问题
|