https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e353b48cb2e87f7a10990…
commit e353b48cb2e87f7a10990154110198257c0d86cf
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Fri Jun 29 21:13:37 2018 +0900
Commit: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito(a)reactos.org>
CommitDate: Fri Jun 29 14:13:37 2018 +0200
[SHELL32] Refresh 'General' tab if the folder icon is updated (#646)
CORE-11407
---
dll/win32/shell32/dialogs/filedefext.cpp | 27 +++++++++++++++++++++++----
1 file changed, 23 insertions(+), 4 deletions(-)
diff --git a/dll/win32/shell32/dialogs/filedefext.cpp
b/dll/win32/shell32/dialogs/filedefext.cpp
index 2065e4ef05..2b650ecf91 100644
--- a/dll/win32/shell32/dialogs/filedefext.cpp
+++ b/dll/win32/shell32/dialogs/filedefext.cpp
@@ -643,6 +643,7 @@ CFileDefExt::InitGeneralPage(HWND hwndDlg)
INT_PTR CALLBACK
CFileDefExt::GeneralPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
+ CFileDefExt *pFileDefExt = reinterpret_cast<CFileDefExt
*>(GetWindowLongPtr(hwndDlg, DWLP_USER));
switch (uMsg)
{
case WM_INITDIALOG:
@@ -654,7 +655,7 @@ CFileDefExt::GeneralPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
LPARAM lPar
TRACE("WM_INITDIALOG hwnd %p lParam %p ppsplParam %S\n", hwndDlg,
lParam, ppsp->lParam);
- CFileDefExt *pFileDefExt = reinterpret_cast<CFileDefExt
*>(ppsp->lParam);
+ pFileDefExt = reinterpret_cast<CFileDefExt *>(ppsp->lParam);
SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pFileDefExt);
pFileDefExt->InitGeneralPage(hwndDlg);
break;
@@ -662,7 +663,6 @@ CFileDefExt::GeneralPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
LPARAM lPar
case WM_COMMAND:
if (LOWORD(wParam) == 14024) /* Opens With - Change */
{
- CFileDefExt *pFileDefExt = reinterpret_cast<CFileDefExt
*>(GetWindowLongPtr(hwndDlg, DWLP_USER));
OPENASINFO oainfo;
oainfo.pcszFile = pFileDefExt->m_wszPath;
oainfo.pcszClass = NULL;
@@ -682,8 +682,6 @@ CFileDefExt::GeneralPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
LPARAM lPar
LPPSHNOTIFY lppsn = (LPPSHNOTIFY)lParam;
if (lppsn->hdr.code == PSN_APPLY)
{
- CFileDefExt *pFileDefExt = reinterpret_cast<CFileDefExt
*>(GetWindowLongPtr(hwndDlg, DWLP_USER));
-
/* Update attributes first */
DWORD dwAttr = GetFileAttributesW(pFileDefExt->m_wszPath);
if (dwAttr)
@@ -717,6 +715,19 @@ CFileDefExt::GeneralPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
LPARAM lPar
}
break;
}
+ case PSM_QUERYSIBLINGS:
+ {
+ // reset icon
+ HWND hIconCtrl = GetDlgItem(hwndDlg, 14025);
+ HICON hIcon = (HICON)SendMessageW(hIconCtrl, STM_GETICON, 0, 0);
+ DestroyIcon(hIcon);
+ hIcon = NULL;
+ SendMessageW(hIconCtrl, STM_SETICON, (WPARAM)hIcon, 0);
+
+ // refresh the page
+ pFileDefExt->InitGeneralPage(hwndDlg);
+ return FALSE; // continue
+ }
default:
break;
}
@@ -878,6 +889,8 @@ CFileDefExt::VersionPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
LPARAM lPar
break;
case WM_DESTROY:
break;
+ case PSM_QUERYSIBLINGS:
+ return FALSE; // continue
default:
break;
}
@@ -949,6 +962,9 @@ CFileDefExt::FolderCustomizePageProc(HWND hwndDlg, UINT uMsg, WPARAM
wParam, LPA
break;
}
+ case PSM_QUERYSIBLINGS:
+ return FALSE; // continue
+
case WM_DESTROY:
pFileDefExt->OnFolderCustDestroy(hwndDlg);
break;
@@ -1116,6 +1132,9 @@ BOOL CFileDefExt::OnFolderCustApply(HWND hwndDlg)
attrs |= FILE_ATTRIBUTE_READONLY;
SetFileAttributesW(m_wszPath, attrs);
+ // notify to the siblings
+ PropSheet_QuerySiblings(GetParent(hwndDlg), 0, 0);
+
// done!
m_bFolderIconIsSet = FALSE;
}