Click here to Skip to main content
15,901,910 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: lparam and wparam Pin
Try27-Mar-07 3:12
Try27-Mar-07 3:12 
AnswerRe: lparam and wparam Pin
David Crow27-Mar-07 3:18
David Crow27-Mar-07 3:18 
GeneralRe: lparam and wparam Pin
Michael Dunn27-Mar-07 20:40
sitebuilderMichael Dunn27-Mar-07 20:40 
AnswerRe: lparam and wparam Pin
prasad_som27-Mar-07 4:00
prasad_som27-Mar-07 4:00 
AnswerRe: lparam and wparam Pin
Christian Graus27-Mar-07 3:04
protectorChristian Graus27-Mar-07 3:04 
GeneralRe: lparam and wparam Pin
Mark Salsbery27-Mar-07 7:10
Mark Salsbery27-Mar-07 7:10 
Questionlearning multithreading Pin
l_d27-Mar-07 2:44
l_d27-Mar-07 2:44 
AnswerRe: learning multithreading Pin
David Crow27-Mar-07 2:45
David Crow27-Mar-07 2:45 
AnswerRe: learning multithreading Pin
Roger Stoltz27-Mar-07 2:46
Roger Stoltz27-Mar-07 2:46 
AnswerRe: learning multithreading Pin
Try27-Mar-07 2:46
Try27-Mar-07 2:46 
QuestionI ve created an MFC(exe) project and its ana Dialog based one. how to hide the dialog during runtime? Pin
Malini Nair27-Mar-07 2:11
Malini Nair27-Mar-07 2:11 
AnswerRe: I ve created an MFC(exe) project and its ana Dialog based one. how to hide the dialog during runtime? Pin
toxcct27-Mar-07 2:18
toxcct27-Mar-07 2:18 
QuestionVirtual Memory Pin
yoti1127-Mar-07 1:56
yoti1127-Mar-07 1:56 
QuestionRe: Virtual Memory Pin
David Crow27-Mar-07 2:50
David Crow27-Mar-07 2:50 
AnswerRe: Virtual Memory Pin
Try27-Mar-07 2:51
Try27-Mar-07 2:51 
QuestionCreating MPEG-1 from series of JPEG Pin
yudhisthira27-Mar-07 1:04
yudhisthira27-Mar-07 1:04 
AnswerRe: Creating MPEG-1 from series of JPEG Pin
Mark Salsbery27-Mar-07 7:17
Mark Salsbery27-Mar-07 7:17 
GeneralRe: Creating MPEG-1 from series of JPEG Pin
yudhisthira27-Mar-07 18:40
yudhisthira27-Mar-07 18:40 
GeneralRe: Creating MPEG-1 from series of JPEG Pin
Mark Salsbery28-Mar-07 6:57
Mark Salsbery28-Mar-07 6:57 
QuestionHow to send messages to windows Pin
Goggelmoggel27-Mar-07 0:57
Goggelmoggel27-Mar-07 0:57 
AnswerRe: How to send messages to windows Pin
Naveen27-Mar-07 1:03
Naveen27-Mar-07 1:03 
GeneralRe: How to send messages to windows Pin
Goggelmoggel27-Mar-07 1:27
Goggelmoggel27-Mar-07 1:27 
QuestionBackground color of a property page Pin
Farhat Aisha27-Mar-07 0:56
Farhat Aisha27-Mar-07 0:56 
Hi,
I want to get the background color of a property page (from its child). I have written the following code which works fine if the child is in a dialog but not for the property page
Here is my code (taken from //http://www.thescripts.com/forum/thread281595.html)

//methods in the child control
bool getColorMethod1()
{
bool bRet=false;
if (GetParent())
{
CDC* pParentDC=GetParent()->GetDC();
if (pParentDC)
{
HBRUSH hbrush;
hbrush =(HBRUSH) GetParent()->SendMessage(WM_CTLCOLORDLG,(WPARAM)pParentDC->m_hDC,(LPARAM) GetParent()->m_hWnd);
if (hbrush)
{
LOGBRUSH lb;
if ((BOOL)GetObject(hbrush, sizeof(lb), &lb))
{
if (BS_SOLID == lb.lbStyle)
{
m_clr = lb.lbColor;
bRet = true;
}
}
}
ReleaseDC(pParentDC);
}
}
return bRet;
}

bool getColorMethod2()
{
bool bRet=false;
CWnd *pParentWnd=GetParent();
if (pParentWnd)
{
CDC* pParentDC=GetParent()->GetDC();
if (pParentDC)
{
CDC memDC;
CBitmap memBitmap;
CBitmap* oldBmp;
CRect rc;

pParentWnd->GetClientRect(&rc);
memDC.CreateCompatibleDC(pParentDC);
memBitmap.CreateCompatibleBitmap(pParentDC,rc.Width(),rc.Height());
oldBmp=memDC.SelectObject(&memBitmap);
if (pParentWnd->SendMessage(WM_ERASEBKGND, (WPARAM)memDC.m_hDC, 0))
{
m_clr=memDC.GetPixel( 0, 0);
bRet=true;
}
memDC.SelectObject(oldBmp);
memBitmap.DeleteObject();
memDC.DeleteDC();

ReleaseDC(pParentDC);
}
}
return bRet;
}

None of the above methods are returning me the correct color for the control on the property page but they work fine on the dialog
So can any body pleeeeeeaaaaaaaaaase help
Thanks
AnswerRe: Background color of a property page Pin
prasad_som27-Mar-07 2:20
prasad_som27-Mar-07 2:20 
QuestionUsing Excel from C++ Pin
BusyDeveloper27-Mar-07 0:44
BusyDeveloper27-Mar-07 0:44 

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.