mirror of
https://github.com/reactos/reactos.git
synced 2025-02-25 01:39:30 +00:00
Implement ShowOwnedPopups and ArrangeIconicWindows. Based on Wine.
svn path=/trunk/; revision=16629
This commit is contained in:
parent
0825640a24
commit
35b93a79d6
5 changed files with 140 additions and 7 deletions
|
@ -228,6 +228,9 @@ DWORD IntRemoveWndProcHandle(WNDPROC Handle);
|
||||||
DWORD IntRemoveProcessWndProcHandles(HANDLE ProcessID);
|
DWORD IntRemoveProcessWndProcHandles(HANDLE ProcessID);
|
||||||
DWORD IntAddWndProcHandle(WNDPROC WindowProc, BOOL IsUnicode);
|
DWORD IntAddWndProcHandle(WNDPROC WindowProc, BOOL IsUnicode);
|
||||||
|
|
||||||
|
BOOL FASTCALL
|
||||||
|
IntShowOwnedPopups( HWND owner, BOOL fShow );
|
||||||
|
|
||||||
#endif /* _WIN32K_WINDOW_H */
|
#endif /* _WIN32K_WINDOW_H */
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -14,6 +14,8 @@
|
||||||
NtGdiPtInRegion((WndObject)->WindowRegion, (INT)((x) - (WndObject)->WindowRect.left), \
|
NtGdiPtInRegion((WndObject)->WindowRegion, (INT)((x) - (WndObject)->WindowRect.left), \
|
||||||
(INT)((y) - (WndObject)->WindowRect.top))))
|
(INT)((y) - (WndObject)->WindowRect.top))))
|
||||||
|
|
||||||
|
UINT
|
||||||
|
FASTCALL WinPosArrangeIconicWindows(PWINDOW_OBJECT parent);
|
||||||
BOOL FASTCALL
|
BOOL FASTCALL
|
||||||
IntGetClientOrigin(HWND hWnd, LPPOINT Point);
|
IntGetClientOrigin(HWND hWnd, LPPOINT Point);
|
||||||
LRESULT FASTCALL
|
LRESULT FASTCALL
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
#include <w32k.h>
|
#include <w32k.h>
|
||||||
|
|
||||||
#define NDEBUG
|
#define DEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
/* registered Logon process */
|
/* registered Logon process */
|
||||||
|
@ -453,9 +453,32 @@ NtUserCallTwoParam(
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case TWOPARAM_ROUTINE_SHOWOWNEDPOPUPS:
|
case TWOPARAM_ROUTINE_SHOWOWNEDPOPUPS:
|
||||||
UNIMPLEMENTED
|
return (DWORD)IntShowOwnedPopups((HWND) Param1, (BOOL) Param2);
|
||||||
return 0;
|
|
||||||
|
|
||||||
|
case TWOPARAM_ROUTINE_ROS_SHOWWINDOW:
|
||||||
|
{
|
||||||
|
#define WIN_NEEDS_SHOW_OWNEDPOPUP (0x00000040)
|
||||||
|
PWINDOW_OBJECT Window = IntGetWindowObject((HWND)Param1);
|
||||||
|
DPRINT1("ROS_SHOWWINDOW\n");
|
||||||
|
if (Window == 0)
|
||||||
|
{
|
||||||
|
SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
if (Param2)
|
||||||
|
{
|
||||||
|
if (!(Window->Flags & WIN_NEEDS_SHOW_OWNEDPOPUP))
|
||||||
|
{
|
||||||
|
IntReleaseWindowObject(Window);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
Window->Flags &= ~WIN_NEEDS_SHOW_OWNEDPOPUP;
|
||||||
|
}
|
||||||
|
else Window->Flags |= WIN_NEEDS_SHOW_OWNEDPOPUP;
|
||||||
|
DPRINT1("ROS_SHOWWINDOW ---> 0x%x\n",Window->Flags);
|
||||||
|
IntReleaseWindowObject(Window);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
case TWOPARAM_ROUTINE_SWITCHTOTHISWINDOW:
|
case TWOPARAM_ROUTINE_SWITCHTOTHISWINDOW:
|
||||||
UNIMPLEMENTED
|
UNIMPLEMENTED
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -570,6 +593,8 @@ NtUserCallTwoParam(
|
||||||
|
|
||||||
ExFreePool(Buffer);
|
ExFreePool(Buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return Ret;
|
return Ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -619,7 +644,6 @@ NtUserCallTwoParam(
|
||||||
|
|
||||||
ExFreePool(Buffer.Pointer);
|
ExFreePool(Buffer.Pointer);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Ret;
|
return Ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -630,6 +654,7 @@ NtUserCallTwoParam(
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
|
@ -653,7 +678,7 @@ NtUserCallHwndLock(
|
||||||
switch (Routine)
|
switch (Routine)
|
||||||
{
|
{
|
||||||
case HWNDLOCK_ROUTINE_ARRANGEICONICWINDOWS:
|
case HWNDLOCK_ROUTINE_ARRANGEICONICWINDOWS:
|
||||||
/* FIXME */
|
WinPosArrangeIconicWindows(Window);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case HWNDLOCK_ROUTINE_DRAWMENUBAR:
|
case HWNDLOCK_ROUTINE_DRAWMENUBAR:
|
||||||
|
|
|
@ -4314,4 +4314,65 @@ IntRemoveProcessWndProcHandles(HANDLE ProcessID)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define WIN_NEEDS_SHOW_OWNEDPOPUP (0x00000040)
|
||||||
|
|
||||||
|
BOOL
|
||||||
|
FASTCALL
|
||||||
|
IntShowOwnedPopups( HWND owner, BOOL fShow )
|
||||||
|
{
|
||||||
|
int count = 0;
|
||||||
|
PWINDOW_OBJECT Window, pWnd;
|
||||||
|
HWND *win_array;
|
||||||
|
|
||||||
|
if(!(Window = IntGetWindowObject(owner)))
|
||||||
|
{
|
||||||
|
SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
win_array = IntWinListChildren( Window);
|
||||||
|
IntReleaseWindowObject(Window);
|
||||||
|
|
||||||
|
if (!win_array) return TRUE;
|
||||||
|
|
||||||
|
while (win_array[count]) count++;
|
||||||
|
while (--count >= 0)
|
||||||
|
{
|
||||||
|
if (NtUserGetWindow( win_array[count], GW_OWNER ) != owner) continue;
|
||||||
|
if (!(pWnd = IntGetWindowObject( win_array[count] ))) continue;
|
||||||
|
// if (pWnd == WND_OTHER_PROCESS) continue;
|
||||||
|
|
||||||
|
if (fShow)
|
||||||
|
{
|
||||||
|
if (pWnd->Flags & WIN_NEEDS_SHOW_OWNEDPOPUP)
|
||||||
|
{
|
||||||
|
IntReleaseWindowObject( pWnd );
|
||||||
|
/* In Windows, ShowOwnedPopups(TRUE) generates
|
||||||
|
* WM_SHOWWINDOW messages with SW_PARENTOPENING,
|
||||||
|
* regardless of the state of the owner
|
||||||
|
*/
|
||||||
|
IntSendMessage(win_array[count], WM_SHOWWINDOW, SW_SHOWNORMAL, SW_PARENTOPENING);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (pWnd->Style & WS_VISIBLE)
|
||||||
|
{
|
||||||
|
IntReleaseWindowObject( pWnd );
|
||||||
|
/* In Windows, ShowOwnedPopups(FALSE) generates
|
||||||
|
* WM_SHOWWINDOW messages with SW_PARENTCLOSING,
|
||||||
|
* regardless of the state of the owner
|
||||||
|
*/
|
||||||
|
IntSendMessage(win_array[count], WM_SHOWWINDOW, SW_HIDE, SW_PARENTCLOSING);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
IntReleaseWindowObject( pWnd );
|
||||||
|
}
|
||||||
|
ExFreePool( win_array );
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -165,6 +165,47 @@ WinPosActivateOtherWindow(PWINDOW_OBJECT Window)
|
||||||
IntReleaseWindowObject(Wnd);
|
IntReleaseWindowObject(Wnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
UINT
|
||||||
|
FASTCALL
|
||||||
|
WinPosArrangeIconicWindows(PWINDOW_OBJECT parent)
|
||||||
|
{
|
||||||
|
RECT rectParent;
|
||||||
|
HWND hwndChild;
|
||||||
|
INT i, x, y, xspacing, yspacing;
|
||||||
|
HWND *List = IntWinListChildren(parent);
|
||||||
|
|
||||||
|
IntGetClientRect( parent, &rectParent );
|
||||||
|
x = rectParent.left;
|
||||||
|
y = rectParent.bottom;
|
||||||
|
|
||||||
|
xspacing = NtUserGetSystemMetrics(SM_CXMINSPACING);
|
||||||
|
yspacing = NtUserGetSystemMetrics(SM_CYMINSPACING);
|
||||||
|
|
||||||
|
DPRINT("X:%d Y:%d XS:%d YS:%d\n",x,y,xspacing,yspacing);
|
||||||
|
|
||||||
|
for( i = 0; List[i]; i++)
|
||||||
|
{
|
||||||
|
hwndChild = List[i];
|
||||||
|
|
||||||
|
if((NtUserGetWindowLong( hwndChild, GWL_STYLE, FALSE) & WS_MINIMIZE) != 0 )
|
||||||
|
{
|
||||||
|
WinPosSetWindowPos( hwndChild, 0, x + NtUserGetSystemMetrics(SM_CXBORDER),
|
||||||
|
y - yspacing - NtUserGetSystemMetrics(SM_CYBORDER)
|
||||||
|
, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE );
|
||||||
|
if (x <= rectParent.right - xspacing) x += xspacing;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
x = rectParent.left;
|
||||||
|
y -= yspacing;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ExFreePool(List);
|
||||||
|
return yspacing;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
VOID STATIC FASTCALL
|
VOID STATIC FASTCALL
|
||||||
WinPosFindIconPos(PWINDOW_OBJECT Window, POINT *Pos)
|
WinPosFindIconPos(PWINDOW_OBJECT Window, POINT *Pos)
|
||||||
{
|
{
|
||||||
|
@ -1210,8 +1251,9 @@ WinPosShowWindow(HWND Wnd, INT Cmd)
|
||||||
ObmDereferenceObject(Window);
|
ObmDereferenceObject(Window);
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
Swp |= SWP_HIDEWINDOW | SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE |
|
Swp |= SWP_HIDEWINDOW | SWP_NOSIZE | SWP_NOMOVE;
|
||||||
SWP_NOZORDER;
|
if (Window->Self != NtUserGetActiveWindow())
|
||||||
|
Swp |= SWP_NOACTIVATE | SWP_NOZORDER;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue