Start on the native side of the boundary.
An Avalonia window hands you its HWND on Windows or NSWindow on macOS. In Electron, work past its APIs crosses from the renderer over IPC into the main process, and from there into native code.
- Native libraries are a P/Invoke away
- Platform views embed through NativeControlHost
if (TopLevel.GetTopLevel(this)?.TryGetPlatformHandle() is { } handle)
{
// handle.Handle is the native handle
IntPtr nativeHandle = handle.Handle;
// handle.HandleDescriptor tells you the type
string kind = handle.HandleDescriptor;
}








