BrowseForFolder


概要

showfilesオプションを指定してFDLog Browse (OpenPath) ダイアログボックスを開きます。

構文

bool BrowseForFolder( string * pstrPath, HWND hWndParent, LPCSTR lpcszTitle, DWORD dwCntrl )

パラメータ

pstrPath
[Input/output] ダイアログが開いたときの初期パス。選択したフォルダのパスを取得します。
hWndParent
[Input] 親ウィンドウ。NULLの場合、Originのメインウィンドウが使用されます。
lpcszTitle
[Input] ダイアログボックスのタイトル(NULLの場合は「フォルダの参照」を使用)。
dwCntrl
[input] BROWSEFOLDER_SHOW_FILES を設定すると、各フォルダの下にファイルが表示されます。

戻り値

フォルダが選択されている場合はtrue、キャンセルボタンをクリックまたはファイルをダブルクリックする場合はfalseになります。

サンプル

EX1

void BrowseForFolder_ex()
{
        string strPath = GetAppPath();
        if( BrowseForFolder(&strPath, NULL, NULL, BROWSEFOLDER_SHOW_FILES) )
                out_str(strPath);
        else
                out_str("please select a folder");
}

備考

関連情報

含めるヘッダ

origin.h

参考情報