* Addendum to r66800.
authorAmine Khaldi <amine.khaldi@reactos.org>
Thu, 19 Mar 2015 12:08:58 +0000 (12:08 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Thu, 19 Mar 2015 12:08:58 +0000 (12:08 +0000)
svn path=/trunk/; revision=66802

reactos/dll/win32/comctl32/icon.c [new file with mode: 0644]
reactos/dll/win32/comctl32/theme_scrollbar.c [new file with mode: 0644]

diff --git a/reactos/dll/win32/comctl32/icon.c b/reactos/dll/win32/comctl32/icon.c
new file mode 100644 (file)
index 0000000..3b6816a
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Comctl32 Icon functions
+ *
+ * Copyright 2014 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
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "comctl32.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(commctrl);
+
+HRESULT WINAPI
+LoadIconMetric (HINSTANCE hinst, PCWSTR name, INT size, HICON *icon)
+{
+    INT width, height;
+
+    TRACE("(%p %s %d %p)\n", hinst, debugstr_w(name), size, icon);
+
+    if (!icon)
+        return E_INVALIDARG;
+
+    /* windows sets it to zero in a case of failure */
+    *icon = NULL;
+
+    if (!name)
+        return E_INVALIDARG;
+
+    if (size == LIM_SMALL)
+    {
+        width  = GetSystemMetrics( SM_CXSMICON );
+        height = GetSystemMetrics( SM_CYSMICON );
+    }
+    else if (size == LIM_LARGE)
+    {
+        width  = GetSystemMetrics( SM_CXICON );
+        height = GetSystemMetrics( SM_CYICON );
+    }
+    else
+        return E_INVALIDARG;
+
+    *icon = LoadImageW( hinst, name, IMAGE_ICON, width, height, LR_SHARED );
+    if (*icon)
+        return S_OK;
+
+    return HRESULT_FROM_WIN32(GetLastError());
+}
diff --git a/reactos/dll/win32/comctl32/theme_scrollbar.c b/reactos/dll/win32/comctl32/theme_scrollbar.c
new file mode 100644 (file)
index 0000000..c2ababd
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Theming - Scrollbar control
+ *
+ * Copyright (c) 2015 Mark Harmstone
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ *
+ */
+
+#include "comctl32.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(theme_scroll);
+
+LRESULT CALLBACK THEMING_ScrollbarSubclassProc (HWND hwnd, UINT msg,
+                                                WPARAM wParam, LPARAM lParam,
+                                                ULONG_PTR dwRefData)
+{
+    TRACE("(%p, 0x%x, %lu, %lu, %lu)\n", hwnd, msg, wParam, lParam, dwRefData);
+
+    return THEMING_CallOriginalClass (hwnd, msg, wParam, lParam);
+}