المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Dont update part of dialog window



C++ Programming
08-25-2009, 01:16 PM
Hi,

I have tab control and two cards (dialogs) in tab control. I put my bitmap picture (from resources) in picture control on main dialog window (parent dialog) and I wanna that picture stays underneath tab control dialogs, so when I called next handler (on change tab cards) I wanna that that picture be on same place for both dialogs(child) in tab control. When I activate particular tab the next handler is called :
void Board_TabCtrl::ActivateTabDialogs()
{
int nSel = GetCurSel();

if(m_Dialog[nSel]->m_hWnd)
m_Dialog[nSel]->ShowWindow(SW_HIDE);

CRect l_rectClient;
CRect l_rectWnd;

GetClientRect(l_rectClient);
AdjustRect(FALSE,l_rectClient);
GetWindowRect(l_rectWnd);
GetParent()->ScreenToClient(l_rectWnd);
l_rectClient.OffsetRect(l_rectWnd.left,l_rectWnd.top);
for(int nCount=0; nCount < m_nPageCount; nCount++)
{
m_Dialog[nCount]->SetWindowPos(&wndTop, l_rectClient.left,l_rectClient.top,l_rectClient.Width(),l_rectClient.Height(),SWP_HIDEWINDOW);
}
m_Dialog[nSel]->SetWindowPos(&wndTop,l_rectClient.left,l_rectClient.top,l_rectClient.Width(),l_rectClient.Height(),SWP_SHOWWINDOW) ;

m_Dialog[nSel]->ShowWindow(SW_SHOW);
}

But when I change tab card that picture flick because I call ShowWindow(SW_SHOW) i.e ShowWindow(SW_HIDE);
. How can I prevent that picture flick. Is there way to not update part of dialog window or some trick with differernt properties (transparent ....)

PS: What I want is like there is a hole on that picture place on child dialog windows, so that there no be flickering due to calls of ShowWindow(SW_SHOW) i.e. ShowWindow(SW_HIDE) for child dialogs in tab control;

Best regards