Вверх ↑
Ответов: 5227
Рейтинг: 586
#1: 2022-06-20 06:18:06 ЛС | профиль | цитата
envoy_sky, такая схемка пойдёт
Add(MainForm,1060781,84,133)
{
Width=721
Height=373
Caption="ImgList"
}
Add(StringTable,740573,245,63)
{
Left=190
Top=15
Width=465
Height=290
Flat=1
Point(PHandle)
}
Add(InlineCode,3320836,259,140)
{
WorkPoints=#9:doGetIcon|
DataPoints=#8:ListView|8:FileName|
Code=#26:{ Author -=andrestudio=- }|15:unit HiAsmUnit;|0:|9:interface|0:|29:uses kol,Windows,Share,Debug;|0:|4:type|28: THiAsmClass = class(TDebug)|10: private|0:|9: public|34: ListView,FileName: THI_Event;|51: procedure doGetIcon(var dt: TData; idx: word);|0:|5: end;|1: |63: function ExtractIconEx(lpszFile: PChar; nIconIndex: Integer;|70: var phiconLarge, phiconSmall: HICON; nIcons: UINT): UINT; stdcall;|50: external 'shell32.dll' name 'ExtractIconExA';|0:|14:implementation|0:|32:procedure THiAsmClass.doGetIcon;|3:var|13: i: integer;|15: LV: PControl;|23: Icon32,Icon16: HICON;|13: fn: string;|4: |5:begin|33: LV := ReadControl(ListView,'');|24: LV.LVStyle := lvsIcon;|32: fn := ToStringEvent(FileName);|11: LV.Clear;|26: LV.ImageListNormal.Free;|42: LV.ImageListNormal := NewImageList(nil);|36: LV.ImageListNormal.ImgWidth := 32;|52: LV.ImageListNormal.BkColor := Color2RGB(clWindow);|38: LV.LVBkColor := Color2RGB(clWindow);|42: LV.LVTextBkColor := Color2RGB(clWindow);|84: SendMessage(LV.Handle, LVM_SETIMAGELIST, LVSIL_NORMAL, LV.ImageListNormal.Handle);|17: LV.BeginUpdate;|6: try|9: i:=0;|70: while Integer(ExtractIconEx(PAnsiChar(fn),i,Icon32,Icon16,1))>0 do|10: begin|43: LV.LVItemAdd('Index - '+Int2Str(i));|41: LV.ImageListNormal.AddIcon(Icon32);|34: LV.LVItemImageIndex[i] := i;|13: inc(i);|9: end;|9: except|22: _debug('Error');|7: end;|16: LV.EndUpdate;|20: LV.Invalidate; |4:end;|0:|4:end.|
link(ListView,740573:PHandle,[])
link(FileName,11900013:String,[(272,128)(237,128)(237,184)(202,184)])
}
Add(ListBox,11900013,175,133)
{
Left=20
Top=15
Width=130
Height=290
Strings=#11:shell32.dll|12:imageres.dll|10:ddores.dll|12:netshell.dll|19:Networkexplorer.dll|12:setupapi.dll|10:Wmploc.dll|12:wpdshext.dll|12:compstui.dll|11:ieframe.dll|12:dmdskres.dll|11:dsuiext.dll|12:wiashext.dll|10:comres.dll|
Point(String)
link(onClick,3320836:doGetIcon,[])
}




добавил ресурсы по наводке от Gunta
карма: 4
Мой форум - http://hiasm.bbtalk.me/ схемы, компоненты...
3
Голосовали:tig-rrr, makcum15, ric
Редактировалось 3 раз(а), последний 2022-06-20 07:03:07