<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Добавление в скрипт Menu]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=11585&amp;type=atom" />
	<updated>2016-05-13T11:38:07Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=11585</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Добавление в скрипт Menu]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=103736#p103736" />
			<content type="html"><![CDATA[<p>Понял, спасибо.</p>]]></content>
			<author>
				<name><![CDATA[SeaVodikendu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33752</uri>
			</author>
			<updated>2016-05-13T11:38:07Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=103736#p103736</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Добавление в скрипт Menu]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=103731#p103731" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>#Persistent 
Menu, tray, add 
Menu, tray, add, Пункт1, MenuHandler

MenuHandler(ItemName, ItemPos, MenuName)
{
	Global
MsgBox %verk%
}

Msgbox, Hi

verk := &quot;wqerty&quot;</code></pre></div><p>Надо что бы функция была глобальная и текст в переменной был в кавычках.</p>]]></content>
			<author>
				<name><![CDATA[yalanne]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32850</uri>
			</author>
			<updated>2016-05-13T09:46:31Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=103731#p103731</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Добавление в скрипт Menu]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=103727#p103727" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>#Persistent 
Menu, tray, add 
Menu, tray, add, Пункт1, MenuHandler

MenuHandler(ItemName, ItemPos, MenuName)
{
MsgBox %verk%
}

Msgbox, Hi

verk := wqerty</code></pre></div><p>Почему не читает переменную &quot;verk&quot;?</p>]]></content>
			<author>
				<name><![CDATA[SeaVodikendu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33752</uri>
			</author>
			<updated>2016-05-13T09:13:25Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=103727#p103727</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Добавление в скрипт Menu]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=103726#p103726" />
			<content type="html"><![CDATA[<p>Спасибо.</p>]]></content>
			<author>
				<name><![CDATA[SeaVodikendu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33752</uri>
			</author>
			<updated>2016-05-13T08:40:58Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=103726#p103726</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Добавление в скрипт Menu]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=103717#p103717" />
			<content type="html"><![CDATA[<div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header"><strong>+</strong>&nbsp;Вариант 1. перенести до первого прерывания нужную строку.</div><div class="fancy_spoiler"><div class="codebox"><pre><code>#Persistent 
Menu, tray, add 
Menu, tray, add, Пункт1, MenuHandler
Msgbox, Hi ; перенести сюда то что должно быть при запуске скрипта.
return

MenuHandler:
MsgBox Вы выбрали %A_ThisMenuItem% из меню %A_ThisMenu%.
return </code></pre></div></div></div><div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header"><strong>+</strong>&nbsp;Вариант 2. переходить по метке. Goto\Gosub.</div><div class="fancy_spoiler"><div class="codebox"><pre><code>#Persistent 
Menu, tray, add 
Menu, tray, add, Пункт1, MenuHandler
Goto next ; Создать метку перехода.
return

MenuHandler:
MsgBox Вы выбрали %A_ThisMenuItem% из меню %A_ThisMenu%.
return 


next: 
Msgbox, Hi</code></pre></div></div></div><div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header"><strong>+</strong>&nbsp;Вариант 3. Вместо метки для меню можно использовать функцию, она не прерывает поток.</div><div class="fancy_spoiler"><div class="codebox"><pre><code>#Persistent 
Menu, tray, add 
Menu, tray, add, Пункт1, MenuHandler

MenuHandler(ItemName, ItemPos, MenuName) ; указываем просто как функцию.
{
; ItemName, ItemPos, MenuName - можно задать свои имена для этих переменных. они содержат то же самое что и 
; A_ThisMenuItem, A_ThisMenuItemPos,A_ThisMenu
MsgBox Вы выбрали %A_ThisMenuItem% из меню %A_ThisMenu%.
}

Msgbox, Hi</code></pre></div></div></div>]]></content>
			<author>
				<name><![CDATA[yalanne]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32850</uri>
			</author>
			<updated>2016-05-13T06:36:36Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=103717#p103717</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Добавление в скрипт Menu]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=103716#p103716" />
			<content type="html"><![CDATA[<p>Menu не блокирует. Команда return прерывает текущий поток. Просто уберите ее после команд Menu, и будет выполняться код ниже.</p>]]></content>
			<author>
				<name><![CDATA[mafckz]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32877</uri>
			</author>
			<updated>2016-05-13T06:15:46Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=103716#p103716</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Добавление в скрипт Menu]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=103715#p103715" />
			<content type="html"><![CDATA[<p>Здравствуйте.<br />Помогите разобраться как правильно добавить в скрипт Menu, Tray.<br /></p><div class="codebox"><pre><code>
#Persistent 
Menu, tray, add 
Menu, tray, add, Пункт1, MenuHandler
return

MenuHandler:
MsgBox Вы выбрали %A_ThisMenuItem% из меню %A_ThisMenu%.
return 

Msgbox, Hi</code></pre></div><p>По идее должно при запуске скрипта показывать Msgbox с &quot;Hi&quot;.<br />А Menu блокирует все что прописано после него.</p>]]></content>
			<author>
				<name><![CDATA[SeaVodikendu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33752</uri>
			</author>
			<updated>2016-05-13T05:56:45Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=103715#p103715</id>
		</entry>
</feed>
