diff --git a/dlls/comctl32/commctrl.c b/dlls/comctl32/commctrl.c index e18c27d5d45..97656a5fbe4 100644 --- a/dlls/comctl32/commctrl.c +++ b/dlls/comctl32/commctrl.c @@ -3,6 +3,7 @@ * * Copyright 1997 Dimitrie O. Paun * Copyright 1998,2000 Eric Kohl + * Copyright 2014-2015 Michael Müller * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -1641,8 +1642,19 @@ HRESULT WINAPI TaskDialogIndirect(const TASKDIALOGCONFIG *pTaskConfig, int *pnBu /*********************************************************************** * LoadIconWithScaleDown [COMCTL32.@] */ -HRESULT WINAPI LoadIconWithScaleDown(HINSTANCE hinst, PCWSTR name, int cx, int cy, HICON *icon) +HRESULT WINAPI LoadIconWithScaleDown(HINSTANCE hinst, const WCHAR *name, int cx, int cy, HICON *icon) { - FIXME("stub: %p %s %d %d %p\n", hinst, wine_dbgstr_w(name), cx, cy, icon); - return E_NOTIMPL; + TRACE("(%p, %s, %d, %d, %p)\n", hinst, debugstr_w(name), cx, cy, icon); + + *icon = NULL; + + if (!name) + return E_INVALIDARG; + + *icon = LoadImageW(hinst, name, IMAGE_ICON, cx, cy, + (hinst || IS_INTRESOURCE(name)) ? 0 : LR_LOADFROMFILE); + if (!*icon) + return HRESULT_FROM_WIN32(GetLastError()); + + return S_OK; } diff --git a/include/commctrl.h b/include/commctrl.h index 0bcaeb68063..0ed09972571 100644 --- a/include/commctrl.h +++ b/include/commctrl.h @@ -42,7 +42,7 @@ BOOL WINAPI InitCommonControlsEx (const INITCOMMONCONTROLSEX*); LANGID WINAPI GetMUILanguage (VOID); VOID WINAPI InitMUILanguage (LANGID uiLang); -HRESULT WINAPI LoadIconWithScaleDown(HINSTANCE, PCWSTR, int, int, HICON *); +HRESULT WINAPI LoadIconWithScaleDown(HINSTANCE, const WCHAR *, int, int, HICON *); #define COMCTL32_VERSION 5 /* dll version */