Home:ALL Converter>How to Close, Minimize and Maximize window in Javascript

How to Close, Minimize and Maximize window in Javascript

Ask Time:2022-01-03T21:27:14         Author:Vidu

Json Formatter

I want to Close, Minimize and Maximize my electron application from Javascript. I tried it with this code. It worked for maximize and close but sometimes it's not working.

const { app } = require("electron");
const remote = require("electron").remote;

function closeApplication() {
    window.close().method;
}

function maximizeWindow() {
    // win.maximize();
    // window.maximize();
    window.moveTo(0, 0);
    window.resizeTo(screen.width, screen.height);
}

function minimizeWindow() {
    let window = remote.getCurrentWindow();
    window.minimize();
}

Can anyone help me

Author:Vidu,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/70566475/how-to-close-minimize-and-maximize-window-in-javascript
yy