Author: jimtabor
Date: Sun Aug 19 23:07:29 2012
New Revision: 57109
URL:
http://svn.reactos.org/svn/reactos?rev=57109&view=rev
Log:
[User32]
- Attempt to fix Win test_mouse_input, properly set MA_ACTIVATE with right conditions when
sending WM_LBUTTONDOWN.
- Get code close to wine.
Modified:
trunk/reactos/win32ss/user/user32/windows/defwnd.c
trunk/reactos/win32ss/user/user32/windows/nonclient.c
Modified: trunk/reactos/win32ss/user/user32/windows/defwnd.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/window…
==============================================================================
--- trunk/reactos/win32ss/user/user32/windows/defwnd.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/user32/windows/defwnd.c [iso-8859-1] Sun Aug 19 23:07:29
2012
@@ -1274,62 +1274,32 @@
}
*/
case WM_CLOSE:
- {
DestroyWindow(hWnd);
return (0);
- }
case WM_MOUSEACTIVATE:
- {
if (GetWindowLongPtrW(hWnd, GWL_STYLE) & WS_CHILD)
{
- LONG Ret;
- if (bUnicode)
- {
- Ret = SendMessageW(GetParent(hWnd), WM_MOUSEACTIVATE,
- wParam, lParam);
- }
- else
- {
- Ret = SendMessageA(GetParent(hWnd), WM_MOUSEACTIVATE,
- wParam, lParam);
- }
- if (Ret)
- {
- return (Ret);
- }
- }
- return ((LOWORD(lParam) >= HTCLIENT) ? MA_ACTIVATE : MA_NOACTIVATE);
- }
+ LONG Ret = SendMessageW(GetParent(hWnd), WM_MOUSEACTIVATE, wParam,
lParam);
+ if (Ret) return (Ret);
+ }
+ return ( (HIWORD(lParam) == WM_LBUTTONDOWN && LOWORD(lParam) ==
HTCAPTION) ? MA_NOACTIVATE : MA_ACTIVATE );
case WM_ACTIVATE:
- {
- /* Check if the window is minimized. */
+ /* The default action in Windows is to set the keyboard focus to
+ * the window, if it's being activated and not minimized */
if (LOWORD(wParam) != WA_INACTIVE &&
!(GetWindowLongPtrW(hWnd, GWL_STYLE) & WS_MINIMIZE))
{
+ //ERR("WM_ACTIVATE %p\n",hWnd);
SetFocus(hWnd);
}
break;
- }
case WM_MOUSEWHEEL:
- {
if (GetWindowLongPtrW(hWnd, GWL_STYLE) & WS_CHILD)
- {
- if (bUnicode)
- {
- return (SendMessageW(GetParent(hWnd), WM_MOUSEWHEEL,
- wParam, lParam));
- }
- else
- {
- return (SendMessageA(GetParent(hWnd), WM_MOUSEWHEEL,
- wParam, lParam));
- }
- }
- break;
- }
+ return SendMessageW( GetParent(hWnd), WM_MOUSEWHEEL, wParam, lParam);
+ break;
case WM_ERASEBKGND:
case WM_ICONERASEBKGND:
Modified: trunk/reactos/win32ss/user/user32/windows/nonclient.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/window…
==============================================================================
--- trunk/reactos/win32ss/user/user32/windows/nonclient.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/user32/windows/nonclient.c [iso-8859-1] Sun Aug 19 23:07:29
2012
@@ -995,7 +995,8 @@
}
case HTSYSMENU:
{
- if (GetWindowLongPtrW(hWnd, GWL_STYLE) & WS_SYSMENU)
+ LONG style = GetWindowLongPtrW( hWnd, GWL_STYLE );
+ if (style & WS_SYSMENU)
{
SendMessageW(hWnd, WM_SYSCOMMAND, SC_MOUSEMENU + HTSYSMENU,
lParam);
@@ -1036,6 +1037,8 @@
SendMessageW(hWnd, WM_SYSCOMMAND, SC_SIZE + wParam - (HTLEFT - WMSZ_LEFT),
lParam);
break;
}
+ case HTBORDER:
+ break;
}
return(0);
}