Atom Electron – Close the window with javascript

You must access the BrowserWindow object created by your main process and call the minimize, maximize, and close methods on that. You can access this using the remote module. Here is an example of binding all three buttons: const remote = require(‘electron’).remote; document.getElementById(“min-btn”).addEventListener(“click”, function (e) { var window = remote.getCurrentWindow(); window.minimize(); }); document.getElementById(“max-btn”).addEventListener(“click”, function (e) … Read more

Frameless window with controls in electron (Windows)

Assuming you don’t want window chrome, you can accomplish this by removing the frame around Electron and filling the rest in with html/css/js. I wrote an article that achieves what you are looking for on my blog here: http://mylifeforthecode.github.io/making-the-electron-shell-as-pretty-as-the-visual-studio-shell/. Code to get you started is also hosted here: https://github.com/srakowski/ElectronLikeVS To summarize, you need to pass … Read more

Passing Data to Windows in Electron

To send events to particular window you can use webContents.send(EVENT_NAME, ARGS) (see docs). webContents is a property of a window instance: // main process storeWindow.webContents.send(‘store-data’, store); To listen for this event being sent, you need a listener in a window process (renderer): // renderer process var ipcRenderer = require(‘electron’).ipcRenderer; ipcRenderer.on(‘store-data’, function (event,store) { console.log(store); });

Why do Node modules go into .staging folder?

I was also facing the same issue, I tried the steps below: Delete package-lock.json Delete Node Modules folder Try installing it using below command (should be in open network) npm install Note: – “.staging” means, those dependencies are getting downloaded so for the temporary basis it keeps all those dependencies under “.staging” folder. Once all … Read more

How to prevent multiple instances in Electron

There is a new API now: requestSingleInstanceLock const { app } = require(‘electron’) let myWindow = null const gotTheLock = app.requestSingleInstanceLock() if (!gotTheLock) { app.quit() } else { app.on(‘second-instance’, (event, commandLine, workingDirectory) => { // Someone tried to run a second instance, we should focus our window. if (myWindow) { if (myWindow.isMinimized()) myWindow.restore() myWindow.focus() } … Read more

Play sound in Angular 4

just did this in a project am working (angular 4) and it worked playAudio(){ let audio = new Audio(); audio.src = “https://stackoverflow.com/questions/44883501/assets/audio/alarm.wav”; audio.load(); audio.play(); } this.playAudio(); make sure the path is correct and references an existing audio

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)