[2/3] comctl32: Add implementation for LoadIconMetric.

Sebastian Lackner sebastian at fds-team.de
Fri Oct 2 08:13:05 CDT 2015


From: Michael Müller <michael at fds-team.de>

Signed-off-by: Michael Müller <michael at fds-team.de>
Signed-off-by: Sebastian Lackner <sebastian at fds-team.de>
---
 dlls/comctl32/comctl32.spec |    1 +
 dlls/comctl32/commctrl.c    |   28 ++++++++++++++++++++++++++++
 include/commctrl.h          |    7 +++++++
 3 files changed, 36 insertions(+)

diff --git a/dlls/comctl32/comctl32.spec b/dlls/comctl32/comctl32.spec
index 1e92e5f..1a5ab57 100644
--- a/dlls/comctl32/comctl32.spec
+++ b/dlls/comctl32/comctl32.spec
@@ -88,6 +88,7 @@
 375 stdcall -noname -private StrCSpnIW(wstr wstr)
 376 stdcall -noname -private IntlStrEqWorkerA(long str str long)
 377 stdcall -noname -private IntlStrEqWorkerW(long wstr wstr long)
+380 stdcall -ordinal LoadIconMetric(ptr wstr long ptr)
 381 stdcall -ordinal LoadIconWithScaleDown(ptr wstr long long ptr)
 382 stdcall -noname SmoothScrollWindow(ptr)
 383 stub -noname DoReaderMode
diff --git a/dlls/comctl32/commctrl.c b/dlls/comctl32/commctrl.c
index 97656a5..6d6b5e4 100644
--- a/dlls/comctl32/commctrl.c
+++ b/dlls/comctl32/commctrl.c
@@ -1658,3 +1658,31 @@ HRESULT WINAPI LoadIconWithScaleDown(HINSTANCE hinst, const WCHAR *name, int cx,
 
     return S_OK;
 }
+
+/***********************************************************************
+ * LoadIconMetric [COMCTL32.@]
+ */
+HRESULT WINAPI LoadIconMetric(HINSTANCE hinst, const WCHAR *name, int size, HICON *icon)
+{
+    int cx, cy;
+
+    TRACE("(%p, %s, %d, %p)\n", hinst, debugstr_w(name), size, icon);
+
+    if (size == LIM_SMALL)
+    {
+        cx = GetSystemMetrics(SM_CXSMICON);
+        cy = GetSystemMetrics(SM_CYSMICON);
+    }
+    else if (size == LIM_LARGE)
+    {
+        cx = GetSystemMetrics(SM_CXICON);
+        cy = GetSystemMetrics(SM_CYICON);
+    }
+    else
+    {
+        *icon = NULL;
+        return E_INVALIDARG;
+    }
+
+    return LoadIconWithScaleDown(hinst, name, cx, cy, icon);
+}
diff --git a/include/commctrl.h b/include/commctrl.h
index 0ed0997..5029e77 100644
--- a/include/commctrl.h
+++ b/include/commctrl.h
@@ -42,7 +42,14 @@ BOOL WINAPI InitCommonControlsEx (const INITCOMMONCONTROLSEX*);
 LANGID WINAPI GetMUILanguage (VOID);
 VOID WINAPI InitMUILanguage (LANGID uiLang);
 
+enum _LI_METRIC
+{
+    LIM_SMALL,
+    LIM_LARGE
+};
+
 HRESULT WINAPI LoadIconWithScaleDown(HINSTANCE, const WCHAR *, int, int, HICON *);
+HRESULT WINAPI LoadIconMetric(HINSTANCE, const WCHAR *, int, HICON *);
 
 #define COMCTL32_VERSION                5  /* dll version */
 
-- 
2.5.1



More information about the wine-patches mailing list