本文整理汇总了C++中ImageList_AddIcon函数的典型用法代码示例。如果您正苦于以下问题:C++ ImageList_AddIcon函数的具体用法?C++ ImageList_AddIcon怎么用?C++ ImageList_AddIcon使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ImageList_AddIcon函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitTreeViewImageLists
/*
* InitTreeViewImageLists - creates an image list, adds three bitmaps
* to it, and associates the image list with a tree view control.
* Returns TRUE if successful, or FALSE otherwise.
* hwndTV - handle to the tree view control.
*/
static BOOL InitTreeViewImageLists(HWND hwndTV)
{
HIMAGELIST himl; /* handle to image list */
HICON hico; /* handle to icon */
/* Create the image list. */
if ((himl = ImageList_Create(CX_ICON, CY_ICON,
ILC_MASK, 0, NUM_ICONS)) == NULL)
return FALSE;
/* Add the open file, closed file, and document bitmaps. */
hico = LoadIconW(hInst, MAKEINTRESOURCEW(IDI_OPEN_FILE));
Image_Open = ImageList_AddIcon(himl, hico);
hico = LoadIconW(hInst, MAKEINTRESOURCEW(IDI_CLOSED_FILE));
Image_Closed = ImageList_AddIcon(himl, hico);
hico = LoadIconW(hInst, MAKEINTRESOURCEW(IDI_ROOT));
Image_Root = ImageList_AddIcon(himl, hico);
/* Fail if not all of the images were added. */
if (ImageList_GetImageCount(himl) < NUM_ICONS)
{
return FALSE;
}
/* Associate the image list with the tree view control. */
SendMessageW(hwndTV, TVM_SETIMAGELIST, TVSIL_NORMAL, (LPARAM)himl);
return TRUE;
}
示例2: InitListViewColumns
void InitListViewColumns( HWND hListView, const LISTVIEW_COLUMN * Cols, int numColumns, long style )
{
HKEY hKey;
DWORD valLength;
TCHAR colName[32];
RECT rc;
// Get window sizes
rc.left = -1;
rc.top = -1;
RegCreateKey(HKEY_CURRENT_USER, _T("Software\\Sysinternals\\ShareEnum"), &hKey );
valLength = sizeof(DWORD);
RegQueryValueEx( hKey, _T("x"), NULL, NULL, (LPBYTE) &rc.left,
&valLength );
RegQueryValueEx( hKey, _T("y"), NULL, NULL, (LPBYTE) &rc.top,
&valLength );
RegQueryValueEx( hKey, _T("w"), NULL, NULL, (LPBYTE) &rc.right,
&valLength );
RegQueryValueEx( hKey, _T("h"), NULL, NULL, (LPBYTE) &rc.bottom,
&valLength );
if( rc.left != -1 && rc.top != -1 )
MoveWindow( GetParent( hListView), rc.left, rc.top, rc.right, rc.bottom, TRUE );
// Set listview styles
ListView_SetExtendedListViewStyleEx( hListView, style, style );
// Create columns
for ( int i = 0; i < numColumns; ++i ) {
LVCOLUMN col = { 0 };
col.mask = LVCF_TEXT | LVCF_WIDTH;
col.pszText = (TCHAR *)Cols[i].Title;
col.cx = Cols[i].Width;
_stprintf( colName, _T("Column%d"), i );
DWORD val = -1;
valLength = sizeof(DWORD);
RegQueryValueEx( hKey,colName, NULL, NULL, (LPBYTE) &val, &valLength );
if ( val < 600 )
col.cx = val;
ListView_InsertColumn( hListView, i, &col );
}
RegCloseKey( hKey );
HINSTANCE hInstance = GetModuleHandle(NULL);
// Create image list (order corresponds to LISTVIEW_IMG_* enumeration)
HIMAGELIST hImageList = ImageList_Create( GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLORDDB, 10, 30 );
UINT loadFlags = LR_DEFAULTCOLOR | LR_LOADTRANSPARENT | LR_SHARED;
ImageList_SetBkColor( hImageList, GetSysColor(COLOR_WINDOW) );
ImageList_AddIcon( hImageList, (HICON) LoadImage( hInstance, MAKEINTRESOURCE(IDI_FILE), IMAGE_ICON, 16, 16, loadFlags));
ImageList_SetBkColor( hImageList, GetSysColor(COLOR_BTNFACE) );
ImageList_AddIcon( hImageList, (HICON) LoadImage( hInstance, MAKEINTRESOURCE(IDI_DOWNARROW), IMAGE_ICON, 16, 16, loadFlags ) );
ImageList_AddIcon( hImageList, (HICON) LoadImage( hInstance, MAKEINTRESOURCE(IDI_UPARROW), IMAGE_ICON, 16, 16, loadFlags ) );
ImageList_SetBkColor( hImageList, GetSysColor(COLOR_WINDOW) );
ImageList_AddIcon( hImageList, (HICON) LoadImage( hInstance, MAKEINTRESOURCE(IDI_FILEGOOD), IMAGE_ICON, 16, 16, loadFlags ) );
ImageList_AddIcon( hImageList, (HICON) LoadImage( hInstance, MAKEINTRESOURCE(IDI_FILEBAD), IMAGE_ICON, 16, 16, loadFlags ) );
ListView_SetImageList( hListView, hImageList, LVSIL_SMALL );
}
示例3: ImageList_Destroy
void FileInfoListView::loadImages()
{
if (m_smallImageList != NULL) {
ImageList_Destroy(m_smallImageList);
}
m_smallImageList = ImageList_Create(GetSystemMetrics(SM_CXSMICON),
GetSystemMetrics(SM_CYSMICON),
ILC_MASK, 1, 1);
HICON icon;
ResourceLoader *rLoader = ResourceLoader::getInstance();
icon = rLoader->loadIcon(MAKEINTRESOURCE(IDI_FILEUP));
_ASSERT(icon != NULL);
ImageList_AddIcon(m_smallImageList, icon);
DestroyIcon(icon);
icon = rLoader->loadIcon(MAKEINTRESOURCE(IDI_FOLDER_ICON));
_ASSERT(icon != NULL);
ImageList_AddIcon(m_smallImageList, icon);
DestroyIcon(icon);
icon = rLoader->loadIcon(MAKEINTRESOURCE(IDI_FILE_ICON));
_ASSERT(icon != NULL);
ImageList_AddIcon(m_smallImageList, icon);
DestroyIcon(icon);
}
示例4: InsertTabs
void InsertTabs() {
HIMAGELIST hImageList1 = ImageList_Create(16, 16, ILC_MASK | ILC_COLORDDB, 3, 0);
TabCtrl_SetImageList(hSelDlgTabControl, hImageList1);
HICON hIcon1 = LoadIcon(hAppInst, MAKEINTRESOURCE(IDI_APP));
HICON hIcon2 = LoadIcon(hAppInst, MAKEINTRESOURCE(IDI_STAR));
HICON hIcon3 = LoadIcon(hAppInst, MAKEINTRESOURCE(IDI_COG));
ImageList_AddIcon(hImageList1, hIcon1);
ImageList_AddIcon(hImageList1, hIcon2);
ImageList_AddIcon(hImageList1, hIcon3);
TC_ITEMHEADER TCI;
TCI.mask = TCIF_TEXT | TCIF_IMAGE;
TCI.pszText = _T("Games List");
TCI.iImage = 0;
SendMessage(hSelDlgTabControl, TCM_INSERTITEM, (WPARAM) 0, (LPARAM) &TCI);
TCI.pszText = _T("Favorite Games List");
TCI.iImage = 1;
SendMessage(hSelDlgTabControl, TCM_INSERTITEM, (WPARAM) 1, (LPARAM) &TCI);
TCI.pszText = _T("Options");
TCI.iImage = 2;
SendMessage(hSelDlgTabControl, TCM_INSERTITEM, (WPARAM) 2, (LPARAM) &TCI);
}
示例5: InitListViewImageLists
static BOOL InitListViewImageLists(HWND hwndLV)
{
HIMAGELIST himl; /* handle to image list */
HICON hico; /* handle to icon */
/* Create the image list. */
if ((himl = ImageList_Create(CX_ICON, CY_ICON,
ILC_MASK, 0, NUM_ICONS)) == NULL)
{
return FALSE;
}
hico = LoadIconW(hInst, MAKEINTRESOURCEW(IDI_BIN));
Image_Bin = ImageList_AddIcon(himl, hico);
hico = LoadIconW(hInst, MAKEINTRESOURCEW(IDI_STRING));
Image_String = ImageList_AddIcon(himl, hico);
/* Fail if not all of the images were added. */
if (ImageList_GetImageCount(himl) < NUM_ICONS)
{
return FALSE;
}
/* Associate the image list with the tree view control. */
(void)ListView_SetImageList(hwndLV, himl, LVSIL_SMALL);
return TRUE;
}
示例6: ImageList_AddIcon
void CMLuaOptions::OnInitDialog()
{
CDlgBase::OnInitDialog();
m_scripts.SetExtendedListViewStyle(LVS_EX_SUBITEMIMAGES | LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES | LVS_EX_INFOTIP);
HIMAGELIST hImageList = m_scripts.CreateImageList(LVSIL_SMALL);
ImageList_AddIcon(hImageList, GetIcon(IDI_LOADED));
ImageList_AddIcon(hImageList, GetIcon(IDI_FAILED));
ImageList_AddIcon(hImageList, GetIcon(IDI_OPEN));
ImageList_AddIcon(hImageList, GetIcon(IDI_RELOAD));
TCHAR scriptDir[MAX_PATH], relativeScriptDir[MAX_PATH], header[MAX_PATH + 100];
FoldersGetCustomPathT(g_hScriptsFolder, scriptDir, _countof(scriptDir), VARST(MIRLUA_PATHT));
PathToRelativeT(scriptDir, relativeScriptDir, NULL);
mir_sntprintf(header, _T("%s (%s)"), TranslateT("Common scripts"), relativeScriptDir);
m_scripts.AddColumn(0, _T("Script"), 380);
m_scripts.AddColumn(1, NULL, 32 - GetSystemMetrics(SM_CXVSCROLL));
m_scripts.AddColumn(2, NULL, 32 - GetSystemMetrics(SM_CXVSCROLL));
LoadScripts();
isScriptListInit = true;
}
示例7: OnInitDialog
static VOID
OnInitDialog(HWND hwndDlg)
{
HWND hwndListView;
HIMAGELIST hImgList;
HICON hIcon;
/* Create the image list */
hImgList = ImageList_Create(16, 16, ILC_COLOR8 | ILC_MASK, 5, 5);
hIcon = LoadImage(hApplet, MAKEINTRESOURCE(IDI_USER), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
ImageList_AddIcon(hImgList, hIcon);
hIcon = LoadImage(hApplet, MAKEINTRESOURCE(IDI_LOCKED_USER), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
ImageList_AddIcon(hImgList, hIcon);
DestroyIcon(hIcon);
hwndListView = GetDlgItem(hwndDlg, IDC_USERS_LIST);
(VOID)ListView_SetImageList(hwndListView, hImgList, LVSIL_SMALL);
(void)ListView_SetExtendedListViewStyle(hwndListView, LVS_EX_FULLROWSELECT);
SetUsersListColumns(hwndListView);
UpdateUsersList(hwndListView);
}
示例8: CreateImageList
void CreateImageList(HWND hWnd)
{
// Create and populate image list
HIMAGELIST hImList = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_MASK | ILC_COLOR32, nProtocol, 0);
NudgeElementList *n;
for(n = NudgeList;n != NULL; n = n->next)
{
HICON hIcon = NULL;
hIcon=(HICON)CallProtoService(n->item.ProtocolName, PS_LOADICON,PLI_PROTOCOL | PLIF_SMALL, 0);
if (hIcon == NULL || (int)hIcon == CALLSERVICE_NOTFOUND)
{
hIcon=(HICON)CallProtoService(n->item.ProtocolName, PS_LOADICON, PLI_PROTOCOL, 0);
}
if (hIcon == NULL || (int)hIcon == CALLSERVICE_NOTFOUND)
hIcon = (HICON) LoadImage(hInst, MAKEINTRESOURCE(IDI_NUDGE), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0);
ImageList_AddIcon(hImList, hIcon);
DestroyIcon(hIcon);
}
//ADD default Icon for nudge
HICON hIcon = NULL;
hIcon = (HICON) LoadImage(hInst, MAKEINTRESOURCE(IDI_NUDGE), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0);
ImageList_AddIcon(hImList, hIcon);
DestroyIcon(hIcon);
HWND hLstView = GetDlgItem(hWnd, IDC_PROTOLIST);
TreeView_SetImageList(hLstView, hImList, TVSIL_NORMAL);
}
示例9: AddLine
static HTREEITEM AddLine(HWND hTree,TopButtonInt *b, HTREEITEM hItem, HIMAGELIST il)
{
TVINSERTSTRUCT tvis = { 0 };
tvis.hInsertAfter = hItem;
tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_STATE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
int index;
TCHAR* tmp;
if (b->dwFlags & TTBBF_ISSEPARATOR) {
tvis.item.pszText = _T("------------------");
index = -1;
}
else {
if (b->hIconHandleUp) {
HICON hIcon = IcoLib_GetIconByHandle(b->hIconHandleUp);
index = ImageList_AddIcon(il, hIcon);
IcoLib_ReleaseIcon(hIcon);
}
else index = ImageList_AddIcon(il, b->hIconUp);
tmp = mir_a2t( b->pszName );
tvis.item.pszText = TranslateTS(tmp);
}
tvis.item.iImage = tvis.item.iSelectedImage = index;
tvis.item.lParam = (LPARAM)b;
HTREEITEM hti = TreeView_InsertItem(hTree, &tvis);
if (!(b->dwFlags & TTBBF_ISSEPARATOR))
mir_free(tmp);
TreeView_SetCheckState(hTree, hti, b->isVisible());
return hti;
}
示例10: CreateTreeIcons
// create iconlist and Treeview control
static BOOL CreateTreeIcons()
{
HICON hIcon;
INT i;
HINSTANCE hInst = GetModuleHandle(0);
int numIcons = ICON_MAX + numExtraIcons;
hTreeSmall = ImageList_Create (16, 16, ILC_COLORDDB | ILC_MASK, numIcons, numIcons);
//dprintf("Trying to load %i normal icons",ICON_MAX);
for (i = 0; i < ICON_MAX; i++)
{
hIcon = LoadIconFromFile(treeIconNames[i].lpName);
if (!hIcon)
hIcon = LoadIcon(hInst, MAKEINTRESOURCE(treeIconNames[i].nResourceID));
if (ImageList_AddIcon (hTreeSmall, hIcon) == -1)
{
ErrorMsg("Error creating icon on regular folder, %i %i",i,hIcon != NULL);
return FALSE;
}
}
//dprintf("Trying to load %i extra custom-folder icons",numExtraIcons);
for (i = 0; i < numExtraIcons; i++)
{
if ((hIcon = LoadIconFromFile(ExtraFolderIcons[i])) == 0)
hIcon = LoadIcon (hInst, MAKEINTRESOURCE(IDI_FOLDER));
if (ImageList_AddIcon(hTreeSmall, hIcon) == -1)
{
ErrorMsg("Error creating icon on extra folder, %i %i",i,hIcon != NULL);
return FALSE;
}
}
// Be sure that all the small icons were added.
if (ImageList_GetImageCount(hTreeSmall) < numIcons)
{
ErrorMsg("Error with icon list--too few images. %i %i",
ImageList_GetImageCount(hTreeSmall),numIcons);
return FALSE;
}
// Be sure that all the small icons were added.
if (ImageList_GetImageCount (hTreeSmall) < ICON_MAX)
{
ErrorMsg("Error with icon list--too few images. %i < %i",
ImageList_GetImageCount(hTreeSmall),ICON_MAX);
return FALSE;
}
// Associate the image lists with the list view control.
TreeView_SetImageList(GetTreeView(), hTreeSmall, TVSIL_NORMAL);
return TRUE;
}
示例11: SIC_IconAppend
/*****************************************************************************
* SIC_IconAppend [internal]
*
* NOTES
* appends an icon pair to the end of the cache
*/
static INT SIC_IconAppend (LPCWSTR sSourceFile, INT dwSourceIndex, HICON hSmallIcon, HICON hBigIcon, DWORD dwFlags)
{
LPSIC_ENTRY lpsice;
INT ret, index, index1, indexDPA;
WCHAR path[MAX_PATH];
TRACE("%s %i %p %p\n", debugstr_w(sSourceFile), dwSourceIndex, hSmallIcon ,hBigIcon);
lpsice = (LPSIC_ENTRY) SHAlloc (sizeof (SIC_ENTRY));
GetFullPathNameW(sSourceFile, MAX_PATH, path, NULL);
lpsice->sSourceFile = (LPWSTR)HeapAlloc( GetProcessHeap(), 0, (wcslen(path)+1)*sizeof(WCHAR) );
wcscpy( lpsice->sSourceFile, path );
lpsice->dwSourceIndex = dwSourceIndex;
lpsice->dwFlags = dwFlags;
EnterCriticalSection(&SHELL32_SicCS);
indexDPA = DPA_Search (sic_hdpa, lpsice, 0, SIC_CompareEntries, 0, DPAS_SORTED|DPAS_INSERTAFTER);
indexDPA = DPA_InsertPtr(sic_hdpa, indexDPA, lpsice);
if ( -1 == indexDPA )
{
ret = INVALID_INDEX;
goto leave;
}
index = ImageList_AddIcon (ShellSmallIconList, hSmallIcon);
index1= ImageList_AddIcon (ShellBigIconList, hBigIcon);
/* Something went wrong when allocating a new image in the list. Abort. */
if((index == -1) || (index1 == -1))
{
WARN("Something went wrong when adding the icon to the list: small - 0x%x, big - 0x%x.\n",
index, index1);
if(index != -1) ImageList_Remove(ShellSmallIconList, index);
if(index1 != -1) ImageList_Remove(ShellBigIconList, index1);
ret = INVALID_INDEX;
goto leave;
}
if (index!=index1)
{
FIXME("iconlists out of sync 0x%x 0x%x\n", index, index1);
/* What to do ???? */
}
lpsice->dwListIndex = index;
ret = lpsice->dwListIndex;
leave:
if(ret == INVALID_INDEX)
{
if(indexDPA != -1) DPA_DeletePtr(sic_hdpa, indexDPA);
HeapFree(GetProcessHeap(), 0, lpsice->sSourceFile);
SHFree(lpsice);
}
LeaveCriticalSection(&SHELL32_SicCS);
return ret;
}
示例12: WideAddIconToExtraImageList
//wparam=hIcon
//return hImage on success,-1 on failure
INT_PTR WideAddIconToExtraImageList(WPARAM wParam,LPARAM lParam)
{
int res=-1;
if (hWideExtraImageList==0||wParam==0){return(-1);};
res=((int)ImageList_AddIcon(hWideExtraImageList,(HICON)wParam));
if (res==0xFF) res=((int)ImageList_AddIcon(hWideExtraImageList,(HICON)wParam));
if (res>0xFFFE) return -1;
return res;
};
示例13: LoadGlobalIcons
void LoadGlobalIcons() {
int i;
if (ServiceExists(MS_SKIN2_ADDICON)) {
g_dat->hIcons[SMF_ICON_ADD] = (HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM)"scriver_ADD");
g_dat->hIcons[SMF_ICON_USERDETAILS] = (HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM)"scriver_USERDETAILS");
g_dat->hIcons[SMF_ICON_HISTORY] = (HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM)"scriver_HISTORY");
g_dat->hIcons[SMF_ICON_TYPING] = (HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM)"scriver_TYPING");
g_dat->hIcons[SMF_ICON_SEND] = (HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM)"scriver_SEND");
g_dat->hIcons[SMF_ICON_CANCEL] = (HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM)"scriver_CANCEL");
g_dat->hIcons[SMF_ICON_SMILEY] = (HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM)"scriver_SMILEY");
g_dat->hIcons[SMF_ICON_UNICODEON] = (HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM)"scriver_UNICODEON");
g_dat->hIcons[SMF_ICON_UNICODEOFF] = (HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM)"scriver_UNICODEOFF");
g_dat->hIcons[SMF_ICON_DELIVERING] = (HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM)"scriver_DELIVERING");
g_dat->hIcons[SMF_ICON_QUOTE] = (HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM)"scriver_QUOTE");
g_dat->hIcons[SMF_ICON_INCOMING] = (HICON) LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_INCOMING));
g_dat->hIcons[SMF_ICON_OUTGOING] = (HICON) LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_OUTGOING));
g_dat->hIcons[SMF_ICON_NOTICE] = (HICON) LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_NOTICE));
g_dat->hIcons[SMF_ICON_CLOSEX] = (HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM)"scriver_CLOSEX");
} else {
g_dat->hIcons[SMF_ICON_ADD] = (HICON) LoadImage(g_hInst, MAKEINTRESOURCE(IDI_ADDCONTACT), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0);
g_dat->hIcons[SMF_ICON_USERDETAILS] = (HICON) LoadImage(g_hInst, MAKEINTRESOURCE(IDI_USERDETAILS), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0);
g_dat->hIcons[SMF_ICON_HISTORY] = (HICON) LoadImage(g_hInst, MAKEINTRESOURCE(IDI_HISTORY), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0);
g_dat->hIcons[SMF_ICON_SEND] = (HICON) LoadImage(g_hInst, MAKEINTRESOURCE(IDI_SEND), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0);
g_dat->hIcons[SMF_ICON_CANCEL] = (HICON) LoadImage(g_hInst, MAKEINTRESOURCE(IDI_CANCEL), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0);
g_dat->hIcons[SMF_ICON_SMILEY] = (HICON) LoadImage(g_hInst, MAKEINTRESOURCE(IDI_SMILEY), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0);
g_dat->hIcons[SMF_ICON_TYPING] = (HICON) LoadImage(g_hInst, MAKEINTRESOURCE(IDI_TYPING), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0);
g_dat->hIcons[SMF_ICON_UNICODEON] = (HICON) LoadImage(g_hInst, MAKEINTRESOURCE(IDI_UNICODEON), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0);
g_dat->hIcons[SMF_ICON_UNICODEOFF] = (HICON) LoadImage(g_hInst, MAKEINTRESOURCE(IDI_UNICODEOFF), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0);
g_dat->hIcons[SMF_ICON_DELIVERING] = (HICON) LoadImage(g_hInst, MAKEINTRESOURCE(IDI_TIMESTAMP), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0);
g_dat->hIcons[SMF_ICON_QUOTE] = (HICON) LoadImage(g_hInst, MAKEINTRESOURCE(IDI_QUOTE), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0);
g_dat->hIcons[SMF_ICON_INCOMING] = (HICON) LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_INCOMING));
g_dat->hIcons[SMF_ICON_OUTGOING] = (HICON) LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_OUTGOING));
g_dat->hIcons[SMF_ICON_NOTICE] = (HICON) LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_NOTICE));
g_dat->hIcons[SMF_ICON_CLOSEX] = (HICON) LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_CLOSEX));
}
if (g_dat->hButtonIconList == NULL) {
g_dat->hButtonIconList = ImageList_Create(16, 16, IsWinVerXPPlus() ? ILC_COLOR32 | ILC_MASK : ILC_COLOR8 | ILC_MASK, (g_dat->protoNum + 1) * 12 + 8, 0);
} else {
ImageList_RemoveAll(g_dat->hButtonIconList);
}
for (i=0; i<sizeof(buttonIcons)/sizeof(int); i++) {
if (buttonIcons[i] == -1) {
ImageList_AddIcon(g_dat->hButtonIconList, LoadSkinnedProtoIcon(NULL, ID_STATUS_OFFLINE));
} else {
ImageList_AddIcon(g_dat->hButtonIconList, g_dat->hIcons[buttonIcons[i]]);
}
}
}
示例14: CreateImageList
static HIMAGELIST
CreateImageList(void)
{
HIMAGELIST hImgList;
hImgList = ImageList_Create(16, 16, ILC_COLOR32, 3, 0);
ImageList_AddIcon(hImgList, LoadIcon(hInst, MAKEINTRESOURCE(IDI_REG_KEY)));
ImageList_AddIcon(hImgList, LoadIcon(hInst, MAKEINTRESOURCE(IDI_REG_VALUE_STR)));
ImageList_AddIcon(hImgList, LoadIcon(hInst, MAKEINTRESOURCE(IDI_REG_VALUE_BIN)));
return hImgList;
}
示例15: LoadModuleIcons
void LoadModuleIcons(MODULEINFO * mi) {
mi->OnlineIconIndex = ImageList_AddIcon(g_dat->hTabIconList, LoadSkinnedProtoIcon(mi->pszModule, ID_STATUS_ONLINE));
mi->hOnlineIcon = ImageList_GetIcon(g_dat->hTabIconList, mi->OnlineIconIndex, ILD_TRANSPARENT);
mi->hOnlineTalkIcon = ImageList_GetIcon(g_dat->hTabIconList, mi->OnlineIconIndex, ILD_TRANSPARENT|INDEXTOOVERLAYMASK(1));
ImageList_AddIcon(g_dat->hTabIconList, mi->hOnlineTalkIcon);
mi->OfflineIconIndex = ImageList_AddIcon(g_dat->hTabIconList, LoadSkinnedProtoIcon(mi->pszModule, ID_STATUS_OFFLINE));
mi->hOfflineIcon = ImageList_GetIcon(g_dat->hTabIconList, mi->OfflineIconIndex, ILD_TRANSPARENT);
mi->hOfflineTalkIcon = ImageList_GetIcon(g_dat->hTabIconList, mi->OfflineIconIndex, ILD_TRANSPARENT|INDEXTOOVERLAYMASK(1));
ImageList_AddIcon(g_dat->hTabIconList, mi->hOfflineTalkIcon);
}