Is there a way to list current processes using Qt on windows?

时光总嘲笑我的痴心妄想 提交于 2019-12-23 22:44:56

问题


Is it possible to know which processes are running using Qt 4? I'm looking for a way to wait until an application is closed by the user to make an operation.


回答1:


I don't know a Qt solution either. But doing it is not that hard using theCreateToolhelp32Snapshot(), Process32FirstW() and Process32NextW() functions. Just search the MSDN for this. There is also a (IMO too complex) example on

Taking a snapshot and viewing processes




回答2:


Not really a Qt4 solution, but you could start WMIC in a QProcess and evaluate the result.

Something like :

wmic process get name /every:5


来源:https://stackoverflow.com/questions/833113/is-there-a-way-to-list-current-processes-using-qt-on-windows

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