Getting a list of current APPLICATIONS running, not processes c#

前端 未结 2 916
眼角桃花
眼角桃花 2021-01-20 20:40

I know you can get a list of the current processes that are running by using Process[] processes = Process.GetProcesses(); or Process[] processes = Proces

2条回答
  •  醉话见心
    2021-01-20 21:43

    Amy's answer is the one, but I had to change it to

    var running_apps = Process.GetProcesses()
                              .Where(p => (long)p.MainWindowHandle != 0)
                              .ToArray();
    

提交回复
热议问题