打印本文 打印本文 关闭窗口 关闭窗口
Window SubClassing另类运用(之二)
作者:武汉SEO闵涛  文章来源:敏韬网  点击数3716  更新时间:2009/4/23 18:39:46  文章录入:mintao  责任编辑:mintao
pdis^.rcItem, GetSysColorBrush(COLOR_HIGHLIGHT));


              SetTextColor(pdis^.hDC, GetsysColor(COLOR_HIGHLIGHTTEXT));


           end


           else begin


              FillRect(pdis^.hDC, pdis^.rcItem, GetSysColorBrush(COLOR_WINDOW));


              SetTextColor(pdis^.hDC, GetSysColor(COLOR_WINDOWTEXT));


           end;


           SetBkMode(pdis^.hDC, TRANSPARENT);


           if csidl<>555 then begin  // csidl


              SHGetSpecialFolderLocation(AWnd, csidl, pidl);


              str := GetNameFromPIDL(pidl);


              GetSmallIconFromPIDL(pidl, himl, iImage);


              ImageList_Draw(himl, iImage, pdis^.hDC, pdis^.rcItem.Left+2, pdis^.rcItem.Top+2, ILD_TRANSPARENT);


              Inc(pdis^.rcItem.Left, 20);


              DrawText(pdis^.hdc, PChar(str), -1, pdis^.rcItem, DT_SINGLELINE or DT_LEFT or DT_VCENTER);


              CoTaskMemFree(pidl);


           end


           else begin // normal path


              SetLength(str, MAX_PATH);


              SendMessage(hCombo, CB_GETLBTEXT, pdis^.itemID, LongInt(PChar(str)));


              str := PChar(str);


              GetSmallIconFromPath(str, himl, iImage);


              ImageList_Draw(himl, iImage, pdis^.hDC, pdis^.rcItem.Left+2, pdis^.rcItem.Top+2, ILD_TRANSPARENT);


              Inc(pdis^.rcItem.Left, 20);


              DrawText(pdis^.hDC, PChar(str), -1, pdis^.rcItem, DT_SINGLELINE or DT_LEFT or DT_VCENTER);


           end;


        end;


end;


 


 


 

上一页  [1] [2] [3] [4] 

打印本文 打印本文 关闭窗口 关闭窗口