title: Restore a minimized windows application from electron application
body: <p>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.</p>
  <p>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.</p>
  <pre><code>    let executablePath = &quot;&quot;;
  let currentWindow = window.require(&quot;electron&quot;).remote.getCurrentWindow();
      child('tasklist', function(error, stdout, stderr) {
              var lines = stdout.trim().split(&quot;\n&quot;);  
              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 &gt; 0){  
                  currentWindow.minimize();
              }
              else{ 
                  child(executablePath, function(err, data) {
                      if(err){
                      console.error(err.message);
                      return;
                      }
                  });
              }
          });
  </code></pre>