<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK V2: Edit. Добавляем строки и скролим вниз]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=18288&amp;type=atom" />
	<updated>2024-08-24T19:56:37Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=18288</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK V2: Edit. Добавляем строки и скролим вниз]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=161491#p161491" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p><strong>Anfanger</strong><br />Отлично, что используете v2. В скрипте есть недостаток: если во время заполнения кликнуть в edit куда-нибудь выше, порядок сломается.</p></blockquote></div><p>Спасибо. Не учёл, что можно изменить положение курсора.</p><p>Исправил.</p><div class="codebox"><pre><code>
MyGui := Gui()
MyEdit := MyGui.Add(&quot;Edit&quot;, &quot;r9 w300&quot;, )
MyGui.Show

NewlineEdit := &quot;`r`n&quot;
GuiEditAppend(MyEdit, &quot;Start:&quot;)

Loop 50
{
	GuiEditAppend(MyEdit, NewlineEdit . A_Index)
	Sleep 1000
}


GuiEditAppend(hEdit, Append) {
    ; Calculate required size and allocate a buffer.
    buf := Buffer(StrPut(Append))
    ; Copy or convert the string.
    StrPut(Append, buf)
    Static EM_SETSEL:=0xB1
	; Устанавливаем курсор в конец текста
    SendMessage EM_SETSEL, -2, -1, hEdit			
	Static EM_REPLACESEL:=0x00C2
	SendMessage EM_REPLACESEL, False, buf.Ptr, hEdit
}
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Anfanger]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=44013</uri>
			</author>
			<updated>2024-08-24T19:56:37Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=161491#p161491</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK V2: Edit. Добавляем строки и скролим вниз]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=161485#p161485" />
			<content type="html"><![CDATA[<p>Нет вроде.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2024-08-24T08:18:16Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=161485#p161485</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK V2: Edit. Добавляем строки и скролим вниз]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=161484#p161484" />
			<content type="html"><![CDATA[<p>В AHK v2 нет встроенных методов добавления строк?</p>]]></content>
			<author>
				<name><![CDATA[Alectric]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26027</uri>
			</author>
			<updated>2024-08-24T07:59:14Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=161484#p161484</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK V2: Edit. Добавляем строки и скролим вниз]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=161480#p161480" />
			<content type="html"><![CDATA[<p><strong>Anfanger</strong><br />Отлично, что используете v2. В скрипте есть недостаток: если во время заполнения кликнуть в edit куда-нибудь выше, порядок сломается.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2024-08-24T07:11:02Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=161480#p161480</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK V2: Edit. Добавляем строки и скролим вниз]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=161478#p161478" />
			<content type="html"><![CDATA[<p>Идея взята с <a href="https://www.autohotkey.com/boards/viewtopic.php?p=322832#p322832">www.autohotkey.com</a> и переделана под AHK V2. Спасибо just me</p><br /><div class="codebox"><pre><code>
MyGui := Gui()
MyEdit := MyGui.Add(&quot;Edit&quot;, &quot;r9 w300&quot;, )
MyGui.Show

NewlineEdit := &quot;`r`n&quot;
GuiEditAppend(MyEdit, &quot;Start:&quot;)

Loop 20
{
	GuiEditAppend(MyEdit, NewlineEdit . A_Index)
	Sleep 500
}


GuiEditAppend(hEdit, Append) {
    ; Calculate required size and allocate a buffer.
    buf := Buffer(StrPut(Append))
    ; Copy or convert the string.
    StrPut(Append, buf)
	SendMessage 0x00C2, False, buf.Ptr, hEdit
}
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Anfanger]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=44013</uri>
			</author>
			<updated>2024-08-24T00:17:18Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=161478#p161478</id>
		</entry>
</feed>
