From afe9bb814d24cdb81a3285c7d332d5e8b62c2eef Mon Sep 17 00:00:00 2001 From: Chris Morgan Date: Sun, 20 Aug 2000 18:48:05 +0000 Subject: [PATCH] Implemented DuplicateIcon(). --- dlls/shell32/shell32.spec | 2 +- dlls/shell32/shell32_main.c | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/dlls/shell32/shell32.spec b/dlls/shell32/shell32.spec index e13357785e..e7de4d39d0 100644 --- a/dlls/shell32/shell32.spec +++ b/dlls/shell32/shell32.spec @@ -335,7 +335,7 @@ import kernel32.dll @ stdcall DoEnvironmentSubstA(str str)DoEnvironmentSubstA @ stdcall DoEnvironmentSubstW(wstr wstr)DoEnvironmentSubstW @ stub DragQueryFileAorW -@ stub DuplicateIcon +@ stdcall DuplicateIcon(long long) DuplicateIcon @ stdcall ExtractAssociatedIconA(long ptr long)ExtractAssociatedIconA @ stub ExtractAssociatedIconExA @ stub ExtractAssociatedIconExW diff --git a/dlls/shell32/shell32_main.c b/dlls/shell32/shell32_main.c index c7d5012493..b32180c2d7 100644 --- a/dlls/shell32/shell32_main.c +++ b/dlls/shell32/shell32_main.c @@ -297,6 +297,29 @@ DWORD WINAPI SHGetFileInfoAW( return SHGetFileInfoA(path, dwFileAttributes, psfi, sizeofpsfi, flags ); } +/************************************************************************* + * DuplicateIcon [SHELL32.188] + */ +HICON WINAPI DuplicateIcon( HINSTANCE hInstance, HICON hIcon) +{ + ICONINFO IconInfo; + HICON hDupIcon = NULL; + + TRACE("(%04x, %04x)\n", hInstance, hIcon); + + if(GetIconInfo(hIcon, &IconInfo)) + { + hDupIcon = CreateIconIndirect(&IconInfo); + + /* clean up hbmMask and hbmColor */ + DeleteObject(IconInfo.hbmMask); + DeleteObject(IconInfo.hbmColor); + } + + return hDupIcon; +} + + /************************************************************************* * ExtractIconA [SHELL32.133] *