home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 27 / IOPROG_27.ISO / SOFT / CCARACT.ZIP / cchxdir.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-23  |  630 b   |  33 lines

  1. #include <afxwin.h>
  2. #include <shlobj.h>
  3. #pragma hdrstop
  4. #include "cchxdir.hpp"
  5.  
  6. CChxDir::CChxDir()
  7. {
  8. }
  9.  
  10. CChxDir::~CChxDir()
  11. {
  12. }
  13.  
  14. bool CChxDir::Get( CWnd * parent, char * buffer, char * title )
  15. {
  16.  BROWSEINFO bi;
  17.  LPITEMIDLIST rc;
  18.  
  19.  bi.hwndOwner = parent->m_hWnd;
  20.  bi.pidlRoot = NULL;
  21.  bi.pszDisplayName = buffer; // Repertoire choisit
  22.  bi.lpszTitle = title; // Titre de la boite de dialogue
  23.  bi.ulFlags = BIF_RETURNONLYFSDIRS;
  24.  bi.lpfn = NULL;  // Fonction eventuelle
  25.  bi.lParam = 0;
  26.  
  27.  rc = SHBrowseForFolder( &bi );
  28.  if ( !rc  ) return(FALSE);
  29.  SHGetPathFromIDList( rc, buffer );
  30.  return(true);
  31. }
  32.  
  33.