<?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=6031&amp;type=atom" />
	<updated>2011-07-20T18:50:07Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=6031</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как передать шотркат последнему активному окну (классу)?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=50035#p50035" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>restless_fisher пишет:</cite><blockquote><p>поэтому я и хочу узнать, есть-ли универсально средство для кнопок с передачей одних и тех же горячих клавиш в разные окна (разные Ahk_классы).</p></blockquote></div><p><a href="http://script-coding.com/AutoHotkey/ControlSendRaw.html"><em>ControlSend</em></a></p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2011-07-20T18:50:07Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=50035#p50035</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как передать шотркат последнему активному окну (классу)?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=50033#p50033" />
			<content type="html"><![CDATA[<p>Если я правильно понял то попробуйте это:<br /></p><div class="codebox"><pre><code>~lbutton::
winget,name_id,id,A
WinGetTitle, name, ahk_id %name_id%
if name &lt;&gt; x ; это название окна gui
{
filedelete, c:\active.txt
fileappend, %name_id%, c:\active.txt
}
return</code></pre></div><p>Это наверное лучше сделать как отдельный скрипт, а в ваш gui добавить функцию типа:<br /></p><div class="codebox"><pre><code>fileread, active, c:\active.txt, 1
winactivate, ahk_id %active%
send, ^x</code></pre></div><p>По идее должно сработать почти в любых вариантах, ну нешто когда ид окна не сможем определить</p>]]></content>
			<author>
				<name><![CDATA[MixaLich]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27090</uri>
			</author>
			<updated>2011-07-20T18:43:36Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=50033#p50033</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как передать шотркат последнему активному окну (классу)?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=50031#p50031" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>ypppu пишет:</cite><blockquote><p>То есть трудность в том, что окно GUI становится активным, и сочетания клавиш посылаются не в целевое окно, а в само окно GUI?</p></blockquote></div><p>Ага, именно в этом <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /><br />Хотя наверное даже в том, что я не знаю что мне писать вместо целевого окна. Тоесть, например я сделал GUI&nbsp; для фотошопа, там около 20 кнопок, все они заточены именно под фотошоп, поэтому когда я перехожу к работе с папками или браузером я загружаю другой GUI, а в этих средах уже много общего (горячие клавиши я мсею ввиду),&nbsp; а загружать каждый раз интерфейс для рабочего стола, папок, браузера и т.д. не очень логично (опять же, из-за сходства многих команд), поэтому я и хочу узнать, есть-ли универсально средство для кнопок с передачей одних и тех же горячих клавиш в разные окна (разные Ahk_классы).</p>]]></content>
			<author>
				<name><![CDATA[restless_fisher]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27094</uri>
			</author>
			<updated>2011-07-20T18:14:23Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=50031#p50031</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как передать шотркат последнему активному окну (классу)?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=50030#p50030" />
			<content type="html"><![CDATA[<p>То есть трудность в том, что окно GUI становится активным, и сочетания клавиш посылаются не в целевое окно, а в само окно GUI?</p>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2011-07-20T18:08:35Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=50030#p50030</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как передать шотркат последнему активному окну (классу)?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=50027#p50027" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>А чем отличается <em>последнее активное окно</em> от просто активного окна?</p></blockquote></div><p>Ничем если оно все еще активно <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" />.</p><div class="quotebox"><cite>ypppu пишет:</cite><blockquote><p>Передать сочетание клавиш активному окну довольно просто...</p></blockquote></div><p>Да, это так, если использовать клавиатуру например. Я же пытаюсь добавить кнопки на экран (gui), сделать что-то вроде дока, для управления приложениями с их помощью. В этом случае (при нажатии на такую кнопку) активным становится &quot;окно&quot; Gui, таки образом клавиатурное сочетание никуда не отправляется. С функцией передачи &quot;горячих клавиш&quot; конкретному окну я разобрался </p><div class="codebox"><pre><code>WinActivate, ahk_class ProgMan
Send, ^x</code></pre></div><p>Таким образом можно &quot;вырезать&quot; выделенный файл с рабочего стола, а вот из папки нельзя. С текстом в&nbsp; болкноте тоже ничего не получится, для всего этого отдельные команды. А я хочу для стандартных действий таких как &quot;копировать&quot;, &quot;вставить&quot;, &quot;назад&quot;, &quot;вперед&quot; и т.д. применить универсальное решение, чтобы не загружать для каждого приложения отдельный Gui.</p>]]></content>
			<author>
				<name><![CDATA[restless_fisher]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27094</uri>
			</author>
			<updated>2011-07-20T16:54:45Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=50027#p50027</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как передать шотркат последнему активному окну (классу)?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=50026#p50026" />
			<content type="html"><![CDATA[<p>Передать сочетание клавиш активному окну довольно просто:<br /></p><div class="codebox"><pre><code>Send, ^x</code></pre></div><p>В русском переводе документации можно почитать <strong>Send / SendRaw / SendInput / SendPlay / SendEvent: Send Keys &amp; Clicks</strong>.</p>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2011-07-20T15:48:41Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=50026#p50026</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как передать шотркат последнему активному окну (классу)?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=50024#p50024" />
			<content type="html"><![CDATA[<p>А чем отличается <em>последнее активное окно</em> от просто активного окна?</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2011-07-20T15:28:35Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=50024#p50024</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как передать шотркат последнему активному окну (классу)?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=50019#p50019" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>ypppu пишет:</cite><blockquote><p>Что есть шотркат?</p></blockquote></div><p>Это клавиатурное сочетание (Send, ^x). Извините если с термином напутал. В графических приложениях это так называется <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[restless_fisher]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27094</uri>
			</author>
			<updated>2011-07-20T13:31:41Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=50019#p50019</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Как передать шотркат последнему активному окну (классу)?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=50018#p50018" />
			<content type="html"><![CDATA[<p>Что есть шотркат?</p>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2011-07-20T13:26:46Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=50018#p50018</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Как передать шотркат последнему активному окну (классу)?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=50017#p50017" />
			<content type="html"><![CDATA[<p>Ctrl+x, например. Чтобы работал и с файлами на рабочем столе и с папками и с текстом в блокноте. В &quot;Autoit&quot; есть такой способ:</p><div class="codebox"><pre><code>$a = WinList()
$z = 0

For $i = 1 to $a[0][0]
If WinGetState($a[$i][1]) = 39 Then 
$z = 1
ExitLoop
Endif
Next

If $z &lt;&gt; 1 Then
For $i = 1 to $a[0][0]
If WinGetState($a[$i][1]) = 7 AND $a[$i][0] &lt;&gt; &quot;Start&quot; AND $a[$i][0] &lt;&gt; &quot;&quot; Then ExitLoop
Next
Endif

WinActivate($a[$i][0], &quot;&quot;)
Send(&quot;^x&quot;)</code></pre></div><p>Я почти ничего из него не понимаю, чтобы переделать по такому же принцмпу в &quot;Ahk&quot; <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" />. </p><p>Этот код&nbsp; хорошо работает, правда немного медленно, да и Gui я почти в Ahk дособирал. Может вы знаете подобное решение для Ahk?</p>]]></content>
			<author>
				<name><![CDATA[restless_fisher]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27094</uri>
			</author>
			<updated>2011-07-20T13:20:16Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=50017#p50017</id>
		</entry>
</feed>
