Commit 2799be18 authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

user32: Translate WM_(NC)XBUTTONUP to WM_APPCOMMAND in DefWindowProc.

parent fef10cbe
...@@ -291,6 +291,15 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa ...@@ -291,6 +291,15 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
*/ */
break; break;
case WM_XBUTTONUP:
case WM_NCXBUTTONUP:
if (HIWORD(wParam) == XBUTTON1 || HIWORD(wParam) == XBUTTON2)
{
SendMessageW(hwnd, WM_APPCOMMAND, (WPARAM)hwnd,
MAKELPARAM(LOWORD(wParam), FAPPCOMMAND_MOUSE | HIWORD(wParam)));
}
break;
case WM_CONTEXTMENU: case WM_CONTEXTMENU:
if (GetWindowLongW( hwnd, GWL_STYLE ) & WS_CHILD) if (GetWindowLongW( hwnd, GWL_STYLE ) & WS_CHILD)
SendMessageW( GetParent(hwnd), msg, wParam, lParam ); SendMessageW( GetParent(hwnd), msg, wParam, lParam );
......
...@@ -14378,6 +14378,18 @@ static const struct message NCRBUTTONDOWNSeq[] = ...@@ -14378,6 +14378,18 @@ static const struct message NCRBUTTONDOWNSeq[] =
{ 0 } { 0 }
}; };
static const struct message NCXBUTTONUPSeq1[] =
{
{ WM_APPCOMMAND, sent|lparam, /*hwnd*/0, MAKELPARAM(0, FAPPCOMMAND_MOUSE | APPCOMMAND_BROWSER_BACKWARD) },
{ 0 }
};
static const struct message NCXBUTTONUPSeq2[] =
{
{ WM_APPCOMMAND, sent|lparam, /*hwnd*/0, MAKELPARAM(0, FAPPCOMMAND_MOUSE | APPCOMMAND_BROWSER_FORWARD) },
{ 0 }
};
struct rbuttonup_thread_data struct rbuttonup_thread_data
{ {
HWND hwnd; HWND hwnd;
...@@ -14437,6 +14449,22 @@ static void test_defwinproc(void) ...@@ -14437,6 +14449,22 @@ static void test_defwinproc(void)
DefWindowProcA( hwnd, WM_NCRBUTTONDOWN, HTCAPTION, MAKELPARAM(x, y)); DefWindowProcA( hwnd, WM_NCRBUTTONDOWN, HTCAPTION, MAKELPARAM(x, y));
ok_sequence(NCRBUTTONDOWNSeq, "WM_NCRBUTTONDOWN on caption", FALSE); ok_sequence(NCRBUTTONDOWNSeq, "WM_NCRBUTTONDOWN on caption", FALSE);
res = DefWindowProcA(hwnd, WM_NCXBUTTONUP, 0, MAKELPARAM(x, y));
ok(!res, "WM_NCXBUTTONUP returned %ld\n", res);
ok_sequence(WmEmptySeq, "WM_NCXBUTTONUP without button", FALSE);
res = DefWindowProcA(hwnd, WM_NCXBUTTONUP, MAKEWPARAM(0, XBUTTON1), MAKELPARAM(x, y));
ok(!res, "WM_NCXBUTTONUP returned %ld\n", res);
ok_sequence(NCXBUTTONUPSeq1, "WM_NCXBUTTONUP with XBUTTON1", FALSE);
res = DefWindowProcA(hwnd, WM_NCXBUTTONUP, MAKEWPARAM(0, XBUTTON2), MAKELPARAM(x, y));
ok(!res, "WM_NCXBUTTONUP returned %ld\n", res);
ok_sequence(NCXBUTTONUPSeq2, "WM_NCXBUTTONUP with XBUTTON2", FALSE);
res = DefWindowProcA(hwnd, WM_NCXBUTTONUP, MAKEWPARAM(0, 3), MAKELPARAM(x, y));
ok(!res, "WM_NCXBUTTONUP returned %ld\n", res);
ok_sequence(WmEmptySeq, "WM_NCXBUTTONUP with invalid button", FALSE);
SetEvent( data.wndproc_finished ); SetEvent( data.wndproc_finished );
WaitForSingleObject( thread, 1000 ); WaitForSingleObject( thread, 1000 );
CloseHandle( data.wndproc_finished ); CloseHandle( data.wndproc_finished );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment