2015-07-25 17:18:47 -07:00
|
|
|
From 74254e3904454c5d088bf400d3d58107aa2b138b Mon Sep 17 00:00:00 2001
|
2014-08-06 17:00:57 -07:00
|
|
|
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
|
|
|
Date: Thu, 7 Aug 2014 01:41:25 +0200
|
|
|
|
Subject: comctl32: Implement LoadIconMetric function.
|
|
|
|
|
2015-07-24 01:17:26 -07:00
|
|
|
Changes by Alistair Leslie-Hughes:
|
|
|
|
* Moved LoadIconMetric to commctrl.c
|
|
|
|
* Changed INT, PCWSTR type
|
|
|
|
* Added function to include/commctrl.h
|
2014-08-06 17:00:57 -07:00
|
|
|
---
|
|
|
|
dlls/comctl32/comctl32.spec | 1 +
|
2015-07-25 17:18:47 -07:00
|
|
|
dlls/comctl32/commctrl.c | 40 ++++++++++++++++++++++++++++++++++++++++
|
2015-07-24 01:17:26 -07:00
|
|
|
include/commctrl.h | 7 +++++++
|
2015-07-25 17:18:47 -07:00
|
|
|
3 files changed, 48 insertions(+)
|
2014-08-06 17:00:57 -07:00
|
|
|
|
|
|
|
diff --git a/dlls/comctl32/comctl32.spec b/dlls/comctl32/comctl32.spec
|
2015-07-24 01:17:26 -07:00
|
|
|
index 1e92e5f..e61dfbf 100644
|
2014-08-06 17:00:57 -07:00
|
|
|
--- 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 LoadIconMetric(ptr wstr long ptr)
|
2014-12-15 13:50:30 -08:00
|
|
|
381 stdcall -ordinal LoadIconWithScaleDown(ptr wstr long long ptr)
|
2014-08-06 17:00:57 -07:00
|
|
|
382 stdcall -noname SmoothScrollWindow(ptr)
|
|
|
|
383 stub -noname DoReaderMode
|
2015-07-24 01:17:26 -07:00
|
|
|
diff --git a/dlls/comctl32/commctrl.c b/dlls/comctl32/commctrl.c
|
2015-07-25 17:18:47 -07:00
|
|
|
index e18c27d..462ecf8 100644
|
2015-07-24 01:17:26 -07:00
|
|
|
--- a/dlls/comctl32/commctrl.c
|
|
|
|
+++ b/dlls/comctl32/commctrl.c
|
|
|
|
@@ -3,6 +3,7 @@
|
|
|
|
*
|
|
|
|
* Copyright 1997 Dimitrie O. Paun
|
|
|
|
* Copyright 1998,2000 Eric Kohl
|
2014-08-06 17:00:57 -07:00
|
|
|
+ * Copyright 2014 Michael Müller
|
2015-07-24 01:17:26 -07:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
2015-07-25 17:18:47 -07:00
|
|
|
@@ -1646,3 +1647,42 @@ HRESULT WINAPI LoadIconWithScaleDown(HINSTANCE hinst, PCWSTR name, int cx, int c
|
2015-07-24 01:17:26 -07:00
|
|
|
FIXME("stub: %p %s %d %d %p\n", hinst, wine_dbgstr_w(name), cx, cy, icon);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
2014-08-06 17:00:57 -07:00
|
|
|
+
|
2015-07-24 01:17:26 -07:00
|
|
|
+/***********************************************************************
|
|
|
|
+ * LoadIconMetric [COMCTL32.@]
|
|
|
|
+ */
|
|
|
|
+HRESULT WINAPI LoadIconMetric(HINSTANCE hinst, const WCHAR *name, int size, HICON *icon)
|
2014-08-06 17:00:57 -07:00
|
|
|
+{
|
2015-07-24 01:17:26 -07:00
|
|
|
+ int width, height;
|
2014-08-06 17:00:57 -07:00
|
|
|
+
|
|
|
|
+ TRACE("(%p %s %d %p)\n", hinst, debugstr_w(name), size, icon);
|
|
|
|
+
|
|
|
|
+ if (!icon)
|
|
|
|
+ return E_INVALIDARG;
|
|
|
|
+
|
2015-07-25 17:18:47 -07:00
|
|
|
+ /* Windows sets it to zero in a case of failure. */
|
2014-08-06 17:00:57 -07:00
|
|
|
+ *icon = NULL;
|
|
|
|
+
|
|
|
|
+ if (!name)
|
|
|
|
+ return E_INVALIDARG;
|
|
|
|
+
|
|
|
|
+ if (size == LIM_SMALL)
|
|
|
|
+ {
|
2015-07-24 01:17:26 -07:00
|
|
|
+ width = GetSystemMetrics(SM_CXSMICON);
|
|
|
|
+ height = GetSystemMetrics(SM_CYSMICON);
|
2014-08-06 17:00:57 -07:00
|
|
|
+ }
|
|
|
|
+ else if (size == LIM_LARGE)
|
|
|
|
+ {
|
2015-07-24 01:17:26 -07:00
|
|
|
+ width = GetSystemMetrics(SM_CXICON);
|
|
|
|
+ height = GetSystemMetrics(SM_CYICON);
|
2014-08-06 17:00:57 -07:00
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ return E_INVALIDARG;
|
|
|
|
+
|
2015-07-25 17:18:47 -07:00
|
|
|
+ /* FIXME: This doesn't seem to work properly yet with file names. */
|
|
|
|
+ *icon = LoadImageW(hinst, name, IMAGE_ICON, width, height, 0);
|
2014-08-06 17:00:57 -07:00
|
|
|
+ if (*icon)
|
|
|
|
+ return S_OK;
|
|
|
|
+
|
|
|
|
+ return HRESULT_FROM_WIN32(GetLastError());
|
|
|
|
+}
|
|
|
|
diff --git a/include/commctrl.h b/include/commctrl.h
|
2015-07-25 17:18:47 -07:00
|
|
|
index 0bcaeb6..662dca1 100644
|
2014-08-06 17:00:57 -07:00
|
|
|
--- a/include/commctrl.h
|
|
|
|
+++ b/include/commctrl.h
|
2015-07-25 17:18:47 -07:00
|
|
|
@@ -42,6 +42,13 @@ BOOL WINAPI InitCommonControlsEx (const INITCOMMONCONTROLSEX*);
|
|
|
|
LANGID WINAPI GetMUILanguage (VOID);
|
2015-07-24 01:17:26 -07:00
|
|
|
VOID WINAPI InitMUILanguage (LANGID uiLang);
|
|
|
|
|
2014-08-06 17:00:57 -07:00
|
|
|
+enum _LI_METRIC
|
|
|
|
+{
|
2015-07-25 17:18:47 -07:00
|
|
|
+ LIM_SMALL,
|
|
|
|
+ LIM_LARGE
|
2014-08-06 17:00:57 -07:00
|
|
|
+};
|
|
|
|
+
|
2015-07-25 17:18:47 -07:00
|
|
|
+HRESULT WINAPI LoadIconMetric(HINSTANCE, const WCHAR *, int, HICON *);
|
|
|
|
HRESULT WINAPI LoadIconWithScaleDown(HINSTANCE, PCWSTR, int, int, HICON *);
|
|
|
|
|
|
|
|
#define COMCTL32_VERSION 5 /* dll version */
|
2014-08-06 17:00:57 -07:00
|
|
|
--
|
2015-07-24 01:17:26 -07:00
|
|
|
2.4.5
|
2014-08-06 17:00:57 -07:00
|
|
|
|