mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 13:16:07 +00:00
[SHELL32]
* Apply Wine commit e330a128 by Alexandre Julliard: Use Shell_GetImageLists to retrieve image lists instead of using a global variable. CORE-8540 svn path=/branches/shell-experiments/; revision=65222
This commit is contained in:
parent
3a9653d24e
commit
e24032eb8c
6 changed files with 20 additions and 12 deletions
|
@ -125,17 +125,20 @@ HRESULT WINAPI CPrintersExtractIconW::Extract(LPCWSTR pszFile,
|
||||||
HICON *phiconSmall, UINT nIconSize)
|
HICON *phiconSmall, UINT nIconSize)
|
||||||
{
|
{
|
||||||
int index;
|
int index;
|
||||||
|
HIMAGELIST big_icons, small_icons;
|
||||||
|
|
||||||
FIXME("(%p) (file=%p index=%d %p %p size=%x) semi-stub\n", this, debugstr_w(pszFile),
|
FIXME("(%p) (file=%p index=%d %p %p size=%x) semi-stub\n", this, debugstr_w(pszFile),
|
||||||
(signed)nIconIndex, phiconLarge, phiconSmall, nIconSize);
|
(signed)nIconIndex, phiconLarge, phiconSmall, nIconSize);
|
||||||
|
|
||||||
index = SIC_GetIconIndex(pszFile, nIconIndex, 0);
|
index = SIC_GetIconIndex(pszFile, nIconIndex, 0);
|
||||||
|
|
||||||
|
Shell_GetImageLists(&big_icons, &small_icons);
|
||||||
|
|
||||||
if (phiconLarge)
|
if (phiconLarge)
|
||||||
*phiconLarge = ImageList_GetIcon(ShellBigIconList, index, ILD_TRANSPARENT);
|
*phiconLarge = ImageList_GetIcon(big_icons, index, ILD_TRANSPARENT);
|
||||||
|
|
||||||
if (phiconSmall)
|
if (phiconSmall)
|
||||||
*phiconSmall = ImageList_GetIcon(ShellSmallIconList, index, ILD_TRANSPARENT);
|
*phiconSmall = ImageList_GetIcon(small_icons, index, ILD_TRANSPARENT);
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,6 +37,9 @@ typedef struct
|
||||||
|
|
||||||
static HDPA sic_hdpa = 0;
|
static HDPA sic_hdpa = 0;
|
||||||
|
|
||||||
|
static HIMAGELIST ShellSmallIconList;
|
||||||
|
static HIMAGELIST ShellBigIconList;
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
extern CRITICAL_SECTION SHELL32_SicCS;
|
extern CRITICAL_SECTION SHELL32_SicCS;
|
||||||
|
|
|
@ -233,8 +233,6 @@ STDAPI DllGetVersion(DLLVERSIONINFO *pdvi)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
HINSTANCE shell32_hInstance;
|
HINSTANCE shell32_hInstance;
|
||||||
HIMAGELIST ShellSmallIconList = 0;
|
|
||||||
HIMAGELIST ShellBigIconList = 0;
|
|
||||||
|
|
||||||
void *operator new (size_t, void *buf)
|
void *operator new (size_t, void *buf)
|
||||||
{
|
{
|
||||||
|
|
|
@ -587,6 +587,7 @@ BOOL CDefView::InitList()
|
||||||
{
|
{
|
||||||
SHELLDETAILS sd;
|
SHELLDETAILS sd;
|
||||||
WCHAR szTemp[50];
|
WCHAR szTemp[50];
|
||||||
|
HIMAGELIST big_icons, small_icons;
|
||||||
|
|
||||||
TRACE("%p\n", this);
|
TRACE("%p\n", this);
|
||||||
|
|
||||||
|
@ -608,8 +609,9 @@ BOOL CDefView::InitList()
|
||||||
FIXME("no SF2\n");
|
FIXME("no SF2\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
m_ListView.SetImageList(ShellBigIconList, LVSIL_NORMAL);
|
Shell_GetImageLists(&big_icons, &small_icons);
|
||||||
m_ListView.SetImageList(ShellSmallIconList, LVSIL_SMALL);
|
m_ListView.SetImageList(big_icons, LVSIL_NORMAL);
|
||||||
|
m_ListView.SetImageList(small_icons, LVSIL_SMALL);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -419,6 +419,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
|
||||||
HRESULT hr = S_OK;
|
HRESULT hr = S_OK;
|
||||||
BOOL IconNotYetLoaded=TRUE;
|
BOOL IconNotYetLoaded=TRUE;
|
||||||
UINT uGilFlags = 0;
|
UINT uGilFlags = 0;
|
||||||
|
HIMAGELIST big_icons, small_icons;
|
||||||
|
|
||||||
TRACE("%s fattr=0x%x sfi=%p(attr=0x%08x) size=0x%x flags=0x%x\n",
|
TRACE("%s fattr=0x%x sfi=%p(attr=0x%08x) size=0x%x flags=0x%x\n",
|
||||||
(flags & SHGFI_PIDL)? "pidl" : debugstr_w(path), dwFileAttributes,
|
(flags & SHGFI_PIDL)? "pidl" : debugstr_w(path), dwFileAttributes,
|
||||||
|
@ -557,6 +558,9 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ### icons ###*/
|
/* ### icons ###*/
|
||||||
|
|
||||||
|
Shell_GetImageLists( &big_icons, &small_icons );
|
||||||
|
|
||||||
if (flags & SHGFI_OPENICON)
|
if (flags & SHGFI_OPENICON)
|
||||||
uGilFlags |= GIL_OPENICON;
|
uGilFlags |= GIL_OPENICON;
|
||||||
|
|
||||||
|
@ -701,9 +705,9 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
|
||||||
if (ret && (flags & SHGFI_SYSICONINDEX))
|
if (ret && (flags & SHGFI_SYSICONINDEX))
|
||||||
{
|
{
|
||||||
if (flags & SHGFI_SMALLICON)
|
if (flags & SHGFI_SMALLICON)
|
||||||
ret = (DWORD_PTR) ShellSmallIconList;
|
ret = (DWORD_PTR)small_icons;
|
||||||
else
|
else
|
||||||
ret = (DWORD_PTR) ShellBigIconList;
|
ret = (DWORD_PTR)big_icons;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -711,9 +715,9 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
|
||||||
if (SUCCEEDED(hr) && (flags & SHGFI_ICON) && IconNotYetLoaded)
|
if (SUCCEEDED(hr) && (flags & SHGFI_ICON) && IconNotYetLoaded)
|
||||||
{
|
{
|
||||||
if (flags & SHGFI_SMALLICON)
|
if (flags & SHGFI_SMALLICON)
|
||||||
psfi->hIcon = ImageList_GetIcon( ShellSmallIconList, psfi->iIcon, ILD_NORMAL);
|
psfi->hIcon = ImageList_GetIcon( small_icons, psfi->iIcon, ILD_NORMAL);
|
||||||
else
|
else
|
||||||
psfi->hIcon = ImageList_GetIcon( ShellBigIconList, psfi->iIcon, ILD_NORMAL);
|
psfi->hIcon = ImageList_GetIcon( big_icons, psfi->iIcon, ILD_NORMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flags & ~SHGFI_KNOWN_FLAGS)
|
if (flags & ~SHGFI_KNOWN_FLAGS)
|
||||||
|
|
|
@ -31,8 +31,6 @@ extern "C" {
|
||||||
*/
|
*/
|
||||||
extern HMODULE huser32;
|
extern HMODULE huser32;
|
||||||
extern HINSTANCE shell32_hInstance;
|
extern HINSTANCE shell32_hInstance;
|
||||||
extern HIMAGELIST ShellSmallIconList;
|
|
||||||
extern HIMAGELIST ShellBigIconList;
|
|
||||||
|
|
||||||
BOOL WINAPI Shell_GetImageLists(HIMAGELIST * lpBigList, HIMAGELIST * lpSmallList);
|
BOOL WINAPI Shell_GetImageLists(HIMAGELIST * lpBigList, HIMAGELIST * lpSmallList);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue