<?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=12898&amp;type=atom" />
	<updated>2017-08-11T00:39:48Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=12898</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Взаимодействие с диалогами, принадлежащими собственному процессу]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=118115#p118115" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>wisgest пишет:</cite><blockquote><p>между (step = 2) и (step = 3) и почему они не могут быть в одном «потоке» — уже не очень</p></blockquote></div><p>По всей видимости, по той же причине, что и между 1 и 2 — открывается новое диалоговое окно и поток ждёт его закрытия.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2017-08-11T00:39:48Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=118115#p118115</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Взаимодействие с диалогами, принадлежащими собственному процессу]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=118114#p118114" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Хотя как раз в этом случае весь сыр-бор ни к чему, поскольку можно просто<br /></p><div class="codebox"><pre><code>Run intl.cpl</code></pre></div></blockquote></div><p>— это открытие *.cpl сопоставленным приложением, т.е. rundll32.exe…</p><p>Думаю, это решение можно воспроизвести и встроенной командой SetTimer:<br /></p><div class="quotebox"><cite>wisgest пишет:</cite><blockquote><p>Я подозреваю, хотя и не проверял, что если перед этим местом&nbsp; установить следующий таймер, то чего-то и можно добиться, но как-то это некрасиво выглядит.</p></blockquote></div><p>Т.е. почему требуется разрыв между (step = 1) и (step = 2) понятно, а между (step = 2) и (step = 3) и почему они не могут быть в одном «потоке» — уже не очень…</p>]]></content>
			<author>
				<name><![CDATA[wisgest]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=3850</uri>
			</author>
			<updated>2017-08-10T23:14:33Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=118114#p118114</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Взаимодействие с диалогами, принадлежащими собственному процессу]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=118113#p118113" />
			<content type="html"><![CDATA[<p>А, это я же с коллеги <strong>wisgest</strong> скопировал. <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /> Конечно Ptr.</p><div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Вот так у меня срабатывает на семёрке вызов диалога «Язык и региональные стандарты»</p></blockquote></div><p>Хотя как раз в этом случае весь сыр-бор ни к чему, поскольку можно просто<br /></p><div class="codebox"><pre><code>Run intl.cpl</code></pre></div><p>без привязки к окну диалога.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2017-08-10T22:21:03Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=118113#p118113</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Взаимодействие с диалогами, принадлежащими собственному процессу]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=118112#p118112" />
			<content type="html"><![CDATA[<p>&quot;<strong>UInt</strong>&quot;, A_ScriptHwnd?</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2017-08-10T22:16:51Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=118112#p118112</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Взаимодействие с диалогами, принадлежащими собственному процессу]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=118109#p118109" />
			<content type="html"><![CDATA[<p>Вот так у меня срабатывает на семёрке вызов диалога «Язык и региональные стандарты» и по кнопке поддиалога «Настройка формата»:<br /></p><div class="codebox"><pre><code>#Persistent
DllCall(&quot;SetTimer&quot;, Ptr, A_ScriptHwnd, Ptr, id := 1, UInt, 300, Ptr, RegisterCallback(&quot;MyTimer&quot;, &quot;F&quot;))
Return

MyTimer()  {
   static step := 0
   if (++step = 1)  {
      DllCall(&quot;shell32.dll\Control_RunDLL&quot; . (A_IsUnicode ? &quot;W&quot; : &quot;A&quot;)
         , &quot;UInt&quot;, A_ScriptHwnd, &quot;Ptr&quot;, 0, &quot;Str&quot;, &quot;intl.cpl&quot;, &quot;UInt&quot;, nCmdShow := 1)
   }
   else if (step = 2)  {
      WinWait, Язык и региональные стандарты
      ControlClick, &amp;Дополнительные параметры...
   }
   else if (step = 3)  {
      WinWait, Настройка формата
      ControlClick, Button3  ; Button OK, по OK не срабатывает
   }
   else if (step = 4)  {
      DllCall(&quot;KillTimer&quot;, Ptr, A_ScriptHwnd, Ptr, id := 1)
      WinWait, Язык и региональные стандарты
      ControlClick, Button4  ; Button OK
   }
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2017-08-10T21:53:28Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=118109#p118109</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Взаимодействие с диалогами, принадлежащими собственному процессу]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=118102#p118102" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>Ок, если так?</p></blockquote></div><p>Так работает, если в моём случае изменить «Звук» на «Свойства: Звуки и аудиоустройства», но оно работает и через<br /></p><div class="codebox"><pre><code>SetTimer MyTimer, -1</code></pre></div><p>Отличий не заметил.</p>]]></content>
			<author>
				<name><![CDATA[wisgest]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=3850</uri>
			</author>
			<updated>2017-08-10T20:51:29Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=118102#p118102</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Взаимодействие с диалогами, принадлежащими собственному процессу]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=118101#p118101" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>wisgest пишет:</cite><blockquote><p>основной диалог уже вручную не закрывается</p></blockquote></div><p>Эту проблему я пропустил, тоже не закрывается.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2017-08-10T20:47:27Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=118101#p118101</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Взаимодействие с диалогами, принадлежащими собственному процессу]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=118099#p118099" />
			<content type="html"><![CDATA[<p><strong>serzh82saratov</strong>, непосредственно следующий за командой создающей диалог код не выполняется, естественно. Но если «понажимать» запустить в другом (псевдо)потоке, то, может быть что-то и получится. Оно и получается, но только до места, где создаётся следующий диалог. Я подозреваю, хотя и не проверял, что если перед этим местом&nbsp; установить следующий таймер, то чего-то и можно добиться, но как-то это некрасиво выглядит. Может быть поиграться с приоритетами или какими-то директивами, но я в этом не разбираюсь.</p>]]></content>
			<author>
				<name><![CDATA[wisgest]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=3850</uri>
			</author>
			<updated>2017-08-10T20:41:56Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=118099#p118099</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Взаимодействие с диалогами, принадлежащими собственному процессу]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=118098#p118098" />
			<content type="html"><![CDATA[<p>Ок, если так?<br /></p><div class="codebox"><pre><code>
DllCall(&quot;SetTimer&quot;, Ptr, A_ScriptHwnd, Ptr, 1, UInt, 300, Ptr, RegisterCallback(&quot;MyTimer&quot;, &quot;Fast&quot;))
DllCall(&quot;shell32.dll\Control_RunDLL&quot; . (A_IsUnicode? &quot;W&quot;: &quot;A&quot;)
	, UInt, A_ScriptHwnd ; HWND hwnd
;	, UInt, 0 ; HWND hwnd
	, Ptr, 0 ; HINSTANCE hInstance
	, Str, &quot;MmSys.cpl&quot; ; LPTSTR lpszCmd
	, UInt, 1) ; nCmdShow

MyTimer()  {
	DllCall(&quot;KillTimer&quot;, Ptr, A_ScriptHwnd, Ptr, 1)
	WinWait Звук ahk_class #32770
	Loop	
		MsgBox, , , % A_Index, 0.2
}

</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2017-08-10T20:39:22Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=118098#p118098</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Взаимодействие с диалогами, принадлежащими собственному процессу]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=118096#p118096" />
			<content type="html"><![CDATA[<p><strong>serzh82saratov</strong>, в десятку! <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2017-08-10T20:22:46Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=118096#p118096</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Взаимодействие с диалогами, принадлежащими собственному процессу]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=118095#p118095" />
			<content type="html"><![CDATA[<p>На семёрке пока не закроешь окно код далее не выполняется, наверное вопрос в этом...<br />То есть то что надо &quot;по нажимать&quot; не получается.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2017-08-10T20:10:34Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=118095#p118095</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Взаимодействие с диалогами, принадлежащими собственному процессу]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=118094#p118094" />
			<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>2017-08-10T19:19:22Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=118094#p118094</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Взаимодействие с диалогами, принадлежащими собственному процессу]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=118093#p118093" />
			<content type="html"><![CDATA[<p>Так открывается такое окно:</p><p><span class="postimg"><img src="http://i.imgur.com/a2TIQXh.png" alt="http://i.imgur.com/a2TIQXh.png" /></span></p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2017-08-10T18:57:44Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=118093#p118093</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Взаимодействие с диалогами, принадлежащими собственному процессу]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=118092#p118092" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Так вообще ничего не происходит.</p></blockquote></div><p>А так?<br /></p><div class="codebox"><pre><code>DllCall(&quot;shell32.dll\Control_RunDLL&quot; . (A_IsUnicode? &quot;W&quot;: &quot;A&quot;)
	, UInt, A_ScriptHwnd ; HWND hwnd
;	, UInt, 0 ; HWND hwnd
	, Ptr, 0 ; HINSTANCE hInstance
	, Str, &quot;MmSys.cpl&quot; ; LPTSTR lpszCmd
	, UInt, 1) ; nCmdShow
</code></pre></div><div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Так это самый примитивный способ автоматизации, обычно его стараются избегать</p></blockquote></div><p>Кто бы спорил, но часто лучше как-нибудь, чем никак.</p>]]></content>
			<author>
				<name><![CDATA[wisgest]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=3850</uri>
			</author>
			<updated>2017-08-10T18:22:47Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=118092#p118092</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Взаимодействие с диалогами, принадлежащими собственному процессу]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=118091#p118091" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>wisgest пишет:</cite><blockquote><div class="codebox"><pre><code>DllCall(&quot;MmSys.cpl\ShowFullControlPanel&quot;
;   , UInt, A_ScriptHwnd ; HWND hwnd
   , UInt, 0 ; HWND hwnd
   , Ptr, 0 ; HINSTANCE hInstance
   , Ptr, 0 ; LPTSTR lpszCmd
   , UInt, 1) ; nCmdShow</code></pre></div></blockquote></div><p>Так вообще ничего не происходит. На семёрке нет параметра ShowFullControlPanel.<br /></p><div class="quotebox"><cite>wisgest пишет:</cite><blockquote><p>А AutoHotkey нужен для автоматизации, в том числе путём эмуляции действий пользователя.</p></blockquote></div><p>Так это самый примитивный способ автоматизации, обычно его стараются избегать и действовать как-то напрямую.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2017-08-10T18:05:07Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=118091#p118091</id>
		</entry>
</feed>
