How do I put an application to run in the background when it's closed?

1

I'm creating an application on Node.Js using Electron and needs to continue running in the background when it's closed, and becomes an icon for the next application to the computer's clock for the user to access. But I did not find references to do this task, so the question is:

How to put an application to run in the background when it is closed?

    
asked by anonymous 06.11.2017 / 13:43

1 answer

2

Just set the close event of the BrowserWindow object to hide the application instead of closing it:

let win = new BrowserWindow({
    width: 380,
    height: 600,
  })

 win.on('close', event => {
    event.preventDefault()
    win.hide()
 })

More information here .

    
06.11.2017 / 13:54