本文介绍了您如何获得有关其他正在运行或重点关注的应用程序的信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的动力:我正在写一个应用程序来帮助解决一些量化的自我/时间跟踪类型的事情。我想使用电子来记录有关当前正在使用的应用程序的信息。

My motivation: I'm writing an app to help with some quantified self / time tracking type things. I'd like to use electron to record information about which app I am currently using.

是否可以在Electron中获取有关其他应用程序的信息?您至少可以提取有关当前关注的另一个应用程序的信息吗?例如,如果用户正在Chrome中浏览网页,那么很高兴知道A)他们正在使用Chrome浏览器,B)他们正在查看的网页标题。

Is there a way to get information about other apps in Electron? Can you at least pull information about another app that currently has focus? For instance, if the user is browsing a webpage in Chrome, it would be great to know that A) they're using chrome and B) the title of the webpage they're viewing.

在研究期间,我发现了以下问题:
似乎是通过shell脚本执行的,尽管我个人更喜欢直接通过本机Node访问本机API。插件/模块或。

No, Electron doesn't provide an API to obtain information about other apps. You'll need to access the native platform APIs directly to obtain that information. For example Tockler seems to do so via shell scripts, though personally I prefer accessing native APIs directly via native Node addons/modules or node-ffi-napi.

这篇关于您如何获得有关其他正在运行或重点关注的应用程序的信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-28 11:45
查看更多