Get processes name (like you can see in task manager)

此生再无相见时 提交于 2019-12-11 13:58:26

问题


How to get this part of process name with C#?

WindowsAPI.GetWindowThreadProcessId(hwnd, out pid);
Process p = Process.GetProcessById((int)pid);
p.MainWindowTitle.ToString();

is closes I've got to. But for many programs it shows opened window names. For example instead of "Google Chrome" it shows name of the active tab.

EDIT: Solution in "possible duplicated" thread lists things I've tried. From what I've gathered "Process" doesn't even contain information which is used in Task manager.

来源:https://stackoverflow.com/questions/48623678/get-processes-name-like-you-can-see-in-task-manager

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!