Click here to Skip to main content
15,902,903 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questioninterface programming Pin
Adno31-Aug-07 6:18
Adno31-Aug-07 6:18 
AnswerRe: interface programming Pin
led mike31-Aug-07 6:51
led mike31-Aug-07 6:51 
GeneralRe: interface programming Pin
Adno31-Aug-07 7:09
Adno31-Aug-07 7:09 
Questionhow to implement hotfix function? Pin
lostangels31-Aug-07 5:46
lostangels31-Aug-07 5:46 
AnswerRe: how to implement hotfix function? Pin
Roger Broomfield31-Aug-07 5:55
Roger Broomfield31-Aug-07 5:55 
QuestionRe: how to implement hotfix function? Pin
Hamid_RT31-Aug-07 19:09
Hamid_RT31-Aug-07 19:09 
AnswerRe: how to implement hotfix function? Pin
lostangels31-Aug-07 23:07
lostangels31-Aug-07 23:07 
Questionclistctrl oncustomdraw change row color Pin
Derrick Becker31-Aug-07 5:24
Derrick Becker31-Aug-07 5:24 
QuestionFindWindow Pin
Waldermort31-Aug-07 5:16
Waldermort31-Aug-07 5:16 
AnswerRe: FindWindow Pin
David Crow31-Aug-07 5:19
David Crow31-Aug-07 5:19 
GeneralRe: FindWindow Pin
Waldermort31-Aug-07 5:25
Waldermort31-Aug-07 5:25 
GeneralRe: FindWindow Pin
David Crow31-Aug-07 5:37
David Crow31-Aug-07 5:37 
GeneralRe: FindWindow Pin
Waldermort31-Aug-07 5:44
Waldermort31-Aug-07 5:44 
GeneralRe: FindWindow Pin
Roger Broomfield31-Aug-07 5:52
Roger Broomfield31-Aug-07 5:52 
GeneralRe: FindWindow Pin
Waldermort31-Aug-07 5:57
Waldermort31-Aug-07 5:57 
QuestionRe: FindWindow Pin
David Crow31-Aug-07 5:52
David Crow31-Aug-07 5:52 
QuestionMFC OnInitDialog lengthy process halts screen painting Pin
littleGreenDude31-Aug-07 5:02
littleGreenDude31-Aug-07 5:02 
AnswerRe: MFC OnInitDialog lengthy process halts screen painting Pin
Naveen31-Aug-07 5:11
Naveen31-Aug-07 5:11 
QuestionRe: MFC OnInitDialog lengthy process halts screen painting Pin
David Crow31-Aug-07 5:16
David Crow31-Aug-07 5:16 
QuestionVisual indication (Red, green) Pin
__yash__31-Aug-07 4:35
professional__yash__31-Aug-07 4:35 
AnswerRe: Visual indication (Red, green) Pin
Mark Salsbery31-Aug-07 5:02
Mark Salsbery31-Aug-07 5:02 
GeneralRe: Visual indication (Red, green) Pin
__yash__31-Aug-07 5:38
professional__yash__31-Aug-07 5:38 
GeneralRe: Visual indication (Red, green) Pin
Mark Salsbery31-Aug-07 5:48
Mark Salsbery31-Aug-07 5:48 
GeneralRe: Visual indication (Red, green) Pin
__yash__31-Aug-07 5:49
professional__yash__31-Aug-07 5:49 
GeneralRe: Visual indication (Red, green) Pin
Mark Salsbery31-Aug-07 6:13
Mark Salsbery31-Aug-07 6:13 
Here's some of the operations involved:

Add 2 icons to your app's resources - here I'll assume they are custom size
10x10 icons, with IDs IDI_INDICATORRED and IDI_INDICATORGREEN.
Draw the icons the way you want them to look.

Then...
// Add as member of window or dialog class
CStatic m_IndicatorStatic;
...

// In OnCreate() (for a window implementation) or OnInitDialog() (for a dialog implementation)...
//   (for a dialog, if the picture control is a resource on the dialog, and m_IndicatorStatic is already
//     associated with the control, then don't do the Create() call)

//  (Adjust passed CRect to properly position control in window's client area)
if (m_IndicatorStatic.Create(NULL, WS_CHILD | SS_ICON, CRect(0,0,10,10), this, ID_INDICATORSTATIC))
{
   m_IndicatorStatic.SetIcon((HICON)::LoadImage(AfxGetResourceHandle(), MAKEINTRESOURCE(IDI_INDICATORRED), IMAGE_ICON, 10, 10, LR_SHARED));
}
...

// Later...Change the indicator to green
m_IndicatorStatic.SetIcon((HICON)::LoadImage(AfxGetResourceHandle(), MAKEINTRESOURCE(IDI_INDICATORGREEN), IMAGE_ICON, 10, 10, LR_SHARED));

Hope that helps a bit!
Mark


Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

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.