本文整理汇总了C++中ImageList_AddIcon函数的典型用法代码示例。如果您正苦于以下问题:C++ ImageList_AddIcon函数的具体用法?C++ ImageList_AddIcon怎么用?C++ ImageList_AddIcon使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ImageList_AddIcon函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:VOID001,项目名称:wine-void,代码行数:37,代码来源:treeview.c
示例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 );
}
开发者ID:caidongyun,项目名称:libs,代码行数:60,代码来源:ListView.cpp
示例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);
}
开发者ID:Aliceljm1,项目名称:TightVNC-1,代码行数:29,代码来源:FileInfoListView.cpp
示例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);
}
开发者ID:carstene1ns,项目名称:fbagx,代码行数:27,代码来源:favorites.cpp
示例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;
}
开发者ID:RareHare,项目名称:reactos,代码行数:29,代码来源:listview.c
示例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;
}
开发者ID:wyrover,项目名称:miranda-ng,代码行数:25,代码来源:mlua_options.cpp
示例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);
}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:25,代码来源:users.c
示例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);
}
开发者ID:BackupTheBerlios,项目名称:mgoodies-svn,代码行数:30,代码来源:options.cpp
示例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;
}
开发者ID:kmdtukl,项目名称:miranda-ng,代码行数:35,代码来源:ttbopt.cpp
示例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;
}
开发者ID:Bremma,项目名称:pinmame,代码行数:60,代码来源:TreeView.c
示例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;
}
开发者ID:GYGit,项目名称:reactos,代码行数:64,代码来源:iconcache.cpp
示例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;
};
开发者ID:raoergsls,项目名称:miranda,代码行数:11,代码来源:modern_extraimage.cpp
示例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]]);
}
}
}
开发者ID:BackupTheBerlios,项目名称:mgoodies-svn,代码行数:54,代码来源:globals.c
示例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;
}
开发者ID:GeonHun,项目名称:mctrl,代码行数:12,代码来源:ex_treelist2.c
示例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);
}
开发者ID:BackupTheBerlios,项目名称:mgoodies-svn,代码行数:13,代码来源:services.c
示例16: MIR_APP_DLL
MIR_APP_DLL(HGENMENU) Menu_AddItem(int hMenuObject, TMO_MenuItem *pmi, void *pUserData)
{
if (!bIsGenMenuInited || pmi == NULL)
return NULL;
mir_cslock lck(csMenuHook);
TIntMenuObject *pmo = GetMenuObjbyId(hMenuObject);
if (pmo == NULL)
return NULL;
TMO_IntMenuItem* p = (TMO_IntMenuItem*)mir_calloc(sizeof(TMO_IntMenuItem));
p->parent = pmo;
p->signature = MENUITEM_SIGNATURE;
p->iCommand = GetNextObjectMenuItemId();
p->mi = *pmi;
p->iconId = -1;
p->originalPosition = pmi->position;
p->pUserData = pUserData;
if (pmi->flags & CMIF_UNICODE)
p->mi.name.t = mir_tstrdup(pmi->name.t);
else
p->mi.name.t = mir_a2u(pmi->name.a);
if (pmi->hIcon != NULL && !bIconsDisabled) {
HANDLE hIcolibItem = IcoLib_IsManaged(pmi->hIcon);
if (hIcolibItem != NULL) {
HICON hIcon = IcoLib_GetIconByHandle(hIcolibItem, false);
p->iconId = ImageList_AddIcon(pmo->m_hMenuIcons, hIcon);
p->hIcolibItem = hIcolibItem;
IcoLib_ReleaseIcon(hIcon);
}
else p->iconId = ImageList_AddIcon(pmo->m_hMenuIcons, pmi->hIcon);
}
TMO_IntMenuItem *pRoot = (p->mi.root != NULL) ? MO_GetIntMenuItem(p->mi.root) : NULL;
if (pRoot) {
p->owner = &pRoot->submenu;
if (pRoot->iconId == -1)
pRoot->iconId = p->iconId;
}
else p->owner = &pmo->m_items;
if (!p->owner->first)
p->owner->first = p;
if (p->owner->last)
p->owner->last->next = p;
p->owner->last = p;
return p;
}
开发者ID:truefriend-cz,项目名称:miranda-ng,代码行数:51,代码来源:menu_utils.cpp
示例17: ImageList_Create
CPlayListDlg::CPlayListDlg()
{
m_fListDrag = FALSE;
m_nDragItem = -1;
m_hWnd = NULL;
m_hImageList = ImageList_Create(16, 16, ILC_COLOR | ILC_MASK, 2, 2);
HICON hIcon = LoadIcon(GetInst(), LPCTSTR(IDI_FILE_S));
ImageList_AddIcon(m_hImageList, hIcon);
DestroyIcon(hIcon);
hIcon = LoadIcon(GetInst(), LPCTSTR(IDI_PLAY_S));
ImageList_AddIcon(m_hImageList, hIcon);
DestroyIcon(hIcon);
}
开发者ID:v-zaburdaev,项目名称:Gsplayer2,代码行数:14,代码来源:PlayListDlg.cpp
示例18: ImageList_Create
CPlayListDlg::CPlayListDlg()
{
m_hWnd = NULL;
m_hwndMB = NULL;
m_fCtrlKey = FALSE;
m_hImageList = ImageList_Create(SCALEX(16), SCALEY(16), ILC_COLOR | ILC_MASK, 2, 2);
HICON hIcon = LoadIcon(GetInst(), LPCTSTR(IDI_FILE_S));
ImageList_AddIcon(m_hImageList, hIcon);
DestroyIcon(hIcon);
hIcon = (HICON)LoadImage(GetInst(), (LPCTSTR)IDI_PLAY_S, IMAGE_ICON, SCALEX(16), SCALEY(16), 0);
ImageList_AddIcon(m_hImageList, hIcon);
DestroyIcon(hIcon);
}
开发者ID:afriza,项目名称:GSPlayer,代码行数:14,代码来源:PlayListDlgPPC.cpp
示例19: getOverlayedIcon
static HICON getOverlayedIcon(HICON icon, HICON overlay, BOOL big)
{
HIMAGELIST il = ImageList_Create(
GetSystemMetrics(big?SM_CXICON:SM_CXSMICON),
GetSystemMetrics(big?SM_CYICON:SM_CYSMICON),
ILC_COLOR32|ILC_MASK, 2, 2);
ImageList_AddIcon(il, icon);
ImageList_AddIcon(il, overlay);
HIMAGELIST newImage = ImageList_Merge(il,0,il,1,0,0);
ImageList_Destroy(il);
HICON hIcon = ImageList_GetIcon(newImage, 0, 0);
ImageList_Destroy(newImage);
return hIcon; // the result should be destroyed by DestroyIcon()
}
开发者ID:biddyweb,项目名称:miranda-ng,代码行数:14,代码来源:icolib.cpp
示例20: InitListViewImageLists
BOOL InitListViewImageLists(HWND hWndListView)
{
HICON hiconItem; // Icon for list-view items.
HIMAGELIST hLarge; // Image list for icon view.
HIMAGELIST hSmall; // Image list for other views.
// Create the full-sized icon image lists.
hLarge = ImageList_Create(25,
25,
ILC_COLORDDB | ILC_MASK, 2, 1);
hSmall = ImageList_Create(25,
25,
ILC_COLORDDB | ILC_MASK, 2, 1);
// Add an icon to each image list.
//hiconItem = LoadIcon(g_hInstance, TEXT("haha1"));
ImageList_AddIcon(hLarge, hiconItem);
ImageList_AddIcon(hSmall, hiconItem);
DestroyIcon(hiconItem);
//hiconItem = LoadIcon(g_hInstance, TEXT("haha2"));
ImageList_AddIcon(hLarge, hiconItem);
ImageList_AddIcon(hSmall, hiconItem);
DestroyIcon(hiconItem);
// When you are dealing with multiple icons, you can use the previous four lines of
// code inside a loop. The following code shows such a loop. The
// icons are defined in the application's header file as resources, which
// are numbered consecutively starting with IDS_FIRSTICON. The number of
// icons is defined in the header file as C_ICONS.
/*
for(index = 0; index < C_ICONS; index++)
{
hIconItem = LoadIcon (g_hinst, MAKEINTRESOURCE(IDS_FIRSTICON + index));
ImageList_AddIcon(hSmall, hIconItem);
ImageList_AddIcon(hLarge, hIconItem);
Destroy(hIconItem);
}
*/
// Assign the image lists to the list-view control.
ListView_SetImageList(hWndListView, hLarge, LVSIL_NORMAL);
ListView_SetImageList(hWndListView, hSmall, LVSIL_SMALL);
return TRUE;
}
开发者ID:yedan2010,项目名称:xb-ether-tester,代码行数:50,代码来源:right_window.c
注:本文中的ImageList_AddIcon函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论