////////////////////////////
void SSS::SetCell(HWND hWnd1, CString value, int nRow, int nCol)
{
TCHAR szString [256];
wsprintf(szString,value ,0);
//Fill the LVITEM structure with the values given as parameters.
LVITEM lvItem;
lvItem.mask = LVIF_TEXT;
lvItem.iItem = nRow;
lvItem.pszText = szString;
lvItem.iSubItem = nCol;
if(nCol >0)
//set the value of listItem
::SendMessage(hWnd1,LVM_SETITEM, (WPARAM)0,(WPARAM)&lvItem);
else
//Insert the value into List
ListView_InsertItem(hWnd1,&lvItem);
}
SetCell(::GetDlgItem (m_hWnd,IDC_LIST1),nr,pNMListView->iItem, pNMListView->iSubItem);//设置第Index行,第C_L列的值.
本文介绍了一个用于Windows编程的实用函数SetCell,该函数能够将指定的值设置到窗口句柄对应的列表视图控件的指定行和列。通过发送消息的方式更新或插入列表项,适用于Windows桌面应用程序的界面元素操作。

1546

被折叠的 条评论
为什么被折叠?



