fist of all you can use CFileDialog to do so.:)
for more information on same you may go throught following link of msdn.
CFileDialog[
^]
Or better refer your msdn.
Now question remain about you need previous directory!!!.
To do so,
CFileDialog open by default CurrentDirectory when it is open.
Means before modal of your CFileDialog if you check
GetCurrentDirectory()
Function you will get one path same path refered by CFileDialog to open.
after that, in any case if you change the current directory you get updated path in CFileDialog.
CurrentDirectory can be change two way.
1)if you call SetCurrentDirectory.
2)And CFileDialog also changes selected path as current directory.
So your solution is that,
1)Never change currentDirectory
Or
2)Better Make on String Variable to store directory path and setDirectory before calling CFileDialog.
;)
Hope it will work for you..
And Yes if you talking about Folder Tree browse dialog then there ,
Not possiblility about setting path.
Because it shows by default Desktop path as currentDirectory.