https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5daf5cd057d1b04996531…
commit 5daf5cd057d1b0499653196e73a1b2c410a7313a
Author: Stanislav Motylkov <x86corez(a)gmail.com>
AuthorDate: Thu Nov 3 01:38:05 2022 +0300
Commit: Stanislav Motylkov <x86corez(a)gmail.com>
CommitDate: Thu Nov 3 02:58:05 2022 +0300
[REGEDIT] Use shell icons for the tree view
- This makes regedit.exe smaller
- Reduces resource duplication in the source tree
- Potentially improves support for theming
CORE-10764
---
base/applications/regedit/regedit.rc | 3 ---
base/applications/regedit/res/computer.ico | Bin 2550 -> 0 bytes
base/applications/regedit/res/folder.ico | Bin 2862 -> 0 bytes
base/applications/regedit/res/folderopen.ico | Bin 2862 -> 0 bytes
base/applications/regedit/resource.h | 3 ---
base/applications/regedit/treeview.c | 36 ++++++++++++++++-----------
6 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/base/applications/regedit/regedit.rc b/base/applications/regedit/regedit.rc
index 08b2d17829a..18568e40aff 100644
--- a/base/applications/regedit/regedit.rc
+++ b/base/applications/regedit/regedit.rc
@@ -33,9 +33,6 @@
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
-IDI_OPEN_FILE ICON "res/folderopen.ico"
-IDI_CLOSED_FILE ICON "res/folder.ico"
-IDI_ROOT ICON "res/computer.ico"
IDI_STRING ICON "res/string.ico"
IDI_BIN ICON "res/bin.ico"
IDI_REGEDIT ICON "res/regedit.ico"
diff --git a/base/applications/regedit/res/computer.ico
b/base/applications/regedit/res/computer.ico
deleted file mode 100644
index 5287a0b8a7e..00000000000
Binary files a/base/applications/regedit/res/computer.ico and /dev/null differ
diff --git a/base/applications/regedit/res/folder.ico
b/base/applications/regedit/res/folder.ico
deleted file mode 100644
index 25802f9a82f..00000000000
Binary files a/base/applications/regedit/res/folder.ico and /dev/null differ
diff --git a/base/applications/regedit/res/folderopen.ico
b/base/applications/regedit/res/folderopen.ico
deleted file mode 100644
index e488448ef87..00000000000
Binary files a/base/applications/regedit/res/folderopen.ico and /dev/null differ
diff --git a/base/applications/regedit/resource.h b/base/applications/regedit/resource.h
index 5655ef8cfdc..dd39001ac1c 100644
--- a/base/applications/regedit/resource.h
+++ b/base/applications/regedit/resource.h
@@ -40,9 +40,6 @@
#define IDC_REGEDIT_FRAME 110
#define IDR_REGEDIT_MENU 130
#define IDD_EXPORTRANGE 131
-#define IDI_OPEN_FILE 132
-#define IDI_CLOSED_FILE 133
-#define IDI_ROOT 134
#define IDI_STRING 135
#define IDI_BIN 136
#define IDR_POPUP_MENUS 137
diff --git a/base/applications/regedit/treeview.c b/base/applications/regedit/treeview.c
index 4320846c283..7719039e835 100644
--- a/base/applications/regedit/treeview.c
+++ b/base/applications/regedit/treeview.c
@@ -32,6 +32,11 @@ static LPWSTR pathBuffer;
#define NUM_ICONS 3
+/* External resources in shell32.dll */
+#define IDI_SHELL_FOLDER 4
+#define IDI_SHELL_FOLDER_OPEN 5
+#define IDI_SHELL_MY_COMPUTER 16
+
static BOOL get_item_path(HWND hwndTV, HTREEITEM hItem, HKEY* phKey, LPWSTR* pKeyPath,
int* pPathLen, int* pMaxLen)
{
TVITEMW item;
@@ -441,42 +446,43 @@ static BOOL InitTreeViewImageLists(HWND hwndTV)
HICON hico; /* handle to icon */
INT cx = GetSystemMetrics(SM_CXSMICON);
INT cy = GetSystemMetrics(SM_CYSMICON);
+ HMODULE hShell32 = GetModuleHandleW(L"shell32.dll");
/* Create the image list. */
if ((himl = ImageList_Create(cx, cy, ILC_MASK | ILC_COLOR32, 0, NUM_ICONS)) == NULL)
return FALSE;
/* Add the open file, closed file, and document bitmaps. */
- hico = LoadImageW(hInst,
- MAKEINTRESOURCEW(IDI_OPEN_FILE),
+ hico = LoadImageW(hShell32,
+ MAKEINTRESOURCEW(IDI_SHELL_FOLDER_OPEN),
IMAGE_ICON,
- GetSystemMetrics(SM_CXSMICON),
- GetSystemMetrics(SM_CYSMICON),
- 0);
+ cx,
+ cy,
+ LR_DEFAULTCOLOR);
if (hico)
{
Image_Open = ImageList_AddIcon(himl, hico);
DestroyIcon(hico);
}
- hico = LoadImageW(hInst,
- MAKEINTRESOURCEW(IDI_CLOSED_FILE),
+ hico = LoadImageW(hShell32,
+ MAKEINTRESOURCEW(IDI_SHELL_FOLDER),
IMAGE_ICON,
- GetSystemMetrics(SM_CXSMICON),
- GetSystemMetrics(SM_CYSMICON),
- 0);
+ cx,
+ cy,
+ LR_DEFAULTCOLOR);
if (hico)
{
Image_Closed = ImageList_AddIcon(himl, hico);
DestroyIcon(hico);
}
- hico = LoadImageW(hInst,
- MAKEINTRESOURCEW(IDI_ROOT),
+ hico = LoadImageW(hShell32,
+ MAKEINTRESOURCEW(IDI_SHELL_MY_COMPUTER),
IMAGE_ICON,
- GetSystemMetrics(SM_CXSMICON),
- GetSystemMetrics(SM_CYSMICON),
- 0);
+ cx,
+ cy,
+ LR_DEFAULTCOLOR);
if (hico)
{
Image_Root = ImageList_AddIcon(himl, hico);