title: Electron: dialog.showMessageBox() not working with a parent window (modal failed)
body: <p>I'm learning Electron and trying very basic things... without success.</p>
  <p>Whatever the technique I use to make a dialog box modal, it fails. Either the dialog box is not modal, or the dialog box is empty (...and still not modal).</p>
  <pre><code>const {BrowserWindow, dialog} = require('electron')
  
  dialog.showMessageBoxSync(BrowserWindow.getFocusedWindow(), {message: &quot;FooBar&quot;});
  // Not modal: BrowserWindow.getFocusedWindow() returns null.
  
  dialog.showMessageBoxSync(BrowserWindow.getAllWindows()[0], {message: &quot;FooBar&quot;});
  // Not modal: BrowserWindow.getAllWindows() returns an empty array.
  
  dialog.showMessageBoxSync(parentWindow, {message: &quot;FooBar&quot;});
  // &quot;parentWindow&quot; comes from the &quot;click&quot; handler of the menu item launching the message box: it is not null.
  // Error: the message box is not modal, and does not display &quot;FooBar&quot; (i.e. it is empty).
  </code></pre>
  <p>This code is called from the main process, and no error is displayed in the terminal or the development tools. The outcome is the same if I use <code>dialog.showMessageBox()</code> instead of <code>showMessageBoxSync()</code>.</p>
  <p>Electron: v9.0.5 on Windows 10 (x64).</p>