【问题标题】:electron app always placed at the top with full-width and other windows should be placed under it电子应用程序始终以全角放置在顶部,其他窗口应放置在其下方
【发布时间】:2019-02-28 13:13:05
【问题描述】:

我遇到了一个问题。 我需要我的电子应用程序始终以全角放置在顶部,其他窗口应放置在其下方。 我怎样才能做到这一点? 谁能帮我解决这个问题?

【问题讨论】:

标签: window electron screen


【解决方案1】:

你应该使用mainWindow.maximize()来显示全屏。

function createWindow() {
    // Create the browser window.
    mainWindow = new BrowserWindow({
        width: 1366,
        height: 783,
        alwaysOnTop:true //display show on top
    })
    // and load the index.html of the app.
    mainWindow.loadFile('index.html');


    // Emitted when the window is closed.
    mainWindow.on('closed', function () {
        mainWindow = null
    })
    mainWindow.maximize() //call like this way 
}

您可以从here获得更多参考

【讨论】:

  • 我已经创建了全宽应用程序。但我需要控制窗口。其他窗口应该放在它下面
  • Rahul 你想知道是否有办法从其他正在运行的应用程序控制窗口,并将它们放在你的应用程序下方的屏幕上?
  • 我认为@RAHULDEV 想要的是将所有应用程序放在当前应用程序的底部。就像将应用程序放在屏幕顶部,将所有其他应用程序放在它下面(到屏幕底部)
  • @RAHULDEV 想要什么仍然是个谜,你想创建子窗口吗?让我们清楚
猜你喜欢
  • 1970-01-01
  • 2017-02-11
  • 2016-04-01
  • 2023-03-14
  • 1970-01-01
  • 2021-12-31
  • 1970-01-01
  • 2012-06-22
  • 1970-01-01
相关资源
最近更新 更多