if assigned(oldbrowseproc) then
result := oldbrowseproc(awnd, umsg, wp, lp);
end;
在newbrowseproc中必须处理几条消息。第一个就是用户在combobox中选择一项的时候,在treeview中必须同步跳转到同样的文件夹:
case umsg of
wm_command:
if hiword(wp)=cbn_selchange then begin
hcombo := getdlgitem(awnd, idc_combo);
index := sendmessage(hcombo, cb_getcursel, 0, 0);
if index=cb_err then exit;
csidl := sendmessage(hcombo, cb_getitemdata, index, 0);
if csidl<>555 then begin // csidl
shgetspecialfolderlocation(awnd, csidl, pidl);
sendmessage(awnd, bffm_setselection, 0, longint(pidl));
cotaskmemfree(pidl);
end
else begin // normal folder
setlength(str, max_path);
sendmessage(hcombo, cb_getlbtext, index, longint(pchar(str)));
str := pchar(str);