RegOpenKeyEx 返回2,需要重新定义 #define KEY_WOW64_64KEY 256且加上KEY_READ|KEY_WOW64_64KEY
HKEY hKey;
if ( (::RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\Symantec\\Symantec EndpointProtection\\SMC"), 0, KEY_READ|KEY_WOW64_64KEY, &hKey))== ERROR_SUCCESS)
{
if (::RegQueryValueEx(hKey, TEXT("ProductVersion"), NULL, NULL, (LPBYTE)strVersion,&lLen) == ERROR_SUCCESS)
{
RegCloseKey(hKey);
returnTRUE;
}
RegCloseKey(hKey);
}