   using direct input in a multi threaded process
  I'm trying to use direct input 8 in a multithreaded process where a window created in another thread is the foreground/active window. I can't seem to get the cooperation modes right, and I've tried the 4 permutations of fore/background and [non]exclusive. the weird thing is, when I'm debugging my app, it works. I think this has something to do with the visual studio window being in the foreground. I'm puzzled, and I'm not that good with DX to begin with. any ideas?TIA   
  bump   ;  What are you trying to do and what's not working?  What do you mean by "when I'm debugging my app, it works"?   ;  when I pause my process and type anything in the debugger, keys I type get caught by GetDeviceData(). when I'm running my app normally, GetDeviceData() returns the count (dwCount) as zero. what would cause this behavior?   ;  desperate bump   ;  Hello, Well maybe the trouble is the way you are getting your device data, try using your GetDeviceData and Acquire methods inside a loop, to makesure DInput "catch" any inpu, like the following way:while (1){elements = 1;hr = IDirectInputDevice7_GetDeviceData(in.keyboard, sizeof(DIDEVICEOBJECTDATA), &od, &elements, 0);   // if it did not work, try and re-acquire the deviceif (FAILED(hr))IDirectInputDevice7_Acquire(in.keyboard);// If it failed, or there was no events, stopif (FAILED(hr) || elements==0)break;   // Process your data here}Hope that helps you,Oscar   ;  I get the input in my window proc.Pseudocode:if(lpdiKey->GetDeviceData(sizeof(KeyboardData), &KeyboardData, &dwCount, 0) == DIERR_INPUTLOST){//try to re-acquire the deviceif(FAILED(lpdiKey->Acquire())){;//error}}while(dwCount) //while there is keyboard input in the buffer{log("Key detected");//set the according stateKeyboardState[KeyboardData.dwOfs] = (BYTE)(KeyboardData.dwData&0xff);//check for moredwCount = 1;lpdiKey->GetDeviceData(sizeof(KeyboardData), &KeyboardData, &dwCount, 0);}any ideas?   ;  bump   