From 0059e7bcf9a946cf7f1017a97e5e50001313777b Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 20 May 2016 17:12:07 +0900 Subject: [PATCH] Use LoadIconMetric to load correct icon --- atom/common/api/atom_api_native_image.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/atom/common/api/atom_api_native_image.cc b/atom/common/api/atom_api_native_image.cc index 92fba4b..5f15bad 100644 --- a/atom/common/api/atom_api_native_image.cc +++ b/atom/common/api/atom_api_native_image.cc @@ -4,6 +4,10 @@ #include "atom/common/api/atom_api_native_image.h" +#if defined(OS_WIN) +#include +#endif + #include #include @@ -155,9 +159,9 @@ base::win::ScopedHICON ReadICOFromPath(const base::FilePath& path) { } // Load the icon from file. - return base::win::ScopedHICON(static_cast( - LoadImage(NULL, image_path.value().c_str(), IMAGE_ICON, 0, 0, - LR_DEFAULTSIZE | LR_LOADFROMFILE))); + HICON icon = NULL; + LoadIconMetric(NULL, image_path.value().c_str(), LIM_SMALL, &icon); + return base::win::ScopedHICON(icon); } void ReadImageSkiaFromICO(gfx::ImageSkia* image, HICON icon) { -- 2.7.4