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
|
||||
* 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
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -248,8 +248,6 @@ MsqTranslateMouseMessage(HWND hWnd, UINT FilterLow, UINT FilterHigh,
|
|||
USHORT Msg = Message->Msg.message;
|
||||
PWINDOW_OBJECT CaptureWin, Window = NULL;
|
||||
POINT Point;
|
||||
LPARAM SpareLParam;
|
||||
LRESULT Result;
|
||||
|
||||
if (Msg == WM_LBUTTONDOWN ||
|
||||
Msg == WM_MBUTTONDOWN ||
|
||||
|
@ -269,11 +267,11 @@ MsqTranslateMouseMessage(HWND hWnd, UINT FilterLow, UINT FilterHigh,
|
|||
{
|
||||
if(Window->Self != IntGetFocusWindow())
|
||||
{
|
||||
SpareLParam = MAKELONG(*HitTest, Msg);
|
||||
|
||||
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)
|
||||
{
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* 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
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -2124,40 +2124,38 @@ NtUserGetAncestor(HWND hWnd, UINT Type)
|
|||
switch (Type)
|
||||
{
|
||||
case GA_PARENT:
|
||||
{
|
||||
WndAncestor = IntGetParentObject(Wnd);
|
||||
break;
|
||||
}
|
||||
|
||||
case GA_ROOT:
|
||||
{
|
||||
PWINDOW_OBJECT tmp;
|
||||
WndAncestor = Wnd;
|
||||
Parent = NULL;
|
||||
#if 0
|
||||
while (0 != (WndAncestor->Style & WS_CHILD))
|
||||
{
|
||||
Parent = IntGetParentObject(WndAncestor);
|
||||
if (WndAncestor != Wnd)
|
||||
{
|
||||
IntReleaseWindowObject(WndAncestor);
|
||||
}
|
||||
WndAncestor = Parent;
|
||||
}
|
||||
#else
|
||||
|
||||
for(;;)
|
||||
{
|
||||
if(Parent)
|
||||
tmp = Parent;
|
||||
if(!(Parent = IntGetParentObject(WndAncestor)))
|
||||
{
|
||||
break;
|
||||
}
|
||||
if(IntIsDesktopWindow(Parent))
|
||||
{
|
||||
IntReleaseWindowObject(Parent);
|
||||
}
|
||||
if(!(Parent = IntGetParentObject(WndAncestor)) ||
|
||||
!IntIsDesktopWindow(WndAncestor))
|
||||
{
|
||||
break;
|
||||
}
|
||||
if(tmp)
|
||||
IntReleaseWindowObject(tmp);
|
||||
WndAncestor = Parent;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
case GA_ROOTOWNER:
|
||||
{
|
||||
WndAncestor = Wnd;
|
||||
IntReferenceWindowObject(WndAncestor);
|
||||
for (;;)
|
||||
|
@ -2173,21 +2171,19 @@ NtUserGetAncestor(HWND hWnd, UINT Type)
|
|||
WndAncestor = Parent;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
IntReleaseWindowObject(Wnd);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
IntReleaseWindowObject(Wnd);
|
||||
|
||||
if(!WndAncestor)
|
||||
{
|
||||
IntReleaseWindowObject(Wnd);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
hWndAncestor = WndAncestor->Self;
|
||||
if(WndAncestor != Wnd)
|
||||
hWndAncestor = (WndAncestor ? WndAncestor->Self : NULL);
|
||||
IntReleaseWindowObject(Wnd);
|
||||
|
||||
if(WndAncestor && (WndAncestor != Wnd))
|
||||
IntReleaseWindowObject(WndAncestor);
|
||||
|
||||
return hWndAncestor;
|
||||
|
|
Loading…
Reference in a new issue