What is the equivalent for app.dock.hide();(app.dock.hide() 的等价物是什么?)
问题描述
我目前正在开发一个电子托盘应用程序.对于 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() 的等价物是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:app.dock.hide() 的等价物是什么?


- 从原点悬停时触发 translateY() 2022-01-01
- 为什么我的页面无法在 Github 上加载? 2022-01-01
- 我不能使用 json 使用 react 向我的 web api 发出 Post 请求 2022-01-01
- 如何显示带有换行符的文本标签? 2022-01-01
- 是否可以将标志传递给 Gulp 以使其以不同的方式 2022-01-01
- 如何调试 CSS/Javascript 悬停问题 2022-01-01
- 在不使用循环的情况下查找数字数组中的一项 2022-01-01
- 如何向 ipc 渲染器发送添加回调 2022-01-01
- 使用 iframe URL 的 jQuery UI 对话框 2022-01-01
- 为什么悬停在委托事件处理程序中不起作用? 2022-01-01