Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

202
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda