Instead of goofing around with DirectInput and mickeys, use Windows messaging instead. This is especially useful in GUIs and hover events, should they be necessary for your game.
in WndProc does the trick. Additional messages such as double clicks, right clicks, and so on can be caught and used, depending on the program requirements. Initialization with GetCursorPos and ScreenToClient sets up the correct beginning mouse position values.