https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8c4bd09518b9a98b88593…
commit 8c4bd09518b9a98b885932acddc8c337d0bbe421
Author: Charles Ambrye <giawa(a)hotmail.com>
AuthorDate: Sun Apr 19 19:52:52 2020 -0700
Commit: Giannis Adamopoulos <gadamopoulos(a)reactos.org>
CommitDate: Mon Apr 20 23:13:09 2020 +0300
[SHELL32] Fix a bug that caused Auto Arrange to always be highlighted in the file explorer
This occurred in the file explorer because the menu isn't destroyed and recreated each time, so the menu item, once checked, will stay checked forever. We must call CheckMenuItem with MF_UNCHECKED to clear the check when necessary
---
dll/win32/shell32/CDefView.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/dll/win32/shell32/CDefView.cpp b/dll/win32/shell32/CDefView.cpp
index 4f9b409fd9e..08fbd594b14 100644
--- a/dll/win32/shell32/CDefView.cpp
+++ b/dll/win32/shell32/CDefView.cpp
@@ -1324,6 +1324,8 @@ HRESULT CDefView::FillArrangeAsMenu(HMENU hmenuArrange)
if (GetAutoArrange() == S_OK)
CheckMenuItem(hmenuArrange, FCIDM_SHVIEW_AUTOARRANGE, MF_CHECKED);
+ else
+ CheckMenuItem(hmenuArrange, FCIDM_SHVIEW_AUTOARRANGE, MF_UNCHECKED);
if (_GetSnapToGrid() == S_OK)
CheckMenuItem(hmenuArrange, FCIDM_SHVIEW_ALIGNTOGRID, MF_CHECKED);