2.1.27.2 browse_get_path_dialog


Description

Prompt the user with a dialog for choosing a folder.

Syntax

int browse_get_path_dialog( HWND hwndOwner, LPSTR lpstrNewPath, LPCSTR lpcszDefPath, LPCSTR lpcszMsg, bool bShowFiles = false )

Parameters

hwndOwner
[input] handle to the parent window
lpstrNewPath
[output] pointer to the string that will receive the folder
lpcszDefPath
[input] pointer to the default path
lpcszMsg
[input] pointer to a message that will be displayed at the top of the dialog
bShowFiles
[input] show also files inside the folders or not

Return

IDOK = User seleted a folder

IDCANCEL = User canceled

-1 = Error

Examples

EX1

void browse_get_path_dialog_ex1()
{
    char szNewPath[MAX_PATH];
    string strDefPath = GetAppPath();
    int nRet = browse_get_path_dialog(NULL, szNewPath, strDefPath, "Please choose a folder.");
    switch( nRet )
    {
    case IDOK:
        printf("path == %s\n", szNewPath);
        break;
    case IDCANCEL:
        printf("user canceled\n");
        break;
    default:
        printf("error\n");
        break;
    }
}

Remark

See Also

BrowseGetPath

Header to Include

origin.h

Reference