Click here to Skip to main content
15,925,181 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Edit control Pin
tom groezer11-Jun-07 8:29
tom groezer11-Jun-07 8:29 
GeneralRe: Edit control Pin
David Crow11-Jun-07 8:35
David Crow11-Jun-07 8:35 
GeneralRe: Edit control Pin
tom groezer11-Jun-07 21:04
tom groezer11-Jun-07 21:04 
QuestionRe: Edit control Pin
David Crow12-Jun-07 2:30
David Crow12-Jun-07 2:30 
QuestionFind Parent Dialog data in custom control on dialog? [modified] Pin
ldsdbomber11-Jun-07 4:00
ldsdbomber11-Jun-07 4:00 
AnswerRe: Find Parent Dialog data in custom control on dialog? Pin
ldsdbomber11-Jun-07 6:21
ldsdbomber11-Jun-07 6:21 
GeneralRe: Find Parent Dialog data in custom control on dialog? Pin
Mark Salsbery11-Jun-07 6:54
Mark Salsbery11-Jun-07 6:54 
GeneralRe: Find Parent Dialog data in custom control on dialog? Pin
ldsdbomber11-Jun-07 21:27
ldsdbomber11-Jun-07 21:27 
no, I tried passing iRow first and that didn't work either (iRow presumably is the right parameter)



void CColoredListCtrl::OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult)
{
*pResult = 0;

LPNMLVCUSTOMDRAW lplvcd = (LPNMLVCUSTOMDRAW)pNMHDR;
int iRow = lplvcd->nmcd.dwItemSpec;

switch(lplvcd->nmcd.dwDrawStage)
{
case CDDS_PREPAINT :
{
*pResult = CDRF_NOTIFYITEMDRAW;
return;
}

// Modify item text and or background
case CDDS_ITEMPREPAINT:
{

// ACCESS errTable here, and change font accordingly
CWnd* mainDlg = GetParent();
// CTestFolderBrowseDlg* myDlg = (CTestFolderBrowseDlg*)mainDlg;



////////////

LVITEM lvi;
memset(&lvi, 0, sizeof(lvi));

lvi.mask = LVIF_TEXT;
lvi.state = 0;
lvi.stateMask = 0;

unsigned char LVtext[16];
lvi.cchTextMax = 15;
// Length of string to be copied into pszText member

lvi.pszText = (LPTSTR)LVtext;
// String buffer for pszText member

// Nota bene : starts at zero (item) and ends at 'lCols' (last subitem) :
lvi.iSubItem = 5;

// Retrieve the text in an item or a subitem of line 'i' :
mainDlg->SendMessage(LVM_GETITEMTEXT, (WPARAM) iRow, (LPARAM) &lvi);

CString resultText(LVtext);
if(!strcmp((LPCSTR)LVtext, "Failed"))
{
do something here...
}
///////////


lplvcd->clrText = RGB(0,0,0);
// If you want the sub items the same as the item,
// set *pResult to CDRF_NEWFONT
*pResult = CDRF_NOTIFYSUBITEMDRAW;
return;
}

// Modify sub item text and/or background
case CDDS_SUBITEM | CDDS_PREPAINT | CDDS_ITEM:
{

if(iRow %2){
lplvcd->clrTextBk = m_colRow2;
}
else{
lplvcd->clrTextBk = m_colRow1;
}


*pResult = CDRF_DODEFAULT;
return;
}
}




}
GeneralRe: Find Parent Dialog data in custom control on dialog? Pin
Mark Salsbery12-Jun-07 6:31
Mark Salsbery12-Jun-07 6:31 
QuestionPassing parameters to Thread function. Pin
priyank_ldce11-Jun-07 3:33
priyank_ldce11-Jun-07 3:33 
AnswerRe: Passing parameters to Thread function. Pin
KarstenK11-Jun-07 3:47
mveKarstenK11-Jun-07 3:47 
AnswerRe: Passing parameters to Thread function. [modified] Pin
Mark Salsbery11-Jun-07 6:58
Mark Salsbery11-Jun-07 6:58 
AnswerRe: Passing parameters to Thread function. Pin
Mark Salsbery11-Jun-07 7:22
Mark Salsbery11-Jun-07 7:22 
AnswerRe: Passing parameters to Thread function. Pin
ThatsAlok11-Jun-07 20:03
ThatsAlok11-Jun-07 20:03 
QuestionQuick change of class of custom control? Pin
ldsdbomber11-Jun-07 3:26
ldsdbomber11-Jun-07 3:26 
AnswerRe: Quick change of class of custom control? Pin
ldsdbomber11-Jun-07 3:29
ldsdbomber11-Jun-07 3:29 
QuestionHow to detect modal loops in MFC Pin
Jörgen Sigvardsson11-Jun-07 3:21
Jörgen Sigvardsson11-Jun-07 3:21 
QuestionIOCP supports [modified] Pin
Jhony george11-Jun-07 3:05
Jhony george11-Jun-07 3:05 
AnswerRe: IOCP supports Pin
Matthew Faithfull11-Jun-07 3:28
Matthew Faithfull11-Jun-07 3:28 
GeneralRe: IOCP supports Pin
Jhony george11-Jun-07 19:40
Jhony george11-Jun-07 19:40 
QuestionConvert SYSTEMTIME to char * Pin
Programm3r11-Jun-07 2:45
Programm3r11-Jun-07 2:45 
AnswerRe: Convert SYSTEMTIME to char * Pin
Nibu babu thomas11-Jun-07 2:57
Nibu babu thomas11-Jun-07 2:57 
GeneralRe: Convert SYSTEMTIME to char * Pin
Programm3r11-Jun-07 3:23
Programm3r11-Jun-07 3:23 
AnswerRe: Convert SYSTEMTIME to char * Pin
David Crow11-Jun-07 3:11
David Crow11-Jun-07 3:11 
GeneralRe: Convert SYSTEMTIME to char * Pin
Programm3r11-Jun-07 3:22
Programm3r11-Jun-07 3:22 

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.