From 9dc0bfc755b5ba074b9e7c23a311c132e6926f37 Mon Sep 17 00:00:00 2001 From: Adi Shavit Date: Sun, 5 Jan 2014 17:21:59 +0200 Subject: [PATCH] Small fix for extracting mouse coordinates on Windows, in a way that will always work with multiple monitors. This is the way recommended by Microsoft. --- modules/highgui/src/window_w32.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/highgui/src/window_w32.cpp b/modules/highgui/src/window_w32.cpp index 6a5355c..222f0b0 100644 --- a/modules/highgui/src/window_w32.cpp +++ b/modules/highgui/src/window_w32.cpp @@ -1474,8 +1474,8 @@ static LRESULT CALLBACK HighGUIProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM if( uMsg == WM_LBUTTONUP || uMsg == WM_RBUTTONUP || uMsg == WM_MBUTTONUP ) ReleaseCapture(); - pt.x = LOWORD( lParam ); - pt.y = HIWORD( lParam ); + pt.x = GET_X_LPARAM( lParam ); + pt.y = GET_Y_LPARAM( lParam ); GetClientRect( window->hwnd, &rect ); icvGetBitmapData( window, &size, 0, 0 ); -- 2.7.4