Remove iconcache pre-initialization hack, it's not necessary any

more.
This commit is contained in:
Michael Jung 2005-10-27 12:08:44 +00:00 committed by Alexandre Julliard
parent bec54e7c4c
commit d699222eae
1 changed files with 18 additions and 30 deletions

View File

@ -351,17 +351,7 @@ INT SIC_GetIconIndex (LPCWSTR sSourceFile, INT dwSourceIndex, DWORD dwFlags )
if ( INVALID_INDEX == index )
{
if (0 == strcmpiW (sSourceFile, swShell32Name) &&
-IDI_SHELL_MY_DOCUMENTS <= dwSourceIndex &&
dwSourceIndex < IDI_SHELL_MY_DOCUMENTS)
{
/* Return default icon for icons not present in shell32 */
ret = 0;
}
else
{
ret = SIC_LoadIcon (sSourceFile, dwSourceIndex, dwFlags);
}
ret = SIC_LoadIcon (sSourceFile, dwSourceIndex, dwFlags);
}
else
{
@ -374,15 +364,10 @@ INT SIC_GetIconIndex (LPCWSTR sSourceFile, INT dwSourceIndex, DWORD dwFlags )
}
/*****************************************************************************
* SIC_Initialize [internal]
*
* NOTES
* hack to load the resources from the shell32.dll under a different dll name
* will be removed when the resource-compiler is ready
*/
BOOL SIC_Initialize(void)
{
HICON hSm, hLg;
UINT index;
int cx_small, cy_small;
int cx_large, cy_large;
@ -403,24 +388,27 @@ BOOL SIC_Initialize(void)
return(FALSE);
}
ShellSmallIconList = ImageList_Create(16,16,ILC_COLOR32|ILC_MASK,0,0x20);
ShellBigIconList = ImageList_Create(32,32,ILC_COLOR32|ILC_MASK,0,0x20);
ShellSmallIconList = ImageList_Create(cx_small,cy_small,ILC_COLOR32|ILC_MASK,0,0x20);
ShellBigIconList = ImageList_Create(cx_large,cy_large,ILC_COLOR32|ILC_MASK,0,0x20);
ImageList_SetBkColor(ShellSmallIconList, CLR_NONE);
ImageList_SetBkColor(ShellBigIconList, CLR_NONE);
ImageList_SetBkColor(ShellSmallIconList, CLR_NONE);
ImageList_SetBkColor(ShellBigIconList, CLR_NONE);
for (index=1; index<=IDI_SHELL_MY_DOCUMENTS; index++)
{
hSm = (HICON)LoadImageA(shell32_hInstance, MAKEINTRESOURCEA(index), IMAGE_ICON, cx_small, cy_small, LR_SHARED);
hLg = (HICON)LoadImageA(shell32_hInstance, MAKEINTRESOURCEA(index), IMAGE_ICON, cx_large, cy_large, LR_SHARED);
/* Load the document icon, which is used as the default if an icon isn't found. */
hSm = (HICON)LoadImageA(shell32_hInstance, MAKEINTRESOURCEA(IDI_SHELL_DOCUMENT),
IMAGE_ICON, cx_small, cy_small, LR_SHARED);
hLg = (HICON)LoadImageA(shell32_hInstance, MAKEINTRESOURCEA(IDI_SHELL_DOCUMENT),
IMAGE_ICON, cx_large, cy_large, LR_SHARED);
if(hSm)
{
SIC_IconAppend (swShell32Name, index - 1, hSm, hLg, 0);
SIC_IconAppend (swShell32Name, -index, hSm, hLg, 0);
}
}
if (!hSm || !hLg)
{
FIXME("Failed to load IDI_SHELL_DOCUMENT icon!\n");
return FALSE;
}
SIC_IconAppend (swShell32Name, IDI_SHELL_DOCUMENT-1, hSm, hLg, 0);
SIC_IconAppend (swShell32Name, -IDI_SHELL_DOCUMENT, hSm, hLg, 0);
TRACE("hIconSmall=%p hIconBig=%p\n",ShellSmallIconList, ShellBigIconList);
return TRUE;