Méthode IShellLibrary::RemoveFolder (shobjidl_core.h)
Supprime un dossier de la bibliothèque.
Syntaxe
HRESULT RemoveFolder(
[in] IShellItem *psiLocation
);
Paramètres
[in] psiLocation
Type : IShellItem*
Objet IShellItem qui représente le dossier à supprimer.
Valeur retournée
Type : HRESULT
Si cette méthode réussit, elle retourne S_OK. Sinon, elle retourne un code d’erreur HRESULT.
Remarques
Pour des raisons pratiques, SHRemoveFolderPathFromLibrary peut être utilisé à la place de cette méthode.
Exemples
L’exemple de code suivant montre la fonction d’assistance SHRemoveFolderPathFromLibrary, qui encapsule cette méthode.
//
// from shobjidl.h
//
__inline HRESULT SHRemoveFolderPathFromLibrary(
__in IShellLibrary *plib,
__in PCWSTR pszFolderPath)
{
PIDLIST_ABSOLUTE pidlFolder =
SHSimpleIDListFromPath (pszFolderPath);
HRESULT hr = pidlFolder ? S_OK : E_INVALIDARG;
if (SUCCEEDED(hr))
{
IShellItem *psiFolder;
hr = SHCreateItemFromIDList (
pidlFolder,
IID_PPV_ARGS(&psiFolder));
if (SUCCEEDED(hr))
{
hr = plib->RemoveFolder(psiFolder);
psiFolder->Release();
}
CoTaskMemFree(pidlFolder);
}
return hr;
}
Configuration requise
Client minimal pris en charge | Windows 7 [applications de bureau uniquement] |
Serveur minimal pris en charge | Windows Server 2008 R2 [applications de bureau uniquement] |
Plateforme cible | Windows |
En-tête | shobjidl_core.h (inclure Shobjidl.h) |
Voir aussi
IShellLibrary::LoadLibraryFromItem
Commentaires
https://aka.ms/ContentUserFeedback.
Bientôt disponible : Tout au long de 2024, nous allons supprimer progressivement GitHub Issues comme mécanisme de commentaires pour le contenu et le remplacer par un nouveau système de commentaires. Pour plus d’informations, consultezEnvoyer et afficher des commentaires pour