I reproduced your observations on Win10 22H2. The following caused the desktop icon of the Recycle bin to refresh after an item was recycled from a console application. For example purposes all error checking is omitted.
int wmain(int argc, wchar_t *argv[])
{
auto hr = CoInitialize(nullptr);
{
CComPtr<IShellItem> psibin, psifile;
CComPtr<IFileOperation> pfo;
CComPtr<IShellView> psv;
// Fully qualified path of file to be recycled
hr = SHCreateItemFromParsingName(argv[1], nullptr, IID_PPV_ARGS(&psifile));
hr = SHGetKnownFolderItem(FOLDERID_RecycleBinFolder, KF_FLAG_DEFAULT, NULL, IID_PPV_ARGS(&psibin));
hr = psibin->BindToHandler(nullptr, BHID_SFViewObject, IID_PPV_ARGS(&psv));
hr = pfo.CoCreateInstance(CLSID_FileOperation, nullptr, CLSCTX_INPROC_SERVER);
hr = pfo->SetOperationFlags(FOFX_RECYCLEONDELETE);
hr = pfo->DeleteItem(psifile, nullptr);
hr = pfo->PerformOperations();
hr = psv->Refresh();
}
CoUninitialize();
return 0;
}
I wasn't able to test this code on Win 11.