Please don't apply this and other dinput patches. It doesn't work for multiply acquired windows. This approach does not handle "nesting" - when same window is being acquired several times by different devices.
I guess I will have to go back to WINDPROC hook after all.
Vitaliy.