<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: PostMessage послать стрелку вниз]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=12382&amp;type=atom" />
	<updated>2017-02-01T02:30:02Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=12382</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: PostMessage послать стрелку вниз]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=111738#p111738" />
			<content type="html"><![CDATA[<p>Так можно:<br /></p><div class="codebox"><pre><code>processName := &quot;some.exe&quot;    
WinGet, somehwnd, ControlListHwnd, ahk_exe %processName%
PostMessage, 0x100, 0x28,,, ahk_id %somehwnd%
PostMessage, 0x101, 0x28,,, ahk_id %somehwnd%</code></pre></div><p>Или вместо &quot;WinGet, somehwnd, ControlListHwnd, ahk_exe %processName%&quot; - можно<br />&quot;ControlGet, somehwnd, Hwnd,,, ahk_exe %processName%&quot;.</p>]]></content>
			<author>
				<name><![CDATA[svoboden]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34280</uri>
			</author>
			<updated>2017-02-01T02:30:02Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=111738#p111738</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: PostMessage послать стрелку вниз]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=111735#p111735" />
			<content type="html"><![CDATA[<p>Вот пример м блокнотом:<br /></p><div class="codebox"><pre><code>f1::
PostMessage, 0x100, 0x28, 0, Edit1, A
PostMessage, 0x101, 0x28, 0, Edit1, A
return

f2::
ControlGet, OutputVar, Hwnd,, Edit1, A
PostMessage, 0x100, 0x28, 0,, ahk_id %OutputVar%
PostMessage, 0x101, 0x28, 0,, ahk_id %OutputVar%
return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-01-31T22:02:40Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=111735#p111735</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: PostMessage послать стрелку вниз]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=111734#p111734" />
			<content type="html"><![CDATA[<p>Не пойму</p><div class="quotebox"><cite>Malcev пишет:</cite><blockquote><p>если хотите воспользоваться хендлом контрола, а не хендлом окна.</p></blockquote></div><p>control&#039;s HWND (window handle) </p><p>Не пойму...этот код работает:<br /></p><div class="codebox"><pre><code>PostMessage, 0x111, 15,,, ahk_id %somehwnd%</code></pre></div><p> <br />15 - это контрол ид.<br />Этот код нажимает на кнопку в выпадающем меню окна. Я здесь указываю как я понял только хэндл окна, так почему коды выше не работают?</p><p>В программе Windows Detective главное окно указано как TfmMain и хэндл там такой же как я получаю в %somehwnd%</p><p>Может я не правильно посылаю кнопку?</p>]]></content>
			<author>
				<name><![CDATA[Dworkin]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27052</uri>
			</author>
			<updated>2017-01-31T21:52:02Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=111734#p111734</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: PostMessage послать стрелку вниз]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=111732#p111732" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>Во втором абзаце насколько я понял написано что если использовать хэндл окна, то контрол можно опустить.</p></blockquote></div><p>Там написано, что если хотите воспользоваться хендлом контрола, а не хендлом окна.<br />ahk_class TfmMain - это не название контрола.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-01-31T20:18:59Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=111732#p111732</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: PostMessage послать стрелку вниз]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=111731#p111731" />
			<content type="html"><![CDATA[<p>Я использую ControlSend, но когда он работает то блокирует модификаторы и поэтому сложно писать большие буквы и переключать язык. Надеюсь PostMessage лишен этого.</p><p>Во втором абзаце насколько я понял написано что если использовать хэндл окна, то контрол можно опустить.<br />Сделал так, но не работает:<br /></p><div class="codebox"><pre><code>F2::
processName := &quot;some.exe&quot;    
WinGet, somehwnd,id,ahk_exe %processName%
PostMessage, 0x100, 0x28, 0, ,ahk_id %somehwnd%
PostMessage, 0x101, 0x28, 0, ,ahk_id %somehwnd%
return</code></pre></div><p>Так же тоже не работает:<br /></p><div class="codebox"><pre><code>PostMessage, 0x100, 0x28, 0, ahk_class TfmMain, wintitle
PostMessage, 0x101, 0x28, 0, ahk_class TfmMain, wintitle</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Dworkin]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27052</uri>
			</author>
			<updated>2017-01-31T20:08:33Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=111731#p111731</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: PostMessage послать стрелку вниз]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=111728#p111728" />
			<content type="html"><![CDATA[<p>Точно также ищутся через Window Spy. <br />Если в ControlSend контрол не писать, то он отправит в самый верхний.<br />Совсем необязательно, что именно он нужен.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-01-31T19:46:27Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=111728#p111728</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: PostMessage послать стрелку вниз]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=111722#p111722" />
			<content type="html"><![CDATA[<p>Malcev, если человеку сложно найти контрол для PostMessage, в ControlSend, можно без него обойтись. А в чем разница, так не знаю, может, нет никакой разницы.</p>]]></content>
			<author>
				<name><![CDATA[svoboden]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34280</uri>
			</author>
			<updated>2017-01-31T18:57:40Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=111722#p111722</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: PostMessage послать стрелку вниз]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=111720#p111720" />
			<content type="html"><![CDATA[<p><strong>svoboden</strong>, а в чем по-вашему разница в алгоритме нахождения контрола для PostMessage и для ControlSend?</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-01-31T18:46:39Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=111720#p111720</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: PostMessage послать стрелку вниз]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=111716#p111716" />
			<content type="html"><![CDATA[<p>Если сложно найти контрол в PostMessage, тогда ControlSend.</p>]]></content>
			<author>
				<name><![CDATA[svoboden]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34280</uri>
			</author>
			<updated>2017-01-31T17:39:03Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=111716#p111716</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: PostMessage послать стрелку вниз]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=111680#p111680" />
			<content type="html"><![CDATA[<p>В справке написано:<br /></p><div class="quotebox"><blockquote><p>Control</p><p>&nbsp; &nbsp; If this parameter is blank or omitted, the message will be sent directly to the target window rather than one of its controls. Otherwise, this parameter can be either ClassNN (the classname and instance number of the control) or the control&#039;s text, both of which can be determined via Window Spy. When using text, the matching behavior is determined by SetTitleMatchMode.</p><p>&nbsp; &nbsp; To operate upon a control&#039;s HWND (window handle), leave the Control parameter blank and specify ahk_id %ControlHwnd% for the WinTitle parameter (this also works on hidden controls even when DetectHiddenWindows is Off). The HWND of a control is typically retrieved via ControlGet Hwnd, MouseGetPos, or DllCall.</p></blockquote></div><p>Соответственно вписывайте название контрола, которому отправляете нажатие.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-01-31T09:45:11Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=111680#p111680</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: PostMessage послать стрелку вниз]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=111678#p111678" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Malcev пишет:</cite><blockquote><div class="quotebox"><blockquote><p>PostMessage, Msg [, wParam, lParam, <strong>Control</strong>, WinTitle, WinText, ExcludeTitle, ExcludeText]</p></blockquote></div></blockquote></div><p>Msg у меня: 0x100<br />wParam и IParam у меня: 0x28 и 0<br />Получается что хендл окна это как wintitle?<br />Если да то что писать в контрол?<br />Я пробовал оставлять этот параметр пустым:<br /></p><div class="codebox"><pre><code>PostMessage, 0x101, 0x28, 0,, ahk_id %somehwnd%</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Dworkin]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27052</uri>
			</author>
			<updated>2017-01-31T09:24:25Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=111678#p111678</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: PostMessage послать стрелку вниз]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=111675#p111675" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>PostMessage, Msg [, wParam, lParam, <strong>Control</strong>, WinTitle, WinText, ExcludeTitle, ExcludeText]</p></blockquote></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2017-01-31T06:56:31Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=111675#p111675</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: PostMessage послать стрелку вниз]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=111672#p111672" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>F2::
processName := &quot;some.exe&quot;    
WinGet, somehwnd,id,ahk_exe %processName%
PostMessage, 0x100, 0x28, 0, ahk_id %somehwnd%
PostMessage, 0x101, 0x28, 0, ahk_id %somehwnd%
return
</code></pre></div><p>Не работает.</p>]]></content>
			<author>
				<name><![CDATA[Dworkin]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27052</uri>
			</author>
			<updated>2017-01-31T06:17:13Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=111672#p111672</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: PostMessage послать стрелку вниз]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=111668#p111668" />
			<content type="html"><![CDATA[<p>Вместо VK_DOWN, , надо 0x28, 0,</p>]]></content>
			<author>
				<name><![CDATA[svoboden]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34280</uri>
			</author>
			<updated>2017-01-30T23:01:05Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=111668#p111668</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: PostMessage послать стрелку вниз]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=111667#p111667" />
			<content type="html"><![CDATA[<p>Доброй ночи. Подскажите пожалуйста что не так? Пытаюсь послать в окно стрелку вниз. Использую программу Window Detective если что.</p><p>Послать кнопку вниз не получается:<br /></p><div class="codebox"><pre><code>
processName := &quot;some.exe&quot;    
WinGet, somehwnd,id,ahk_exe %processName% ; Получаю hwnd по имени процесса
PostMessage, 0x100, VK_DOWN, , ahk_id %somehwnd%
PostMessage, 0x101, VK_DOWN, , ahk_id %somehwnd%</code></pre></div><p>Не знаю нужно или нет, но в Window Detective вот что показывает при нажатии на стрелки вниз и ее отпускании:<br /></p><div class="quotebox"><blockquote><p>WM_KEYDOWN (0x100)<br />&nbsp; &nbsp; virtual key = VK_DOWN<br />&nbsp; &nbsp; state = 0x00000028<br />WM_KEYUP (0x101)<br />&nbsp; &nbsp; virtual key = VK_DOWN<br />&nbsp; &nbsp; state = 0x00000028</p></blockquote></div><p>P.S. Если что я могу с помощью postmessage нажать кнопку в выпадющем сверху меню.</p>]]></content>
			<author>
				<name><![CDATA[Dworkin]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27052</uri>
			</author>
			<updated>2017-01-30T22:25:26Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=111667#p111667</id>
		</entry>
</feed>
