急!!怎样改变“浏览文件夹”窗口的标题?(在线等待!)(50分)

E

eryu

Unregistered / Unconfirmed
GUEST, unregistred user!
下面的代码可以显示出一个设置文件存放路径的对话框窗口。
我想问一下,这个对话框出来的时候,标题栏里显示的是中文“浏览文件夹”,怎样把
它改成英文的?急!在线等待!
procedure TForm1.Button1Click(Sender: TObject);
var
bi: TBrowseInfo;
pidl: pItemIdList;
strpath, displayname: string;
begin
SetLength (displayname, 100);
bi.hwndOwner := Handle;
bi.pidlRoot := nil;
bi.pszDisplayName := pChar (displayname);
bi.lpszTitle := 'Select a folder';
bi.ulFlags := bif_StatusText;
bi.lpfn := nil;
bi.lParam := 0;
pidl := ShBrowseForFolder (bi);
SetLength (strPath, 100);
ShGetPathFromIdList (pidl, PChar(strPath));
Button1.Text := strPath;
end;
 
无法直接改:
BROWSEINFO
typedef struct _browseinfo {
HWND hwndOwner;
LPCITEMIDLIST pidlRoot;
LPSTR pszDisplayName;
LPCSTR lpszTitle;
UINT ulFlags;
BFFCALLBACK lpfn;
LPARAM lParam;
int iImage;
} BROWSEINFO, *PBROWSEINFO, *LPBROWSEINFO

要改可以的,用窗口钩子,我以前做过。现在不知道代码在哪儿?
 
我找到了:)
function BrowseCallbackProc(Wnd : HWnd;
Msg : UINT;
lParam : LPARAM;
lData : LPARAM) : Integer;
stdcall;
begin
Result := 0;
{ lData is the BrowseInfo's lParam field }
case Msg of
BFFM_INITIALIZED :
//if lData <> 0 then
TExecuteThread(lData).DoThreadShow(Wnd);
SetWindowText(Wnd, 'hello, boy');
end;
end;

procedure TForm1.Button1Click(Sender: TObject);
var
bi: TBrowseInfo;
pidl: pItemIdList;
strpath, displayname: string;
begin
SetLength (displayname, 100);
bi.hwndOwner := Handle;
bi.pidlRoot := nil;
bi.pszDisplayName := pChar (displayname);
bi.lpszTitle := 'Select a folder';
bi.ulFlags := bif_StatusText;
//bi.lpfn := nil;
bi.lpfn := BrowseCallbackProc;
bi.lParam := 0;
pidl := ShBrowseForFolder (bi);
SetLength (strPath, 100);
ShGetPathFromIdList (pidl, PChar(strPath));
caption := strPath;
end;
 
接受答案了.
 
顶部