BOOL EnumInstalledSoft(TCHAR* subKey, TCHAR* subKeyName) {
TCHAR keyName[MAX_PATH] = { 0 };
TCHAR subKeyValue[MAX_PATH] = { 0 };
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, subKey, 0, KEY_READ, &hKey) == ERROR_SUCCESS)
while (RegEnumKeyEx(hKey, dwIndexs, keyName, &dwLength, NULL, NULL, NULL, NULL) == ERROR_SUCCESS)
RegOpenKey(hKey, keyName, &hSubKey);
printf("%s : %s \n", keyName, subKeyValue);
EnumInstalledSoft((TCHAR*)"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall",(TCHAR*)"DisplayName");
EnumInstalledSoft((TCHAR*)"Software\\Classes\\Installer\\Products", (TCHAR*)"ProductName");