How to customize FolderBrowserDialog's title(Caption)?
Posted Date Unknown Mable 2 Comments

Possible to change FolderBrowserDialog's title?
In a windows forms application.

See All Responses Below...
Author
Message Rating
Posted on: 11/05/2012
I had done this in VC++ years back. Is your language in VC++ or C#.NET?.

Tom

Posted on: 11/05/2012
 See a sample code specially the one in Bold in VC++.. Hope this helps..

CXSBrowseFolder::retCode CXSBrowseFolder::Show(HWND parent, LPSTR pathBuffer)
{

    // Passed in a NULL pointer (!)
    ASSERT(pathBuffer);

    if (!pathBuffer)
        return RET_NOPATH;

    // Return value for the function
    retCode ret = RET_OK;

    LPITEMIDLIST itemIDList;

    // Set up the params
    BROWSEINFO browseInfo;

    // The dialog must have a parent
    ASSERT(parent);

    browseInfo.hwndOwner        = parent;
    browseInfo.pidlRoot            = m_root;
    browseInfo.pszDisplayName    = m_displayName;
    browseInfo.lpszTitle        = m_title;
    browseInfo.ulFlags            = m_style;

    browseInfo.lpfn                = NULL;
    browseInfo.lParam            = 0;
   
    // Show the dialog
    itemIDList = SHBrowseForFolder (&browseInfo);

    // Did user press cancel?
    if (!itemIDList)
        ret = RET_CANCEL;

    // Is everything so far?
    if (ret != RET_CANCEL) {
   
        // Get the path from the returned ITEMIDLIST
        if (!SHGetPathFromIDList(itemIDList, pathBuffer))
            ret = RET_NOPATH;
   
        // Now we need to free the ITEMIDLIST the shell allocated
        LPMALLOC    shellMalloc;
        HRESULT        hr;

        // Get pointer to the shell's malloc interface
        hr = SHGetMalloc(&shellMalloc);

        // Did it work?
        if (SUCCEEDED(hr)) {

            // Free the shell's memory
            shellMalloc->Free(itemIDList);

            // Release the interface
            shellMalloc->Release();

        }
    }
   
return ret;
}

Share this page across other social networking sites



Please Login to Post Your Comments
Name (Max. 100 characters)
Please post your comments here
Select Language
Comments
   Design  HTML
Attach File(Max. Size: 2 MB)
A few simple rules when posting your Comments,
  1. Please post only answers relevant to the topic of discussion.
  2. Please dont misuse this site or do not be abusive, offensive, inappropriate,harass anyone on the boards or post ads or spam. Doing so will delete your inappropriate messages and will block or delete your account on this site. 

TekTipsDownload
GateExam
Academic Projects
TekTipsExperts



 
Site optimized for IE7, 1280 X 768 and above. Copyright © 2010 - 2018 KTS InfoTech
Site Developed Using KTS WebCloud