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

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

本文简介:选择自 weizhisheng 的 blog

    getclassname(wnd, classname, 80);


    if lstrcmpi(classname, 'systreeview32')=0 then begin


       found := true;


       break;


    end;


    wnd := getwindow(wnd, gw_hwndnext);


  end;


  if not found then exit;


为了能够让插入的combobox和其他窗口控件的布局协调一致,首先需要找到用来显示文件夹的treeview窗口。我的计划是:让combobox占据treeview原来的位置(当然它的高度要比treeview小得多),然后,包括treeview在内的其他窗口依次下移。下面是实现代码:


  // add combo box and move other controls down


  getwindowrect(wnd, rc);


  screentoclient(awnd, rc.topleft);


  screentoclient(awnd, rc.bottomright);


  wndcombo := createwindow('combobox', '',


                         ws_child or ws_visible or cbs_dropdownlist or cbs_ownerdrawfixed or cbs_hasstrings,


                         rc.left, rc.top,


                         rc.right-rc.left, rc.bottom-rc.top,


                         awnd, hmenu(idc_combo),


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

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

go top