问题描述
我目前正在开发一个电子托盘应用程序.对于 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设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)