在 Electron.js 中使用什么 API 来了解其他进程是否是 运行,以及在主 window 上?

What API to use in Electron.js to know if other process is running, and on the main window?

如何让我的应用知道后台是否有其他进程 运行? API 有什么用?我在 Linux 和 Windows.

别说我有跟踪器应用程序,这个应用程序知道我是否在使用 Chrome 并且它在我的主 window 上。有没有我云使用的相关Electron/SystemsAPI?

谢谢。

据我所知Electron.js不提供这个。也就是说,各种操作系统都有 API 可供您使用。 Windows 有 GetForegroundWindow API 可用。

但是,如果您想避免这种情况,因为将它包含到您的项目中可能需要大量工作,您可以利用 Active Window package here。请注意,它不再维护。