Window SubClassing另类运用(之二)[9]

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 weizhisheng 的 blog

  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);


本文关键:Delphi,API,Subclass
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top