本文整理汇总了C++中ExtraIcon::getDescIcon方法的典型用法代码示例。如果您正苦于以下问题:C++ ExtraIcon::getDescIcon方法的具体用法?C++ ExtraIcon::getDescIcon怎么用?C++ ExtraIcon::getDescIcon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ExtraIcon
的用法示例。
在下文中一共展示了ExtraIcon::getDescIcon方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnInitDialog
virtual void OnInitDialog()
{
int numSlots = GetNumberOfSlots();
if (numSlots < (int)registeredExtraIcons.getCount()) {
HWND label = GetDlgItem(m_hwnd, IDC_MAX_ICONS_L);
SetWindowText(label, CMString(FORMAT, TranslateT("*only the first %d icons will be shown"), numSlots));
ShowWindow(label, SW_SHOW);
}
int cx = g_iIconSX;
HIMAGELIST hImageList = ImageList_Create(cx, cx, ILC_COLOR32 | ILC_MASK, 2, 2);
HICON hBlankIcon = (HICON)LoadImage(g_hInst, MAKEINTRESOURCE(IDI_BLANK), IMAGE_ICON, cx, cx, 0);
ImageList_AddIcon(hImageList, hBlankIcon);
for (int i = 0; i < registeredExtraIcons.getCount(); i++) {
ExtraIcon *extra = registeredExtraIcons[i];
HICON hIcon = IcoLib_GetIcon(extra->getDescIcon());
if (hIcon == NULL)
ImageList_AddIcon(hImageList, hBlankIcon);
else {
ImageList_AddIcon(hImageList, hIcon);
IcoLib_ReleaseIcon(hIcon);
}
}
m_tree.SetImageList(hImageList, TVSIL_NORMAL);
DestroyIcon(hBlankIcon);
for (int k = 0; k < extraIconsBySlot.getCount(); k++) {
ExtraIcon *extra = extraIconsBySlot[k];
if (extra->getType() == EXTRAICON_TYPE_GROUP) {
ExtraIconGroup *group = (ExtraIconGroup *)extra;
intlist ids;
for (int j = 0; j < group->m_items.getCount(); j++)
ids.add(group->m_items[j]->getID());
Tree_AddExtraIconGroup(ids, extra->isEnabled());
}
else Tree_AddExtraIcon((BaseExtraIcon *)extra, extra->isEnabled());
}
TVSORTCB sort = { 0 };
sort.hParent = NULL;
sort.lParam = 0;
sort.lpfnCompare = CompareFunc;
m_tree.SortChildrenCB(&sort, 0);
}