From dc60324d9a14c38e22ba644d53db1f0f74246806 Mon Sep 17 00:00:00 2001 From: Carlos Lozano Date: Wed, 30 Oct 2002 23:39:32 +0000 Subject: [PATCH] Fixed SHGFI_SYSICONINDEX flag handling. --- dlls/shell32/shell32_main.c | 22 +++++++++++++++------- dlls/shell32/shell32_main.h | 1 + 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/dlls/shell32/shell32_main.c b/dlls/shell32/shell32_main.c index ae4a6002d62..e6645fa596e 100644 --- a/dlls/shell32/shell32_main.c +++ b/dlls/shell32/shell32_main.c @@ -410,13 +410,21 @@ DWORD WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes, { if (!strcmp("%1",sTemp)) /* icon is in the file */ strcpy(sTemp, path); - - IconNotYetLoaded=FALSE; - /* FIXME: is it working correctly? */ - PrivateExtractIconsA(sTemp,dwNr,(flags&SHGFI_LARGEICON) ? - GetSystemMetrics(SM_CXICON) : GetSystemMetrics(SM_CXSMICON), - (flags&SHGFI_LARGEICON) ? GetSystemMetrics(SM_CYICON) : - GetSystemMetrics(SM_CYSMICON), &psfi->hIcon,0,1,0); + + if (flags & SHGFI_SYSICONINDEX) + { + psfi->iIcon = SIC_GetIconIndex(sTemp,dwNr); + if (psfi->iIcon == -1) psfi->iIcon = 0; + } + else + { + IconNotYetLoaded=FALSE; + PrivateExtractIconsA(sTemp,dwNr,(flags&SHGFI_LARGEICON) ? + GetSystemMetrics(SM_CXICON) : GetSystemMetrics(SM_CXSMICON), + (flags&SHGFI_LARGEICON) ? GetSystemMetrics(SM_CYICON) : + GetSystemMetrics(SM_CYSMICON), &psfi->hIcon,0,1,0); + psfi->iIcon = dwNr; + } } } } diff --git a/dlls/shell32/shell32_main.h b/dlls/shell32/shell32_main.h index b97bb1a447e..aa3dc1ed93a 100644 --- a/dlls/shell32/shell32_main.h +++ b/dlls/shell32/shell32_main.h @@ -54,6 +54,7 @@ BOOL WINAPI Shell_GetImageList(HIMAGELIST * lpBigList, HIMAGELIST * lpSmallList) BOOL SIC_Initialize(void); void SIC_Destroy(void); BOOL PidlToSicIndex (IShellFolder * sh, LPITEMIDLIST pidl, BOOL bBigIcon, UINT uFlags, UINT * pIndex); +INT SIC_GetIconIndex (LPCSTR sSourceFile, INT dwSourceIndex ); /* Classes Root */ BOOL HCR_MapTypeToValue ( LPCSTR szExtension, LPSTR szFileType, DWORD len, BOOL bPrependDot);