<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Решено. [SendMessage] vs [PostMessage]]]></title>
	<link rel="self" href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=9524&amp;type=atom" />
	<updated>2016-05-25T22:04:08Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=9524</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Решено. [SendMessage] vs [PostMessage]]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=104242#p104242" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong><br />&quot;3.11. Руководствуйтесь правилом: один вопрос - одна тема, не загромождайте...&quot;<br />Конечно. Чтобы получить ответ, нужно создавать отдельную тему со своим вопросом, верно? Не читал правила до сего момента, надеясь на собственную порядочность, каковую впитал на своей местности. Всегда думалось, что в теме должна быть предельная концентрация знаний, отражающих суть названия темы. Так искать информацию легче. Так мне всегда казалось. Увы, был не прав, каюсь.</p><p>Нашёл решение через:<br /></p><div class="codebox"><pre><code>
WinGet, ListControl, ControlListHwnd, WinTitle
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[KusochekDobra]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=33846</uri>
			</author>
			<updated>2016-05-25T22:04:08Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=104242#p104242</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Решено. [SendMessage] vs [PostMessage]]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=104240#p104240" />
			<content type="html"><![CDATA[<p>Да вы по ссылке-то ходили ли?</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2016-05-25T21:35:12Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=104240#p104240</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Решено. [SendMessage] vs [PostMessage]]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=104239#p104239" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong><br />Простите, если ответ на не заданный вопрос мог показаться менее предметным чем сам вероятный вопрос, но я не нашёл что искал, а решение пришло из ассоциации в прошлом опыте(переношу старые скрипты на AHK). Стараюсь сам пользоваться поиском, чтобы меньше отвлекать умудрённых мужей своими трудностями, вот и решил оставить тем, кто тоже ищет. И развивая тему, не подскажите ли, как узнать HWND контрола окна имея лишь его координаты и не перемещая в них курсор?</p>]]></content>
			<author>
				<name><![CDATA[KusochekDobra]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=33846</uri>
			</author>
			<updated>2016-05-25T21:32:01Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=104239#p104239</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Решено. [SendMessage] vs [PostMessage]]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=104235#p104235" />
			<content type="html"><![CDATA[<p><a href="http://forum.script-coding.com/rules.html#3.11.">В порядке критики.</a></p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2016-05-25T20:36:43Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=104235#p104235</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Решено. [SendMessage] vs [PostMessage]]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=104233#p104233" />
			<content type="html"><![CDATA[<p>Как сообщить окну ПКМ посредством Sendmessage/PostMessage?</p><p>Пока печатал, мысль дошла. Оставлю её здесь, может кому пригодится, а может и здраво покритикуют -&gt;<br /></p><div class="codebox"><pre><code>
#x::
	MouseGetPos, my_x, my_y, varWin, cntrol, 2
	
	WinGetPos, hw_x, hw_y, hw_w, hw_h, ahk_id %cntrol%
	WinGetPos, hwWin_x, hwWin_y, hwWin_w, hwWin_h, ahk_id %varWin%
	
	shift_x :=  hw_x - hwWin_x
	shift_y := hw_y - hwWin_y
	
	l_param := % ((my_x - shift_x) + ((my_y - shift_y) * 65536))
	PostMessage, 0x0204, 0x0002, %l_param%, , ahk_id %cntrol%
	sleep 50
	PostMessage, 0x0205, 0x0000, %l_param%, , ahk_id %cntrol%
return
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[KusochekDobra]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=33846</uri>
			</author>
			<updated>2016-05-25T20:22:25Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=104233#p104233</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Решено. [SendMessage] vs [PostMessage]]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=82170#p82170" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>А слона, то я и не приметил...</p></blockquote></div><p>Сколько раз уже натыкался на разницу методов, и не вспомнил.<br />Скрипт попозже выложу.<br />Спасибо!<br /></p><div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header"><strong>+</strong>&nbsp;offtop</div><div class="fancy_spoiler"><p>Вы использовали телепатию, или действительно установили прогу?:o</p></div></div>]]></content>
			<author>
				<name><![CDATA[stealzy]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=31937</uri>
			</author>
			<updated>2014-04-23T09:04:29Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=82170#p82170</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Решено. [SendMessage] vs [PostMessage]]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=82168#p82168" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>раз такое дело.</p></blockquote></div><p>А какое оно по вашему?<br />Всё работает хорошо, просто SendMessage не получает ответа.<br /></p><div class="codebox"><pre><code>
SetTitleMatchMode, RegEx  

F8::
    PostMessage, 0x111, 32808, 0,, ahk_exe grym.exe ahk_class Afx.* 
    WinWait, Общие настройки ahk_class #32770 ahk_exe grym.exe  
    Control,Check, ,Button12   
    Control,Check, ,Button14 
    Return
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2014-04-23T08:47:42Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=82168#p82168</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Решено. [SendMessage] vs [PostMessage]]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=82167#p82167" />
			<content type="html"><![CDATA[<p>Там окно открытия - стандартное; в этой теме в Title окна видно ее название.<br />Указал подробнее, раз такое дело.</p>]]></content>
			<author>
				<name><![CDATA[stealzy]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=31937</uri>
			</author>
			<updated>2014-04-23T08:02:19Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=82167#p82167</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Решено. [SendMessage] vs [PostMessage]]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=82166#p82166" />
			<content type="html"><![CDATA[<p>Удивили <img src="//forum.script-coding.com/img/smilies/sad.png" width="15" height="15" /><br />Создали 2 темы про какие то <span class="bbu">конкретные</span> окна, но что за окна остаётся в тайне. Видимо это загадка такая?</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2014-04-23T07:29:21Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=82166#p82166</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Решено. [SendMessage] vs [PostMessage]]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=82162#p82162" />
			<content type="html"><![CDATA[<p>(Программа 2ГИС <a href="http://info.2gis.ru/">http://info.2gis.ru/</a>)<br />Вызываю окно настроек и в нем ставлю чекбокс.<br />Первое делается с помощью SendMessage, второе — Control,Check(SendMessage не берет).<br />Так вот, если внутри скрипта я использую SendMessage, то использовать Control,Check уже не выходит!<br />Я ставил 10-сек. Sleep-ы, разносил команды на разные хоткеи.<br />Но если разнести их по разным скриптам, все ок!</p><div class="codebox"><pre><code>SetTitleMatchMode, RegEx
WinWaitActive, ^[^(]+\(\S+ 201\d\) - 2ГИС$ ;ahk_class ^Afx:\d{8}:\S+
SetTitleMatchMode, 1
gisID := WinExist(&quot;&quot;) ; главное окно программы
Return

F8::
SendMessage, 0x111, 32808, 0,, ahk_id %gisID% ; вызов окна настроек
Return
F7::
WinWaitActive, AHK_class #32770 ; ожидание окна настроек
Control,Check,,Button12,AHK_class #32770 ; Чекбокс
ControlClick,Button14,AHK_class #32770 ; кнопка ОК. тоже не жмется
Return</code></pre></div><p>---------------------------------------------------------<br />UPD. Там где возможно лучше использовать Post-метод, иначе(Send) скрипт ждет ответа, которого может и не быть.</p>]]></content>
			<author>
				<name><![CDATA[stealzy]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=31937</uri>
			</author>
			<updated>2014-04-23T06:49:33Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=82162#p82162</id>
		</entry>
</feed>
