Add SHDefExtractIcon{AW} function.

oldstable
Rolf Kalbermatter 2002-12-07 23:49:24 +00:00 committed by Alexandre Julliard
parent 263cdcd88a
commit 418ca6d1b0
3 changed files with 55 additions and 0 deletions

View File

@ -534,3 +534,44 @@ HICON WINAPI ExtractAssociatedIconExA(HINSTANCE hInst, LPSTR lpIconPath, LPWORD
HeapFree(GetProcessHeap(), 0, lpwstrFile);
return ret;
}
/****************************************************************************
* SHDefExtractIconW [SHELL32.@]
*/
HRESULT WINAPI SHDefExtractIconW(LPCWSTR pszIconFile, int iIndex, UINT uFlags,
HICON* phiconLarge, HICON* phiconSmall, UINT nIconSize)
{
UINT ret;
HICON hIcons[2];
WARN("%s %d 0x%08x %p %p %d, semi-stub\n", debugstr_w(pszIconFile), iIndex, uFlags, phiconLarge, phiconSmall, nIconSize);
ret = PrivateExtractIconsW(pszIconFile, iIndex, nIconSize, nIconSize, hIcons, NULL, 2, LR_DEFAULTCOLOR);
/* FIXME: deal with uFlags parameter which contains GIL_ flags */
if (ret == 0xFFFFFFFF)
return E_FAIL;
if (ret > 0) {
*phiconLarge = hIcons[0];
*phiconSmall = hIcons[1];
return S_OK;
}
return S_FALSE;
}
/****************************************************************************
* SHDefExtractIconA [SHELL32.@]
*/
HRESULT WINAPI SHDefExtractIconA(LPCSTR pszIconFile, int iIndex, UINT uFlags,
HICON* phiconLarge, HICON* phiconSmall, UINT nIconSize)
{
HRESULT ret;
INT len = MultiByteToWideChar(CP_ACP, 0, pszIconFile, -1, NULL, 0);
LPWSTR lpwstrFile = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
TRACE("%s %d 0x%08x %p %p %d\n", pszIconFile, iIndex, uFlags, phiconLarge, phiconSmall, nIconSize);
MultiByteToWideChar(CP_ACP, 0, pszIconFile, -1, lpwstrFile, len);
ret = SHDefExtractIconW(lpwstrFile, iIndex, uFlags, phiconLarge, phiconSmall, nIconSize);
HeapFree(GetProcessHeap(), 0, lpwstrFile);
return ret;
}

View File

@ -411,3 +411,8 @@
@ stdcall SHGetFolderPathA(long long long long ptr)SHGetFolderPathA
@ stdcall SHGetFolderPathW(long long long long ptr)SHGetFolderPathW
@ stdcall SHGetFolderLocation(long long long long ptr)SHGetFolderLocation
# version 6.0 (WinXP)
# _WIN32_IE >= 0x600
@ stdcall SHDefExtractIconA(str long long ptr ptr long) SHDefExtractIconA
@ stdcall SHDefExtractIconW(wstr long long ptr ptr long) SHDefExtractIconW

View File

@ -569,6 +569,15 @@ HRESULT WINAPI SHGetSpecialFolderLocation(HWND, INT, LPITEMIDLIST *);
#define CSIDL_FLAG_MASK 0xff00
/****************************************************************************
* SHDefExtractIcon API
*/
HRESULT WINAPI SHDefExtractIconA(LPCSTR pszIconFile, int iIndex, UINT uFlags,
HICON* phiconLarge, HICON* phiconSmall, UINT nIconSize);
HRESULT WINAPI SHDefExtractIconW(LPCWSTR pszIconFile, int iIndex, UINT uFlags,
HICON* phiconLarge, HICON* phiconSmall, UINT nIconSize);
#define SHDefExtractIcon WINELIB_NAME_AW(SHDefExtractIcon)
/*
* DROPFILES for CF_HDROP and CF_PRINTERS
*/