Esme Povirk (@madewokherd) commented about dlls/comdlg32/navbar.c:
- menu_item.hbmpItem = HBMMENU_CALLBACK; /* see NAVBAR_OVERFLOW_DrawIcon */
- InsertMenuItemW(info->overflow_menu, -1, TRUE, &menu_item);
+}
+static void NAVBAR_OVERFLOW_Clear(NAVBAR_INFO *info) +{
- INT i, menu_item_count = GetMenuItemCount(info->overflow_menu);
- MENUITEMINFOW menu_item = {0};
- menu_item.cbSize = sizeof(MENUITEMINFOW);
- menu_item.fMask = MIIM_DATA;
- for (i = 0; i < menu_item_count; i++)
- {
/* deleting an item shifts further indices, so don't use `i` */
It would probably be simpler to delete the items from the end, and slightly more efficient because it removes the need to shift indices.