本文整理汇总了C++中ImageList_Create函数的典型用法代码示例。如果您正苦于以下问题:C++ ImageList_Create函数的具体用法?C++ ImageList_Create怎么用?C++ ImageList_Create使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ImageList_Create函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ToolBarSetImageList
BOOLEAN
ToolBarSetImageList(
IN PTOOLBAR_OBJECT ToolBar,
IN UINT BitmapId,
IN COLORREF Mask
)
{
HBITMAP hBitmap;
BITMAP Bitmap = {0};
LONG Width, Height;
HIMAGELIST himlNormal;
HIMAGELIST himlGray;
hBitmap = LoadBitmap(SdkInstance, MAKEINTRESOURCE(BitmapId));
ASSERT(hBitmap != NULL);
if (hBitmap == NULL) {
return FALSE;
}
if (!GetObject(hBitmap, sizeof(BITMAP), &Bitmap)) {
return FALSE;
}
Width = Bitmap.bmWidth / ToolBar->Count;
Height = Bitmap.bmHeight;
himlNormal = ImageList_Create(Width, Height, ILC_COLOR32 | ILC_MASK, ToolBar->Count, 0);
ASSERT(himlNormal);
if (himlNormal == NULL) {
return FALSE;
}
ImageList_AddMasked(himlNormal, hBitmap, Mask);
SendMessage(ToolBar->hWnd, TB_SETIMAGELIST, 0L, (LPARAM)himlNormal);
SendMessage(ToolBar->hWnd, TB_SETHOTIMAGELIST, 0L, (LPARAM)himlNormal);
DeleteObject(hBitmap);
hBitmap = NULL;
himlGray = SdkCreateGrayImageList(himlNormal);
SendMessage(ToolBar->hWnd, TB_SETDISABLEDIMAGELIST, 0L, (LPARAM)himlGray);
ToolBar->himlNormal = himlNormal;
ToolBar->himlGray = himlGray;
return TRUE;
}
开发者ID:John-Chan,项目名称:dprobe,代码行数:47,代码来源:toolbar.c
示例2: ListView_SetExtendedListViewStyle
bool VDUIListViewW32::Create(IVDUIParameters *pParameters) {
mbCheckable = pParameters->GetB(nsVDUI::kUIParam_Checkable, false);
DWORD dwFlags = LVS_REPORT | WS_TABSTOP;
if (pParameters->GetB(nsVDUI::kUIParam_NoHeader, false))
dwFlags |= LVS_NOCOLUMNHEADER;
if (!CreateW32(pParameters, WC_LISTVIEW, dwFlags))
return false;
ListView_SetExtendedListViewStyle(mhwnd, LVS_EX_FULLROWSELECT | ListView_GetExtendedListViewStyle(mhwnd));
if (mbCheckable) {
const int cx = GetSystemMetrics(SM_CXMENUCHECK);
const int cy = GetSystemMetrics(SM_CYMENUCHECK);
if (HBITMAP hbm = CreateBitmap(cx, cy, 1, 1, NULL)) {
if (HDC hdc = CreateCompatibleDC(NULL)) {
if (HGDIOBJ hbmOld = SelectObject(hdc, hbm)) {
bool success = false;
RECT r = { 0, 0, cx, cy };
SetBkColor(hdc, PALETTEINDEX(0));
ExtTextOut(hdc, 0, 0, ETO_OPAQUE, &r, "", 0, NULL);
DrawFrameControl(hdc, &r, DFC_BUTTON, DFCS_BUTTONCHECK|DFCS_CHECKED);
SelectObject(hdc, hbmOld);
if (HIMAGELIST himl = ImageList_Create(cx, cy, ILC_COLOR, 1, 1)) {
if (ImageList_Add(himl, hbm, NULL) >= 0)
ListView_SetImageList(mhwnd, himl, LVSIL_STATE);
else
ImageList_Destroy(himl);
}
}
DeleteDC(hdc);
}
DeleteObject(hbm);
}
}
return true;
}
开发者ID:KGE-INC,项目名称:VirtualDub,代码行数:47,代码来源:w32listview.cpp
示例3: MakeControlToolBar
int MakeControlToolBar ( int iControlID, int iStyle, int iExtendedStyle, DWORD pFilename, int iNumberOfToolImages )
{
// Assign the style
DWORD dwExtendedStyle = GetExtendedStyle ( iExtendedStyle );
DWORD dwSelectStyle = CCS_TOP;
switch ( iStyle )
{
case 1 : dwSelectStyle |= 0; break;
}
// Create control
MaintainGlobalHWND();
if ( !CreateControl ( iControlID, g_pGlob->hWnd, TOOLBARCLASSNAME, dwExtendedStyle, dwSelectStyle, "", 0, 0, 0, 0 ) )
return 0;
// Create image list
g_pControls [ iControlID ].himlImageList = ImageList_Create(16, 16, ILC_COLOR24, 0, 65535);
// Assign the image lists to the list view control.
HWND hwndTB = g_pControls [ iControlID ].hWnd;
// Sets the size of the TBBUTTON structure.
SendMessage(hwndTB, TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0);
// Set the maximum number of text rows and bitmap size.
SendMessage(hwndTB, TB_SETBITMAPSIZE, 0, (LPARAM)MAKELONG(16, 16));
// Load bitmap for all buttons
for ( int iI=0; iI<iNumberOfToolImages; iI++ )
{
char pFile[256];
wsprintf ( pFile, "%s%d.bmp", pFilename, iI );
HBITMAP hbmp = (HBITMAP)LoadImage(NULL, pFile,IMAGE_BITMAP,16,16,LR_LOADFROMFILE);
ImageList_Add(g_pControls [ iControlID ].himlImageList,hbmp,NULL);
}
SendMessage(hwndTB, TB_SETIMAGELIST, 0, (LPARAM)g_pControls [ iControlID ].himlImageList);
SendMessage(hwndTB, TB_SETHOTIMAGELIST, 0, (LPARAM)g_pControls [ iControlID ].himlImageList);
// Subclass to get access to all control messages directly
g_pControls [ iControlID ].lOriginalWinProc = SetWindowLong ( hwndTB, GWL_WNDPROC, (LONG)SubClassControlWinProc );
// Update safe rects after new addition
UpdateSafeRectsArray();
// Success
return 1;
}
开发者ID:Fliper12,项目名称:darkbasicpro,代码行数:47,代码来源:WinGUI.cpp
示例4: LoadContactListModule2
int LoadContactListModule2(void)
{
HookEvent(ME_SYSTEM_MODULESLOADED, ContactListModulesLoaded);
HookEvent(ME_PROTO_ACCLISTCHANGED, ContactListAccountsChanged);
HookEvent(ME_DB_CONTACT_SETTINGCHANGED, ContactSettingChanged);
HookEvent(ME_DB_CONTACT_ADDED, ContactAdded);
HookEvent(ME_DB_CONTACT_DELETED, ContactDeleted);
HookEvent(ME_PROTO_ACK, ProtocolAck);
hContactDoubleClicked = CreateHookableEvent(ME_CLIST_DOUBLECLICKED);
hContactIconChangedEvent = CreateHookableEvent(ME_CLIST_CONTACTICONCHANGED);
LoadCluiServices();
CreateServiceFunction(MS_CLIST_CONTACTDOUBLECLICKED, ContactDoubleClicked);
CreateServiceFunction(MS_CLIST_CONTACTFILESDROPPED, ContactFilesDropped);
CreateServiceFunction(MS_CLIST_GETSTATUSMODEDESCRIPTION, GetStatusModeDescription);
CreateServiceFunction(MS_CLIST_GETCONTACTDISPLAYNAME, GetContactDisplayName);
CreateServiceFunction(MS_CLIST_INVALIDATEDISPLAYNAME, InvalidateDisplayName);
CreateServiceFunction(MS_CLIST_CONTACTSCOMPARE, CompareContacts);
CreateServiceFunction(MS_CLIST_CONTACTCHANGEGROUP, ContactChangeGroup);
CreateServiceFunction(MS_CLIST_SHOWHIDE, ShowHideStub);
CreateServiceFunction(MS_CLIST_SETHIDEOFFLINE, SetHideOfflineStub);
CreateServiceFunction(MS_CLIST_DOCKINGPROCESSMESSAGE, Docking_ProcessWindowMessageStub);
CreateServiceFunction(MS_CLIST_DOCKINGISDOCKED, Docking_IsDocked);
CreateServiceFunction(MS_CLIST_HOTKEYSPROCESSMESSAGE, HotkeysProcessMessageStub);
CreateServiceFunction(MS_CLIST_GETCONTACTICON, GetContactIcon);
InitCListEvents();
InitGroupServices();
cli.pfnInitTray();
hCListImages = ImageList_Create(16, 16, ILC_MASK | ILC_COLOR32, 13, 0);
HookEvent(ME_SKIN_ICONSCHANGED, CListIconsChanged);
CreateServiceFunction(MS_CLIST_GETICONSIMAGELIST, GetIconsImageList);
ImageList_AddIcon_NotShared(hCListImages, MAKEINTRESOURCE(IDI_BLANK));
//now all core skin icons are loaded via icon lib. so lets release them
for (int i=0; i < SIZEOF(statusModeList); i++)
ImageList_AddIcon_IconLibLoaded(hCListImages, skinIconStatusList[i]);
//see IMAGE_GROUP... in clist.h if you add more images above here
ImageList_AddIcon_IconLibLoaded(hCListImages, SKINICON_OTHER_GROUPOPEN);
ImageList_AddIcon_IconLibLoaded(hCListImages, SKINICON_OTHER_GROUPSHUT);
return 0;
}
开发者ID:Ganster41,项目名称:miranda-ng,代码行数:47,代码来源:clistmod.cpp
示例5: RebarSetBarImage
BOOLEAN
RebarSetBarImage(
__in HWND hWndBar,
__in COLORREF Mask,
__out HIMAGELIST *Normal,
__out HIMAGELIST *Grayed
)
{
ULONG Number;
HIMAGELIST himlNormal;
HIMAGELIST himlGrayed;
HICON hicon;
REBARINFO Info = {0};
//
// Create imagelist for toolbar band
//
Number = sizeof(CommandBarButtons) / sizeof(TBBUTTON);
himlNormal = ImageList_Create(16, 16, ILC_COLOR32 | ILC_MASK, Number, Number);
hicon = LoadIcon(SdkInstance, MAKEINTRESOURCE(IDI_ICON_DEDUCTION));
ImageList_AddIcon(himlNormal, hicon);
hicon = LoadIcon(SdkInstance, MAKEINTRESOURCE(IDI_ICON_SEARCH));
ImageList_AddIcon(himlNormal, hicon);
SendMessage(hWndBar, TB_SETIMAGELIST, 0, (LPARAM)himlNormal);
SendMessage(hWndBar, TB_SETHOTIMAGELIST, 0, (LPARAM)himlNormal);
himlGrayed = SdkCreateGrayImageList(himlNormal);
SendMessage(hWndBar, TB_SETDISABLEDIMAGELIST, 0, (LPARAM)himlGrayed);
*Normal = himlNormal;
*Grayed = himlGrayed;
//
// Set rebar's imagelist
//
Info.cbSize = sizeof(Info);
Info.fMask = RBIM_IMAGELIST;
Info.himl = himlNormal;
SendMessage(GetParent(hWndBar), RB_SETBARINFO, 0, (LPARAM)&Info);
return TRUE;
}
开发者ID:HeckMina,项目名称:dprofiler,代码行数:47,代码来源:rebar.c
示例6: SetImageList
static VOID
SetImageList(HWND hwnd)
{
HIMAGELIST hImageList;
hImageList = ImageList_Create(16, 16, ILC_MASK | ILC_COLOR24, 1, 1);
if (!hImageList)
{
MessageBox(hwnd, _T("ImageList it is not created!"), NULL, MB_OK);
return;
}
ImageList_AddMasked(hImageList,
LoadImage(hInstance, MAKEINTRESOURCE(IDB_PLAYICON), IMAGE_BITMAP, 16, 16, LR_DEFAULTCOLOR),
RGB(255, 255, 255));
ImageList_AddMasked(hImageList,
LoadImage(hInstance, MAKEINTRESOURCE(IDB_STOPICON), IMAGE_BITMAP, 16, 16, LR_DEFAULTCOLOR),
RGB(255, 255, 255));
ImageList_AddMasked(hImageList,
LoadImage(hInstance, MAKEINTRESOURCE(IDB_EJECTICON), IMAGE_BITMAP, 16, 16, LR_DEFAULTCOLOR),
RGB(255, 255, 255));
ImageList_AddMasked(hImageList,
LoadImage(hInstance, MAKEINTRESOURCE(IDB_BACKWARDICON), IMAGE_BITMAP, 16, 16, LR_DEFAULTCOLOR),
RGB(255, 255, 255));
ImageList_AddMasked(hImageList,
LoadImage(hInstance, MAKEINTRESOURCE(IDB_SEEKBACKICON), IMAGE_BITMAP, 16, 16, LR_DEFAULTCOLOR),
RGB(255, 255, 255));
ImageList_AddMasked(hImageList,
LoadImage(hInstance, MAKEINTRESOURCE(IDB_SEEKFORWICON), IMAGE_BITMAP, 16, 16, LR_DEFAULTCOLOR),
RGB(255, 255, 255));
ImageList_AddMasked(hImageList,
LoadImage(hInstance, MAKEINTRESOURCE(IDB_FORWARDICON), IMAGE_BITMAP, 16, 16, LR_DEFAULTCOLOR),
RGB(255, 255, 255));
ImageList_Destroy((HIMAGELIST)SendMessage(hToolBar,
TB_SETIMAGELIST,
0,
(LPARAM)hImageList));
}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:46,代码来源:mplay32.c
示例7: ImageList_Destroy
void CMyCombo::SetImages(int nImages, UINT ImageID)
{
if (m_himlImages) {
ImageList_Destroy(m_himlImages);
m_himlImages = NULL;
}
HBITMAP hbm = LoadBitmap(MAKEINTRESOURCE(ImageID));
BITMAP bm = {0};
::GetObject(hbm, sizeof(BITMAP), &bm);
int iImageWidth = bm.bmWidth / nImages;
int iImageHeight = bm.bmHeight;
COLORREF crMask = RGB(255, 0, 255);
m_himlImages = ImageList_Create(iImageWidth, iImageHeight, ILC_COLOR32 | ILC_MASK, nImages, 0);
ImageList_AddMasked(m_himlImages, hbm, crMask);
::DeleteObject(hbm);
}
开发者ID:wyrover,项目名称:win32-framework,代码行数:17,代码来源:MyCombo.cpp
示例8: ImageList_Create
HIMAGELIST CSkin::LoadImageList(int cx, int cy, LPCTSTR pszFile, UINT uDef)
{
#ifdef _WIN32_WCE
UINT uFlags = ILC_COLOR|ILC_MASK;
#else
UINT uFlags = ILC_COLOR24|ILC_MASK;
#endif
HIMAGELIST himl = ImageList_Create(cx, cy, uFlags, 0, 0);
if (!himl)
return NULL;
HBITMAP hbmp = LoadBitmap(pszFile);
if (!hbmp)
hbmp = ::LoadBitmap(GetInst(), (LPCTSTR)uDef);
ImageList_AddMasked(himl, hbmp, MASK_COLOR);
DeleteObject(hbmp);
return himl;
}
开发者ID:afriza,项目名称:GSPlayer,代码行数:17,代码来源:Skin.cpp
示例9: ImageList_Create
HIMAGELIST MyTreeView::setImageList( HBITMAP defIcon ){
//if ( !defImage ) return 0;
this->imgList = ImageList_Create(MYTREEVIEW_DEFAULT_ICONSIZE,MYTREEVIEW_DEFAULT_ICONSIZE,ILC_COLOR24,0,0);
if ( defIcon && imgList )
{
defIconIdx = ImageList_Add(this->imgList, defIcon, NULL);
}
SendMessage(this->getHWND(),TVM_SETIMAGELIST,TVSIL_NORMAL,(LPARAM)this->imgList);
/*HBITMAP image = (HBITMAP)LoadImage(this->hInstance, defImage, IMAGE_BITMAP, MYTREEVIEW_DEFAULT_ICONSIZE, MYTREEVIEW_DEFAULT_ICONSIZE,
LR_DEFAULTSIZE | LR_LOADFROMFILE );
if ( image ){
ImageList_Add(this->imgList,image,NULL);
}*/
return 0;
}
开发者ID:MisterXYZ83,项目名称:SpotifyDownloaderWithGui,代码行数:17,代码来源:mia_treeview.cpp
示例10: UpdateLayoutsList
VOID
UpdateLayoutsList(VOID)
{
HIMAGELIST hImgList;
/* Clear the list */
(VOID) ListView_DeleteAllItems(GetDlgItem(MainDlgWnd, IDC_KEYLAYOUT_LIST));
/* Crate new list */
hImgList = ImageList_Create(16, 16, ILC_COLOR8 | ILC_MASK, 0, 1);
InitLangList(MainDlgWnd, hImgList);
hImgList = ListView_SetImageList(GetDlgItem(MainDlgWnd, IDC_KEYLAYOUT_LIST), hImgList, LVSIL_SMALL);
/* Destroy old image list */
if(hImgList)
(VOID) ImageList_Destroy(hImgList);
}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:17,代码来源:settings.c
示例11: GetSystemMetrics
HIMAGELIST CheckedListView::CreateCheckBoxImageList(HWND hWnd)
{
HDC hdc_wnd, hdc;
HBITMAP hbm_im, hbm_mask, hbm_orig;
RECT rc;
HIMAGELIST himl;
int x = GetSystemMetrics(SM_CXSMICON);
himl = ImageList_Create(x, GetSystemMetrics(SM_CYSMICON), ILC_COLOR16 | ILC_MASK, 2, 2);
hdc_wnd = GetDC(hWnd);
hdc = CreateCompatibleDC(hdc_wnd);
hbm_im = CreateCompatibleBitmap(hdc_wnd, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON));
hbm_mask = CreateBitmap(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 1, 1, NULL);
ReleaseDC(hWnd, hdc_wnd);
rc.left = rc.top = 0;
rc.right = GetSystemMetrics(SM_CXSMICON);
rc.bottom = GetSystemMetrics(SM_CYSMICON);
hbm_orig = (HBITMAP) SelectObject(hdc, hbm_mask);
SelectObject(hdc, hbm_im);
// Create normal image
_createButtonCheckImage(hdc, &rc, false, CheckedColorNone);
SelectObject(hdc, hbm_orig);
ImageList_Add(himl, hbm_im, hbm_mask);
SelectObject(hdc, hbm_im);
// Create color checked images
CheckedColor colors[] = {CheckedColorBlack, CheckedColorGrey, CheckedColorYellow, CheckedColorGreen, CheckedColorNone};
CheckedColor* color = colors;
while (*color != CheckedColorNone)
{
_createButtonCheckImage(hdc, &rc, true, *color);
SelectObject(hdc, hbm_orig);
ImageList_Add(himl, hbm_im, hbm_mask);
SelectObject(hdc, hbm_im);
color++;
}
DeleteObject(hbm_mask);
DeleteObject(hbm_im);
DeleteDC(hdc);
return himl;
}
开发者ID:mitsurugi,项目名称:CatalanitzadorPerAWindows,代码行数:46,代码来源:CheckedListView.cpp
示例12: BuildTree
static int BuildTree(HWND hwndDlg)
{
HWND hTree = GetDlgItem(hwndDlg, IDC_BUTTONORDERTREE);
OrderData *dat = (OrderData*)GetWindowLongPtr(hTree, GWLP_USERDATA);
dat->himlButtonIcons = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 2, 2);
TreeView_SetImageList(hTree, dat->himlButtonIcons, TVSIL_NORMAL);
SetWindowLongPtr(hTree, GWL_STYLE, GetWindowLongPtr(hTree,GWL_STYLE)|TVS_NOHSCROLL);
TreeView_DeleteAllItems(hTree);
if (Buttons.getCount() == 0)
return FALSE;
for (int i = 0; i < Buttons.getCount(); i++)
AddLine(hTree, Buttons[i], TVI_LAST, dat->himlButtonIcons);
return TRUE;
}
开发者ID:kmdtukl,项目名称:miranda-ng,代码行数:17,代码来源:ttbopt.cpp
示例13: MIR_APP_DLL
MIR_APP_DLL(int) Menu_AddObject(LPCSTR szName, LPCSTR szDisplayName, LPCSTR szCheckService, LPCSTR szExecService)
{
if (szName == NULL || szDisplayName == NULL)
return NULL;
mir_cslock lck(csMenuHook);
TIntMenuObject *p = new TIntMenuObject();
p->id = NextObjectId++;
p->pszName = mir_strdup(szName);
p->ptszDisplayName = mir_a2t(szDisplayName);
p->CheckService = mir_strdup(szCheckService);
p->ExecService = mir_strdup(szExecService);
p->m_hMenuIcons = ImageList_Create(g_iIconSX, g_iIconSY, ILC_COLOR32 | ILC_MASK, 15, 100);
g_menus.insert(p);
return p->id;
}
开发者ID:truefriend-cz,项目名称:miranda-ng,代码行数:17,代码来源:menu_utils.cpp
示例14: LoadModuleIcons
void LoadModuleIcons(MODULEINFO *mi)
{
HIMAGELIST hList = ImageList_Create(16, 16, ILC_COLOR32 | ILC_MASK, 0, 0);
int overlayIcon = ImageList_AddIcon(hList, GetCachedIcon("chat_overlay"));
ImageList_SetOverlayImage(hList, overlayIcon, 1);
int index = ImageList_AddIcon(hList, Skin_LoadProtoIcon(mi->pszModule, ID_STATUS_ONLINE));
mi->hOnlineIcon = ImageList_GetIcon(hList, index, ILD_TRANSPARENT);
mi->hOnlineTalkIcon = ImageList_GetIcon(hList, index, ILD_TRANSPARENT | INDEXTOOVERLAYMASK(1));
index = ImageList_AddIcon(hList, Skin_LoadProtoIcon(mi->pszModule, ID_STATUS_OFFLINE));
mi->hOfflineIcon = ImageList_GetIcon(hList, index, ILD_TRANSPARENT);
mi->hOfflineTalkIcon = ImageList_GetIcon(hList, index, ILD_TRANSPARENT | INDEXTOOVERLAYMASK(1));
ImageList_Destroy(hList);
}
开发者ID:kmdtukl,项目名称:miranda-ng,代码行数:17,代码来源:main.cpp
示例15: str
void CFolderDlg::OnInitDialog(HWND hDlg)
{
CTempStr str(IDS_ROOT_FOLDER_NAME);
ShellInitDialog(hDlg);
HWND hTreeView = GetDlgItem(hDlg, IDC_TREE_FOLDER);
m_bRefresh = FALSE;
m_hImageList = NULL;
HICON hIcon;
//イメージリスト作成
m_hImageList = ImageList_Create(SCALEX(16), SCALEY(16), ILC_COLOR|ILC_MASK, 1, 2);
hIcon = (HICON)LoadImage(GetInst(), (LPCTSTR)IDI_ROOT, IMAGE_ICON, SCALEX(16), SCALEY(16), 0);
ImageList_AddIcon(m_hImageList, hIcon);
DeleteObject(hIcon);
SHFILEINFO shfi;
SHGetFileInfo(_T("\\Windows"), NULL, &shfi, sizeof(shfi), SHGFI_SMALLICON | SHGFI_ICON);
ImageList_AddIcon(m_hImageList, shfi.hIcon);
TreeView_SetImageList(hTreeView, m_hImageList, TVSIL_NORMAL);
SetWindowLong(hTreeView, GWL_STYLE, GetWindowLong(hTreeView, GWL_STYLE)|TVS_HASBUTTONS|TVS_HASLINES|TVS_SHOWSELALWAYS);
//フォルダ読み込み
HCURSOR hCursor = SetCursor(LoadCursor(NULL, IDC_WAIT));
TVINSERTSTRUCT tvis;
tvis.hParent = NULL;
tvis.hInsertAfter = TVI_SORT;
tvis.item.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_CHILDREN;
tvis.item.pszText = str;
tvis.item.iImage = 0;
tvis.item.iSelectedImage = 0;
tvis.item.cChildren = 1;
HTREEITEM hRoot = TreeView_InsertItem(hTreeView, &tvis);
TreeView_Expand(hTreeView, hRoot, TVE_EXPAND);
//カレントフォルダをセット
SetCurrentFolder(hTreeView, m_pszPath);
if (m_bSubFolder)
SendMessage(GetDlgItem(hDlg, IDC_CHECK_SUBFOLDER), BM_SETCHECK, 1, 0);
SetCursor(hCursor);
}
开发者ID:v-zaburdaev,项目名称:Gsplayer2,代码行数:46,代码来源:FolderDlg.cpp
示例16: Create
HWND CViewToolbar::Create()
{
if ((m_hWnd = CreateWindow(TOOLBARCLASSNAME, NULL, WS_CHILD | WS_CLIPSIBLINGS | CCS_NODIVIDER | CCS_NOPARENTALIGN | TBSTYLE_FLAT | TBSTYLE_LIST, 0, 0, 0, 0, m_hWndParent, NULL, g_hInstance, NULL)) == NULL)
return NULL;
HBITMAP hBitmap;
if ((hBitmap = LoadBitmap(g_hInstance, MAKEINTRESOURCE(IDB_VIEW_TOOLBAR))) == NULL)
return NULL;
if ((m_hImageList = ImageList_Create(16, 16, ILC_COLOR32 | ILC_MASK, MAX_VIEW_TOOLBAR_ICONS, 0)) == NULL)
{
DeleteObject(hBitmap);
return NULL;
}
if (ImageList_AddMasked(m_hImageList, hBitmap, RGB(0, 0, 0)) == -1)
{
DeleteObject(hBitmap);
return NULL;
}
DeleteObject(hBitmap);
SendMessage(m_hWnd, TB_SETIMAGELIST, 0, (LPARAM)m_hImageList);
TBBUTTON tbb[MAX_CATEGORIES];
for (int i = 0; i < MAX_CATEGORIES; i++)
{
tbb[i].iBitmap = iIcons[i];
tbb[i].idCommand = uCommands[i];
tbb[i].fsState = TBSTATE_ENABLED;
tbb[i].fsStyle = TBSTYLE_AUTOSIZE | TBSTYLE_CHECKGROUP;
tbb[i].dwData = 0;
tbb[i].iString = -1;
}
tbb[0].fsState |= TBSTATE_CHECKED;
if (!SendMessage(m_hWnd, TB_ADDBUTTONS, MAX_CATEGORIES, (LPARAM)tbb))
return NULL;
for (int i = 0; i < MAX_CATEGORIES; i++)
{
m_nCounts[i] = -1;
LoadString(g_hInstance, ID_VIEW_ALL + i, m_szFormats[i], MAX_CAPTION);
}
UpdateTexts();
return m_hWnd;
}
开发者ID:feng1st,项目名称:md5checker,代码行数:45,代码来源:ViewToolbar.cpp
示例17: PopulateImageList
static void PopulateImageList(HIMAGELIST *iList, HWND list)
{
struct gphoto2_file *file;
HWND progress_dialog;
progress_dialog =
CreateDialogW(GPHOTO2_instance,(LPWSTR)MAKEINTRESOURCE(IDD_CONNECTING),
NULL, ConnectingProc);
LIST_FOR_EACH_ENTRY( file, &activeDS.files, struct gphoto2_file, entry)
{
if (strstr(file->filename,".JPG") || strstr(file->filename,".jpg"))
{
HBITMAP bitmap;
BITMAP bmpInfo;
#ifdef HAVE_GPHOTO2
_get_gphoto2_file_as_DIB(file->folder, file->filename,
GP_FILE_TYPE_PREVIEW, 0, &bitmap);
#else
bitmap = 0;
#endif
GetObjectA(bitmap,sizeof(BITMAP),&bmpInfo);
if (*iList == 0)
{
*iList = ImageList_Create(bmpInfo.bmWidth,
bmpInfo.bmHeight,ILC_COLOR24, 10,10);
SendMessageW(list, LVM_SETICONSPACING, 0,
MAKELONG(bmpInfo.bmWidth+6, bmpInfo.bmHeight+15) );
}
ImageList_Add(*iList, bitmap, 0);
DeleteObject(static_bitmap);
static_bitmap = bitmap;
SendMessageW(GetDlgItem(progress_dialog,IDC_BITMAP),STM_SETIMAGE,
IMAGE_BITMAP, (LPARAM)static_bitmap);
RedrawWindow(progress_dialog,NULL,NULL,RDW_INTERNALPAINT|RDW_UPDATENOW|RDW_ALLCHILDREN);
}
}
EndDialog(progress_dialog,0);
}
开发者ID:AlexSteel,项目名称:wine,代码行数:45,代码来源:ui.c
示例18: CreateWindowEx
BOOL CNdbTreeView::CreateTreeView(HINSTANCE hInst, HWND hParent, DWORD dwId) {
m_hInstance = hInst ;
m_hParent = hParent ;
m_dwId = dwId ;
HIMAGELIST himl ;
HBITMAP hbmp ;
DWORD dwCount = 0 ;
m_hControl = CreateWindowEx(WS_EX_OVERLAPPEDWINDOW, WC_TREEVIEW, "Tree View",
WS_VISIBLE | WS_CHILD | WS_BORDER | TVS_HASLINES |
TVS_HASBUTTONS | TVS_LINESATROOT | TVS_SINGLEEXPAND,
0, 0, 0, 0, m_hParent, (HMENU)m_dwId, m_hInstance, NULL) ;
if(!m_hControl)
return FALSE ;
if((himl = ImageList_Create(nX, nY, ILC_MASK | ILC_COLOR8, 4, 0)) == NULL)
return FALSE ;
hbmp = LoadBitmap(m_hInstance, MAKEINTRESOURCE(IDI_OPEN));
hbmp = (HBITMAP)LoadImage(m_hInstance, MAKEINTRESOURCE(IDB_OPEN), IMAGE_BITMAP, nX, 0, LR_DEFAULTSIZE);
m_nOpen = ImageList_AddMasked(himl, hbmp, clr);
DeleteObject(hbmp);
hbmp = (HBITMAP)LoadImage(m_hInstance, MAKEINTRESOURCE(IDB_CLOSED), IMAGE_BITMAP, 0, 0, LR_DEFAULTSIZE);
m_nClosed = ImageList_AddMasked(himl, hbmp, clr);
DeleteObject(hbmp);
hbmp = (HBITMAP)LoadImage(m_hInstance, MAKEINTRESOURCE(IDB_COMPUTER),IMAGE_BITMAP, 0, 0, LR_DEFAULTSIZE);
m_nComputer = ImageList_AddMasked(himl, hbmp, clr);
DeleteObject(hbmp);
hbmp = (HBITMAP)LoadImage(m_hInstance, MAKEINTRESOURCE(IDB_DATABASE), IMAGE_BITMAP, 0, 0, LR_DEFAULTSIZE);
m_nDatabase = ImageList_AddMasked(himl, hbmp, clr);
DeleteObject(hbmp);
if(ImageList_GetImageCount(himl) < 4)
return FALSE ;
TreeView_SetImageList(m_hControl, himl, TVSIL_NORMAL);
ShowWindow(m_hControl, SW_SHOW) ;
return TRUE ;
}
开发者ID:fengshao0907,项目名称:TMySQL,代码行数:45,代码来源:NdbControls.cpp
示例19: ImageList_Create
void Manager::initImageList()
{
char buff[256];
m_himlStates = ImageList_Create(16, 16, ILC_COLOR32 | ILC_MASK, ServerList::FTP_COUNT + 4, 0);
ImageList_AddIcon(m_himlStates, Skin_LoadIcon(SKINICON_OTHER_DELETE)); // image index 0 is useless for INDEXTOSTATEIMAGEMASK
ImageList_AddIcon(m_himlStates, Skin_LoadIcon(SKINICON_OTHER_DELETE));
ImageList_AddIcon(m_himlStates, Skin_LoadIcon(SKINICON_OTHER_NOTICK));
ImageList_AddIcon(m_himlStates, Skin_LoadIcon(SKINICON_OTHER_TICK));
for (int i = 0; i < ServerList::FTP_COUNT; i++) {
mir_snprintf(buff, "ftp%d", i);
ImageList_AddIcon(m_himlStates, Utils::loadIconEx(buff));
}
TreeView_SetImageList(m_hwndFileTree, m_himlStates, TVSIL_STATE);
TreeView_SetItemHeight(m_hwndFileTree, 18);
}
开发者ID:Seldom,项目名称:miranda-ng,代码行数:18,代码来源:manager.cpp
示例20: CreateStackWindow
HWND CreateStackWindow(void)
{
if (hwndStack)
{
SendMessage(hwndStack, WM_SETFOCUS, 0, 0);
}
else
{
HBITMAP bitmap;
bitmap = LoadBitmap(hInstance, "ID_TAG");
ChangeBitmapColor(bitmap, 0xc0c0c0, RetrieveSysColor(COLOR_WINDOW));
tagImageList = ImageList_Create(16, 16, ILC_COLOR24, ILEDIT_IMAGECOUNT, 0);
ImageList_Add(tagImageList, bitmap, NULL);
DeleteObject(bitmap);
hwndStack = CreateDockableWindow(DID_STACKWND, szStackClassName, szStackTitle, hInstance, 30 * 8, 19 * 8);
}
return hwndStack;
}
开发者ID:doniexun,项目名称:OrangeC,代码行数:18,代码来源:dbgstack.c
注:本文中的ImageList_Create函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论