Short version:
How do I initialize and use DirectInput if I have no access to the HWND/HINSTANCE?
Background information:
I am currently using SFML for most parts of my program, amongst others for window creation. Works like a charm. But I'm not fully satisfied with SFML's input system (e.g. I want XInput for XBox 360 gamepads) and want to write my own.
I've already written the XInput part, but for other gamepads/joysticks/... I also need DirectInput. Since SFML hides the Windows-related code from the user (and rightly so) I don't have access to the hwnd or hinstance. How can I use DirectInput without it? Maybe catching input all the time, not only when the window is active? (I could then filter it based on the Window's (de)activated event.)
Thanks,
Mr. Wonko
Finding the window back isn't too hard, use EnumThreadWindows() and GetCurrentThreadId().
Note that DirectInput doesn't need a window handle anywhere. It just needs the instance handle in DirectInput8Create(). GetModuleHandle(NULL) is good for an SFML app.