Add SHDefExtractIcon{AW} function.
This commit is contained in:
parent
263cdcd88a
commit
418ca6d1b0
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue