<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK. Послать строку в несколько неактивных окон Chrome]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=12851&amp;type=atom" />
	<updated>2017-07-28T18:03:09Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=12851</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK. Послать строку в несколько неактивных окон Chrome]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=117638#p117638" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong> Огромное спасибо ! Теперь все работает как должно</p>]]></content>
			<author>
				<name><![CDATA[ratchet27]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38657</uri>
			</author>
			<updated>2017-07-28T18:03:09Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=117638#p117638</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK. Послать строку в несколько неактивных окон Chrome]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=117637#p117637" />
			<content type="html"><![CDATA[<p>Замените</p><div class="codebox"><pre><code>ControlGet, controlID, Hwnd,,Chrome_RenderWidgetHostHWND1, Google Chrome
</code></pre></div><p>на</p><div class="codebox"><pre><code>ControlGet, controlID, Hwnd,,Chrome_RenderWidgetHostHWND1, % &quot;ahk_id&quot; myList%A_Index%</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2017-07-28T17:58:19Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=117637#p117637</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK. Послать строку в несколько неактивных окон Chrome]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=117635#p117635" />
			<content type="html"><![CDATA[<p>Задача:<br />Имеется несколько открытых неактивных окон хрома (разные пользователи). Нужно послать им всем одно и тоже сообщение (строку) </p><p>Код : <br /></p><div class="codebox"><pre><code>

;============================== Start Auto-Execution Section ==============================

#Persistent

#NoEnv

#SingleInstance, Force

DetectHiddenWindows, On

SetWorkingDir %A_ScriptDir%


SetTitleMatchMode, 2

;sets controlID to 0 every time the script is reloaded
controlID      := 0

return

;============================== Main Script ==============================
#IfWinNotActive, ahk_exe chrome.exe



F4::

winget, myList, list, Google Chrome

Loop, %myList% {

    Random, var, 100, 3000 

    ; Gets the control ID of google chrome

    ControlGet, controlID, Hwnd,,Chrome_RenderWidgetHostHWND1, Google Chrome

   ; Focuses on chrome without breaking focus on what you&#039;re doing


    ControlFocus,,ahk_id %controlID%

    Sleep %var%

    ControlSend, Chrome_RenderWidgetHostHWND1,  time  %var% {Enter}, Google Chrome
}
return



#IfWinNotActive

Numpad0::
	ExitApp
</code></pre></div><p>Проблема : <br />Вместо перебирания всех окон скрипт посылает несколько сообщений в последнее отрытое окно.</p><p>Подскажите, где именно я ошибаюсь? В цикле, или где то в получении окна?</p>]]></content>
			<author>
				<name><![CDATA[ratchet27]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38657</uri>
			</author>
			<updated>2017-07-28T17:14:39Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=117635#p117635</id>
		</entry>
</feed>
