How to convert SDL Window handle to C# environment as a parent control

Hi,

I’m using the following code to get the SDL window handle

HWND handle()
{
SDL_SysWMinfo wmInfo;**
SDL_VERSION(&wmInfo.version);
**
SDL_GetWindowWMInfo(m_windowPtr, &wmInfo);**
return wmInfo.info.win.window;
**
}

and passing to open file dialog on c# to select some files, this way

IntPtr handlePtr = System::IntPtr(handle()); // -> this is ok so far, handlPtr is not nullptr

// passing to c#
OpenFileDialog fileDialog = new OpenFileDialog();
NativeWindow nativeWindow = NativeWindow.FrmHandle(handlePtr ); // here nativewindow is nullptr
fileDialog.ShowDialog(nativeWindow) // the dialog is shows but my SDL window is not the parent control

how can get a c# handle to pass as parent, from the SDL Window to a C# Dialog?

Thanks for any advice :slight_smile: