本文整理汇总了C++中CMyComPtr::GetSystemIconIndex方法的典型用法代码示例。如果您正苦于以下问题:C++ CMyComPtr::GetSystemIconIndex方法的具体用法?C++ CMyComPtr::GetSystemIconIndex怎么用?C++ CMyComPtr::GetSystemIconIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMyComPtr
的用法示例。
在下文中一共展示了CMyComPtr::GetSystemIconIndex方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RefreshListCtrl
HRESULT CPanel::RefreshListCtrl(const UString &focusedName, int focusedPos, bool selectFocused,
const UStringVector &selectedNames)
{
_dontShowMode = false;
LoadFullPathAndShow();
// OutputDebugStringA("=======\n");
// OutputDebugStringA("s1 \n");
CDisableTimerProcessing timerProcessing(*this);
CDisableNotify disableNotify(*this);
if (focusedPos < 0)
focusedPos = 0;
_listView.SetRedraw(false);
// m_RedrawEnabled = false;
LVITEMW item;
ZeroMemory(&item, sizeof(item));
// DWORD tickCount0 = GetTickCount();
_enableItemChangeNotify = false;
_listView.DeleteAllItems();
_enableItemChangeNotify = true;
int listViewItemCount = 0;
_selectedStatusVector.Clear();
// _realIndices.Clear();
_startGroupSelect = 0;
_selectionIsDefined = false;
// m_Files.Clear();
if (!_folder)
{
// throw 1;
SetToRootFolder();
}
_headerToolBar.EnableButton(kParentFolderID, !IsRootFolder());
{
CMyComPtr<IFolderSetFlatMode> folderSetFlatMode;
_folder.QueryInterface(IID_IFolderSetFlatMode, &folderSetFlatMode);
if (folderSetFlatMode)
folderSetFlatMode->SetFlatMode(BoolToInt(_flatMode));
}
/*
{
CMyComPtr<IFolderSetShowNtfsStreamsMode> setShow;
_folder.QueryInterface(IID_IFolderSetShowNtfsStreamsMode, &setShow);
if (setShow)
setShow->SetShowNtfsStreamsMode(BoolToInt(_showNtfsStrems_Mode));
}
*/
// DWORD tickCount1 = GetTickCount();
RINOK(_folder->LoadItems());
// DWORD tickCount2 = GetTickCount();
RINOK(InitColumns());
// OutputDebugString(TEXT("Start Dir\n"));
UInt32 numItems;
_folder->GetNumberOfItems(&numItems);
bool showDots = _showDots && !IsRootFolder();
_listView.SetItemCount(numItems + (showDots ? 1 : 0));
_selectedStatusVector.ClearAndReserve(numItems);
int cursorIndex = -1;
CMyComPtr<IFolderGetSystemIconIndex> folderGetSystemIconIndex;
if (!Is_Slow_Icon_Folder() || _showRealFileIcons)
_folder.QueryInterface(IID_IFolderGetSystemIconIndex, &folderGetSystemIconIndex);
if (!IsFSFolder())
{
CMyComPtr<IGetFolderArcProps> getFolderArcProps;
_folder.QueryInterface(IID_IGetFolderArcProps, &getFolderArcProps);
_thereAreDeletedItems = false;
if (getFolderArcProps)
{
CMyComPtr<IFolderArcProps> arcProps;
getFolderArcProps->GetFolderArcProps(&arcProps);
if (arcProps)
{
UInt32 numLevels;
if (arcProps->GetArcNumLevels(&numLevels) != S_OK)
numLevels = 0;
NCOM::CPropVariant prop;
if (arcProps->GetArcProp(numLevels - 1, kpidIsDeleted, &prop) == S_OK)
if (prop.vt == VT_BOOL && VARIANT_BOOLToBool(prop.boolVal))
_thereAreDeletedItems = true;
}
}
}
//.........这里部分代码省略.........
示例2: RefreshListCtrl
HRESULT CPanel::RefreshListCtrl(const UString &focusedName, int focusedPos, bool selectFocused,
const UStringVector &selectedNames)
{
_dontShowMode = false;
LoadFullPathAndShow();
// OutputDebugStringA("=======\n");
// OutputDebugStringA("s1 \n");
CDisableTimerProcessing timerProcessing(*this);
if (focusedPos < 0)
focusedPos = 0;
_listView.SetRedraw(false);
// m_RedrawEnabled = false;
LVITEMW item;
ZeroMemory(&item, sizeof(item));
_listView.DeleteAllItems();
_selectedStatusVector.Clear();
// _realIndices.Clear();
_startGroupSelect = 0;
_selectionIsDefined = false;
// m_Files.Clear();
// _folder.Release();
if (!_folder)
{
// throw 1;
SetToRootFolder();
}
_headerToolBar.EnableButton(kParentFolderID, !IsRootFolder());
CMyComPtr<IFolderSetFlatMode> folderSetFlatMode;
_folder.QueryInterface(IID_IFolderSetFlatMode, &folderSetFlatMode);
if (folderSetFlatMode)
folderSetFlatMode->SetFlatMode(BoolToInt(_flatMode));
RINOK(_folder->LoadItems());
RINOK(InitColumns());
// OutputDebugString(TEXT("Start Dir\n"));
UInt32 numItems;
_folder->GetNumberOfItems(&numItems);
bool showDots = _showDots && !IsRootFolder();
_listView.SetItemCount(numItems + (showDots ? 1 : 0));
_selectedStatusVector.Reserve(numItems);
int cursorIndex = -1;
CMyComPtr<IFolderGetSystemIconIndex> folderGetSystemIconIndex;
if (!IsFSFolder() || _showRealFileIcons)
_folder.QueryInterface(IID_IFolderGetSystemIconIndex, &folderGetSystemIconIndex);
if (showDots)
{
UString itemName = L"..";
item.iItem = _listView.GetItemCount();
if (itemName.CompareNoCase(focusedName) == 0)
cursorIndex = item.iItem;
item.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE;
int subItem = 0;
item.iSubItem = subItem++;
item.lParam = kParentIndex;
item.pszText = const_cast<wchar_t *>((const wchar_t *)itemName);
UInt32 attrib = FILE_ATTRIBUTE_DIRECTORY;
item.iImage = _extToIconMap.GetIconIndex(attrib, itemName);
if (item.iImage < 0)
item.iImage = 0;
if (_listView.InsertItem(&item) == -1)
return E_FAIL;
}
// OutputDebugStringA("S1\n");
for (UInt32 i = 0; i < numItems; i++)
{
UString itemName = GetItemName(i);
const UString relPath = GetItemRelPath(i);
if (relPath.CompareNoCase(focusedName) == 0)
cursorIndex = _listView.GetItemCount();
bool selected = false;
if (selectedNames.FindInSorted(relPath) >= 0)
selected = true;
_selectedStatusVector.Add(selected);
item.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE;
if (!_mySelectMode)
if (selected)
{
item.mask |= LVIF_STATE;
item.state = LVIS_SELECTED;
}
//.........这里部分代码省略.........