diff --git a/base/shell/rshell/CMenuToolbars.cpp b/base/shell/rshell/CMenuToolbars.cpp index fba57b01c33..e66d93e0fda 100644 --- a/base/shell/rshell/CMenuToolbars.cpp +++ b/base/shell/rshell/CMenuToolbars.cpp @@ -791,6 +791,7 @@ HRESULT CMenuStaticToolbar::FillToolbar() int i; int ic = GetMenuItemCount(m_hmenu); + int count = 0; for (i = 0; i < ic; i++) { BOOL last = i + 1 == ic; @@ -807,6 +808,8 @@ HRESULT CMenuStaticToolbar::FillToolbar() continue; } + count++; + DbgPrint("Found item with fType=%x, cmdId=%d\n", info.fType, info.wID); if (info.fType & MFT_SEPARATOR) @@ -836,6 +839,8 @@ HRESULT CMenuStaticToolbar::FillToolbar() } } + DbgPrint("Created toolbar with %d buttons.\n", count); + return S_OK; } @@ -937,7 +942,7 @@ HRESULT CMenuSFToolbar::FillToolbar() // 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); } @@ -946,9 +951,13 @@ HRESULT CMenuSFToolbar::FillToolbar() // 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; }