問題描述
我目前正在開發一個電子托盤應用程序.對于 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模板網!