Search code examples
windowswinapidirectinput

Why does the mouse disappear in DISCL_EXCLUSIVE | DISCL_FOREGROUND mode?


When using DirectInput, why does the mouse cursor completely disappear when you use DISCL_EXCLUSIVE | DISCL_FOREGROUND as your cooperative level?

mouse->SetCooperativeLevel ( hwnd, DISCL_EXCLUSIVE | DISCL_FOREGROUND ) ;

Even though DirectInput is deprecated, does the very fact the mouse is not even available to WINDOWS mean that you're slightly more responsive and better when using DirectInput (vs RAWINPUT)?


Solution

  • At the time I opened this question I didn't realize that DISCL_EXCLUSIVE | DISCL_FOREGROUND setting in DirectInput really amounts to RIDEV_CAPTUREMOUSE | RIDEV_NOLEGACY for the mouse in RAWINPUT. You can simply call ShowCursor( FALSE ); to hide the cursor then.