Click here to Skip to main content
15,912,205 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: SetWindowText Problem in Release Version Pin
David Crow8-Nov-05 6:08
David Crow8-Nov-05 6:08 
GeneralRe: SetWindowText Problem in Release Version Pin
LittleYellowBird8-Nov-05 21:44
LittleYellowBird8-Nov-05 21:44 
GeneralRe: SetWindowText Problem in Release Version Pin
LittleYellowBird8-Nov-05 22:13
LittleYellowBird8-Nov-05 22:13 
GeneralRe: SetWindowText Problem in Release Version Pin
Rage15-Nov-05 21:18
professionalRage15-Nov-05 21:18 
GeneralRe: SetWindowText Problem in Release Version Pin
LittleYellowBird30-Nov-05 5:14
LittleYellowBird30-Nov-05 5:14 
Questioncannot open file(image) that saved Pin
sue8-Nov-05 3:01
sue8-Nov-05 3:01 
QuestionSplitted MDI Client (MFC) Pin
Andre xxxxxxx8-Nov-05 2:12
Andre xxxxxxx8-Nov-05 2:12 
QuestionRepainting mechanism in VC++ ...OnPaint() Pin
maharaja pandian8-Nov-05 1:49
maharaja pandian8-Nov-05 1:49 
hi,
i am displaying a rectangular box in the window on OnLButtonDown event
using

CClientDC dc(this);
dc.Rectangle(5,5,100,50);

when i minimizing or maximizing the window the rectangular box would vanished(not visible) .,because of OnPaint event
so i try with CDC class to convert all image window Bitmap and store it in
the memory .on OnPaint event i once again call the CDC to show the window image
using


void CChildView::OnLButtonDown(UINT nFlags,CPoint point)
{
CDC MemDC;
CClientDC dc(this);
MemDC.CreateCompatibleDC(&dc);
CBitmap *pOldBitmap = MemDC.SelectObject(&m_Bitmap);
MemDC.SetBkMode(TRANSPARENT);
dc.SetBkMode(TRANSPARENT);
MemDC.Rectangle(5,5,100,50);
dc.Rectangle(5,5,100,50);
}
void CChildView::OnPaint()
{

CDC MemDC;
CPaintDC PaintDC(this);
MemDC.CreateCompatibleDC(&PaintDC);
MemDC.SelectObject(&m_Bitmap);
PaintDC.BitBlt(PaintDC.m_ps.rcPaint.left,PaintDC.m_ps.rcPaint.top,
PaintDC.m_ps.rcPaint.right - PaintDC.m_ps.rcPaint.left,
PaintDC.m_ps.rcPaint.bottom - PaintDC.m_ps.rcPaint.top,
&MemDC,PaintDC.m_ps.rcPaint.left,PaintDC.m_ps.rcPaint.top,
SRCCOPY);
}

Even after using this code , i didn't get the original rectangular box
when i maximizing the window.
reply as soon as possible
Smile | :)



send reply
AnswerRe: Repainting mechanism in VC++ ...OnPaint() Pin
Calc208-Nov-05 2:17
Calc208-Nov-05 2:17 
AnswerRe: Repainting mechanism in VC++ ...OnPaint() Pin
Nibu babu thomas8-Nov-05 17:09
Nibu babu thomas8-Nov-05 17:09 
QuestionRepainting mechanism in VC++ ...OnPaint() Pin
maharaja pandian8-Nov-05 1:47
maharaja pandian8-Nov-05 1:47 
QuestionTree ctrl label edit Pin
LiYS7-Nov-05 22:31
LiYS7-Nov-05 22:31 
AnswerRe: Tree ctrl label edit Pin
*Dreamz7-Nov-05 23:36
*Dreamz7-Nov-05 23:36 
GeneralRe: Tree ctrl label edit Pin
LiYS8-Nov-05 2:28
LiYS8-Nov-05 2:28 
GeneralRe: Tree ctrl label edit Pin
Rage8-Nov-05 4:08
professionalRage8-Nov-05 4:08 
GeneralRe: Tree ctrl label edit Pin
LiYS8-Nov-05 14:35
LiYS8-Nov-05 14:35 
QuestionClassView Missing Please Help Pin
shivditya7-Nov-05 22:03
shivditya7-Nov-05 22:03 
AnswerRe: ClassView Missing Please Help Pin
kakan7-Nov-05 22:25
professionalkakan7-Nov-05 22:25 
QuestionRe: ClassView Missing Please Help Pin
shivditya7-Nov-05 23:45
shivditya7-Nov-05 23:45 
AnswerRe: ClassView Missing Please Help Pin
Vikash Dubey7-Nov-05 22:26
Vikash Dubey7-Nov-05 22:26 
GeneralRe: ClassView Missing Please Help Pin
shivditya7-Nov-05 23:41
shivditya7-Nov-05 23:41 
AnswerRe: ClassView Missing Please Help Pin
*Dreamz7-Nov-05 22:34
*Dreamz7-Nov-05 22:34 
QuestionWhy I can't CreateDragImage in CTreeCtrl? Pin
white jungle7-Nov-05 21:21
white jungle7-Nov-05 21:21 
AnswerRe: Why I can't CreateDragImage in CTreeCtrl? Pin
Rage8-Nov-05 4:12
professionalRage8-Nov-05 4:12 
GeneralRe: Why I can't CreateDragImage in CTreeCtrl? Pin
white jungle8-Nov-05 15:28
white jungle8-Nov-05 15:28 

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.