<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Чтение части списка]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=8547&amp;type=atom" />
	<updated>2013-11-29T17:21:20Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=8547</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Чтение части списка]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=77716#p77716" />
			<content type="html"><![CDATA[<p>Нет такого параметра как &quot;Row&quot;.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2013-11-29T17:21:20Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=77716#p77716</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Чтение части списка]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=77715#p77715" />
			<content type="html"><![CDATA[<p>Правильно я понял, что<br /></p><div class="codebox"><pre><code>ControlGet, var, List, Col1, SysListView321, ЗаголовокПрограммы</code></pre></div><p>это нормально, а <br /></p><div class="codebox"><pre><code>ControlGet, var, List, Row1, SysListView321, ЗаголовокПрограммы</code></pre></div><p>неверный код?</p>]]></content>
			<author>
				<name><![CDATA[Pokerist]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24990</uri>
			</author>
			<updated>2013-11-29T17:18:46Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=77715#p77715</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Чтение части списка]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=77713#p77713" />
			<content type="html"><![CDATA[<p>В некоторых SysListView32 работает так:<br /></p><div class="codebox"><pre><code>
#SingleInstance Force
#Persistent  

 ; http://www.autohotkey.com/board/topic/81820-how-to-get-specific-row-text-in-a-syslistview32-easily/#entry522080 
 
row := 1 ; Какую строку читать
   
ControlGet, handle, Hwnd, , SysListView321, ahk_class µTorrent4823DF041B09 
 ; ControlGet, handle, Hwnd, , SysListView321, ahk_class Progman 
 ; У меня не работает на рабочем столе

ControlGet, CountCol, List,Count Col,, ahk_id %handle%
 
Loop % CountCol
    Text .= LvGetText(handle, row, A_Index) . (A_Index = CountCol ? &quot;&quot; : &quot;  |  &quot;)
    
MsgBox % Text

LvGetText(hListView,r=1,c=1)
{
    r--, ntemp := dwProcessId := 0
    DllCall(&quot;GetWindowThreadProcessId&quot;, UInt,hListView, UIntP,dwProcessId)
    hProcess := DllCall(&quot;OpenProcess&quot;, UInt,0x001F0FFF, Int,false, UInt,dwProcessId) ; 0x001F0FFF = PROCESS_ALL_ACCESS
    lpProcessBuf1 := DllCall(&quot;VirtualAllocEx&quot;, UInt,hProcess, UInt,ntemp, UInt,28, UInt,0x1000, UInt,4)
       ; 28 = size of lvItem, 0x1000 = MEM_COMMIT, 4 = PAGE_READWRITE
    lpProcessBuf2 := DllCall(&quot;VirtualAllocEx&quot;, UInt,hProcess, UInt,ntemp, UInt,512, UInt,0x1000, UInt,4) ; text buffer
    VarSetCapacity(t, 511, 1)
    VarSetCapacity(lvItem, 28)
    NumPut(1, lvItem, &quot;uint&quot;)  ; mask
    NumPut(0, lvItem, A_PtrSize, &quot;int&quot;)  ; iItem 0 means the first row; anyhow, when sending the LVM_GETITEMTEXT message, we can specify a different item
    NumPut(c-1, lvItem, A_PtrSize * 2, &quot;int&quot;)  ; iSubItem 0 means the first column
    NumPut(lpProcessBuf2, lvItem, A_PtrSize * 5, &quot;ptr&quot;)  ; pszText
    NumPut(512, lvItem, A_PtrSize * 6) ; cchTextMax
    DllCall(&quot;WriteProcessMemory&quot;, UInt,hProcess, UInt,lpProcessBuf1, UInt,&amp;lvItem, UInt,28, UInt,ntemp)
    DllCall(&quot;SendMessage&quot;, &quot;uint&quot;, hListView, &quot;uint&quot;, (A_IsUnicode ? 0x1000 + 0x73 : 0x1000 + 0x2D), &quot;uint&quot;, r, &quot;ptr&quot;, lpProcessBuf1)
    DllCall(&quot;ReadProcessMemory&quot;, UInt,hProcess, UInt,lpProcessBuf2, UInt,&amp;t, UInt,512, UInt,ntemp)
    DllCall(&quot;VirtualFreeEx&quot;, UInt,hProcess, UInt,lpProcessBuf1, UInt,0, UInt,0x8000) ; 0x8000 = MEM_RELEASE
    DllCall(&quot;VirtualFreeEx&quot;, UInt,hProcess, UInt,lpProcessBuf2, UInt,0, UInt,0x8000)
    DllCall(&quot;CloseHandle&quot;, UInt,hProcess) 
    return t
}

Esc:: 
    ExitApp
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2013-11-29T16:31:59Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=77713#p77713</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Чтение части списка]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=77705#p77705" />
			<content type="html"><![CDATA[<p>Смелое предположение, что если существует &quot;Col4 считывает только четвёртую колонку (поле). Замените 4 на нужный номер.&quot;, то должен быть и&nbsp; &quot;Row1&quot;. Как-то нелогично, что колонками читать можно, а строками нет.<br />&nbsp; Ошибка?</p>]]></content>
			<author>
				<name><![CDATA[Pokerist]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24990</uri>
			</author>
			<updated>2013-11-29T13:54:43Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=77705#p77705</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Чтение части списка]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=77703#p77703" />
			<content type="html"><![CDATA[<p>А что за параметр такой: &quot;Row1&quot;?</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2013-11-29T13:40:58Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=77703#p77703</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Чтение части списка]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=77699#p77699" />
			<content type="html"><![CDATA[<p>А у меня очень долго читается список. Он, правда большой. 100000 строк и 9 колонок.&nbsp; Вот это <br /></p><div class="codebox"><pre><code> ControlGet, List1, List, , SysListView321, ЗаголовокПрограммы</code></pre></div><p> занимает до минуты.</p><p> Пробовал читать строками<br /></p><div class="codebox"><pre><code>ControlGet, var, List, Row1, SysListView321, ЗаголовокПрограммы</code></pre></div><p> всё равно читает весь список. Хотя то&nbsp; же самое с &quot;Col1&quot; работает - читаются именно колонки. Так и должно быть?</p>]]></content>
			<author>
				<name><![CDATA[Pokerist]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24990</uri>
			</author>
			<updated>2013-11-29T12:56:33Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=77699#p77699</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Чтение части списка]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=74444#p74444" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong>, спасибо, теперь время выполнения кода укладывается в минуту, основное время загрузки видимо занимала запись в ini фаил</p>]]></content>
			<author>
				<name><![CDATA[cbbelor]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=30550</uri>
			</author>
			<updated>2013-08-12T12:14:52Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=74444#p74444</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Чтение части списка]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=74326#p74326" />
			<content type="html"><![CDATA[<p>Вот так можно попробовать:<br /></p><div class="codebox"><pre><code>Number := 100

ControlGet, List1, List, , SysListView321, ЗаголовокПрограммы

Loop, Parse, List1, `n 
{
   IniWrite, %A_LoopField%, D:\ListMess.ini, List_In, Ms%A_Index%
   NumIn := A_Index
} until A_Index = Number

IniWrite,  %NumIn%, D:\ListMess.ini, List_In, Total</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2013-08-08T14:45:17Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=74326#p74326</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Чтение части списка]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=74318#p74318" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>считать в переменную только определенное число строк</p></blockquote></div><p>ControlGet, так долго загружает в переменную?</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2013-08-08T12:26:05Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=74318#p74318</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Чтение части списка]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=74310#p74310" />
			<content type="html"><![CDATA[<p>Добрый день. Необходимо сделать так, что бы список из одной программы отображался на других компьютерах сети. Основная проблема заключается в размерах списка, более 4 тысяч позиций. При этом более свежая часть списка(скажем последние 50 – 100 позиций) могут периодически обновляться. И их нужно считывать каждые 5-10 минут.<br />C чтением списка справляется такой код:<br /></p><div class="codebox"><pre><code>ControlGet, List1, List, , SysListView321, ЗаголовокПрограммы

Loop, Parse, List1, `n 
{
IniWrite, %A_LoopField%, D:\ListMess.ini, List_In, Ms%A_Index%
NumIn := A_Index
}

IniWrite,  %NumIn%, D:\ListMess.ini, List_In, Total
</code></pre></div><p>Но, это действие занимает у него пару минут, и хорошо грузит старенький компьютер. Есть возможность считать в переменную только определенное число строк из начала списка?</p>]]></content>
			<author>
				<name><![CDATA[cbbelor]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=30550</uri>
			</author>
			<updated>2013-08-08T08:38:52Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=74310#p74310</id>
		</entry>
</feed>
