Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

196
Vistas
Restore a minimized windows application from electron application

I am working on launching a windows application.exe from an electron application with a button click. The first button click will launch the application.exe and when the button is again clicked for the second time, the program checks from the running process of the application.exe. If the windows application is not running, exe will be executed, but if the application is already running and minimized. The electron app window should restore the minimized windows application focus the application on the screen.

I have achieved till launching and checking whether the application is already running or not using child process and task list. Just need help to restore the minimized window and set focus.

    let executablePath = "";
let currentWindow = window.require("electron").remote.getCurrentWindow();
    child('tasklist', function(error, stdout, stderr) {
            var lines = stdout.trim().split("\n");  
            var processes = lines.slice(2);   
            var parsed = processes.map(function(process) {
                return process.match(/(.+?)[\s]+?(\d+)/); 
            });
            var filtered = parsed.filter(function(process) {
                return /^AppName/.test(process[1]);  
            }); 
            if(filtered.length > 0){  
                currentWindow.minimize();
            }
            else{ 
                child(executablePath, function(err, data) {
                    if(err){
                    console.error(err.message);
                    return;
                    }
                });
            }
        });
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda