For C++, we all know that "SHBrowseForFolder" can be used to browse folder. For example:
//include Ceshell.lib in the lib
BROWSEINFO bi = { 0 };
bi.lpszTitle = _T("Please select a directory to store pictures!");
LPITEMIDLIST pidl = SHBrowseForFolder ( &bi );
if ( pidl != 0 )
{
CString sPath;
TCHAR* buf = sPath.GetBuffer(MAX_PATH);
SHGetPathFromIDList(pidl, buf); //get a full path
sStatus.Format(_T("%s"),buf );
UpdateData(FALSE);
// free memory used
IMalloc * imalloc = 0;
if ( SUCCEEDED( SHGetMalloc ( &imalloc )) )
{
imalloc->Free ( pidl );
imalloc->Release ( );
}
}
But how to do it in C#? It seems this part is missing?
Wednesday, May 23, 2007
Subscribe to:
Post Comments (Atom)
Blog Archive
-
▼
2007
(13)
-
▼
May
(12)
- MessageBox with more options in C#
- Error Report Example in C#
- Error Report Example in C++
- Ascii to Hex in C#
- Hex to Ascii Conversion in C#
- C# File Open, Save in .Net Framework and Compact F...
- C++ File Open, save in .Net Compact Framework
- How to do a folder browing in .Net Compact Framework?
- Folder Browsing --- Easy way 2
- Folder Browsing --- Easy way 1
- Microsoft way to do folder browsing
- How to do a folder browsing in C#?
-
▼
May
(12)
No comments:
Post a Comment