Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

164 lines
3.1 KiB

  1. /*++
  2. Copyright (c) 1994-1998 Microsoft Corporation
  3. Module Name :
  4. dirbrows.h
  5. Abstract:
  6. Directory Browser Dialog definitions
  7. Author:
  8. Ronald Meijer (ronaldm)
  9. Project:
  10. Internet Services Manager
  11. Revision History:
  12. --*/
  13. #ifndef _DIRBROWS_H
  14. #define _DIRBROWS_H
  15. #ifndef _SHLOBJ_H_
  16. #include <shlobj.h>
  17. #endif // _SHLOBJ_H_
  18. class COMDLL CDirBrowseDlg
  19. /*++
  20. Class Description:
  21. Directory browsing dialog. Use the shell browser functionality to
  22. return a folder. Optionally allow conversion of remote paths to
  23. UNC paths.
  24. Public Interface:
  25. CDirBrowseDlg : Construct the dialog
  26. ~CDirBrowseDlg : Destruct the dialog
  27. GetFullPath : Get the full path selected
  28. --*/
  29. {
  30. //
  31. // Construction
  32. //
  33. public:
  34. //
  35. // standard constructor
  36. //
  37. CDirBrowseDlg(
  38. IN CWnd * pParent = NULL,
  39. IN LPCTSTR lpszInitialDir = NULL
  40. );
  41. ~CDirBrowseDlg();
  42. public:
  43. LPCTSTR GetFullPath(
  44. OUT CString & str,
  45. IN BOOL fConvertToUNC = TRUE
  46. ) const;
  47. virtual int DoModal();
  48. protected:
  49. TCHAR m_szBuffer[MAX_PATH+1];
  50. CString m_strTitle;
  51. CString m_strInitialDir;
  52. BROWSEINFO m_bi;
  53. };
  54. #if 0
  55. // ***************************************************************************
  56. // * *
  57. // * The code below is pre-WIN95 shell directory browsing. It is OBSOLETE *
  58. // * *
  59. // ***************************************************************************
  60. class COMDLL CDirBrowseDlg : public CFileDialog
  61. /*++
  62. Class Description:
  63. Directory browsing dialog. Derived from file browser, but subclassed
  64. so as to allow only directories to be browsed for. Additionally,
  65. it is possible to create new directories, and to network directory
  66. paths to UNC paths.
  67. Public Interface:
  68. CDirBrowseDlg : Construct the dialog
  69. ~CDirBrowseDlg : Destruct the dialog
  70. GetFullPath : Get the full path selected
  71. --*/
  72. {
  73. //
  74. // Construction
  75. //
  76. public:
  77. //
  78. // standard constructor
  79. //
  80. CDirBrowseDlg(
  81. IN LPCTSTR lpszInitialDir = NULL,
  82. IN BOOL bOpenFileDialog = TRUE,
  83. IN LPCTSTR lpszDefExt = NULL,
  84. IN DWORD dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
  85. IN LPCTSTR lpszFilter = NULL,
  86. IN CWnd * pParent = NULL
  87. );
  88. ~CDirBrowseDlg();
  89. //
  90. // Dialog Data
  91. //
  92. //{{AFX_DATA(CDirBrowseDlg)
  93. enum { IDD = IDD_DIRBROWSE };
  94. CEdit m_edit_NewDirectoryName;
  95. CStatic m_static_stc1;
  96. CStatic m_static_stc2;
  97. CString m_strNewDirectoryName;
  98. //}}AFX_DATA
  99. public:
  100. LPCTSTR GetFullPath(
  101. OUT CString & str,
  102. IN BOOL fConvertToUNC = TRUE
  103. ) const;
  104. //
  105. // Implementation
  106. //
  107. protected:
  108. //
  109. // DDX/DDV support
  110. //
  111. virtual void DoDataExchange(
  112. IN CDataExchange* pDX
  113. );
  114. // Generated message map functions
  115. //{{AFX_MSG(CDirBrowseDlg)
  116. virtual BOOL OnInitDialog();
  117. virtual void OnOK();
  118. //}}AFX_MSG
  119. DECLARE_MESSAGE_MAP()
  120. };
  121. #endif // 0
  122. #endif // _DIRBROWS_H