Home » Category » Microsoft Visual C & C++

Microsoft Visual C & C++: CFileDialog customization

205| Mon, 02 Jun 2008 12:47:00 GMT| anonymous| Comments (2)
I have my own class I have derived from CFileDialog and I
want to filter the "Look In" combo box so it only contains
the folders I want the user to be able to navigate to.

I can easily gain access to the CComboBox but I'm having
difficulties filtering the contents. I can't really go
from the text of the item, because I really need the full
path.

There is a trick with the list control of the file dialog
in that each item display has its PIDL stored in the lParam
of the list item. I was hoping there would be a similar
trick to the items in the combobox. I can do a GetItemData()
and it does give me something that looks like a pointer,
but I don't know what it is pointing to.

If anyone has ever attempted this and can give me some hints
I would greatly appreciate it.

Thanks

P.S. If you want to know about the list control trick, go here:
http://msdn.microsoft.com/msdnmag/issues/03/09/CQA/

Keywords & Tags: cfiledialog, customization, microsoft, visual c++, vc

URL: http://www.7prog.com/visual-c-c++/44505/
 
«« Prev - Next »» 2 helpful answers below.
I have never done that, I have never seen that done before. Not to say that
it can't be done.

But here is another suggestion. You can user Hans XFileDialog that shows how
to customize the CFileDialog, he adds a recent folder combo box at the
bottom of the dialog box. You can use this method to hide the normal folder
combobox at the top of the dialog and place you own combo box in it's place,
that has exactly what you want in it.

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

AliR.

"Murrgon" <murrgon...hotmail.com> wrote in message
news:uhW2rjSGFHA.2588...TK2MSFTNGP09.phx.gbl...
> I have my own class I have derived from CFileDialog and I
> want to filter the "Look In" combo box so it only contains
> the folders I want the user to be able to navigate to.
> I can easily gain access to the CComboBox but I'm having
> difficulties filtering the contents. I can't really go
> from the text of the item, because I really need the full
> path.
> There is a trick with the list control of the file dialog
> in that each item display has its PIDL stored in the lParam
> of the list item. I was hoping there would be a similar
> trick to the items in the combobox. I can do a GetItemData()
> and it does give me something that looks like a pointer,
> but I don't know what it is pointing to.
> If anyone has ever attempted this and can give me some hints
> I would greatly appreciate it.
> Thanks
> P.S. If you want to know about the list control trick, go here:
> http://msdn.microsoft.com/msdnmag/issues/03/09/CQA/

alir | Mon, 02 Jun 2008 12:48:00 GMT |

Go back in the handler function of CDN_FOLDERCHANGE(
CFileDialog::OnFolderChange) if the user navigated to a wrong folder may
work.

"Murrgon" <murrgon...hotmail.com>
':uhW2rjSGFHA.2588...TK2MSFTNGP09.phx.gbl...
>I have my own class I have derived from CFileDialog and I
> want to filter the "Look In" combo box so it only contains
> the folders I want the user to be able to navigate to.
> I can easily gain access to the CComboBox but I'm having
> difficulties filtering the contents. I can't really go
> from the text of the item, because I really need the full
> path.
> There is a trick with the list control of the file dialog
> in that each item display has its PIDL stored in the lParam
> of the list item. I was hoping there would be a similar
> trick to the items in the combobox. I can do a GetItemData()
> and it does give me something that looks like a pointer,
> but I don't know what it is pointing to.
> If anyone has ever attempted this and can give me some hints
> I would greatly appreciate it.
> Thanks
> P.S. If you want to know about the list control trick, go here:
> http://msdn.microsoft.com/msdnmag/issues/03/09/CQA/

jiangshengmvpvc | Mon, 02 Jun 2008 12:49:00 GMT |

Microsoft Visual C & C++ Hot Answers

Microsoft Visual C & C++ New questions

Microsoft Visual C & C++ Related Categories