tbvjaos510 / electron-disable-minimize

Blocking window minimize with [Window + D] and Show Desktop button
MIT License
8 stars 5 forks source link

electron-disable-minimize not a valid win32 application #4

Closed giotiskl closed 4 years ago

giotiskl commented 4 years ago

Thank you for the plugin. I am new to electron and I followed the installation steps on Windows 10 (using Ubuntu WSL).

I started a new electron project and tried to install your lib. Compilation and electron-rebuild appear to have completed successfully but then when I tried to run my app using ./node_modules/.bin/electron path-to-my-index-js I get the following error:

error_Screenshot

any thoughts?

This is the content of my index file:

// @ts-ignore
const { app, BrowserWindow } = require('electron');
const { DisableMinimize } = require('electron-disable-minimize');

function createWindow() {
  // Create the browser window.
  const win = new BrowserWindow({
    width: 800,
    height: 600,
    frame: false,
    alwaysOnTop: true,
    transparent: true,
    // skipTaskbar: true,
    webPreferences: {
      nodeIntegration: true,
    },
    type: 'desktop',
  });

  // and load the index.html of the app.
  win.loadURL('http://localhost:3000');

  const handle = win.getNativeWindowHandle();
  DisableMinimize(handle);
  console.log('handle', handle.toString());
}

app.whenReady().then(createWindow);
giotiskl commented 4 years ago

I got over this issue using PowerShell instead of WSL in the end.