{
PWND pWnd, pWndChild;
+ if ( !pWndTop )
+ {
+ pWndTop = UserGetDesktopWindow();
+ if ( !pWndTop ) return NULL;
+ }
+
if (!(pWndTop->style & WS_VISIBLE)) return NULL;
if ((pWndTop->style & WS_DISABLED)) return NULL;
if (!IntPtInWindow(pWndTop, x, y)) return NULL;
pwndDesktop = UserGetDesktopWindow();
MessageQueue = pti->MessageQueue;
CurInfo = IntGetSysCursorInfo();
- pwndMsg = UserGetWindowObject(msg->hwnd);
+ pwndMsg = ValidateHwndNoErr(msg->hwnd);
clk_msg = MessageQueue->msgDblClk;
pDesk = pwndDesktop->head.rpdesk;
if (pwndMsg) UserReferenceObject(pwndMsg);
}
else
- {
- pwndMsg = co_WinPosWindowFromPoint(pwndMsg, &msg->pt, &hittest);
+ { // Fix wine Msg test_HTTRANSPARENT. Start with a NULL window.
+ // http://www.winehq.org/pipermail/wine-patches/2012-August/116776.html
+ pwndMsg = co_WinPosWindowFromPoint(NULL, &msg->pt, &hittest);
}
TRACE("Got mouse message for 0x%x, hittest: 0x%x\n", msg->hwnd, hittest );
{
for (phWnd = List; *phWnd; ++phWnd)
{
- if (!(pwndChild = UserGetWindowObject(*phWnd)))
+ if (!(pwndChild = ValidateHwndNoErr(*phWnd)))
{
continue;
}
}
}
- *HitTest = (USHORT)co_IntSendMessage(ScopeWin->head.h, WM_NCHITTEST, 0,
- MAKELONG(Point->x, Point->y));
- if ((*HitTest) == (USHORT)HTTRANSPARENT)
+ if (ScopeWin->head.pti == PsGetCurrentThreadWin32Thread())
{
- UserDereferenceObject(ScopeWin);
- return NULL;
+ *HitTest = (USHORT)co_IntSendMessage(ScopeWin->head.h, WM_NCHITTEST, 0,
+ MAKELONG(Point->x, Point->y));
+ if ((*HitTest) == (USHORT)HTTRANSPARENT)
+ {
+ UserDereferenceObject(ScopeWin);
+ return NULL;
+ }
}
+ else
+ *HitTest = HTCLIENT;
return ScopeWin;
}
Window = co_WinPosSearchChildren(ScopeWin, &Point, HitTest);
UserDerefObjectCo(ScopeWin);
- if(Window)
+ if (Window)
ASSERT_REFS_CO(Window);
ASSERT_REFS_CO(ScopeWin);
for (phWnd = List; *phWnd; phWnd++)
{
PWND Child;
- if ((Child = UserGetWindowObject(*phWnd)))
+ if ((Child = ValidateHwndNoErr(*phWnd)))
{
if ( Child->style & WS_VISIBLE && IntPtInWindow(Child, Pt.x, Pt.y) )
{
for (phWnd = List; *phWnd; phWnd++)
{
PWND Child;
- if ((Child = UserGetWindowObject(*phWnd)))
+ if ((Child = ValidateHwndNoErr(*phWnd)))
{
if (uiFlags & (CWP_SKIPINVISIBLE|CWP_SKIPDISABLED))
{
//pti = PsGetCurrentThreadWin32Thread();
Window = co_WinPosWindowFromPoint(DesktopWindow, &pt, &hittest);
- if(Window)
+ if (Window)
{
- Ret = Window->head.h;
+ Ret = UserHMGetHandle(Window);
RETURN( Ret);
}