void CShellBrowser::MoveItemsIntoGroups(void) { LVITEM Item; int nItems; int iGroupId; int i = 0; ListView_RemoveAllGroups(m_hListView); ListView_EnableGroupView(m_hListView,TRUE); nItems = ListView_GetItemCount(m_hListView); SendMessage(m_hListView,WM_SETREDRAW,(WPARAM)FALSE,(LPARAM)NULL); m_GroupList.clear(); m_iGroupId = 0; g_bSortAscending = m_bSortAscending; g_pGroupList = &m_GroupList; for(i = 0;i < nItems ;i++) { Item.mask = LVIF_PARAM; Item.iItem = i; Item.iSubItem = 0; ListView_GetItem(m_hListView,&Item); iGroupId = DetermineItemGroup((int)Item.lParam); InsertItemIntoGroup(i,iGroupId); } SendMessage(m_hListView,WM_SETREDRAW,(WPARAM)TRUE,(LPARAM)NULL); }
void CShellBrowser::SortFolder(UINT SortMode) { m_SortMode = SortMode; if(m_bShowInGroups) { ListView_EnableGroupView(m_hListView,FALSE); ListView_RemoveAllGroups(m_hListView); ListView_EnableGroupView(m_hListView,TRUE); SetGrouping(TRUE); } SendMessage(m_hListView,LVM_SORTITEMS,reinterpret_cast<WPARAM>(this),reinterpret_cast<LPARAM>(SortStub)); /* If in details view, the column sort arrow will need to be changed to reflect the new sorting mode. */ if(m_ViewMode == VM_DETAILS) { ApplyHeaderSortArrow(); } }
AFX_INLINE void CGridListCtrlGroups::RemoveAllGroups() { ASSERT(::IsWindow(m_hWnd)); ListView_RemoveAllGroups(m_hWnd); }