I have a C++/WinRT/UWP project. I need the HWND and HINSTANCE to be able to correctly initialize Direct Input, otherwise DirectInput manage only to enumerate the keyboard and mouse but not the joysticks.. don't ask me why, I even tried to get the TopMostWindow from the HInstance got with GetModule, it just return NULL when running from my C++/WinRT/UWP app, but works when running from a console app.
documentation https://learn.microsoft.com/en-us/windows/win32/api/corewindow/nn-corewindow-icorewindowinterop I have no idea how to cast my CoreWindow to ICoreWindowInterop. CComPtr is not availble and not usable in C++/WinRT, conflicts with IUnkwnown.
In the method App::OnLaunched(LaunchActivatedEventArgs const& e) I get the current window like this
CoreWindow w = Window::Current().CoreWindow().GetForCurrentThread();
Then I don't know how to get the ICoreWindowInterop from it. CoreWindow is a ICoreWindow , but I don't see any explanation in the Microsoft documentation :/
I tried casting and reinterpret casting without success ( compilation error ). I'm no COM/Windows expert, so I'm quite lost now.
Thanks for the help Cheers, Seb