Changeset ad2c317d2d1e…
Parent 3d363c94dc34…
by
Changes to 2 files · Browse files at ad2c317d2d1e Showing diff from parent 3d363c94dc34 Diff from another changeset...
@@ -398,6 +398,20 @@ return 0;
}
+void
+CShellExtCMenu::TweakMenuForVista(HMENU hMenu)
+{
+ if (!SysInfo::Instance().IsVistaOrLater())
+ return;
+
+ MENUINFO MenuInfo = {};
+ MenuInfo.cbSize = sizeof(MenuInfo);
+ MenuInfo.fMask = MIM_STYLE | MIM_APPLYTOSUBMENUS;
+ MenuInfo.dwStyle = MNS_CHECKORBMP;
+
+ SetMenuInfo(hMenu, &MenuInfo);
+}
+
#define ResultFromShort(i) ResultFromScode(MAKE_SCODE(SEVERITY_SUCCESS, 0, (USHORT)(i)))
// IContextMenu
@@ -548,18 +562,8 @@ if (isSeparator && indexSubMenu > 0)
RemoveMenu(hSubMenu, indexSubMenu - 1, MF_BYPOSITION);
- if (SysInfo::Instance().IsVistaOrLater())
- {
- MENUINFO MenuInfo;
-
- memset(&MenuInfo, 0, sizeof(MenuInfo));
+ TweakMenuForVista(hSubMenu);
- MenuInfo.cbSize = sizeof(MenuInfo);
- MenuInfo.fMask = MIM_STYLE | MIM_APPLYTOSUBMENUS;
- MenuInfo.dwStyle = MNS_CHECKORBMP;
-
- SetMenuInfo(hSubMenu, &MenuInfo);
- }
}
TDEBUG_TRACE(" CShellExtCMenu::QueryContextMenu: adding main THG menu");
@@ -570,18 +574,7 @@
InitStatus::check();
- if (SysInfo::Instance().IsVistaOrLater())
- {
- MENUINFO MenuInfo;
-
- memset(&MenuInfo, 0, sizeof(MenuInfo));
-
- MenuInfo.cbSize = sizeof(MenuInfo);
- MenuInfo.fMask = MIM_STYLE | MIM_APPLYTOSUBMENUS;
- MenuInfo.dwStyle = MNS_CHECKORBMP;
-
- SetMenuInfo(hMenu, &MenuInfo);
- }
+ TweakMenuForVista(hMenu);
return ResultFromShort(idCmd - idCmdFirst);
}
|
@@ -14,6 +14,7 @@ std::string myFolder;
void DoHgtk(const std::string&);
+ void TweakMenuForVista(HMENU menu);
public:
explicit CShellExtCMenu(char dummy);
|
Loading...