<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: задание фона в ListView]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=10532</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=10532&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: задание фона в ListView».]]></description>
		<lastBuildDate>Sun, 29 Mar 2015 12:19:43 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: задание фона в ListView]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92843#p92843</link>
			<description><![CDATA[<p>А понял, авто-размер столбов. Спасибо</p>]]></description>
			<author><![CDATA[null@example.com (yalanne)]]></author>
			<pubDate>Sun, 29 Mar 2015 12:19:43 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92843#p92843</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: задание фона в ListView]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92842#p92842</link>
			<description><![CDATA[<p>В данном конкретном случае не нужна, а, например:<br /></p><div class="codebox"><pre><code>#SingleInstance,Force
Gui, +LastFound
Gui, Add, ListView, x5 y5 w200 h200 vLV_Sample hwndlv,Номер|День|Месяц
lv:=new ListView(lv)
LV.Add(&quot;&quot;,1,&quot;Понедельник&quot;,&quot;Сентябрь&quot;)
LV.Add(&quot;&quot;,2,&quot;Вторник&quot;,&quot;Сентябрь&quot;)
LV.Add(&quot;&quot;,3,&quot;Среда&quot;,&quot;Сентябрь&quot;)
LV.Add(&quot;&quot;,4,&quot;Четверг&quot;,&quot;Сентябрь&quot;)
LV.Add(&quot;&quot;,5,&quot;Пятница&quot;,&quot;Сентябрь&quot;)
LV.Add(&quot;&quot;,6,&quot;Субота&quot;,&quot;Сентябрь&quot;)
LV.Add(&quot;&quot;,7,&quot;Воскресенье&quot;,&quot;Сентябрь&quot;)
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,&quot;WM_NOTIFY&quot;)
        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,&quot;col&quot; A_Index,b)
        }
    }
    clear(){
        this.control:=[]
    }
    Color(item,fore=&quot;&quot;,back=&quot;&quot;){
        LV_GetText(text,item)
        if fore!=&quot;&quot;
            this.Control[text,&quot;fore&quot;]:=fore
        if Back!=&quot;&quot;
            this.Control[text,&quot;back&quot;]:=back
    }
}
WM_NOTIFY(Param*){
    Critical
    control:=
    if (this:=ListView.list[NumGet(Param.2)])&amp;&amp;(NumGet(Param.2,2*A_PtrSize,&quot;int&quot;)=-12){
        stage:=NumGet(Param.2,3*A_PtrSize,&quot;uint&quot;)
        if (stage=1)
            return 0x20 ;sets CDRF_NOTIFYITEMDRAW
        if (stage=0x10001){ ;NM_CUSTOMDRAW &amp;&amp; Control is in the list
            index:=numget(Param.2,A_PtrSize=4?9*A_PtrSize:7*A_PtrSize,&quot;uint&quot;)
            LV_GetText(text,index+1)
            info:=this.Control[text]
            if info.fore!=&quot;&quot;
                NumPut(info.fore,Param.2,A_PtrSize=4?12*A_PtrSize:10*A_PtrSize,&quot;int&quot;) ;sets the foreground
            if info.back!=&quot;&quot;
                NumPut(info.back,Param.2,A_PtrSize=4?13*A_PtrSize:10.5*A_PtrSize,&quot;int&quot;) ;sets the background
        }
    }
}</code></pre></div><p>и<br /></p><div class="codebox"><pre><code>#SingleInstance,Force
Gui, +LastFound
Gui, Add, ListView, x5 y5 w200 h200 vLV_Sample hwndlv,Номер|День|Месяц
lv:=new ListView(lv)
LV.Add(&quot;&quot;,1,&quot;Понедельник&quot;,&quot;Сентябрь&quot;)
LV.Add(&quot;&quot;,2,&quot;Вторник&quot;,&quot;Сентябрь&quot;)
LV.Add(&quot;&quot;,3,&quot;Среда&quot;,&quot;Сентябрь&quot;)
LV.Add(&quot;&quot;,4,&quot;Четверг&quot;,&quot;Сентябрь&quot;)
LV.Add(&quot;&quot;,5,&quot;Пятница&quot;,&quot;Сентябрь&quot;)
LV.Add(&quot;&quot;,6,&quot;Субота&quot;,&quot;Сентябрь&quot;)
LV.Add(&quot;&quot;,7,&quot;Воскресенье&quot;,&quot;Сентябрь&quot;)
LV_ModifyCol(2,&quot;AutoHdr&quot;)
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,&quot;WM_NOTIFY&quot;)
        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,&quot;col&quot; A_Index,b)
        }
    }
    clear(){
        this.control:=[]
    }
    Color(item,fore=&quot;&quot;,back=&quot;&quot;){
        LV_GetText(text,item)
        if fore!=&quot;&quot;
            this.Control[text,&quot;fore&quot;]:=fore
        if Back!=&quot;&quot;
            this.Control[text,&quot;back&quot;]:=back
    }
}
WM_NOTIFY(Param*){
    Critical
    control:=
    if (this:=ListView.list[NumGet(Param.2)])&amp;&amp;(NumGet(Param.2,2*A_PtrSize,&quot;int&quot;)=-12){
        stage:=NumGet(Param.2,3*A_PtrSize,&quot;uint&quot;)
        if (stage=1)
            return 0x20 ;sets CDRF_NOTIFYITEMDRAW
        if (stage=0x10001){ ;NM_CUSTOMDRAW &amp;&amp; Control is in the list
            index:=numget(Param.2,A_PtrSize=4?9*A_PtrSize:7*A_PtrSize,&quot;uint&quot;)
            LV_GetText(text,index+1)
            info:=this.Control[text]
            if info.fore!=&quot;&quot;
                NumPut(info.fore,Param.2,A_PtrSize=4?12*A_PtrSize:10*A_PtrSize,&quot;int&quot;) ;sets the foreground
            if info.back!=&quot;&quot;
                NumPut(info.back,Param.2,A_PtrSize=4?13*A_PtrSize:10.5*A_PtrSize,&quot;int&quot;) ;sets the background
        }
    }
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Sun, 29 Mar 2015 10:49:47 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92842#p92842</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: задание фона в ListView]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92840#p92840</link>
			<description><![CDATA[<p>В оригинальном скрипте автора используется вот такая функция <strong>LV_ModifyCol</strong>. Для чего она? я её в своем примере убрал так, как вроде нечего не изменилось.</p>]]></description>
			<author><![CDATA[null@example.com (yalanne)]]></author>
			<pubDate>Sun, 29 Mar 2015 09:51:51 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92840#p92840</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: задание фона в ListView]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92836#p92836</link>
			<description><![CDATA[<p>yalanne, спасибо. То, что доктор прописал <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></description>
			<author><![CDATA[null@example.com (equipment66)]]></author>
			<pubDate>Sun, 29 Mar 2015 07:02:52 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92836#p92836</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: задание фона в ListView]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92828#p92828</link>
			<description><![CDATA[<p>О, не знал! <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Sat, 28 Mar 2015 23:27:30 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92828#p92828</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: задание фона в ListView]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92826#p92826</link>
			<description><![CDATA[<p>Можно!<br />Вот пожалуйста:<br /></p><div class="codebox"><pre><code>#SingleInstance,Force
Gui, +LastFound
Gui, Add, ListView, x5 y5 w200 h200 vLV_Sample hwndlv,Номер|День
lv:=new ListView(lv)
LV.Add(&quot;&quot;,1,&quot;Понедельник&quot;)
LV.Add(&quot;&quot;,2,&quot;Вторник&quot;)
LV.Add(&quot;&quot;,3,&quot;Среда&quot;)
LV.Add(&quot;&quot;,4,&quot;Четверг&quot;)
LV.Add(&quot;&quot;,5,&quot;Пятница&quot;)
LV.Add(&quot;&quot;,6,&quot;Субота&quot;)
LV.Add(&quot;&quot;,7,&quot;Воскресенье&quot;)
Gui,Show,x50 y50 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,&quot;WM_NOTIFY&quot;)
        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,&quot;col&quot; A_Index,b)
        }
    }
    clear(){
        this.control:=[]
    }
    Color(item,fore=&quot;&quot;,back=&quot;&quot;){
        LV_GetText(text,item)
        if fore!=&quot;&quot;
            this.Control[text,&quot;fore&quot;]:=fore
        if Back!=&quot;&quot;
            this.Control[text,&quot;back&quot;]:=back
    }
}
WM_NOTIFY(Param*){
    Critical
    control:=
    if (this:=ListView.list[NumGet(Param.2)])&amp;&amp;(NumGet(Param.2,2*A_PtrSize,&quot;int&quot;)=-12){
        stage:=NumGet(Param.2,3*A_PtrSize,&quot;uint&quot;)
        if (stage=1)
            return 0x20 ;sets CDRF_NOTIFYITEMDRAW
        if (stage=0x10001){ ;NM_CUSTOMDRAW &amp;&amp; Control is in the list
            index:=numget(Param.2,A_PtrSize=4?9*A_PtrSize:7*A_PtrSize,&quot;uint&quot;)
            LV_GetText(text,index+1)
            info:=this.Control[text]
            if info.fore!=&quot;&quot;
                NumPut(info.fore,Param.2,A_PtrSize=4?12*A_PtrSize:10*A_PtrSize,&quot;int&quot;) ;sets the foreground
            if info.back!=&quot;&quot;
                NumPut(info.back,Param.2,A_PtrSize=4?13*A_PtrSize:10.5*A_PtrSize,&quot;int&quot;) ;sets the background
        }
    }
}</code></pre></div><p>Взято от <a href="http://www.autohotkey.com/board/topic/104869-listview-custom-colors-ahk-11">сюда.</a><br />и 16й код цвета можно подобрать&nbsp; <a href="http://www.mathsisfun.com/hexadecimal-decimal-colors.html">тут.</a></p>]]></description>
			<author><![CDATA[null@example.com (yalanne)]]></author>
			<pubDate>Sat, 28 Mar 2015 20:57:04 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92826#p92826</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: задание фона в ListView]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92825#p92825</link>
			<description><![CDATA[<p>Спасибо</p>]]></description>
			<author><![CDATA[null@example.com (equipment66)]]></author>
			<pubDate>Sat, 28 Mar 2015 20:51:36 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92825#p92825</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: задание фона в ListView]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92824#p92824</link>
			<description><![CDATA[<p>Нельзя.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Sat, 28 Mar 2015 20:45:42 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92824#p92824</guid>
		</item>
		<item>
			<title><![CDATA[AHK: задание фона в ListView]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92823#p92823</link>
			<description><![CDATA[<p>Доброе время суток,</p><p>Есть ли возможность в ListView задать фон разного цвета для строк или столбцов (для лучшей читаемости)?</p>]]></description>
			<author><![CDATA[null@example.com (equipment66)]]></author>
			<pubDate>Sat, 28 Mar 2015 20:41:22 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92823#p92823</guid>
		</item>
	</channel>
</rss>
