Click here to Skip to main content
15,898,769 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Wait for event versus while / do loop or timer – academic questions Pin
Vaclav_19-Oct-13 6:29
Vaclav_19-Oct-13 6:29 
GeneralRe: Wait for event versus while / do loop or timer – academic questions Pin
pasztorpisti19-Oct-13 7:22
pasztorpisti19-Oct-13 7:22 
AnswerRe: Wait for event versus while / do loop or timer – academic questions Pin
David Crow19-Oct-13 16:43
David Crow19-Oct-13 16:43 
GeneralRe: Wait for event versus while / do loop or timer – academic questions SOLVED Pin
Vaclav_20-Oct-13 5:33
Vaclav_20-Oct-13 5:33 
Questionrtp server using ffmpeg in VC++ Pin
CodingHell18-Oct-13 2:39
CodingHell18-Oct-13 2:39 
AnswerRe: rtp server using ffmpeg in VC++ Pin
PCuong198322-Oct-13 5:20
professionalPCuong198322-Oct-13 5:20 
GeneralRe: rtp server using ffmpeg in VC++ Pin
CodingHell22-Oct-13 18:45
CodingHell22-Oct-13 18:45 
QuestionCListCtrl subitem text not colored. Pin
Le@rner17-Oct-13 19:27
Le@rner17-Oct-13 19:27 
please help me to color the Subitem text of CListCtrl .

I m derived a Class from CListCtrl and write a code on its Custom draw but its not color the ListCtrl subitem text color

C++
NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>( pNMHDR );

  	*pResult = CDRF_DODEFAULT;	


	if ( CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage )
	{
        *pResult = CDRF_NOTIFYITEMDRAW;
	}
    else if ( CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage )
	{
        // This is the notification message for an item.  We'll request
        // notifications before each subitem's prepaint stage.
		
        *pResult = CDRF_NOTIFYSUBITEMDRAW;
	}
    else if ( (CDDS_ITEMPREPAINT | CDDS_SUBITEM) == pLVCD->nmcd.dwDrawStage )
	{		
		COLORREF clrNewTextColor, clrNewBkColor;
        
		int    nItem = static_cast<int>( pLVCD->nmcd.dwItemSpec );
		CString strTemp="";

		if(pLVCD->iSubItem==8)
		{
			strTemp = GetItemText(nItem,pLVCD->iSubItem);
			
			if(strTemp == "Y")
			{
				clrNewTextColor = RGB(0,0,255);
				clrNewBkColor = RGB(255,255,255);
			}		
			else
			{
				clrNewTextColor = RGB(0,0,0);
				clrNewBkColor = RGB(255,255,255);
			}
		}
		
		else
		{			
			clrNewTextColor = RGB(0,0,0);		//Leave the text black
			clrNewBkColor = RGB(255,255,255);	//leave the bkgrnd color white
		}

		pLVCD->clrText = clrNewTextColor;
		pLVCD->clrTextBk = clrNewBkColor;
		        
        // Tell Windows to paint the control itself.
        *pResult = CDRF_DODEFAULT;
	}


please help me correct me where I am wrong
QuestionRe: CListCtrl subitem text not colored. Pin
David Crow18-Oct-13 4:13
David Crow18-Oct-13 4:13 
AnswerRe: CListCtrl subitem text not colored. Pin
Jochen Arndt18-Oct-13 5:37
professionalJochen Arndt18-Oct-13 5:37 
QuestionHow Draw default button MFC (BS_DEFPUSHBUTTON)? Pin
thanhtuan198917-Oct-13 18:08
thanhtuan198917-Oct-13 18:08 
QuestionWhy a HANDLE created by CreateFile can be assigned to an object Pin
digitalspace.xjtu17-Oct-13 5:07
digitalspace.xjtu17-Oct-13 5:07 
AnswerRe: Why a HANDLE created by CreateFile can be assigned to an object Pin
Albert Holguin17-Oct-13 5:20
professionalAlbert Holguin17-Oct-13 5:20 
GeneralRe: Why a HANDLE created by CreateFile can be assigned to an object Pin
digitalspace.xjtu17-Oct-13 5:33
digitalspace.xjtu17-Oct-13 5:33 
AnswerRe: Why a HANDLE created by CreateFile can be assigned to an object Pin
Chris Losinger17-Oct-13 5:25
professionalChris Losinger17-Oct-13 5:25 
GeneralRe: Why a HANDLE created by CreateFile can be assigned to an object Pin
digitalspace.xjtu17-Oct-13 5:35
digitalspace.xjtu17-Oct-13 5:35 
QuestionHow to generate DSA 512 bit KeyPair in VC++ 2010 Pin
IICTECH17-Oct-13 3:05
IICTECH17-Oct-13 3:05 
QuestionHow to Create Single Process in C++ Pin
Thong LeTrung16-Oct-13 6:40
Thong LeTrung16-Oct-13 6:40 
AnswerRe: How to Create Single Process in C++ Pin
Rajesh R Subramanian16-Oct-13 6:52
professionalRajesh R Subramanian16-Oct-13 6:52 
GeneralRe: How to Create Single Process in C++ Pin
Thong LeTrung16-Oct-13 6:58
Thong LeTrung16-Oct-13 6:58 
QuestionHow does this code with "event" functions? Pin
Vaclav_16-Oct-13 6:38
Vaclav_16-Oct-13 6:38 
AnswerRe: How does this code with "event" functions? Pin
Rajesh R Subramanian16-Oct-13 9:05
professionalRajesh R Subramanian16-Oct-13 9:05 
GeneralRe: How does this code with "event" functions? Pin
Vaclav_16-Oct-13 14:36
Vaclav_16-Oct-13 14:36 
GeneralRe: How does this code with "event" functions? Pin
Rajesh R Subramanian16-Oct-13 19:15
professionalRajesh R Subramanian16-Oct-13 19:15 
QuestionRe: How does this code with "event" functions? Pin
Vaclav_17-Oct-13 8:59
Vaclav_17-Oct-13 8: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.