1

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 nvidia settings

  • 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

Momh
  • 732
  • 5
  • 17
  • Have you done any research into this question? If so, please can you edit it into your question. – ProgrammingLlama Nov 11 '19 at 02:38
  • 1
    I actually managed to retrieve Process name of an arbitrary window (using some windows API), also I kinda managed to get human readable name of installed applications from the registry (using this path: "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"). Although, I didn't manage to get all installed application and I don't know how to relate informations between a running process and infos of an installed application – Momh Nov 11 '19 at 02:43
  • there will be some applications that haven't set any registry keys, so this will be a difficult task. You probably have to scan all kinds of folders for .exe files or something. if you only need info about running processes you could build a list or database that automatically grows over time, when new processes are started... – Charles Nov 11 '19 at 04:42

0 Answers0