Click here to Skip to main content
15,888,610 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: 2 Class Circular Reference Pin
Fehma1-Sep-05 23:08
Fehma1-Sep-05 23:08 
GeneralRe: 2 Class Circular Reference Pin
Cedric Moonen1-Sep-05 23:20
Cedric Moonen1-Sep-05 23:20 
GeneralRe: 2 Class Circular Reference Pin
Fehma1-Sep-05 23:55
Fehma1-Sep-05 23:55 
GeneralRe: 2 Class Circular Reference Pin
Cedric Moonen1-Sep-05 23:59
Cedric Moonen1-Sep-05 23:59 
GeneralRe: 2 Class Circular Reference Pin
Fehma2-Sep-05 0:06
Fehma2-Sep-05 0:06 
GeneralRe: 2 Class Circular Reference Pin
Fehma2-Sep-05 2:09
Fehma2-Sep-05 2:09 
QuestionStatic Control Background Painting Pin
Joel Holdsworth1-Sep-05 22:15
Joel Holdsworth1-Sep-05 22:15 
AnswerRe: Static Control Background Painting Pin
Neagoe Gabriel2-Sep-05 0:04
Neagoe Gabriel2-Sep-05 0:04 
It`s very simple a Static in requesting a brush(OnCtlColor) from it`s parent dialog, to paint it`s background, you have to give a pattern brush with the portion you need... here it`s an example

if( nCtlColor == CTLCOLOR_STATIC )
{
CRect rc;
pWnd->GetWindowRect(&rc);
ScreenToClient(&rc);

CDC *pBDC = new CDC;
CBitmap *pBmp = new CBitmap;
pBDC->CreateCompatibleDC(pDC);
pBmp->CreateCompatibleBitmap(pDC, rc.Width(), rc.Height());
CBitmap *pOLD = (CBitmap*)pBDC->SelectObject(pBmp);

m_pBackgroundBmp->DrawPart( pBDC->GetSafeHdc(),0,0, rc.left, rc.top, rc.Width(), rc.Height());

pBDC->SelectObject( pOLD );

if(m_hbr) DeleteObject(m_hbr);
m_hbr = ::CreatePatternBrush((HBITMAP)pBmp->m_hObject);

pBDC->DeleteDC();
pBmp->DeleteObject();

delete (pBmp);
pBmp = NULL;
delete (pBDC);
pBDC = NULL;

return m_hbr;
}

int h file you have HBRUSH m_hbr;


NG

-- modified at 6:04 Friday 2nd September, 2005
GeneralRe: Static Control Background Painting Pin
Joel Holdsworth2-Sep-05 1:15
Joel Holdsworth2-Sep-05 1:15 
QuestionDifference between Instance and Context Pin
badal_akr1-Sep-05 21:42
badal_akr1-Sep-05 21:42 
AnswerRe: Difference between Instance and Context Pin
toxcct1-Sep-05 21:50
toxcct1-Sep-05 21:50 
QuestionSetForeGroundWindow with XP Pin
dharani1-Sep-05 21:02
dharani1-Sep-05 21:02 
AnswerRe: SetForeGroundWindow with XP Pin
khan++1-Sep-05 21:09
khan++1-Sep-05 21:09 
AnswerRe: SetForeGroundWindow with XP Pin
ThatsAlok2-Sep-05 0:07
ThatsAlok2-Sep-05 0:07 
AnswerRe: SetForeGroundWindow with XP Pin
Marc Soleda2-Sep-05 1:44
Marc Soleda2-Sep-05 1:44 
AnswerRe: SetForeGroundWindow with XP Pin
Gary R. Wheeler3-Sep-05 3:53
Gary R. Wheeler3-Sep-05 3:53 
Questionwhat is the difference? Pin
Anonymous1-Sep-05 20:33
Anonymous1-Sep-05 20:33 
AnswerRe: what is the difference? Pin
toxcct1-Sep-05 20:58
toxcct1-Sep-05 20:58 
AnswerRe: what is the difference? Pin
Gary R. Wheeler3-Sep-05 4:18
Gary R. Wheeler3-Sep-05 4:18 
QuestionStrange Acclerator Table Problem Pin
megafont1-Sep-05 19:42
megafont1-Sep-05 19:42 
NewsRe: Strange Acclerator Table Problem Pin
megafont2-Sep-05 18:26
megafont2-Sep-05 18:26 
QuestionGetting Internet Information Pin
rajeevktripathi1-Sep-05 19:21
rajeevktripathi1-Sep-05 19:21 
QuestionCan I use Visual C++ *.lib into C#? Pin
uumeme1-Sep-05 18:55
uumeme1-Sep-05 18:55 
AnswerRe: Can I use Visual C++ *.lib into C#? Pin
Christian Graus1-Sep-05 18:59
protectorChristian Graus1-Sep-05 18:59 
AnswerRe: Can I use Visual C++ *.lib into C#? Pin
Bob Stanneveld1-Sep-05 19:24
Bob Stanneveld1-Sep-05 19:24 

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.