Click here to Skip to main content
15,902,002 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: database connectivity Pin
CPallini5-May-08 23:33
mveCPallini5-May-08 23:33 
AnswerRe: database connectivity Pin
Hamid_RT6-May-08 1:20
Hamid_RT6-May-08 1:20 
Questionchild control flickers [modified] Pin
followait5-May-08 22:47
followait5-May-08 22:47 
AnswerRe: child control flicks Pin
Nelek6-May-08 1:55
protectorNelek6-May-08 1:55 
GeneralRe: child control flicks Pin
followait6-May-08 3:40
followait6-May-08 3:40 
GeneralRe: child control flicks Pin
Rajkumar R6-May-08 4:46
Rajkumar R6-May-08 4:46 
GeneralRe: child control flicks Pin
followait6-May-08 13:09
followait6-May-08 13:09 
GeneralRe: child control flicks Pin
followait6-May-08 13:56
followait6-May-08 13:56 
Here is the new version with less flicker

BOOL CEditorDlg::OnEraseBkgnd( CDC* pDC )
{
	CRect rcClient;
	GetClientRect(&rcClient);

	static CRect rcClientPrev(0,0,0,0);

	Graphics g(pDC->m_hDC);

	if (rcClient!=rcClientPrev || m_pBmBk==NULL) {
		rcClientPrev=rcClient;
		//////////////////////////////////////////////////////////////////////////
		//cap
		CRect rc(rcClient);
		rc.bottom=rc.top+m_capH;
		Bitmap bmBkCap(rc.Width(),rc.Height(),PixelFormat32bppARGB);
		Graphics gMemBkCap(&bmBkCap);
		TextureBrush brBkCap(&m_bmCapBkM);
		gMemBkCap.FillRectangle(&brBkCap,m_bmCapBkL.GetWidth(),0,
			rc.Width()-m_bmCapBkL.GetWidth()-m_bmCapBkR.GetWidth(),m_bmCapBkM.GetHeight());
		gMemBkCap.DrawImage(&m_bmCapBkL,0,0);
		gMemBkCap.DrawImage(&m_bmCapBkR,rc.right-m_bmCapBkR.GetWidth(),0);
		gMemBkCap.DrawImage(&m_bmCapBkTitle,(rc.Width()-m_bmCapBkTitle.GetWidth())/2,0);

		//////////////////////////////////////////////////////////////////////////
		//tool area bg
		rc=rcClient;
		rc.top=rc.bottom-m_footH;
		Bitmap bmBkFoot(rc.Width(),rc.Height(),PixelFormat32bppARGB);
		Graphics gMemBkFoot(&bmBkFoot);
		TextureBrush brBkFoot(&m_bmFootBkM);
		gMemBkFoot.FillRectangle(&brBkFoot,m_bmFootBkL.GetWidth(),0,
			rc.Width()-m_bmFootBkL.GetWidth()-m_bmFootBkR.GetWidth(),m_bmFootBkM.GetHeight());
		gMemBkFoot.DrawImage(&m_bmFootBkL,0,0);
		gMemBkFoot.DrawImage(&m_bmFootBkR,rc.right-m_bmFootBkR.GetWidth(),0);

		//////////////////////////////////////////////////////////////////////////
		//
		Bitmap bmMemBk(rcClient.Width(),rcClient.Height(),&g);
		Graphics gMemBk(&bmMemBk);
		gMemBk.Clear((ARGB)Color::White);
		gMemBk.DrawImage(&bmBkCap,0,0);
		gMemBk.DrawImage(&bmBkFoot,0,rc.top);

		delete m_pBmBk;
		m_pBmBk=new CachedBitmap(&bmMemBk,&g);
	}

	g.DrawCachedBitmap(m_pBmBk,0,0);
	
	return TRUE;
}

GeneralRe: child control flicks Pin
Rajkumar R6-May-08 23:56
Rajkumar R6-May-08 23:56 
QuestionDoModal() Dialog Position Pin
mehmetned5-May-08 22:19
mehmetned5-May-08 22:19 
AnswerRe: DoModal() Dialog Position Pin
Cedric Moonen5-May-08 22:23
Cedric Moonen5-May-08 22:23 
AnswerRe: DoModal() Dialog Position Pin
Nibu babu thomas5-May-08 22:39
Nibu babu thomas5-May-08 22:39 
AnswerRe: DoModal() Dialog Position Pin
wct27-Mar-11 21:00
wct27-Mar-11 21:00 
QuestionHow to find component properties when i hold the object hWnd ? Pin
Yanshof5-May-08 22:09
Yanshof5-May-08 22:09 
AnswerRe: How to find component properties when i hold the object hWnd ? Pin
spsharma6-May-08 0:01
spsharma6-May-08 0:01 
GeneralRe: How to find component properties when i hold the object hWnd ? Pin
Yanshof6-May-08 0:45
Yanshof6-May-08 0:45 
GeneralRe: How to find component properties when i hold the object hWnd ? Pin
Rajkumar R6-May-08 2:40
Rajkumar R6-May-08 2:40 
QuestionProblems with string as member variable Pin
piul5-May-08 22:05
piul5-May-08 22:05 
AnswerRe: Problems with string as member variable Pin
Cedric Moonen5-May-08 22:13
Cedric Moonen5-May-08 22:13 
QuestionRe: Problems with string as member variable Pin
CPallini5-May-08 22:15
mveCPallini5-May-08 22:15 
AnswerRe: Problems with string as member variable Pin
piul5-May-08 22:31
piul5-May-08 22:31 
GeneralRe: Problems with string as member variable Pin
CPallini5-May-08 22:40
mveCPallini5-May-08 22:40 
GeneralRe: Problems with string as member variable Pin
piul5-May-08 23:08
piul5-May-08 23:08 
GeneralRe: Problems with string as member variable Pin
Cedric Moonen5-May-08 23:21
Cedric Moonen5-May-08 23:21 
GeneralRe: Problems with string as member variable Pin
CPallini5-May-08 23:42
mveCPallini5-May-08 23:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.