mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
Implement MDICascade, MDITile and WIN_ListChildren. This will help Winefile cascade and tile windows. WIN_ListChildren is tmp located here in mdi.c for now.
svn path=/trunk/; revision=16521
This commit is contained in:
parent
6c73106dfd
commit
c0fb7448b1
1 changed files with 48 additions and 10 deletions
|
@ -143,6 +143,47 @@ static void MDI_SwapMenuItems(HWND, UINT, UINT);
|
||||||
static LRESULT WINAPI MDIClientWndProcA( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam );
|
static LRESULT WINAPI MDIClientWndProcA( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam );
|
||||||
static LRESULT WINAPI MDIClientWndProcW( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam );
|
static LRESULT WINAPI MDIClientWndProcW( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam );
|
||||||
|
|
||||||
|
|
||||||
|
static
|
||||||
|
HWND* WIN_ListChildren (HWND hWndparent)
|
||||||
|
{
|
||||||
|
|
||||||
|
DWORD dwCount = 0;
|
||||||
|
HWND* pHwnd = NULL;
|
||||||
|
HANDLE hHeap;
|
||||||
|
|
||||||
|
SetLastError(0);
|
||||||
|
|
||||||
|
dwCount = NtUserBuildHwndList ( NULL, hWndparent, FALSE, 0, 0, NULL, 0 );
|
||||||
|
|
||||||
|
if ( !dwCount || GetLastError() )
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
/* allocate buffer to receive HWND handles */
|
||||||
|
hHeap = GetProcessHeap();
|
||||||
|
|
||||||
|
pHwnd = HeapAlloc ( hHeap, 0, sizeof(HWND)*(dwCount+1) );
|
||||||
|
if ( !pHwnd )
|
||||||
|
{
|
||||||
|
SetLastError ( ERROR_NOT_ENOUGH_MEMORY );
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* now call kernel again to fill the buffer this time */
|
||||||
|
dwCount = NtUserBuildHwndList (NULL, hWndparent, FALSE, 0, 0, pHwnd, dwCount );
|
||||||
|
|
||||||
|
if ( !dwCount || GetLastError() )
|
||||||
|
{
|
||||||
|
if ( pHwnd )
|
||||||
|
HeapFree ( hHeap, 0, pHwnd );
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return pHwnd;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __REACTOS__
|
#ifdef __REACTOS__
|
||||||
void WINAPI ScrollChildren(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
void WINAPI ScrollChildren(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||||
void WINAPI CalcChildScroll(HWND hwnd, INT scroll);
|
void WINAPI CalcChildScroll(HWND hwnd, INT scroll);
|
||||||
|
@ -912,19 +953,20 @@ static HBITMAP CreateMDIMenuBitmap(void)
|
||||||
return hbCopy;
|
return hbCopy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* MDICascade
|
* MDICascade
|
||||||
*/
|
*/
|
||||||
static LONG MDICascade( HWND client, MDICLIENTINFO *ci )
|
static LONG MDICascade( HWND client, MDICLIENTINFO *ci )
|
||||||
{
|
{
|
||||||
#ifdef __REACTOS__
|
|
||||||
/* FIXME */
|
|
||||||
return 0;
|
|
||||||
#else
|
|
||||||
HWND *win_array;
|
HWND *win_array;
|
||||||
BOOL has_icons = FALSE;
|
BOOL has_icons = FALSE;
|
||||||
int i, total;
|
int i, total;
|
||||||
|
|
||||||
|
DbgPrint("MDICascade\n");
|
||||||
|
|
||||||
if (ci->hwndChildMaximized)
|
if (ci->hwndChildMaximized)
|
||||||
SendMessageA( client, WM_MDIRESTORE,
|
SendMessageA( client, WM_MDIRESTORE,
|
||||||
(WPARAM)ci->hwndChildMaximized, 0);
|
(WPARAM)ci->hwndChildMaximized, 0);
|
||||||
|
@ -968,7 +1010,6 @@ static LONG MDICascade( HWND client, MDICLIENTINFO *ci )
|
||||||
|
|
||||||
if (has_icons) ArrangeIconicWindows( client );
|
if (has_icons) ArrangeIconicWindows( client );
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
|
@ -976,14 +1017,12 @@ static LONG MDICascade( HWND client, MDICLIENTINFO *ci )
|
||||||
*/
|
*/
|
||||||
static void MDITile( HWND client, MDICLIENTINFO *ci, WPARAM wParam )
|
static void MDITile( HWND client, MDICLIENTINFO *ci, WPARAM wParam )
|
||||||
{
|
{
|
||||||
#ifdef __REACTOS__
|
|
||||||
/* FIXME */
|
|
||||||
return;
|
|
||||||
#else
|
|
||||||
HWND *win_array;
|
HWND *win_array;
|
||||||
int i, total;
|
int i, total;
|
||||||
BOOL has_icons = FALSE;
|
BOOL has_icons = FALSE;
|
||||||
|
|
||||||
|
DbgPrint("MDITile\n");
|
||||||
|
|
||||||
if (ci->hwndChildMaximized)
|
if (ci->hwndChildMaximized)
|
||||||
SendMessageA( client, WM_MDIRESTORE, (WPARAM)ci->hwndChildMaximized, 0);
|
SendMessageA( client, WM_MDIRESTORE, (WPARAM)ci->hwndChildMaximized, 0);
|
||||||
|
|
||||||
|
@ -1056,7 +1095,6 @@ static void MDITile( HWND client, MDICLIENTINFO *ci, WPARAM wParam )
|
||||||
}
|
}
|
||||||
HeapFree( GetProcessHeap(), 0, win_array );
|
HeapFree( GetProcessHeap(), 0, win_array );
|
||||||
if (has_icons) ArrangeIconicWindows( client );
|
if (has_icons) ArrangeIconicWindows( client );
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------------- Frame window ---------------------------- */
|
/* ----------------------- Frame window ---------------------------- */
|
||||||
|
|
Loading…
Reference in a new issue