<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: как определить текущий статус другого запущенного ahk-скрипта?]]></title>
	<link rel="self" href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=8575&amp;type=atom" />
	<updated>2013-08-15T23:58:24Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=8575</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: как определить текущий статус другого запущенного ahk-скрипта?]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=74616#p74616" />
			<content type="html"><![CDATA[<p>Спасибо, видимо я как-то не так его код тогда пробовал: Ваш код у меня работает на AHK_L x64. И даже с #NoTrayIcon.<br />Спасибо.</p>]]></content>
			<author>
				<name><![CDATA[Drugoy]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27463</uri>
			</author>
			<updated>2013-08-15T23:58:24Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=74616#p74616</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: как определить текущий статус другого запущенного ahk-скрипта?]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=74561#p74561" />
			<content type="html"><![CDATA[<p>У меня на х32 работает<br /></p><div class="codebox"><pre><code>
SetTitleMatchMode, 2
DetectHiddenWindows, On
script_id := WinExist(&quot;keys.ahk ahk_class AutoHotkey&quot;)
MsgBox % script_id

; Force the script to update its Pause/Suspend checkmarks.
SendMessage, 0x211,,,, ahk_id %script_id%  ; WM_ENTERMENULOOP
SendMessage, 0x212,,,, ahk_id %script_id%  ; WM_EXITMENULOOP

; Get script status from its main menu.
mainMenu := DllCall(&quot;GetMenu&quot;, &quot;uint&quot;, script_id)
fileMenu := DllCall(&quot;GetSubMenu&quot;, &quot;uint&quot;, mainMenu, &quot;int&quot;, 0)
isPaused := DllCall(&quot;GetMenuState&quot;, &quot;uint&quot;, fileMenu, &quot;uint&quot;, 4, &quot;uint&quot;, 0x400) &gt;&gt; 3 &amp; 1
isSuspended := DllCall(&quot;GetMenuState&quot;, &quot;uint&quot;, fileMenu, &quot;uint&quot;, 5, &quot;uint&quot;, 0x400) &gt;&gt; 3 &amp; 1
DllCall(&quot;CloseHandle&quot;, &quot;uint&quot;, fileMenu)
DllCall(&quot;CloseHandle&quot;, &quot;uint&quot;, mainMenu)

MsgBox Paused: %isPaused%`nSuspended: %isSuspended%
</code></pre></div><p>Иконка в трее не при делах. Определяются пункты меню скрытого (основного) окна.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2013-08-15T08:33:41Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=74561#p74561</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: как определить текущий статус другого запущенного ahk-скрипта?]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=74557#p74557" />
			<content type="html"><![CDATA[<p>Я написал скрипт-менеджер для управления файлами и процессами .ahk-скриптов. Этот скрипт-менеджер умеет pause/unpause других запущенных скриптов, а также suspend/unsuspend hotkeys им же, используя PostMessage.</p><p>Вопрос в том: а как определить текущий статус (paused? hotkeys_suspended?) другого запущенного ahk-скрипта?</p><p>У Lexikos&#039;а <a href="http://www.autohotkey.com/board/topic/41725-how-do-i-disable-a-script-from-a-different-script/#entry287262">описано</a> как это сделать, но у меня не получилось заставить работать этот код. Как мне подсказали - возможно из-за того, что он писался под другой AHK (у меня AHK_L x64 последней релизной версии). Более того, я не знаю как работают его SendMessage и DllCall&#039;ы и не уверен, что этот код сумел бы определить статус скрипта не имеющего собственную иконку в трее (#NoTrayIcon или же она могла быть скрыта/убита <a href="http://www.autohotkey.com/board/topic/65494-oneicon-tame-your-tray-menu/#entry516042">как-то так</a>).</p>]]></content>
			<author>
				<name><![CDATA[Drugoy]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=27463</uri>
			</author>
			<updated>2013-08-15T01:08:01Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=74557#p74557</id>
		</entry>
</feed>
