   Two Device Input..
  In my program i've tried to inizialize two Input devices, the first dedicate to Mouse Input and the second for KeyBoard Input. So:LPDIRECTINPUT8   g_lpDI;// the direct input objectLPDIRECTINPUTDEVICE8  g_lpDIDeviceMouse;// the direct input deviceLPDIRECTINPUTDEVICE8  g_lpDIDeviceKeyboard;// the direct input deviceLPDIRECTINPUT8   g_lpDIK;// the direct input objectI don't have problem when i try to inizialize the Mouse:bool diManager::initDirectInputMouse(HINSTANCE hInst, HWND wndHandle){HRESULT hr;// Create the DirectInput object.hr = DirectInput8Create(hInst, DIRECTINPUT_VERSION,    IID_IDirectInput8, (void**)&g_lpDI, NULL); if FAILED(hr) return FALSE;// Retrieve a pointer to an IDirectInputDevice8 interfacehr = g_lpDI->CreateDevice(GUID_SysMouse, &g_lpDIDeviceMouse, NULL); if FAILED(hr)return FALSE; hr = g_lpDIDeviceMouse->SetDataFormat(&c_dfDIMouse); if FAILED(hr)return FALSE; // Set the cooperative levelhr = g_lpDIDeviceMouse->SetCooperativeLevel(wndHandle, DISCL_FOREGROUND | DISCL_EXCLUSIVE);if FAILED(hr)    return FALSE;// Get access to the input device.hr = g_lpDIDeviceMouse->Acquire();if FAILED(hr)    return FALSE; return true; }But when i try to inizializze my Keyboard Device:bool diManager::initDirectInputKeyboard(HINSTANCE hInst, HWND wndHandle){HRESULT hr;hr = DirectInput8Create(hInst, DIRECTINPUT_VERSION,  IID_IDirectInput8, (void**)&g_lpDIK, NULL);    if FAILED(hr) return FALSE; // Retrieve a pointer to an IDirectInputDevice8 interfacehr = g_lpDIK->CreateDevice(GUID_SysKeyboard, &g_lpDIDeviceKeyboard, NULL); hr = g_lpDIDeviceKeyboard->SetDataFormat(&c_dfDIKeyboard); if FAILED(hr) return FALSE; hr = g_lpDIDeviceKeyboard->SetCooperativeLevel(wndHandle,DISCL_FOREGROUND | DISCL_NONEXCLUSIVE);if FAILED(hr)    return FALSE;// Get access to the input device.hr = g_lpDIDeviceKeyboard->Acquire();if FAILED(hr)    return FALSE; }This return me "FALSE" in the first control of hr. In WinMain i write this two controls:if (!diMgr.initDirectInputMouse(hInst, wndHandle)){MessageBox(NULL, "Unable to init DirectInput MOUSE", "ERROR", MB_OK);return false;}if (!diMgr.initDirectInputKeyboard(hInst, wndHandle)){MessageBox(NULL, "Unable to init DirectInput KEYBOARD", "ERROR", MB_OK);return false;}But the second control give me FALSE.. Can i create a only device dedicated to Keyboard and mouse to solve this problem?   
  In my projects (although they are OpenGL) i use one dinput device for mouse and keyboard. It may be the error in your code.   ;  So i can do this?bool diManager::initDirectInput(HINSTANCE hInst, HWND wndHandle){HRESULT hr;// Create the DirectInput object.hr = DirectInput8Create(hInst, DIRECTINPUT_VERSION,    IID_IDirectInput8, (void**)&g_lpDI, NULL); if FAILED(hr) return FALSE;// Retrieve a pointer to an IDirectInputDevice8 interfacehr = g_lpDI->CreateDevice(GUID_SysMouse, &g_lpDIDeviceMouse, NULL); if FAILED(hr)return FALSE; hr = g_lpDIDevice->SetDataFormat(&c_dfDIMouse); if FAILED(hr)return FALSE;// Retrieve a pointer to an IDirectInputDevice8 interfacehr = g_lpDIK->CreateDevice(GUID_SysKeyboard, &g_lpDIDeviceKeyboard, NULL); hr = g_lpDIDevice->SetDataFormat(&c_dfDIKeyboard); if FAILED(hr) return FALSE; hr = g_lpDIDevice->SetCooperativeLevel(wndHandle,DISCL_FOREGROUND | DISCL_NONEXCLUSIVE);if FAILED(hr)    return FALSE;  // Set the cooperative levelhr = g_lpDIDevice->SetCooperativeLevel(wndHandle, DISCL_FOREGROUND | DISCL_EXCLUSIVE);if FAILED(hr)    return FALSE;// Get access to the input device.hr = g_lpDIDevice->Acquire();if FAILED(hr)    return FALSE; return true; };  There is an error in the code(second post)hr = g_lpDIK->CreateDevice(GUID_SysKeyboard, &g_lpDIDeviceKeyboard, NULL); should behr = g_lpDI->CreateDevice(GUID_SysKeyboard, &g_lpDIDeviceKeyboard, NULL); cause its only one dinput objectsecondly look over g_lpDIDevice, you mixed them all up   ;  You need only one DirectInput-object (LPDIRECTINPUT8), but the devices (LPDIRECTINPUTDEVICE8) are as many as you need. In your case, 2.   ;  Thank you to everyone!   