| 8 | |
| 9 | template <typename Func> |
| 10 | static void TraverseMenuRecursive(CMenu* pMenu, Func func) |
| 11 | { |
| 12 | if (!pMenu) |
| 13 | return; |
| 14 | int itemCount = pMenu->GetMenuItemCount(); |
| 15 | for (int i = itemCount - 1; i >= 0; --i) |
| 16 | { |
| 17 | UINT id = pMenu->GetMenuItemID(i); |
| 18 | if (id == (UINT)-1) |
| 19 | { |
| 20 | CMenu* pSubMenu = pMenu->GetSubMenu(i); |
| 21 | if (pSubMenu) |
| 22 | TraverseMenuRecursive(pSubMenu, func); |
| 23 | } |
| 24 | func(pMenu, i, id); |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | static void DisableMenuItemRecursive(CMenu* pMenu, UINT idDisabled) |
| 29 | { |
no outgoing calls
no test coverage detected