SDL_CreateWindowFrom Not Returning Back(Hanged)

Hello Everyone,

OS:- Windows

I am trying to re-initialize SDL with native window by passing window handler(Windows Environment) to SDL. SDL uses SDL_CreateWindowFrom API to create window from handle which is provided by application.

As per our application architecture, I create window handle in Thread-1 context and pass it to Thread-2. Thread-2 calls SDL_CreateWindowFrom to re-initialize SDL with native window but SDL_CreateWindowFrom is blocking/hanging (Not returning back).

Please suggest a solution to get rid of blocking state.

Please see below code which i use to create window handle (From SDL Sample App).

Here, created window handle hwnd is given to Thread-2 to re-initialize SDL.

BIG THANKS in advance !!