#include <windows.h>
#include <stdbool.h>
#include <stdio.h>
#pragma comment(lib,"advapi32.lib")
int main(){
HKEY hKey;
DWORD cSubKeys; //Used to store the number of Subkeys
DWORD maxSubkeyLen; //Longest Subkey name length
DWORD retCode; //Return values of calls
//RegOpenKeyEx(HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\CurrentVersion",0,KEY_ALL_ACCESS,&hKey);
RegOpenKeyEx(HKEY_LOCAL_MACHINE,"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall",0,KEY_ALL_ACCESS,&hKey);
int i=0;
RegQueryInfoKey(hKey, // key handle
NULL, // buffer for class name
NULL, // size of class string
NULL, // reserved
&cSubKeys, // number of subkeys
&maxSubkeyLen, // longest subkey length
NULL, // longest class string
NULL, // number of values for this key
NULL, // longest value name
NULL, // longest value data
NULL, // security descriptor
NULL); // last write time
if(cSubKeys>0){
char currentSubkey[MAX_PATH];
for(;i < cSubKeys;i++){
DWORD currentSubLen=MAX_PATH;
retCode=RegEnumKeyEx(hKey, // Handle to an open/predefined key
i, // Index of the subkey to retrieve.
currentSubkey, // buffer to receives the name of the subkey
¤tSubLen, // size of that buffer
NULL, // Reserved
NULL, // buffer for class string
NULL, // size of that buffer
NULL); // last write time
if(retCode==ERROR_SUCCESS){
printf("(%d) %s\n", i+1, currentSubkey);
}
}
}
RegCloseKey(hKey);
getchar();
return 0;
}
Dzięki za pomoc btw trochę pomogło zrozumieć o co chodzi No jutro resztę spróbuje wypleść.