Click here to Skip to main content
16,007,843 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Checking if an exe file is running Pin
vishalmore15-Dec-04 17:31
vishalmore15-Dec-04 17:31 
QuestionHow to speed up creation of a window? Pin
[AMI]14-Dec-04 23:53
[AMI]14-Dec-04 23:53 
AnswerRe: How to speed up creation of a window? Pin
User 665815-Dec-04 0:55
User 665815-Dec-04 0:55 
GeneralExtracting the Points from a CRgn Object Pin
Rajesh_Parameswaran14-Dec-04 23:49
Rajesh_Parameswaran14-Dec-04 23:49 
GeneralWrite a .ini file of the application in MFC Pin
ytod14-Dec-04 23:33
ytod14-Dec-04 23:33 
GeneralRe: Write a .ini file of the application in MFC Pin
User 665815-Dec-04 0:54
User 665815-Dec-04 0:54 
Generalcolor the text in MFC Dialog Pin
ytod14-Dec-04 23:05
ytod14-Dec-04 23:05 
GeneralRe: color the text in MFC Dialog Pin
V.15-Dec-04 0:56
professionalV.15-Dec-04 0:56 
Handle the WM_CTLCOLOR message.
In VS call the properties for the dialog, there you can set handlers for messages, in that list is a WM_CTLCOLOR message. Choose a function to handle this.
Write something like this in it:

HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);<br />
CBrush *brush;<br />
brush = NULL;<br />
// TODO:  Change any attributes of the DC here<br />
CWnd* pStaticWnd = (CWnd*)GetDlgItem(IDC_STATIC_STATUS);<br />
if(pWnd == pStaticWnd){<br />
    pDC->SetTextColor(RGB(0, 0, 255));<br />
}                                       //end if<br />
pStaticWnd = (CWnd*)GetDlgItem(IDC_STATIC_INFO_DOC);<br />
if(pWnd == pStaticWnd){<br />
    if(lock_docstatus_text){<br />
        pDC->SetTextColor(RGB(0, 100, 200));<br />
    }                                   //end if<br />
    else{<br />
        pDC->SetTextColor(RGB(0, 0, 255));<br />
    }                                   //end else<br />
}                                       //end if<br />
pStaticWnd = (CWnd*)GetDlgItem(IDC_STATIC_INFO_SEND);<br />
if(pWnd == pStaticWnd){<br />
    if(lock_sendstatus_text){<br />
        pDC->SetTextColor(RGB(0, 100, 200));<br />
    }                                   //end if<br />
    else{<br />
        pDC->SetTextColor(RGB(0, 0, 255));<br />
    }                                   //end else<br />
}                                       //end if<br />
// TODO:  Return a different brush if the default is not desired<br />
return hbr;<br />


for more info check out msdn.

Hope this helps, good luck.

"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
GeneralRe: color the text in MFC Dialog Pin
ytod15-Dec-04 16:12
ytod15-Dec-04 16:12 
GeneralRe: color the text in MFC Dialog Pin
David Crow15-Dec-04 4:04
David Crow15-Dec-04 4:04 
GeneralRe: color the text in MFC Dialog Pin
ytod15-Dec-04 15:33
ytod15-Dec-04 15:33 
GeneralRe: color the text in MFC Dialog Pin
David Crow16-Dec-04 4:00
David Crow16-Dec-04 4:00 
QuestionHow to add a lineat the beginnig of a file? Pin
lucia4444es14-Dec-04 22:50
lucia4444es14-Dec-04 22:50 
AnswerRe: How to add a lineat the beginnig of a file? Pin
User 665814-Dec-04 23:11
User 665814-Dec-04 23:11 
AnswerRe: How to add a lineat the beginnig of a file? Pin
Cedric Moonen14-Dec-04 23:11
Cedric Moonen14-Dec-04 23:11 
GeneralRe: How to add a lineat the beginnig of a file? Pin
ytod14-Dec-04 23:21
ytod14-Dec-04 23:21 
GeneralRe: How to add a lineat the beginnig of a file? Pin
lucia4444es14-Dec-04 23:33
lucia4444es14-Dec-04 23:33 
GeneralRe: How to add a lineat the beginnig of a file? Pin
David Crow15-Dec-04 4:08
David Crow15-Dec-04 4:08 
Questionhow to read resource info from an exe file directly? Pin
includeh1014-Dec-04 22:46
includeh1014-Dec-04 22:46 
AnswerRe: how to read resource info from an exe file directly? Pin
David Crow15-Dec-04 4:08
David Crow15-Dec-04 4:08 
GeneralNeed help playing sound with DirectSound Pin
rikkemus14-Dec-04 22:34
rikkemus14-Dec-04 22:34 
GeneralConvert MFC Program inot a Class Pin
sweep12314-Dec-04 21:55
sweep12314-Dec-04 21:55 
GeneralRe: Convert MFC Program inot a Class Pin
Maximilien15-Dec-04 2:14
Maximilien15-Dec-04 2:14 
GeneralRe: Convert MFC Program inot a Class Pin
sweep12315-Dec-04 5:48
sweep12315-Dec-04 5:48 
GeneralMemory Overwrite Pin
vilmer14-Dec-04 21:55
vilmer14-Dec-04 21:55 

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.