[SHELL32] CDefView: Disable auto arrange in list and details view mode.
authorGiannis Adamopoulos <gadamopoulos@reactos.org>
Mon, 22 Oct 2018 16:18:28 +0000 (19:18 +0300)
committerGiannis Adamopoulos <gadamopoulos@reactos.org>
Mon, 22 Oct 2018 16:18:28 +0000 (19:18 +0300)
This supersedes PR #927 and does it correctly.

dll/win32/shell32/CDefView.cpp

index 9e67b44..cd2b91d 100644 (file)
@@ -1192,6 +1192,11 @@ HRESULT CDefView::FillArrangeAsMenu(HMENU hmenuArrange)
                        m_sortInfo.nHeaderID + 0x30, 
                        MF_BYCOMMAND);
 
+    if (m_FolderSettings.ViewMode == FVM_DETAILS || m_FolderSettings.ViewMode == FVM_LIST)
+        EnableMenuItem(hmenuArrange, FCIDM_SHVIEW_AUTOARRANGE, MF_BYCOMMAND | MF_GRAYED);
+    else
+        EnableMenuItem(hmenuArrange, FCIDM_SHVIEW_AUTOARRANGE, MF_BYCOMMAND); 
+
     return S_OK;
 }