Browse Source

DisableInputWndProc clean up

pull/556/head^2^2
Anders Jenbo 6 years ago
parent
commit
8a2cd19d95
  1. 19
      Source/diablo.cpp

19
Source/diablo.cpp

@ -641,31 +641,32 @@ LRESULT CALLBACK DisableInputWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM
case WM_MOUSEMOVE: case WM_MOUSEMOVE:
return 0; return 0;
case WM_LBUTTONDOWN: case WM_LBUTTONDOWN:
if (sgbMouseDown == 0) { if (sgbMouseDown != 0)
return 0;
sgbMouseDown = 1; sgbMouseDown = 1;
SetCapture(hWnd); SetCapture(hWnd);
}
return 0; return 0;
case WM_LBUTTONUP: case WM_LBUTTONUP:
if (sgbMouseDown == 1) { if (sgbMouseDown != 1)
return 0;
sgbMouseDown = 0; sgbMouseDown = 0;
ReleaseCapture(); ReleaseCapture();
}
return 0; return 0;
case WM_RBUTTONDOWN: case WM_RBUTTONDOWN:
if (sgbMouseDown == 0) { if (sgbMouseDown != 0)
return 0;
sgbMouseDown = 2; sgbMouseDown = 2;
SetCapture(hWnd); SetCapture(hWnd);
}
return 0; return 0;
case WM_RBUTTONUP: case WM_RBUTTONUP:
if (sgbMouseDown == 2) { if (sgbMouseDown != 2)
return 0;
sgbMouseDown = 0; sgbMouseDown = 0;
ReleaseCapture(); ReleaseCapture();
}
return 0; return 0;
case WM_CAPTURECHANGED: case WM_CAPTURECHANGED:
if (hWnd != (HWND)lParam) if (hWnd == (HWND)lParam)
return 0;
sgbMouseDown = 0; sgbMouseDown = 0;
return 0; return 0;
} }

Loading…
Cancel
Save