<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Как извлечь текст из контрола?]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=8093</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=8093&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Как извлечь текст из контрола?».]]></description>
		<lastBuildDate>Tue, 23 Jul 2013 15:17:15 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Как извлечь текст из контрола?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=74007#p74007</link>
			<description><![CDATA[<p>Перенёс в отдельную тему.</p>]]></description>
			<author><![CDATA[null@example.com (Pokerist)]]></author>
			<pubDate>Tue, 23 Jul 2013 15:17:15 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=74007#p74007</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Как извлечь текст из контрола?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=70947#p70947</link>
			<description><![CDATA[<p>Так можно попробовать:<br /></p><div class="codebox"><pre><code>ControlGet, OutputVar, Hwnd,, Internet Explorer_Server1, ahk_class IEFrame
if (OutputVar = &quot;&quot;)
{
   ToolTip, Контрол не найден!
   return
}

msg := DllCall(&quot;RegisterWindowMessage&quot;, Str, &quot;WM_HTML_GETOBJECT&quot;)
SendMessage, msg,,,, ahk_id %OutputVar%

DllCall(&quot;oleacc\ObjectFromLresult&quot;, Ptr, ErrorLevel, Ptr, 0, Ptr, 0, PtrP, pdoc)
        
HTMLDocument := ComObjEnwrap(pdoc)
ObjRelease(pdoc)

if !IsObject(HTMLDocument)
   return

var := HTMLDocument.body.innerText
HTMLDocument := &quot;&quot;</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Sat, 30 Mar 2013 19:58:54 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=70947#p70947</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Как извлечь текст из контрола?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=70946#p70946</link>
			<description><![CDATA[<p>Ничего с этим сделать нельзя?</p>]]></description>
			<author><![CDATA[null@example.com (Pokerist)]]></author>
			<pubDate>Sat, 30 Mar 2013 19:14:03 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=70946#p70946</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Как извлечь текст из контрола?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=70741#p70741</link>
			<description><![CDATA[<p>Всё равно сбоит. Предупреждение :<br /></p><div class="quotebox"><blockquote><p>Отказано в доступе ...&quot;файл скрипта&quot;...<br />....<br />Specificaty: body</p></blockquote></div><p>В строке <br /> if(HTMLDocument&amp;&amp;HTMLDocument.body)</p>]]></description>
			<author><![CDATA[null@example.com (Pokerist)]]></author>
			<pubDate>Sun, 24 Mar 2013 16:24:27 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=70741#p70741</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Как извлечь текст из контрола?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=70693#p70693</link>
			<description><![CDATA[<div class="quotebox"><cite>Pokerist пишет:</cite><blockquote><p>Можно как-то предусмотреть эти обстоятельства и предотвратить остановку работы скрипта?</p></blockquote></div><p>ну дык как всегда:<br /></p><div class="codebox"><pre><code>if(HTMLDocument&amp;&amp;HTMLDocument.body) 
{
    var := HTMLDocument.body.innerText
    HTMLDocument := &quot;&quot;
}
else
    msgbox error</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Александр_)]]></author>
			<pubDate>Sat, 23 Mar 2013 22:11:25 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=70693#p70693</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Как извлечь текст из контрола?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=70691#p70691</link>
			<description><![CDATA[<p>Появился вопрос.&nbsp; Иногда, при закрытии окна, работа скрипта срывается и появляется сообщение &quot;No Valid COM Object!&quot; с указанием на предпоследнюю строку:</p><br /><br /><div class="codebox"><pre><code>ControlGet, OutputVar, Hwnd,, Internet Explorer_Server1, ahk_class IEFrame
if (OutputVar = &quot;&quot;)
{
   ToolTip, Контрол не найден!
   return
}

msg := DllCall(&quot;RegisterWindowMessage&quot;, Str, &quot;WM_HTML_GETOBJECT&quot;)
SendMessage, msg,,,, ahk_id %OutputVar%

DllCall(&quot;oleacc\ObjectFromLresult&quot;, Ptr, ErrorLevel, Ptr, 0, Ptr, 0, PtrP, pdoc)
        
HTMLDocument := ComObjEnwrap(pdoc)
ObjRelease(pdoc)

var := HTMLDocument.body.innerText
HTMLDocument := &quot;&quot;</code></pre></div><br /><br /><br /><p>&nbsp; &nbsp;Можно как-то предусмотреть эти обстоятельства и предотвратить остановку работы скрипта?</p>]]></description>
			<author><![CDATA[null@example.com (Pokerist)]]></author>
			<pubDate>Sat, 23 Mar 2013 21:54:32 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=70691#p70691</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Как извлечь текст из контрола?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=69683#p69683</link>
			<description><![CDATA[<div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><div class="quotebox"><blockquote><p>Осталось понять в чём же тут принципиальная разница между</p></blockquote></div><p>В зависимости от раскладки. Никогда не пишите буквенно символьные клавиши по их именам. Замечал что само действие {CtrlDown} не всегда надёжно, видимо ос неуспевает решить что Ctrl удержан а уже послана след. кнопка, а ^{vk41} посылает сразу нажатие с модификатором.<br />Хотя Send, {CtrlDown}{vk41}{CtrlUp} вполне работает.</p></blockquote></div><p>&nbsp; &nbsp;Во втором случае OC &quot;успевает решить, что Ctrl удержан&quot;,&nbsp; а в&nbsp; первом нет?&nbsp; Странно как-то :-/</p>]]></description>
			<author><![CDATA[null@example.com (Pokerist)]]></author>
			<pubDate>Thu, 21 Feb 2013 07:43:38 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=69683#p69683</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Как извлечь текст из контрола?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=69674#p69674</link>
			<description><![CDATA[<div class="quotebox"><blockquote><p><strong>Pokerist пишет:</strong><br />С кодами&nbsp; я знаком.&nbsp; Почему работает по разному не понимаю.</p></blockquote></div><p>Вы про это:&nbsp; <em>^ и {CtrlDown}</em> , или про это <em>{vk41} и {A}</em>.</p><p><strong>OFF:</strong><br /></p><div class="quotebox"><blockquote><p><strong>teadrinker пишет:</strong><br />Если это действительно контрол Internet Explorer_Server, то примерно так, только указать верное название контрола и окна.</p></blockquote></div><p>Мда, с памятью у меня беда...</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Wed, 20 Feb 2013 20:21:38 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=69674#p69674</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Как извлечь текст из контрола?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=69672#p69672</link>
			<description><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Если это действительно контрол <em>Internet Explorer_Server</em>, то примерно <a href="http://forum.script-coding.com/viewtopic.php?pid=68054#p68054">так</a>, только указать верное название контрола и окна.</p></blockquote></div><p>&nbsp; Раз &quot;Window Spy&quot; сказал, что это он, то так оно и есть! <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /><br />&nbsp; Огромное спасибо!&nbsp; Сработало великолепно! Не нужны клики, не нужна даже видимость самого контрола! Всё великолепно читается без малейших сбоев.</p>]]></description>
			<author><![CDATA[null@example.com (Pokerist)]]></author>
			<pubDate>Wed, 20 Feb 2013 17:18:43 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=69672#p69672</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Как извлечь текст из контрола?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=69671#p69671</link>
			<description><![CDATA[<div class="quotebox"><cite>Pokerist пишет:</cite><blockquote><p>Не могу с помощью скрипта получить текст из контрола.</p></blockquote></div><p>Если это действительно контрол <em>Internet Explorer_Server</em>, то примерно <a href="http://forum.script-coding.com/viewtopic.php?pid=68054#p68054">так</a>, только указать верное название контрола и окна.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Wed, 20 Feb 2013 17:05:17 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=69671#p69671</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Как извлечь текст из контрола?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=69669#p69669</link>
			<description><![CDATA[<p>С кодами&nbsp; я знаком.&nbsp; Почему работает по разному не понимаю.</p>]]></description>
			<author><![CDATA[null@example.com (Pokerist)]]></author>
			<pubDate>Wed, 20 Feb 2013 16:02:46 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=69669#p69669</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Как извлечь текст из контрола?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=69668#p69668</link>
			<description><![CDATA[<p>Вот лично вам <a href="http://forum.script-coding.com/viewtopic.php?pid=69653#p69653">скрипт для определения кнопок</a> с готовым синтаксисом</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Wed, 20 Feb 2013 15:40:49 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=69668#p69668</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Как извлечь текст из контрола?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=69667#p69667</link>
			<description><![CDATA[<div class="quotebox"><blockquote><p>Осталось понять в чём же тут принципиальная разница между</p></blockquote></div><p>В зависимости от раскладки. Никогда не пишите буквенно символьные клавиши по их именам. Замечал что само действие {CtrlDown} не всегда надёжно, видимо ос неуспевает решить что Ctrl удержан а уже послана след. кнопка, а ^{vk41} посылает сразу нажатие с модификатором.<br />Хотя Send, {CtrlDown}{vk41}{CtrlUp} вполне работает.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Wed, 20 Feb 2013 15:36:57 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=69667#p69667</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Как извлечь текст из контрола?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=69666#p69666</link>
			<description><![CDATA[<div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>или надёжнее:<br /></p><div class="codebox"><pre><code>
clipboard := &quot;&quot;
 Loop { 
    ControlFocus, Internet Explorer_Server2, ahk_class PTIODEVICE
     ControlGetFocus, Focus, ahk_class PTIODEVICE
    iF ( Focus &lt;&gt; &quot;Internet Explorer_Server2&quot; )
        Continue 
    Send, ^{vk41}  ;  &quot;A&quot;
    Send, ^{vk43}  ;  &quot;C&quot;
    } Until clipboard
 ToolTip, %clipboard%
 return
</code></pre></div></blockquote></div><p>&nbsp; Не срабатывает если не кликнуть этот контрол. </p><br /><p> Но Вы всё равно помогли!&nbsp; Спасибо!</p><br /><p>Вот так вполне себе работает:</p><br /><div class="codebox"><pre><code>ToolTip,
clipboard := &quot;&quot;
Click x, y
Send, ^{vk41}  ;  &quot;A&quot;
Send, ^{vk43}  ;  &quot;C&quot;
ClipWait, 1
;SoundBeep
ToolTip, %clipboard% </code></pre></div><p>&nbsp; &nbsp;Осталось понять в чём же тут принципиальная разница между </p><div class="codebox"><pre><code>Send, ^{vk41}</code></pre></div><p>и<br /></p><div class="codebox"><pre><code>Send, {CtrlDown}{A}{CtrlUp}</code></pre></div><p>&nbsp; ?</p>]]></description>
			<author><![CDATA[null@example.com (Pokerist)]]></author>
			<pubDate>Wed, 20 Feb 2013 15:26:35 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=69666#p69666</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Как извлечь текст из контрола?]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=69664#p69664</link>
			<description><![CDATA[<div class="codebox"><pre><code>
clipboard := &quot;&quot;
 Loop
    {  ControlFocus, Internet Explorer_Server2, A
    Send, ^{vk41}  ;  &quot;A&quot;
    Send, ^{vk43}  ;  &quot;C&quot;
    } Until clipboard
 ToolTip, %clipboard%
 return</code></pre></div><p>или надёжнее:<br /></p><div class="codebox"><pre><code>
clipboard := &quot;&quot;
 Loop { 
    ControlFocus, Internet Explorer_Server2, ahk_class PTIODEVICE
     ControlGetFocus, Focus, ahk_class PTIODEVICE
    iF ( Focus &lt;&gt; &quot;Internet Explorer_Server2&quot; )
        Continue 
    Send, ^{vk41}  ;  &quot;A&quot;
    Send, ^{vk43}  ;  &quot;C&quot;
    } Until clipboard
 ToolTip, %clipboard%
 return
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Wed, 20 Feb 2013 14:17:52 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=69664#p69664</guid>
		</item>
	</channel>
</rss>
