TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
akhilesh.kumar
NA
7
0
Directory picker dialog???
Jan 8 2004 6:23 PM
Hi, Does any body know how to display a directory picker dialog in CSharp, I have seen many sample but they are so complex for a simple directory picker dialog, is there any simple directory picker sample. I have a very siple directory picker sample written using shell in win32, can it be used in C-sharp if yes how? static BOOL BrowseForDirectory(HWND hWnd, LPTSTR pSelectedPath, LPCTSTR pPrompt) { BOOL result = FALSE; // Assume failure LPMALLOC pMalloc; // Get's the Shell's default allocator if (::SHGetMalloc(&pMalloc) == NOERROR) { BROWSEINFO bi; TCHAR pszBuffer[MAX_PATH]; LPITEMIDLIST pidl; bi.hwndOwner = hWnd; bi.pidlRoot = NULL; bi.pszDisplayName = pszBuffer; bi.lpszTitle = ; bi.ulFlags = BIF_RETURNFSANCESTORS | BIF_RETURNONLYFSDIRS; bi.lpfn = NULL; bi.lParam = 0; if ((pidl = ::SHBrowseForFolder(&bi)) != NULL) { //get path from id if (::SHGetPathFromIDList(pidl, pszBuffer)) { _tcscpy(pSelectedPath, pszBuffer); result = TRUE; } // Free the PIDL allocated by SHBrowseForFolder pMalloc->Free(pidl); } // Release the shell's allocator pMalloc->Release(); } return result; }
Reply
Answers (
3
)
Posting message C-Sharp
How to program Close button of Windows Form