在电子中改变BrowserWindow的系统z顺序,可能吗? [英] Change system z-order of BrowserWindow in electron, possible?
问题描述
我需要控制主窗口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()
通过 node-ffi
(或编写本机节点模块/插件)。要获得 HWND
的 BrowserWindow
,请致电 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顺序,可能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!