void
ShowArea( CDialog *pDialog, CRect rectHide )
{
CWnd *pWnd = pDialog->GetWindow( GW_CHILD );
while
( pWnd )
{
CRect rect;
pWnd->GetWindowRect ( &rect );
pDialog->ScreenToClient( &rect );
// 显示
if
( rect.top >= rectHide.top && rect.left >= 1000 )
{
rect.OffsetRect( -1000, 0 );
pWnd->MoveWindow( rect );
}
else
{
// 下移
if
( rect.top >= rectHide.top)
{
rect.OffsetRect( 0, rectHide.Height() );
pWnd->MoveWindow( rect );
}
}
pWnd = pWnd->GetWindow( GW_HWNDNEXT );
}
CRect rectDialog;
pDialog->GetWindowRect( &rectDialog );
rectDialog.bottom += rectHide.Height();
pDialog->MoveWindow( rectDialog );
}
void
HideArea( CDialog *pDialog, CRect rectHide )
{
CWnd *pWnd = pDialog->GetWindow( GW_CHILD );
while
( pWnd )
{
CRect rect;
pWnd->GetWindowRect ( &rect );
pDialog->ScreenToClient( &rect );
// 隐藏
if
( rect.top >= rectHide.top && rect.bottom <= rectHide.bottom )
{
// pWnd->ShowWindow( SW_HIDE );
rect.OffsetRect( 1000, 0 );
pWnd->MoveWindow( rect );
}
else
{
// 上移
if
( rect.top >= rectHide.bottom)
{
rect.OffsetRect( 0, -rectHide.Height() );
pWnd->MoveWindow( rect );
}
}
pWnd = pWnd->GetWindow( GW_HWNDNEXT );
}
CRect rectDialog;
pDialog->GetWindowRect( &rectDialog );
rectDialog.bottom -= rectHide.Height();
pDialog->MoveWindow( rectDialog );
}