mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
fixed NtUserGetAncestor()
svn path=/trunk/; revision=8938
This commit is contained in:
parent
dfa957c310
commit
96a21f824f
2 changed files with 25 additions and 31 deletions
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: msgqueue.c,v 1.79 2004/03/28 21:46:26 weiden Exp $
|
/* $Id: msgqueue.c,v 1.80 2004/03/31 19:44:34 weiden Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -248,8 +248,6 @@ MsqTranslateMouseMessage(HWND hWnd, UINT FilterLow, UINT FilterHigh,
|
||||||
USHORT Msg = Message->Msg.message;
|
USHORT Msg = Message->Msg.message;
|
||||||
PWINDOW_OBJECT CaptureWin, Window = NULL;
|
PWINDOW_OBJECT CaptureWin, Window = NULL;
|
||||||
POINT Point;
|
POINT Point;
|
||||||
LPARAM SpareLParam;
|
|
||||||
LRESULT Result;
|
|
||||||
|
|
||||||
if (Msg == WM_LBUTTONDOWN ||
|
if (Msg == WM_LBUTTONDOWN ||
|
||||||
Msg == WM_MBUTTONDOWN ||
|
Msg == WM_MBUTTONDOWN ||
|
||||||
|
@ -269,11 +267,11 @@ MsqTranslateMouseMessage(HWND hWnd, UINT FilterLow, UINT FilterHigh,
|
||||||
{
|
{
|
||||||
if(Window->Self != IntGetFocusWindow())
|
if(Window->Self != IntGetFocusWindow())
|
||||||
{
|
{
|
||||||
SpareLParam = MAKELONG(*HitTest, Msg);
|
|
||||||
|
|
||||||
if(*HitTest != (USHORT)HTTRANSPARENT)
|
if(*HitTest != (USHORT)HTTRANSPARENT)
|
||||||
{
|
{
|
||||||
Result = IntSendMessage(Window->Self, WM_MOUSEACTIVATE, (WPARAM)NtUserGetParent(Window->Self), (LPARAM)SpareLParam);
|
LRESULT Result;
|
||||||
|
Result = IntSendMessage(Window->Self, WM_MOUSEACTIVATE, (WPARAM)NtUserGetParent(Window->Self), (LPARAM)MAKELONG(*HitTest, Msg));
|
||||||
|
|
||||||
switch (Result)
|
switch (Result)
|
||||||
{
|
{
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: window.c,v 1.206 2004/03/31 19:20:18 gvg Exp $
|
/* $Id: window.c,v 1.207 2004/03/31 19:44:34 weiden Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -2124,40 +2124,38 @@ NtUserGetAncestor(HWND hWnd, UINT Type)
|
||||||
switch (Type)
|
switch (Type)
|
||||||
{
|
{
|
||||||
case GA_PARENT:
|
case GA_PARENT:
|
||||||
|
{
|
||||||
WndAncestor = IntGetParentObject(Wnd);
|
WndAncestor = IntGetParentObject(Wnd);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case GA_ROOT:
|
case GA_ROOT:
|
||||||
|
{
|
||||||
|
PWINDOW_OBJECT tmp;
|
||||||
WndAncestor = Wnd;
|
WndAncestor = Wnd;
|
||||||
Parent = NULL;
|
Parent = NULL;
|
||||||
#if 0
|
|
||||||
while (0 != (WndAncestor->Style & WS_CHILD))
|
|
||||||
{
|
|
||||||
Parent = IntGetParentObject(WndAncestor);
|
|
||||||
if (WndAncestor != Wnd)
|
|
||||||
{
|
|
||||||
IntReleaseWindowObject(WndAncestor);
|
|
||||||
}
|
|
||||||
WndAncestor = Parent;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
for(;;)
|
for(;;)
|
||||||
{
|
{
|
||||||
if(Parent)
|
tmp = Parent;
|
||||||
{
|
if(!(Parent = IntGetParentObject(WndAncestor)))
|
||||||
IntReleaseWindowObject(Parent);
|
|
||||||
}
|
|
||||||
if(!(Parent = IntGetParentObject(WndAncestor)) ||
|
|
||||||
!IntIsDesktopWindow(WndAncestor))
|
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if(IntIsDesktopWindow(Parent))
|
||||||
|
{
|
||||||
|
IntReleaseWindowObject(Parent);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if(tmp)
|
||||||
|
IntReleaseWindowObject(tmp);
|
||||||
WndAncestor = Parent;
|
WndAncestor = Parent;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case GA_ROOTOWNER:
|
case GA_ROOTOWNER:
|
||||||
|
{
|
||||||
WndAncestor = Wnd;
|
WndAncestor = Wnd;
|
||||||
IntReferenceWindowObject(WndAncestor);
|
IntReferenceWindowObject(WndAncestor);
|
||||||
for (;;)
|
for (;;)
|
||||||
|
@ -2173,21 +2171,19 @@ NtUserGetAncestor(HWND hWnd, UINT Type)
|
||||||
WndAncestor = Parent;
|
WndAncestor = Parent;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
{
|
||||||
IntReleaseWindowObject(Wnd);
|
IntReleaseWindowObject(Wnd);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hWndAncestor = (WndAncestor ? WndAncestor->Self : NULL);
|
||||||
IntReleaseWindowObject(Wnd);
|
IntReleaseWindowObject(Wnd);
|
||||||
|
|
||||||
if(!WndAncestor)
|
if(WndAncestor && (WndAncestor != Wnd))
|
||||||
{
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
hWndAncestor = WndAncestor->Self;
|
|
||||||
if(WndAncestor != Wnd)
|
|
||||||
IntReleaseWindowObject(WndAncestor);
|
IntReleaseWindowObject(WndAncestor);
|
||||||
|
|
||||||
return hWndAncestor;
|
return hWndAncestor;
|
||||||
|
|
Loading…
Reference in a new issue