3,882
社区成员
发帖
与我相关
我的任务
分享
LPCTSTR Regkey = "Software\\Microsoft\\Windows NT\\CurrentVersion";
DWORD dwInsTime = 0;
DWORD dwType = REG_DWORD;
DWORD cbData = sizeof(DWORD);
HKEY hKey;
RegOpenKeyEx(HKEY_LOCAL_MACHINE, Regkey, 0, KEY_ALL_ACCESS, &hKey);
RegQueryValueEx(hKey, "InstallDate", NULL, &dwType, (PBYTE)&dwInsTime, &cbData);
WinExec("cmd /c c:\\windows\\system32\\regedit.exe /e temp1.reg HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion",SW_HIDE);
//然后读文件temp1.reg的内容
试试看。[/quote]
多谢,是一种思路![/quote]
解决很多问题,往往一种思路就足够了;想多了反而会自讨苦吃。[/quote]
更简单的来了:
RegOpenKeyEx(HKEY_LOCAL_MACHINE, Regkey, 0, KEY_ALL_ACCESS|KEY_WOW64_64KEY, &hKey);
搞定了!WinExec("cmd /c c:\\windows\\system32\\regedit.exe /e temp1.reg HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion",SW_HIDE);
//然后读文件temp1.reg的内容
试试看。[/quote]
多谢,是一种思路![/quote]
解决很多问题,往往一种思路就足够了;想多了反而会自讨苦吃。WinExec("cmd /c c:\\windows\\system32\\regedit.exe /e temp1.reg HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion",SW_HIDE);
//然后读文件temp1.reg的内容
试试看。[/quote]
多谢,是一种思路!WinExec("cmd /c c:\\windows\\system32\\regedit.exe /e temp1.reg HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion",SW_HIDE);
//然后读文件temp1.reg的内容
试试看。



总不至于你是在虚拟机环境下或远程打开别的电脑的注册表吧。