Click here to Skip to main content
15,881,870 members
Articles / Desktop Programming / MFC

Selecting a Subfolder from a Particular Folder

Rate me:
Please Sign up or sign in to vote.
4.56/5 (10 votes)
23 Feb 2010CPOL2 min read 89.4K   2.9K   39  
Restricting the user to browse and select from a particular folder
// BrowsePFDlg.h : header file
//

#if !defined(AFX_BROWSEPFDLG_H__1F58FFD6_CE72_41A0_A3B4_96F4FB29A375__INCLUDED_)
#define AFX_BROWSEPFDLG_H__1F58FFD6_CE72_41A0_A3B4_96F4FB29A375__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

/////////////////////////////////////////////////////////////////////////////
// CBrowsePFDlg dialog

class CBrowsePFDlg : public CDialog
{
// Construction
public:
	CBrowsePFDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	//{{AFX_DATA(CBrowsePFDlg)
	enum { IDD = IDD_BROWSEPF_DIALOG };
	CString	m_RootFolder;
	CString	m_ChosenFolder;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CBrowsePFDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CBrowsePFDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnButtonFolder();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

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

#endif // !defined(AFX_BROWSEPFDLG_H__1F58FFD6_CE72_41A0_A3B4_96F4FB29A375__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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
CEO GIPL
India India
Ahamad has done M.Tech. in Information Technology. He has 15 years software development experience. He started learning programming with GW-BASIC. He learnt COBOL, Pascal, Fortran, C, C++, Java and C#. He worked with DOS, Unix, Novel Netware and Windows platforms. He has been working on Microsoft technologies for the last 10 years. He worked with .NET, Visual C++, ATL COM/DCOM, Win SDK, MFC, WTL, Visual Basic, ASP, JavaScript, XML, OOAD and Rational Rose. He has written three books on Computer Science:

1. Programming in GW-BASIC, BPB Publications, New Delhi, 1993
2. Computer Science with C++, Allied Publishers, New Delhi, 1997
3. Introduction to C++, Allied Publishers, New Delhi. 1998

He enjoys playing badminton and musical keyboards in his spare time. He also participates in community activities. He can be reached by ahamadalisha@yahoo.com

Comments and Discussions