<?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=10339&amp;type=atom" />
	<updated>2015-01-14T11:04:26Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=10339</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: проверка возможности ввода текста]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=90506#p90506" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Почему, в FF и в Опере определяется, если в фокусе адресная строка и в ней нет выделения.</p></blockquote></div><p>А у меня этот ahk-код везде показывает нули.<br /></p><div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Эту часть не понял.</p></blockquote></div><p>Белый список? Список программ, в которые можно что-нибудь отправлять без этой проверки на каретку.</p>]]></content>
			<author>
				<name><![CDATA[a154802]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26538</uri>
			</author>
			<updated>2015-01-14T11:04:26Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=90506#p90506</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: проверка возможности ввода текста]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=90503#p90503" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>a154802 пишет:</cite><blockquote><p>Я бы даже сказал, что нигде smile. Потому что у вас код не совсем полный.</p></blockquote></div><p>Почему, в FF и в Опере определяется, если в фокусе адресная строка и в ней нет выделения.<br /></p><div class="quotebox"><blockquote><p>А если вы про сишную версию, то пока я обнаружил проблемы с вижуальной штудией, вимом и возможно QT, но в целом я доволен. Первые два можно было бы просто внести в белый список.</p></blockquote></div><p>Эту часть не понял.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2015-01-14T10:27:52Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=90503#p90503</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: проверка возможности ввода текста]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=90502#p90502" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>наличие каретки способом по ссылке можно определить не везде:</p></blockquote></div><p>Я бы даже сказал, что нигде <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" />. Потому что у вас код не совсем полный. А если вы про сишную версию, то пока я обнаружил проблемы с вижуальной штудией, вимом и возможно QT, но в целом я доволен. Первые два можно было бы просто внести в белый список.</p>]]></content>
			<author>
				<name><![CDATA[a154802]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26538</uri>
			</author>
			<updated>2015-01-14T10:24:32Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=90502#p90502</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: проверка возможности ввода текста]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=90481#p90481" />
			<content type="html"><![CDATA[<p>WM_CHAR может обрабатываться независимо от активности поля ввода, наличие каретки способом по ссылке можно определить не везде:<br /></p><div class="codebox"><pre><code>F11::
   SendMessage, WM_CHAR := 0x102, Asc(&quot;a&quot;), (GetKeySC(&quot;a&quot;) &lt;&lt; 16) | 1,, A
   ResWM_CHAR := ErrorLevel
   
   AccObj := AccObjectFromWindow(WinExist(&quot;A&quot;), OBJID_CARET := 0xFFFFFFF8)
   oLocation := AccLocation(AccObj)
   ToolTip % &quot;координаты каретки: x = &quot; oLocation.x &quot;, y = &quot; oLocation.y &quot;`nResWM_CHAR = &quot; ResWM_CHAR  ; если 0 значит обработано
   Return

AccInit()
{
   Static   h
   If Not   h
      h:=DllCall(&quot;LoadLibrary&quot;,&quot;Str&quot;,&quot;oleacc&quot;,&quot;Ptr&quot;)
}

AccObjectFromWindow(hWnd, idObject = 0)
{
   AccInit()
   If   DllCall(&quot;oleacc\AccessibleObjectFromWindow&quot;, &quot;Ptr&quot;, hWnd, &quot;UInt&quot;, idObject&amp;=0xFFFFFFFF
      , &quot;Ptr&quot;, -VarSetCapacity(IID,16)+NumPut(idObject==0xFFFFFFF0?0x46000000000000C0:0x719B3800AA000C81
      ,NumPut(idObject==0xFFFFFFF0?0x0000000000020400:0x11CF3C3D618736E0,IID,&quot;Int64&quot;),&quot;Int64&quot;), &quot;Ptr*&quot;, pacc)=0
   Return   ComObjEnwrap(9,pacc,1)
}

AccLocation(Acc, ChildId=0, byref Position=&quot;&quot;)
{
   try Acc.accLocation(ComObj(0x4003,&amp;x:=0), ComObj(0x4003,&amp;y:=0), ComObj(0x4003,&amp;w:=0), ComObj(0x4003,&amp;h:=0), ChildId)
   catch
      return
   Position := &quot;x&quot; NumGet(x,0,&quot;int&quot;) &quot; y&quot; NumGet(y,0,&quot;int&quot;) &quot; w&quot; NumGet(w,0,&quot;int&quot;) &quot; h&quot; NumGet(h,0,&quot;int&quot;)
   return   {x:NumGet(x,0,&quot;int&quot;), y:NumGet(y,0,&quot;int&quot;), w:NumGet(w,0,&quot;int&quot;), h:NumGet(h,0,&quot;int&quot;)}
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2015-01-14T07:35:52Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=90481#p90481</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: проверка возможности ввода текста]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=90477#p90477" />
			<content type="html"><![CDATA[<p>У меня было две идеи:<br />проследить, обрабатывается ли WM_CHAR,<br />узнать, показывается ли на экране каретка.<br />Но это слишком сложно для меня. Сейчас нашёл какой-то код <a href="http://w3facility.org/question/how-to-find-out-if-the-caret-exists-in-opera/">http://w3facility.org/question/how-to-f … -in-opera/</a></p>]]></content>
			<author>
				<name><![CDATA[a154802]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26538</uri>
			</author>
			<updated>2015-01-14T07:00:53Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=90477#p90477</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: проверка возможности ввода текста]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=90475#p90475" />
			<content type="html"><![CDATA[<p>Я чисто из любопытства спросил. Не думаю, что есть в общем случае способ проверить, возможен ли в данный момент ввод текста. Если только программа пользуется стандартными для Windows контролами для ввода текста.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2015-01-14T06:35:47Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=90475#p90475</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: проверка возможности ввода текста]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=90474#p90474" />
			<content type="html"><![CDATA[<p>Смысл в том, что это нужно моей программе (о которой я промолчу). Но могу предложить другой смысл: для хотстрингов тоже такая проверка не помешала бы.</p>]]></content>
			<author>
				<name><![CDATA[a154802]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26538</uri>
			</author>
			<updated>2015-01-14T06:30:00Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=90474#p90474</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: проверка возможности ввода текста]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=90471#p90471" />
			<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>2015-01-14T06:07:10Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=90471#p90471</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: проверка возможности ввода текста]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=90469#p90469" />
			<content type="html"><![CDATA[<p>Предположим, что мы собрались отправить<br /></p><div class="codebox"><pre><code>Send, абракадабра</code></pre></div><p>в незнакомую программу. И, если это не текстовый редактор, то рискуем нарваться на бибиканье и горячие клавиши. Какую проверку можно сделать, чтобы этого избежать?</p>]]></content>
			<author>
				<name><![CDATA[a154802]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26538</uri>
			</author>
			<updated>2015-01-14T05:50:49Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=90469#p90469</id>
		</entry>
</feed>
