Question : How to display full path in SHBrowseForFolder edit box when BIF_EDITBOX is set?

I am using CFolderDialog based on SHBrowseForFolder from

http://www.codeproject.com/dialog/cfolderdialog.asp

with the BIF_EDITBOX flag.

How do I get the edit box to display the full absolute path as folders are clicked (not just the folder name)?

Thanks in advance

Answer : How to display full path in SHBrowseForFolder edit box when BIF_EDITBOX is set?

You may retrieve handle to Edit box window in selection change notofication function using FindWindowEx() and set window text with full path name....

make changes like following :

In FolderDlg.CPP edit CFolderDialog::OnSelChanged() function.... and change it like :

VOID CFolderDialog::OnSelChanged( IN LPITEMIDLIST pItemIDList )
{
      TCHAR szSelFol[ MAX_PATH ] = { 0 };
      
        if( ::SHGetPathFromIDList( pItemIDList, szSelFol ) )
        {
       
         HWND hEdit = FindWindowEx(m_hWnd,NULL,_T("Edit"),NULL);    // **Find Handle to Edit box

      ::SetWindowText(hEdit,szSelFol);        //** Set Edit Box text to Full Folder path

          if( m_bi.ulFlags & BIF_STATUSTEXT )
                  SetStatusText( m_szFolPath );
      }
}

This displays full pathname of selected folder in edit box of Browse for folder dialog.....

-MAHESH
Random Solutions  
 
programming4us programming4us