程序一闪而过 及能运行但是并没有出效果 。关于注册表修改键值
#include "stdio.h"
#include "stdlib.h"
#include"windows.h"
#include <wchar.h>
int main(){
HKEY hKey;
long lRet;
lRet = RegOpenKeyExA(HKEY_LOCAL_MACHINE,
"SOFTWARE\\MICROSOFT\\WINDOWS\\CURRENVERSION\\EXPLORER\\ADVANCED\\FOLDER\\HIDEFILEEXT",
0, KEY_SET_VALUE, &hKey);
if (lRet != ERROR_SUCCESS){
printf("open error!\n");
return FALSE;
}
char* data_;
data_ = "1";
WCHAR* name = L"UncheckedValue";
int Size;
char* name_;
Size = WideCharToMultiByte(CP_ACP, 0, name, -1, NULL, 0, NULL, NULL);
name_ = (char*)malloc((Size + 1));
WideCharToMultiByte(CP_ACP, 0, name, -1, name_, Size, NULL, NULL);
lRet = RegSetValueEx(hKey, name_, 0, REG_DWORD, (const BYTE*)data_, strlen(data_));
if (lRet != ERROR_SUCCESS)
{
printf("error no RegSetValueEx %s\n", GetLastError());
printf(" RegSetValueEx()\n", GetLastError());
return 0;
}
RegCloseKey(hKey);
system("pause");
return 0;
}