admin管理员组文章数量:1334674
I am developping a crossplatform desktop application using Electron, nodeJs and angular2. My application needs to know, at all time, which foreground process/window is running on the puter. Do you have any idea on how to achieve such a task ?
I am developping a crossplatform desktop application using Electron, nodeJs and angular2. My application needs to know, at all time, which foreground process/window is running on the puter. Do you have any idea on how to achieve such a task ?
Share Improve this question asked Mar 20, 2017 at 20:22 Lolo Lolo 1332 silver badges7 bronze badges 1- Maybe the solution is different for each OS. In this case, I prefer to have a solution working on Linux puters first. – Lolo Commented Mar 20, 2017 at 20:26
2 Answers
Reset to default 4To get metadata on active window you can use sindresorhus/active-win: it is multi platform (win, osx, linux) and very easy to implement
First of all you need to detect platform which runs Node app:
os.platform()
- https://nodejs/dist/latest-v5.x/docs/api/os.html#os_os_platform
Then you need to run platform specific mand for getting process info with child_process.exec()
.
https://nodejs/api/child_process.html#child_process_child_process_exec_mand_options_callback
本文标签: javascriptHow to get the title of the foreground processwindowStack Overflow
版权声明:本文标题:javascript - How to get the title of the foreground processwindow - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742378351a2463614.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论