Reputation: 1070
how to make my app know if other process are running on the background? What API to use? I'm on Linux and Windows.
Lest say I got tracker app, this app know if I'm using Chrome and it is on my main window. Are there any related Electron/Systems API that I cloud use?
Thanks.
Upvotes: 1
Views: 853
Reputation: 4377
As far as I am aware Electron.js does not offer this. That said the various operating systems have APIs available you can use. Windows has the GetForegroundWindow API available.
However, if you want to avoid that as it may require a lot of work to include it into your project, you may be able to leverage the Active Window package here. Please note that it is no longer maintained.
Upvotes: 3