Handle of Electron window in NG Desktop Client

Hi All,

I am working with NG Desktop client application. I need to get handle of Electron window to bind some events to get triggers when they occur.

For example:

var window = <electron window handle>; //how to get this handle?
window.on('before-quit', function(){
  // logic here.
});

Any help is highly appreciated.

Regards

you talk about making a service right? (so a ngclient/ngdesktop plugin)

then you should be able to do:

const remote = require (“electron”).remote;

and then on remote i think you have getCurrentWindow()

some examples of using remote:

https://github.com/Servoy/ngdesktopfile … ile.js#L17

Thanks for the guidance.

Yes, I am making a service.

But still I am not able to configure events on this first electron window(screen launched when we start NG Desktop client), events such as ‘on-close’, ‘before-quit’, etc are not triggering.

We need to trigger an event when first electron window is closed to make some closing transactions.

Any help will be highly appreciated.

Regards

Hi,

did you try using the idle service plugin for this?
This might be doing what you want, only for the browser window, not specifically the electron window.

Thanks for your guidance. I will try this and let you know the results.

Regards