Compartilhar via


SHBrowseForFolder (Compact 2013)

3/28/2014

This function displays a dialog box that allows a user to select a folder.

Syntax

LPITEMIDLIST WINAPI SHBrowseForFolder(
  LPBROWSEINFO lpbi
);

Parameters

  • lpbi
    [in] Pointer to a BROWSEINFO structure that contains information used to display the dialog box.

Return Value

The return value is a pointer to an ITEMIDLIST structure (PIDL) that specifies the location of the folder that the user selected relative to the root of the namespace. NULL indicates that the user chose the Cancel button in the dialog box.

Remarks

You should call the InitCommonControls function before calling SHBrowseForFolder.

The calling application is responsible for freeing the returned PIDL with the IMalloc::Free method for the shell allocator. To get a handle to the IMalloc:IUnknown interface for the shell's allocator, call SHGetMalloc.

If you implement a callback function, you receive a handle to the dialog box. You can use this window handle to modify the layout or the contents of the dialog box.

Requirements

Header

shlobj.h

Library

ceshell.lib

See Also

Reference

Shell Functions
InitCommonControls
SHGetMalloc
BROWSEINFO
ITEMIDLIST

Other Resources

IMalloc::Free
IMalloc