Click here to Skip to main content
15,887,819 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: about hook some windows Pin
FlyWithYou3-Mar-06 0:02
FlyWithYou3-Mar-06 0:02 
QuestionSilent Code Signing? Pin
Peter Weyzen2-Mar-06 19:38
Peter Weyzen2-Mar-06 19:38 
AnswerRe: Silent Code Signing? Pin
Michael Dunn2-Mar-06 20:21
sitebuilderMichael Dunn2-Mar-06 20:21 
GeneralRe: Silent Code Signing? Pin
Peter Weyzen2-Mar-06 20:46
Peter Weyzen2-Mar-06 20:46 
GeneralRe: Silent Code Signing? Pin
Peter Weyzen2-Mar-06 21:52
Peter Weyzen2-Mar-06 21:52 
GeneralRe: Silent Code Signing? Pin
DoctorEd5-Mar-06 9:46
DoctorEd5-Mar-06 9:46 
QuestionFail to set profile on Windows Media Video Image Pin
Kin Tutnik2-Mar-06 19:33
Kin Tutnik2-Mar-06 19:33 
QuestionColor to Static Control (Urgent pls) Pin
RockyJames2-Mar-06 19:30
RockyJames2-Mar-06 19:30 
hi,

I want draw staic Color With a color.I have Taken CBrush m_myBrush;
In OnInitDialog() function ...i have created the SolidBrush.
m_brush.CreateSolidBrush(RGB(255,0,0));

I have overriden OnCtlColor() function;

HBRUSH CMyDialogDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if (pWnd->GetDlgCtrlID() == IDC_MYSTATIC)
{

// Return handle to our CBrush object
return (HBRUSH)m_brush;

}
return hbr;
}

Now in OnOk() function on buttuon click i want to change the color of static control from Red to Green..

void CMyDialogDlg::OnOK()
{
// TODO: Add extra validation here

DeleteObject(m_brush);
m_brush.CreateSolidBrush(RGB(0,255,0));
PostMessage(WM_CTLCOLOR);
//CDialog::OnOK();
}
But it is not working.......Application is crashing.
AnswerRe: Color to Static Control (Urgent pls) Pin
Ryan Binns2-Mar-06 19:33
Ryan Binns2-Mar-06 19:33 
GeneralRe: Color to Static Control (Urgent pls) Pin
RockyJames2-Mar-06 19:38
RockyJames2-Mar-06 19:38 
GeneralRe: Color to Static Control (Urgent pls) Pin
Naveen2-Mar-06 19:48
Naveen2-Mar-06 19:48 
GeneralRe: Color to Static Control (Urgent pls) Pin
RockyJames2-Mar-06 19:53
RockyJames2-Mar-06 19:53 
GeneralRe: Color to Static Control (Urgent pls) Pin
Naveen2-Mar-06 20:34
Naveen2-Mar-06 20:34 
AnswerRe: Color to Static Control (Urgent pls) Pin
Malli_S2-Mar-06 19:56
Malli_S2-Mar-06 19:56 
GeneralRe: Color to Static Control (Urgent pls) Pin
RockyJames2-Mar-06 20:05
RockyJames2-Mar-06 20:05 
GeneralRe: Color to Static Control (Urgent pls) Pin
Malli_S2-Mar-06 20:18
Malli_S2-Mar-06 20:18 
AnswerRe: Color to Static Control (Urgent pls) Pin
Cool Ju2-Mar-06 20:21
Cool Ju2-Mar-06 20:21 
GeneralRe: Color to Static Control (Urgent pls) Pin
RockyJames2-Mar-06 20:53
RockyJames2-Mar-06 20:53 
GeneralRe: Color to Static Control (Urgent pls) Pin
RockyJames2-Mar-06 21:31
RockyJames2-Mar-06 21:31 
AnswerRe: Color to Static Control (Urgent pls) Pin
David Crow3-Mar-06 4:43
David Crow3-Mar-06 4:43 
AnswerRe: Color to Static Control (Urgent pls) Pin
DoctorEd5-Mar-06 10:12
DoctorEd5-Mar-06 10:12 
QuestionC2491 Error Pin
subramanyeswari2-Mar-06 19:04
subramanyeswari2-Mar-06 19:04 
AnswerRe: C2491 Error Pin
Nibu babu thomas2-Mar-06 19:20
Nibu babu thomas2-Mar-06 19:20 
GeneralRe: C2491 Error Pin
subramanyeswari2-Mar-06 19:50
subramanyeswari2-Mar-06 19:50 
GeneralRe: C2491 Error Pin
Nibu babu thomas2-Mar-06 19:59
Nibu babu thomas2-Mar-06 19:59 

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.