This commit is contained in:
Birunthan Mohanathas 2013-12-05 10:17:33 +02:00
parent 6ade414505
commit c864de2859

View File

@ -4589,20 +4589,20 @@ bool MeterWindow::DoMoveAction(int x, int y, MOUSEACTION action)
*/ */
LRESULT MeterWindow::OnMouseInput(UINT uMsg, WPARAM wParam, LPARAM lParam) LRESULT MeterWindow::OnMouseInput(UINT uMsg, WPARAM wParam, LPARAM lParam)
{ {
POINT pos = System::GetCursorPosition(); const POINT pos = System::GetCursorPosition();
HWND hwnd = WindowFromPoint(pos);
// Only process for unfocused skin window. // Only process for unfocused skin window.
if (m_Window == hwnd && m_Window != GetFocus()) if (m_Window == WindowFromPoint(pos) && m_Window != GetFocus())
{ {
RAWINPUT ri; RAWINPUT ri;
UINT riSize = sizeof(ri); UINT riSize = sizeof(ri);
GetRawInputData((HRAWINPUT)lParam, RID_INPUT, &ri, &riSize, sizeof(RAWINPUTHEADER)); const UINT dataSize = GetRawInputData(
if (ri.header.dwType == RIM_TYPEMOUSE) (HRAWINPUT)lParam, RID_INPUT, &ri, &riSize, sizeof(RAWINPUTHEADER));
if (dataSize != (UINT)-1 &&
ri.header.dwType == RIM_TYPEMOUSE)
{ {
WPARAM wheelDelta = MAKEWPARAM(0, HIWORD((short)ri.data.mouse.usButtonData)); const WPARAM wheelDelta = MAKEWPARAM(0, HIWORD((short)ri.data.mouse.usButtonData));
LPARAM wheelPos = MAKELPARAM(pos.x, pos.y); const LPARAM wheelPos = MAKELPARAM(pos.x, pos.y);
if (ri.data.mouse.usButtonFlags == RI_MOUSE_WHEEL) if (ri.data.mouse.usButtonFlags == RI_MOUSE_WHEEL)
{ {
OnMouseScrollMove(WM_INPUT, wheelDelta, wheelPos); OnMouseScrollMove(WM_INPUT, wheelDelta, wheelPos);