А, забыл, ещё можно через ActiveX-control htmlfile:
html =
(
<style>
.red {
color: 'red';
}
.lime {
color: 'lime';
}
</style>
<body>
<span class="red">22222222222<br>
2222222<br></span>
<span class="lime">5555555555<br>
5555<br>
55555<br>
55555555<br>
555555<br></span>
<span class="red">222222222<br>
22222222222</span>
</body>
)
Gui, Margin, 0, 0
Gui, Add, ActiveX, vText w475 h400, htmlfile
Text.write(html)
Gui, Show
Return
GuiClose:
ExitApp
C ListView пример есть, но не мой, я не разбирался:
#SingleInstance,Force
Gui, +LastFound
Gui, Add, ListView, x5 y5 w200 h200 vLV_Sample hwndlv,Номер|День
lv:=new ListView(lv)
LV.Add("",1,"Понедельник")
LV.Add("",2,"Вторник")
LV.Add("",3,"Среда")
LV.Add("",4,"Четверг")
LV.Add("",5,"Пятница")
LV.Add("",6,"Субота")
LV.Add("",7,"Воскресенье")
Gui,Show, w210 h210
lv.Color(1,0xA8FFFF,0xC030FF)
lv.Color(3,0xA8FFFF,0xA8FF84)
WinSet,Redraw,,A
Return
GuiClose:
GuiEscape:
Exitapp
class ListView{
static list:=[]
__New(hwnd){
this.list[hwnd]:=this
OnMessage(0x4e,"WM_NOTIFY")
this.hwnd:=hwnd
this.control:=[]
}
add(options,items*){
Gui,ListView,% this.hwnd
for a,b in items{
if A_Index=1
item:=LV_Add(options,b)
Else
LV_Modify(item,"col" A_Index,b)
}
}
clear(){
this.control:=[]
}
Color(item,fore="",back=""){
LV_GetText(text,item)
if fore!=""
this.Control[text,"fore"]:=fore
if Back!=""
this.Control[text,"back"]:=back
}
}
WM_NOTIFY(Param*){
Critical
if (this:=ListView.list[NumGet(Param.2)])&&(NumGet(Param.2,2*A_PtrSize,"int")=-12){
stage:=NumGet(Param.2,3*A_PtrSize,"uint")
if (stage=1)
return 0x20 ;sets CDRF_NOTIFYITEMDRAW
if (stage=0x10001){ ;NM_CUSTOMDRAW && Control is in the list
index:=numget(Param.2,A_PtrSize=4?9*A_PtrSize:7*A_PtrSize,"uint")
LV_GetText(text,index+1)
info:=this.Control[text]
if info.fore!=""
NumPut(info.fore,Param.2,A_PtrSize=4?12*A_PtrSize:10*A_PtrSize,"int") ;sets the foreground
if info.back!=""
NumPut(info.back,Param.2,A_PtrSize=4?13*A_PtrSize:10.5*A_PtrSize,"int") ;sets the background
}
}
}
Разработка AHK-скриптов:
e-mail
dfiveg@mail.ruTelegram
jollycoder