Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions ElectronNET.API/BrowserWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1809,6 +1809,25 @@ public Task<bool> IsKioskAsync()
return taskCompletionSource.Task;
}

/// <summary>
/// Returns the native type of the handle is HWND on Windows, NSView* on macOS, and Window (unsigned long) on Linux.
/// </summary>
/// <returns>string of the native handle obtained, HWND on Windows, NSView* on macOS, and Window (unsigned long) on Linux.</returns>
public Task<string> GetNativeWindowHandle()
{
var taskCompletionSource = new TaskCompletionSource<string>();

BridgeConnector.Socket.On("browserWindow-getNativeWindowHandle-completed", (nativeWindowHandle) =>
{
BridgeConnector.Socket.Off("browserWindow-getNativeWindowHandle-completed");
taskCompletionSource.SetResult(nativeWindowHandle.ToString());
});

BridgeConnector.Socket.Emit("browserWindowGetNativeWindowHandle", Id);

return taskCompletionSource.Task;
}

/// <summary>
/// Sets the pathname of the file the window represents,
/// and the icon of the file will show in window’s title bar.
Expand Down
4 changes: 4 additions & 0 deletions ElectronNET.Host/api/browserWindows.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading