It's most likely caused by this line:
FAILED( pMouse->SetCooperativeLevel( hWnd,
DISCL_FOREGROUND|DISCL_EXCLUSIVE ) ) )
See the documentation on SetCooperativeLevel here: http://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.setcooperativelevel(v=vs.85).aspx
If the system mouse is acquired in exclusive mode, the pointer is removed from the screen until the device is unacquired. This applies only to a mouse created by passing GUID_SysMouse to IDirectInput8::CreateDevice.