Commit 6eeb389d authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

explorer: Don't alter the shell imagelist.

parent 2b79436a
...@@ -105,42 +105,43 @@ static ULONG WINAPI IExplorerBrowserEventsImpl_fnRelease(IExplorerBrowserEvents ...@@ -105,42 +105,43 @@ static ULONG WINAPI IExplorerBrowserEventsImpl_fnRelease(IExplorerBrowserEvents
return ref; return ref;
} }
static BOOL create_combobox_item(IShellFolder *folder, LPCITEMIDLIST pidl, IImageList *icon_list, COMBOBOXEXITEMW *item) static BOOL create_combobox_item(IShellFolder *folder, LPCITEMIDLIST child_pidl, IImageList *icon_list, COMBOBOXEXITEMW *item)
{ {
STRRET strret; STRRET strret;
HRESULT hres; HRESULT hres;
IExtractIconW *extract_icon; PIDLIST_ABSOLUTE parent_pidl, pidl;
UINT reserved; SHFILEINFOW info;
WCHAR icon_file[MAX_PATH]; IImageList *list;
INT icon_index;
UINT icon_flags;
HICON icon;
strret.uType=STRRET_WSTR; strret.uType=STRRET_WSTR;
hres = IShellFolder_GetDisplayNameOf(folder,pidl,SHGDN_FORADDRESSBAR,&strret); hres = IShellFolder_GetDisplayNameOf( folder, child_pidl, SHGDN_FORADDRESSBAR, &strret );
if(SUCCEEDED(hres)) if(SUCCEEDED(hres))
hres = StrRetToStrW(&strret, pidl, &item->pszText); hres = StrRetToStrW(&strret, child_pidl, &item->pszText);
if(FAILED(hres)) if(FAILED(hres))
{ {
WINE_WARN("Could not get name for pidl\n"); WINE_WARN("Could not get name for pidl\n");
return FALSE; return FALSE;
} }
hres = IShellFolder_GetUIObjectOf(folder,NULL,1,&pidl,&IID_IExtractIconW,
&reserved,(void**)&extract_icon); item->mask &= ~CBEIF_IMAGE;
if(SUCCEEDED(hres)) hres = SHGetIDListFromObject( (IUnknown *)folder, &parent_pidl );
{ if (FAILED(hres)) return FALSE;
item->mask |= CBEIF_IMAGE;
IExtractIconW_GetIconLocation(extract_icon,GIL_FORSHELL,icon_file, pidl = ILCombine( parent_pidl, child_pidl );
sizeof(icon_file)/sizeof(WCHAR), if (pidl)
&icon_index,&icon_flags);
IExtractIconW_Extract(extract_icon,icon_file,icon_index,NULL,&icon,20);
item->iImage = ImageList_AddIcon((HIMAGELIST)icon_list,icon);
IExtractIconW_Release(extract_icon);
}
else
{ {
item->mask &= ~CBEIF_IMAGE; list = (IImageList *)SHGetFileInfoW( (WCHAR *)pidl, 0, &info, sizeof(info),
WINE_WARN("Could not get an icon for %s\n",wine_dbgstr_w(item->pszText)); SHGFI_PIDL | SHGFI_SMALLICON | SHGFI_SYSICONINDEX );
if (list)
{
IImageList_Release( list );
item->iImage = info.iIcon;
item->mask |= CBEIF_IMAGE;
}
ILFree( pidl );
} }
ILFree( parent_pidl );
return TRUE; return TRUE;
} }
...@@ -153,7 +154,6 @@ static void update_path_box(explorer_info *info) ...@@ -153,7 +154,6 @@ static void update_path_box(explorer_info *info)
LPITEMIDLIST desktop_pidl; LPITEMIDLIST desktop_pidl;
IEnumIDList *ids; IEnumIDList *ids;
ImageList_Remove((HIMAGELIST)info->icon_list,-1);
SendMessageW(info->path_box,CB_RESETCONTENT,0,0); SendMessageW(info->path_box,CB_RESETCONTENT,0,0);
SHGetDesktopFolder(&desktop); SHGetDesktopFolder(&desktop);
IShellFolder_QueryInterface(desktop,&IID_IPersistFolder2,(void**)&persist); IShellFolder_QueryInterface(desktop,&IID_IPersistFolder2,(void**)&persist);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment