diff --git a/src/SharpWebview/Bindings.cs b/src/SharpWebview/Bindings.cs
index 1b4c62d..305e20b 100644
--- a/src/SharpWebview/Bindings.cs
+++ b/src/SharpWebview/Bindings.cs
@@ -242,13 +242,20 @@ internal extern static void webview_return(IntPtr webview,
RPCResult result,
[MarshalAs(UnmanagedType.LPUTF8Str)] string resultJson);
- /*
- Not mapped:
-
- // Returns a native window handle pointer. When using GTK backend the pointer
- // is GtkWindow pointer, when using Cocoa backend the pointer is NSWindow
- // pointer, when using Win32 backend the pointer is HWND pointer.
- WEBVIEW_API void *webview_get_window(webview_t w);
- */
+ ///
+ ///
+ /// Returns a native window handle pointer. When using GTK backend the pointer
+ /// is GtkWindow pointer, when using Cocoa backend the pointer is NSWindow
+ /// pointer, when using Win32 backend the pointer is HWND pointer.
+ ///
+ ///
+ /// Binding for:
+ /// WEBVIEW_API void *webview_get_window(webview_t w);
+ ///
+ ///
+ /// The webview to get the handle.
+ ///
+ [DllImport(DllFile, CallingConvention = CallingConvention.Cdecl)]
+ internal extern static IntPtr webview_get_window(IntPtr webview);
}
}
diff --git a/src/SharpWebview/Webview.cs b/src/SharpWebview/Webview.cs
index 3ce1dbb..41ce3bb 100644
--- a/src/SharpWebview/Webview.cs
+++ b/src/SharpWebview/Webview.cs
@@ -173,6 +173,15 @@ public void Dispatch(Action dispatchFunc)
Bindings.webview_dispatch(_nativeWebview, dispatchFuncInstance, IntPtr.Zero);
}
+ ///
+ /// Get the native window of the webview.
+ ///
+ /// Native window handle.
+ public IntPtr GetWindow()
+ {
+ return Bindings.webview_get_window(_nativeWebview);
+ }
+
///
/// Disposes the current webview.
///