qq用户列表,点击变大的皱形及原理
QQ用户列表的那个点一下变大的实现。
不知道是不会搜还是真没有,google没啥资料 codeproject也没看到 估计太简单了
注意点
1.window sytle
LBS_NOTIFY | LBS_OWNERDRAWVARIABLE
2.sting and setitemdata
id = m_listbox.AddString(L"3234234123");
m_listbox.SetItemData(id, (DWORD_PTR)&myCon[0]);
void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
// must be implemented
Contactors* con = (Contactors*)lpDrawItemStruct->itemData;
CDCHandle dc = lpDrawItemStruct->hDC;
TCHAR aa[100] = {0};
wsprintf(aa,L"这里是状态%d这里是坐标%d-%d-%d-%d",lpDrawItemStruct->itemState, lpDrawItemStruct->rcItem.left, lpDrawItemStruct->rcItem.top, lpDrawItemStruct->rcItem.right, lpDrawItemStruct->rcItem.bottom);
//if((lpDrawItemStruct->itemState&ODS_NOFOCUSRECT )==ODS_NOFOCUSRECT )
//{
dc.SetBkMode(TRANSPARENT);
dc.FillRect(&lpDrawItemStruct->rcItem, CreateSolidBrush(RGB(100+lpDrawItemStruct->itemID*10,10+lpDrawItemStruct->itemID*70,40+lpDrawItemStruct->itemID*80)));
dc.TextOut(lpDrawItemStruct->rcItem.left, lpDrawItemStruct->rcItem.top,aa);
//}
}
(gif图像点击看效果)