I am currently trying to list installed applications on the machine and get the application name of a running window, the objective being to be able to acknowledge the association between a running opened window with informations about the related installed application.
As an illustration I'd like to be able to reproduce a menu like the one in nvidia settings > 3d parameters > parameter per programs
- Is there some API which can list installed application on a machine in C# ?
- Is there some API to get application informations from a running window ?
- How can we associate informations between the two ?
EDIT:
So far, I managed to get process informations (especially its name) using this resource: https://facstaff.elon.edu/dhutchings/miscellany/appnamefromhwnd.shtml
Also, with this snippet I managed to retrieve some installed application names:
const string registry_key = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall";
public static IEnumerable<string> GetInstalledPrograms()
{
using (RegistryKey key = Registry.LocalMachine.OpenSubKey(registry_key))
{
foreach (string subkey_name in key.GetSubKeyNames())
{
using (RegistryKey subkey = key.OpenSubKey(subkey_name))
{
string name = "";
// @formatter:off
try { name = (string) subkey.GetValue("DisplayName"); } catch (Exception) { } // Silently fails
// @formatter:on
if (!string.IsNullOrWhiteSpace(name))
yield return name;
}
}
}
}
I don't think it's the right approach though, process name and Application display names are different things and cannot be used to make a mapping