Change system z-order of BrowserWindow in electron, possible?(在电子中更改 BrowserWindow 的系统 z 顺序,可能吗?)
问题描述
可以这么说,我需要控制主窗口的 z 顺序.总是在最上面不是我的情况.我想把我的窗口放在所有其他窗口的后面和桌面上方.是否可以?是否有 C++ SetWindowPos 函数的类似物?或者可能有一些解决方法?
I need to control main window z-order so to say. Always on top is not my case. I want to put my window behind all others and above desktop. Is it possible? Is there analogue to C++ SetWindowPos function? Or maybe some workaround?
推荐答案
如果这不是你可以用 父/子窗口 然后你可以通过 SetWindowPos()-ffi/node-ffi" rel="nofollow">node-ffi
(或者写一个原生的Node模块/插件).要获取 BrowserWindow
的 HWND
,请调用 getNativeWindowHandle()
.我不知道您如何在 macOS 或 Ubuntu 上本地执行此操作.
If it's not something you can accomplish with parent/child windows then you could call SetWindowPos()
via node-ffi
(or write a native Node module/addon). To get the HWND
for a BrowserWindow
call getNativeWindowHandle()
. I have no idea how you'd do this natively on macOS or Ubuntu.
这篇关于在电子中更改 BrowserWindow 的系统 z 顺序,可能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在电子中更改 BrowserWindow 的系统 z 顺序,可能吗


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