SelectDirectory函数显示中文?

cxxer 2022-04-03 17:47:13
void __fastcall TfrmMain::Button1Click(TObject *Sender)
{
	const int SELDIRHELP = 1000;
	String Dir = "D:\\Documents";
	if (SelectDirectory(Dir, TSelectDirOpts() << sdAllowCreate
						<< sdPerformCreate << sdPrompt,SELDIRHELP))

	if(!Dir.IsEmpty())
		Edit1->Text = Dir;
}

 SelectDirectory函示中文界面只有自己重做吗?

 

...全文
249 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
青蛙工作室 2022-04-14
  • 打赏
  • 举报
回复

SelectDirectory是CB的东西,不是windows的,你的CB是英文版,它应该就是英文界面。至于显示中文字,你让CB去哪里弄中文字?

cxxer 2022-04-04
  • 打赏
  • 举报
回复

img


void __fastcall TfrmMain::Button1Click(TObject *Sender)
{
    BROWSEINFO bi;
    ZeroMemory(&bi,sizeof(BROWSEINFO));
    LPMALLOC pMalloc;
    LPITEMIDLIST pidl = SHBrowseForFolder(&bi);
    String AppPath;
    if(pidl != nullptr)
    {
        SHGetPathFromIDList(pidl, AppPath.c_str());
        Application->MessageBox(AppPath.c_str(), L"浏览文件夹", MB_OK);
        if(SUCCEEDED(SHGetMalloc(&pMalloc)))
        {
            pMalloc->Free(pidl);
            pMalloc->Release();
        }
    }
    else
        Application->MessageBox(L"选择为空", L"浏览文件夹", MB_OK);
}
ooolinux 2022-04-03
  • 打赏
  • 举报
回复

SelectDirectory有另一个重载的函数,参数不同,你试试那个。

taozc 2022-04-03
  • 打赏
  • 举报
回复 1

SHBrowseForFolder

13,873

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧