問題描述
可以這么說,我需要控制主窗口的 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 順序,可能嗎?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!