プログラムから「プログラムと機能」の一覧を取得する方法。
コマンドラインの「reg query」を使用する。
C#
var p = new System.Diagnostics.Process();
p.StartInfo.FileName = string.Format("{0}\\cmd.exe", Environment.GetFolderPath(Environment.SpecialFolder.System));
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardInput = false;
p.StartInfo.CreateNoWindow = true;
p.StartInfo.Arguments = " /c reg query \"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\" /s | findstr \"\\<DisplayName\"";
p.Start();
// コマンドの結果を受け取る
string programListInfo = p.StandardOutput.ReadToEnd();