我目前正在开发一个电子托盘应用程序.对于 Mac,electron 框架具有将应用程序隐藏在 Dock 中的功能.
I currently working on an electron tray application. For Mac, the electron framework has a function for hiding the app in the dock.
app.dock.hide();
我尝试在 Windows 机器上运行它并得到一个错误.
I try to run this on a Windows machine and get an error.
TypeError: Cannot read property 'hide' of undefined
现在我正在为 Windows 寻找一个等效的功能来隐藏任务栏中的应用程序.
Now I am looking for an equivalent functionality for Windows to hide the app in the taskbar.
Mac OS X 是面向应用程序的,而 Windows 是面向窗口的...
Mac OS X is application-oriented, whereas Windows is window-oriented...
app.dock.hide () 确实只标记为 macOS.
app.dock.hide () Is indeed tagged as macOS only.
为了使窗口不显示在任务栏中,您可以调用:
In order to make the window not show in the taskbar, you can either call:
win.setSkipTaskbar (true);
或者将 skipTaskbar 添加到传递给新 BrowserWindow 的选项中:
Or add skipTaskbar to the options passed to the new BrowserWindow:
{
// ...
skipTaskbar: true,
// ...
}
这篇关于app.dock.hide() 的等价物是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
在 Electron 渲染器进程中创建子窗口时如何修复How to fix BrowserWindow is not a constructor error when creating child window in Electron renderer process(在 Electron 渲染器进程中创建子窗口
mainWindow.loadURL("https://localhost:3000/") 在 EmainWindow.loadURL(quot;https://localhost:3000/quot;) show white screen on Electron app(mainWindow.loadURL(https://localhost:3000/) 在 Electron 应用程
Electron webContents executeJavaScript:无法在第二个 loaElectron webContents executeJavaScript : Cannot execute script on second on loadURL(Electron webContents executeJavaScript:无法在第二个 loadURL 上
如何在angular-cli的组件内使用电子浏览器窗口?how to use electron browser window inside components in angular-cli?(如何在angular-cli的组件内使用电子浏览器窗口?)
ElectronJS - 在 Windows 之间共享 redux 存储?ElectronJS - sharing redux store between windows?(ElectronJS - 在 Windows 之间共享 redux 存储?)
如何在电子应用程序中访问相机/网络摄像头?How to access camera/webcamera inside electron app?(如何在电子应用程序中访问相机/网络摄像头?)