IShellLibrary::RemoveFolder 메서드(shobjidl_core.h)

라이브러리에서 폴더를 제거합니다.

구문

HRESULT RemoveFolder(
  [in] IShellItem *psiLocation
);

매개 변수

[in] psiLocation

형식: IShellItem*

제거할 폴더를 나타내는 IShellItem 개체입니다.

반환 값

형식: HRESULT

메서드가 성공하면 S_OK를 반환하고, 그러지 않으면 HRESULT 오류 코드를 반환합니다.

설명

편의를 위해 이 메서드 대신 SHRemoveFolderPathFromLibrary 를 사용할 수 있습니다.

예제

다음 코드 예제에서는 이 메서드를 래핑하는 도우미 함수 SHRemoveFolderPathFromLibrary를 보여 줍니다.

//
// 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;
}

요구 사항

   
지원되는 최소 클라이언트 Windows 7 [데스크톱 앱만 해당]
지원되는 최소 서버 Windows Server 2008 R2 [데스크톱 앱만 해당]
대상 플랫폼 Windows
헤더 shobjidl_core.h(Shobjidl.h 포함)

추가 정보

IShellLibrary

IShellLibrary::AddFolder

IShellLibrary::LoadLibraryFromItem

IShellLibrary::LoadLibraryFromKnownFolder

SHAddFolderPathToLibrary

SHLoadLibraryFromItem

SHLoadLibraryFromKnownFolder

SHLoadLibraryFromParsingName

SHRemoveFolderPathFromLibrary

Windows 라이브러리