int i;
int ic = GetMenuItemCount(m_hmenu);
+ int count = 0;
for (i = 0; i < ic; i++)
{
BOOL last = i + 1 == ic;
continue;
}
+ count++;
+
DbgPrint("Found item with fType=%x, cmdId=%d\n", info.fType, info.wID);
if (info.fType & MFT_SEPARATOR)
}
}
+ DbgPrint("Created toolbar with %d buttons.\n", count);
+
return S_OK;
}
// Fetch next item already, so we know if the current one is the last
hr = eidl->Next(1, &item, &fetched);
- AddButton(++i, MenuString, attrs & SFGAO_FOLDER, index, dwData, SUCCEEDED(hr) && fetched > 0);
+ AddButton(++i, MenuString, attrs & SFGAO_FOLDER, index, dwData, FAILED(hr) || fetched == 0);
CoTaskMemFree(MenuString);
}
// If no items were added, show the "empty" placeholder
if (i == 0)
{
+ DbgPrint("The toolbar is empty, adding placeholder.\n");
+
return AddPlaceholder();
}
+ DbgPrint("Created toolbar with %d buttons.\n", i);
+
return hr;
}