void CColorListBox::SetItemColor(int nIndex, COLORREF rgb) // // Return Value: None. // // Parameters : nIndex - Specifies the zero-based index of the item. // rgb - Specifies the color to be associated with the item. // // Res : Sets the 32-bit value associated with the specified // item in the list box. // { SetItemData(nIndex, rgb); RedrawWindow(); } // SetItemColor 其中的代码是这样写的 对SetItemData函数, 在MSDN中有MFC的说明。 不过,对于其它语言,我想只有这个消息,最合适了, 那大家能不能用其它方法 在VC中这个方法可以。
2. 没有效果指的是什么?是SendMessage(hList1,LB_GETITEMDATA,nIndex,0)取不到数据吗?
谢谢CHEHW,这里LINDEX只是做一个变量没有其它意义
没有效果指的是,这句原来,我希望能改变LIST指定ITEM的颜色。
//
// Return Value: None.
//
// Parameters : nIndex - Specifies the zero-based index of the item.
// rgb - Specifies the color to be associated with the item.
//
// Res : Sets the 32-bit value associated with the specified
// item in the list box.
//
{
SetItemData(nIndex, rgb);
RedrawWindow();
} // SetItemColor
其中的代码是这样写的
对SetItemData函数, 在MSDN中有MFC的说明。
不过,对于其它语言,我想只有这个消息,最合适了,
那大家能不能用其它方法
在VC中这个方法可以。
还是控件自己SEND的。
如果涉及另一个进程有哪些要注意的
我用sendmessage向edit发送settxt消息成功的
但是发送listbox的click就不成功了。(具体的那个消息忘了)
WM_SETTEXT消息来达到通知的目的。
http://www.csdn.net/expert/topic/516/516072.xml