Click here to Skip to main content
15,892,059 members
Articles / Desktop Programming / MFC

"Browse For Folder" dialog alike with source

Rate me:
Please Sign up or sign in to vote.
4.60/5 (5 votes)
5 Sep 2001 114.9K   1.7K   38  
Shell interfaces in use. IShellFolder, IEnumIDList, etc.
//
// Written by Marat Bedretdinov (maratb@hotmail.com)
// Copyright (c) 2000.
//
// This code may be used in compiled form in any way you desire. This
// file may be redistributed unmodified by any means PROVIDING it is 
// not sold for profit without the authors written consent, and 
// providing that this notice and the authors name is included. 
//
// This file is provided "as is" with no expressed or implied warranty.
// The author accepts no liability if it causes any damage whatsoever.
// It's free - so you get what you pay for.//

#if !defined(AFX_BFFTREECTRL_H__CBB14E5F_1B1E_4809_A8C5_554ADF1A7F77__INCLUDED_)
#define AFX_BFFTREECTRL_H__CBB14E5F_1B1E_4809_A8C5_554ADF1A7F77__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// BFFTreeCtrl.h : header file
//

#include "FileTreeCtrl.h"

class CBrowseForFolderDlg;

/////////////////////////////////////////////////////////////////////////////
// CBFFTreeCtrl window

class AFX_EXT_CLASS CBFFTreeCtrl : public CFileTreeCtrl
{
friend class CBrowseForFolderDlg;
// Construction
public:
					CBFFTreeCtrl();

		  void      DisplaySelectedPath();

	const char*		GetSelectedPath() const;
	const char*		GetSelectedName() const;

  LPITEMIDLIST		GetTreeSelectedFullIdl();
  LPITEMIDLIST		GetTreeSelectedRelativeIdl();

protected:
			void	SaveSelectedInfo();

// Attributes
public:

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CBFFTreeCtrl)
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CBFFTreeCtrl();

	// Generated message map functions
protected:
	//{{AFX_MSG(CBFFTreeCtrl)
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	//}}AFX_MSG

	DECLARE_MESSAGE_MAP()
protected:
// this will be set only to paths/names that belong to the system folders
	CString m_strPath;
	CString m_strName;
// save it for later use, after the dialog is destoryed (visually!) 
// but remains in memory; clean them up in the destuctor
	LPITEMIDLIST	m_pFullIdl;
	LPITEMIDLIST	m_pRelativeIdl;
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_BFFTREECTRL_H__CBB14E5F_1B1E_4809_A8C5_554ADF1A7F77__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here



Comments and Discussions