[CPL][DESK] Use shell32 icon directly; follow-up to #2281
authorKatayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
Tue, 28 Jan 2020 05:05:51 +0000 (14:05 +0900)
committerKatayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
Tue, 28 Jan 2020 05:05:51 +0000 (14:05 +0900)
dll/cpl/desk/background.c
dll/cpl/desk/desk.rc
dll/cpl/desk/resource.h
dll/cpl/desk/resources/none.ico [deleted file]

index f73cdcb..34a42d2 100644 (file)
@@ -309,6 +309,7 @@ AddListViewItems(HWND hwndDlg, PBACKGROUND_DATA pData)
     HRESULT hr;
     HICON hIcon;
     INT cx, cy;
+    HINSTANCE hShell32;
 
     hwndBackgroundList = GetDlgItem(hwndDlg, IDC_BACKGROUND_LIST);
 
@@ -317,7 +318,11 @@ AddListViewItems(HWND hwndDlg, PBACKGROUND_DATA pData)
     cx = GetSystemMetrics(SM_CXSMICON);
     cy = GetSystemMetrics(SM_CYSMICON);
     himl = ImageList_Create(cx, cy, ILC_COLOR32 | ILC_MASK, 0, 0);
-    hIcon = (HICON)LoadImageW(hApplet, MAKEINTRESOURCEW(IDI_NONE), IMAGE_ICON, cx, cy, 0);
+
+    /* Load (None) icon */
+    hShell32 = LoadLibraryEx(L"shell32", NULL, LOAD_LIBRARY_AS_DATAFILE);
+    hIcon = (HICON)LoadImageW(hShell32, MAKEINTRESOURCEW(200), IMAGE_ICON, cx, cy, 0);
+    FreeLibrary(hShell32);
 
     ListView_SetImageList(hwndBackgroundList, himl, LVSIL_SMALL);
 
index 60352ed..08301b0 100644 (file)
@@ -14,7 +14,6 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
 
 IDC_DESK_ICON ICON "resources/applet.ico"
 IDC_DESK_ICON2 ICON "resources/applet.ico"
-IDI_NONE ICON "resources/none.ico"
 
 IDC_MONITOR BITMAP "resources/monitor.bmp"
 
index bbe32ea..816ab45 100644 (file)
@@ -3,7 +3,6 @@
 /* ids */
 #define IDC_DESK_ICON  40
 #define IDC_DESK_ICON2 100 /* Needed for theme compatability with Windows. */
-#define IDI_NONE 101
 
 #define IDC_STATIC -1
 
diff --git a/dll/cpl/desk/resources/none.ico b/dll/cpl/desk/resources/none.ico
deleted file mode 100644 (file)
index f306984..0000000
Binary files a/dll/cpl/desk/resources/none.ico and /dev/null differ