Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I browse directories?

Status
Not open for further replies.

CptGreenwood

Technical User
Dec 31, 2002
3
DE
Hi,
in Visual Basic there are controls like CDrive, CDir, CFile where you can browse files in directories. How can I do it in Visual C++? These controls are missing. There are only tree and list controls, but I didn't find instructions to use them as a dir/file browser. Can anyone help?
 
Don't really know. I want the user to choose one or more subdirs in a special dir where the prog performs operations on it. A simple listbox would do when I get it filled with all subdirnames.
 
Try using this

LPITEMIDLIST IDRoot;
BROWSEINFO BrowseInfo;

HWND h = this->GetSafeHwnd();
SHGetSpecialFolderLocation(h, CSIDL_DESKTOPDIRECTORY, &IDRoot);
char Path[MAX_PATH];
ZeroMemory(&BrowseInfo, sizeof(BROWSEINFO));
ZeroMemory(Path, MAX_PATH);


 
Uhh, thanx but this looks like pure WinAPI and I'm not very familiar with it. Is there a solution using the MFC as well?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top