Use LoadIconMetric to load correct icon

This commit is contained in:
Cheng Zhao 2016-05-20 17:12:07 +09:00
parent 9e26e5c121
commit 0059e7bcf9

View file

@ -4,6 +4,10 @@
#include "atom/common/api/atom_api_native_image.h" #include "atom/common/api/atom_api_native_image.h"
#if defined(OS_WIN)
#include <commctrl.h>
#endif
#include <string> #include <string>
#include <vector> #include <vector>
@ -155,9 +159,9 @@ base::win::ScopedHICON ReadICOFromPath(const base::FilePath& path) {
} }
// Load the icon from file. // Load the icon from file.
return base::win::ScopedHICON(static_cast<HICON>( HICON icon = NULL;
LoadImage(NULL, image_path.value().c_str(), IMAGE_ICON, 0, 0, LoadIconMetric(NULL, image_path.value().c_str(), LIM_SMALL, &icon);
LR_DEFAULTSIZE | LR_LOADFROMFILE))); return base::win::ScopedHICON(icon);
} }
void ReadImageSkiaFromICO(gfx::ImageSkia* image, HICON icon) { void ReadImageSkiaFromICO(gfx::ImageSkia* image, HICON icon) {