The wParam in WM_NCMOUSEMOVE messages already contains the non-client hit-test value.
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- dlls/user32/controls.h | 2 +- dlls/user32/defwnd.c | 7 +------ dlls/user32/nonclient.c | 14 ++++++++------ 3 files changed, 10 insertions(+), 13 deletions(-)
diff --git a/dlls/user32/controls.h b/dlls/user32/controls.h index 2b3d405ae69..ce14d13171f 100644 --- a/dlls/user32/controls.h +++ b/dlls/user32/controls.h @@ -171,7 +171,7 @@ extern LRESULT NC_HandleNCActivate( HWND hwnd, WPARAM wParam, LPARAM lParam ) DE extern LRESULT NC_HandleNCCalcSize( HWND hwnd, WPARAM wParam, RECT *winRect ) DECLSPEC_HIDDEN; extern LRESULT NC_HandleNCHitTest( HWND hwnd, POINT pt ) DECLSPEC_HIDDEN; extern LRESULT NC_HandleNCLButtonDown( HWND hwnd, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN; -extern LRESULT NC_HandleNCMouseMove( HWND hwnd, POINT pt ) DECLSPEC_HIDDEN; +extern LRESULT NC_HandleNCMouseMove( HWND hwnd, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN; extern LRESULT NC_HandleNCMouseLeave( HWND hwnd ) DECLSPEC_HIDDEN; extern LRESULT NC_HandleNCRButtonDown( HWND hwnd, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN; extern LRESULT NC_HandleNCLButtonDblClk( HWND hwnd, WPARAM wParam, LPARAM lParam) DECLSPEC_HIDDEN; diff --git a/dlls/user32/defwnd.c b/dlls/user32/defwnd.c index 44675c7b8e7..abb73e73ca8 100644 --- a/dlls/user32/defwnd.c +++ b/dlls/user32/defwnd.c @@ -246,12 +246,7 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa return NC_HandleNCPaint( hwnd, (HRGN)wParam );
case WM_NCMOUSEMOVE: - { - POINT pt; - pt.x = (short)LOWORD(lParam); - pt.y = (short)HIWORD(lParam); - return NC_HandleNCMouseMove( hwnd, pt ); - } + return NC_HandleNCMouseMove( hwnd, wParam, lParam );
case WM_NCMOUSELEAVE: return NC_HandleNCMouseLeave( hwnd ); diff --git a/dlls/user32/nonclient.c b/dlls/user32/nonclient.c index b47616bb639..639cca707fb 100644 --- a/dlls/user32/nonclient.c +++ b/dlls/user32/nonclient.c @@ -635,22 +635,24 @@ LRESULT NC_HandleNCHitTest( HWND hwnd, POINT pt ) return HTNOWHERE; }
-LRESULT NC_HandleNCMouseMove(HWND hwnd, POINT pt) +LRESULT NC_HandleNCMouseMove(HWND hwnd, WPARAM wParam, LPARAM lParam) { - LONG hittest; RECT rect; + POINT pt;
- TRACE("hwnd=%p pt=%s\n", hwnd, wine_dbgstr_point(&pt)); + TRACE("hwnd=%p wparam=%#lx lparam=%#lx\n", hwnd, wParam, lParam);
- hittest = NC_HandleNCHitTest(hwnd, pt); - if (hittest != HTHSCROLL && hittest != HTVSCROLL) + if (wParam != HTHSCROLL && wParam != HTVSCROLL) return 0;
WIN_GetRectangles(hwnd, COORDS_CLIENT, &rect, NULL); + + pt.x = (short)LOWORD(lParam); + pt.y = (short)HIWORD(lParam); ScreenToClient(hwnd, &pt); pt.x -= rect.left; pt.y -= rect.top; - SCROLL_HandleScrollEvent(hwnd, hittest == HTHSCROLL ? SB_HORZ : SB_VERT, WM_NCMOUSEMOVE, pt); + SCROLL_HandleScrollEvent(hwnd, wParam == HTHSCROLL ? SB_HORZ : SB_VERT, WM_NCMOUSEMOVE, pt); return 0; }