nw.js icon indicating copy to clipboard operation
nw.js copied to clipboard

Browser process/getting native window handle?

Open thedracle opened this issue 4 years ago • 4 comments

So I am interested in seeing if there is some way for me to get a native window handle to an NWJS window, to implement some functionality similar to applications that use getNativeWindowHandle in electron: https://www.electronjs.org/docs/api/browser-window#wingetnativewindowhandle

I have noticed these two duplicate feature request issues for getting the window ID: https://github.com/nwjs/nw.js/issues/572 https://github.com/nwjs/nw.js/issues/1337

I have managed to get the window ID in a round about way, but the issue is getting the window handle is problematic because all of the windows are owned by the parent PID (browser process).

Is there any mechanism to run something on behalf of the browser process, it seems that my original NW window is already running as a child PID of the browser process, so getting a handle to the window is impossible.

Is there some way to run in the context of the browser process? I seem to remember in earlier versions of NWJS running in the same PID as the top level process in a certain context.

thedracle avatar May 08 '20 23:05 thedracle