title: Electron Remote (Close, Minimize etc) not work (Cannot read property 'getCurrentWindow' of undefined)
body: <p>I am trying to add close and minimize button on frameless window in Electron JS app. But its not working in anyhow. It's alwasy show &quot;Cannot read property 'getCurrentWindow' of undefined&quot; error. Here is my code:</p>
  <pre><code>const {remote} = require('electron');
  
  document.getElementById('minimize').onclick = function() {
      var window = remote.getCurrentWindow();
      window.minimize();
  }
  
  document.getElementById('close').onclick = function() {
      var window = remote.getCurrentWindow();
      window.close();
  }
  </code></pre>
  <p>I also add webPreferences: {nodeIntegration: true} in main.js.</p>
  <pre><code>win = new BrowserWindow({width: 990, height: 660, title: &quot;Okkhor52 Tools&quot;, show: false, resizable: false, frame: false, webPreferences: {nodeIntegration: true}});
  </code></pre>
  <p>Please give me a sollution, I try to found this problem sollution in many place but i didn't get exact sollution.</p>