Click here to Skip to main content
15,890,043 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: What is MAX_INT for? Pin
Joe Woodbury22-Mar-10 6:30
professionalJoe Woodbury22-Mar-10 6:30 
GeneralRe: What is MAX_INT for? Pin
Adam Roderick J22-Mar-10 7:08
Adam Roderick J22-Mar-10 7:08 
GeneralRe: What is MAX_INT for? Pin
Joe Woodbury22-Mar-10 7:16
professionalJoe Woodbury22-Mar-10 7:16 
GeneralRe: What is MAX_INT for? Pin
Adam Roderick J23-Mar-10 5:38
Adam Roderick J23-Mar-10 5:38 
QuestionOwner drawn ListBox problem Pin
Manmohan2921-Mar-10 5:25
Manmohan2921-Mar-10 5:25 
AnswerRe: Owner drawn ListBox problem Pin
«_Superman_»21-Mar-10 6:40
professional«_Superman_»21-Mar-10 6:40 
GeneralRe: Owner drawn ListBox problem Pin
Manmohan2921-Mar-10 7:04
Manmohan2921-Mar-10 7:04 
GeneralRe: Owner drawn ListBox problem Pin
«_Superman_»21-Mar-10 7:10
professional«_Superman_»21-Mar-10 7:10 
OK. Try this -

Replace
COLORREF   rgbBkgnd = ::GetSysColor((lpDIS->itemState & ODS_SELECTED) ?COLOR_HIGHLIGHT : COLOR_WINDOW);
with
COLORREF   rgbBkgnd = COLOR_WINDOW;


Remove
if( lpDIS->itemState & ODS_FOCUS )
	dc.DrawFocusRect(rcItem);


Replace
if( nIndex != (UINT)-1 )
{
	// The text color is stored as the item data.
	COLORREF   rgbText = (lpDIS->itemState & ODS_SELECTED) ?::GetSysColor(COLOR_HIGHLIGHTTEXT) : GetItemData(nIndex);
	CString str;
	GetText(nIndex, str);
	dc.SetBkColor(rgbBkgnd);
	dc.SetTextColor(rgbText);
	dc.TextOut(rcItem.left + 2, rcItem.top + 2, str);
}

with
if( nIndex != (UINT)-1 )
{
	// The text color is stored as the item data.
	COLORREF   rgbText = GetItemData(nIndex);
	CString str;
	GetText(nIndex, str);
	dc.SetBkColor(rgbBkgnd);
	dc.SetTextColor(rgbText);
	dc.TextOut(rcItem.left + 2, rcItem.top + 2, str);
}

«_Superman
I love work. It gives me something to do between weekends.

Microsoft MVP (Visual C++)

GeneralRe: Owner drawn ListBox problem Pin
Manmohan2921-Mar-10 7:27
Manmohan2921-Mar-10 7:27 
GeneralRe: Owner drawn ListBox problem Pin
Manmohan2921-Mar-10 8:06
Manmohan2921-Mar-10 8:06 
AnswerRe: Owner drawn ListBox problem Pin
Luc Pattyn21-Mar-10 11:18
sitebuilderLuc Pattyn21-Mar-10 11:18 
QuestionOpenGL Pin
MrMcIntyre21-Mar-10 4:45
MrMcIntyre21-Mar-10 4:45 
AnswerRe: OpenGL Pin
Richard MacCutchan21-Mar-10 6:09
mveRichard MacCutchan21-Mar-10 6:09 
QuestionGetAsyncKeyState() and GetKeyState() [Solved] Pin
Rozis21-Mar-10 2:05
Rozis21-Mar-10 2:05 
AnswerRe: GetAsyncKeyState() and GetKeyState() Pin
CPallini21-Mar-10 2:48
mveCPallini21-Mar-10 2:48 
GeneralRe: GetAsyncKeyState() and GetKeyState() Pin
Rozis21-Mar-10 3:12
Rozis21-Mar-10 3:12 
GeneralRe: GetAsyncKeyState() and GetKeyState() Pin
CPallini21-Mar-10 3:23
mveCPallini21-Mar-10 3:23 
GeneralRe: GetAsyncKeyState() and GetKeyState() Gathered answers [modified] Pin
Rozis21-Mar-10 4:23
Rozis21-Mar-10 4:23 
AnswerRe: GetAsyncKeyState() and GetKeyState() Pin
Adam Roderick J21-Mar-10 4:53
Adam Roderick J21-Mar-10 4:53 
GeneralRe: GetAsyncKeyState() and GetKeyState() Pin
Rozis21-Mar-10 5:08
Rozis21-Mar-10 5:08 
GeneralRe: GetAsyncKeyState() and GetKeyState() Pin
Adam Roderick J21-Mar-10 6:11
Adam Roderick J21-Mar-10 6:11 
GeneralRe: GetAsyncKeyState() and GetKeyState() Pin
Rozis21-Mar-10 10:44
Rozis21-Mar-10 10:44 
GeneralRe: GetAsyncKeyState() and GetKeyState() Pin
Adam Roderick J21-Mar-10 22:01
Adam Roderick J21-Mar-10 22:01 
AnswerRe: GetAsyncKeyState() and GetKeyState() Pin
Avi Berger21-Mar-10 5:21
Avi Berger21-Mar-10 5:21 
GeneralRe: GetAsyncKeyState() and GetKeyState() Pin
Rozis21-Mar-10 10:58
Rozis21-Mar-10 10:58 

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.