PathDialog.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. //////////////////////////////////////////////////////////////////////////
  2. //PathDialog.h file
  3. //
  4. //Written by Nguyen Tan Hung <[email protected]>
  5. //////////////////////////////////////////////////////////////////////////
  6. #if !defined(AFX_PATHDIALOG_H__0F70BC86_11DB_11D4_B012_0000E8DD8DAA__INCLUDED_)
  7. #define AFX_PATHDIALOG_H__0F70BC86_11DB_11D4_B012_0000E8DD8DAA__INCLUDED_
  8. #if _MSC_VER > 1000
  9. #pragma once
  10. #endif // _MSC_VER > 1000
  11. // PathDialog.h : header file
  12. //
  13. #include "shlobj.h"
  14. class CPathDialog;
  15. // CPathDialogSub - intercepts messages from child controls
  16. class CPathDialogSub : public CWnd
  17. {
  18. friend CPathDialog;
  19. public:
  20. CPathDialog* m_pPathDialog;
  21. protected:
  22. afx_msg void OnOK(); // OK button clicked
  23. afx_msg void OnChangeEditPath();
  24. DECLARE_MESSAGE_MAP()
  25. private:
  26. };
  27. /////////////////////////////////////////////////////////////////////////////
  28. // CPathDialog dialog
  29. class CPathDialog
  30. {
  31. friend CPathDialogSub;
  32. // Construction
  33. public:
  34. CPathDialog(LPCTSTR lpszCaption=NULL,
  35. LPCTSTR lpszTitle=NULL,
  36. LPCTSTR lpszInitialPath=NULL,
  37. CWnd* pParent = NULL);
  38. CString GetPathName();
  39. virtual int DoModal();
  40. static Touch(LPCTSTR lpPath, BOOL bValidate=TRUE);
  41. static int MakeSurePathExists(LPCTSTR lpPath);
  42. static BOOL IsFileNameValid(LPCTSTR lpFileName);
  43. static int ConcatPath(LPTSTR lpRoot, LPCTSTR lpMorePath);
  44. private:
  45. static int CALLBACK BrowseCallbackProc(HWND hwnd,UINT uMsg,LPARAM lParam, LPARAM pData);
  46. LPCTSTR m_lpszCaption;
  47. LPCTSTR m_lpszInitialPath;
  48. TCHAR m_szPathName[MAX_PATH];
  49. BROWSEINFO m_bi;
  50. HWND m_hWnd;
  51. CWnd* m_pParentWnd;
  52. BOOL m_bParentDisabled;
  53. BOOL m_bGetSuccess;
  54. CPathDialogSub m_PathDialogSub;
  55. };
  56. //{{AFX_INSERT_LOCATION}}
  57. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  58. #endif // !defined(AFX_PATHDIALOG_H__0F70BC86_11DB_11D4_B012_0000E8DD8DAA__INCLUDED_)