Advertisement
Guest User

Untitled

a guest
Dec 13th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | None | 0 0
  1.     int iLastIndex = ListView_GetItemCount(hWndLV);
  2.         LVITEM lvi;
  3.         lvi.mask = LVIF_TEXT;
  4.         lvi.cchTextMax = textMaxLen;
  5.         lvi.iSubItem = 0;
  6.  
  7.         lvi.iItem = iLastIndex;
  8.         std::wstring tmpName(item->name);
  9.         lvi.pszText = &tmpName[0];
  10.        
  11.         if (ListView_InsertItem(hWndLV, &lvi) == -1)
  12.             return FALSE;
  13.        
  14.         std::wstring tmpDate(item->date);
  15.  
  16.         std::wstringstream ss;
  17.         ss << item->size;
  18.         std::wstring str = ss.str();
  19.         ListView_SetItemText(hWndLV, iLastIndex, 0, &tmpName[0]);
  20.         ListView_SetItemText(hWndLV, iLastIndex, 1, &tmpDate[0]);
  21.         ListView_SetItemText(hWndLV, iLastIndex, 2, (LPWSTR)str.c_str());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement