Archive for the ‘Managed C++’ Category

Get list of installed softwares with Managed C++

The below code is for listing installed softwares in a windows machine with Managed C++.

RegistryKey^ rk = RegistryKey::OpenRemoteBaseKey(RegistryHive::LocalMachine, System::Environment::MachineName);
RegistryKey^ rkprograms = rk->OpenSubKey(”SoftwareMicrosoftWindowsCurrentVersionUninstall”,RegistryKeyPermissionCheck::ReadSubTree,System::Security::AccessControl::RegistryRights::FullControl);
array^ rksubkeynames = rkprograms->GetSubKeyNames();
for (int i=0;iLength;i++) {
Object ^app = rkprograms->OpenSubKey(rksubkeynames[i])->GetValue(”DisplayName”);
if (app) {
listBox1->Items->Add(app);
}
}
VN:F [1.1.6_502]Rating: 0.0/5 (0 votes cast)

Leave a Comment

Programatically get list of Installed Programs

To get the list of installed software programs in a machine use this code:

RegistryKey rk = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, “pvn”);
RegistryKey rkprograms = rk.OpenSubKey(@”SoftwareMicrosoftWindowsCurrentVersionUninstall”);
foreach (string s in rkprograms.GetSubKeyNames())
[...]

Leave a Comment