<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: запуск файлов прикрепленных к скомпилированному скрипту]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=5048</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=5048&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: запуск файлов прикрепленных к скомпилированному скрипту».]]></description>
		<lastBuildDate>Sun, 21 Nov 2010 23:17:59 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: запуск файлов прикрепленных к скомпилированному скрипту]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=42044#p42044</link>
			<description><![CDATA[<p>Нет, оказывается, всё возможно. Вот <a href="http://www.autohotkey.com/forum/viewtopic.php?p=147202#147202">здесь</a> примеры распаковки ресурсов. Для <em>wav</em> нужен пример &quot;Referencing a WAVE&quot;, вместо числа 666, выделенного красным, нужно поставить 1, если ресурс единственный. Ну и <em>Loop 10</em> не обязательно: <br /></p><div class="codebox"><pre><code>hModule   := DllCall( &quot;GetModuleHandle&quot;, Str, A_ScriptFullPath )
hResource := DllCall(&quot;FindResource&quot;, UInt,hModule, UInt, 1, UInt,10 )
nSize     := DllCall(&quot;SizeofResource&quot;, UInt,hModule, UInt, hResource )

hResData  := DllCall(&quot;LoadResource&quot;, UInt,0, UInt,hResource )
Buffer    := DllCall(&quot;LockResource&quot;, &quot;UInt&quot;, hResData )

DllCall(&quot;winmm.dll\sndPlaySoundA&quot;, UInt,Buffer, UINT, ( (SND_MEMORY:=0x4) | (SND_NODEFAULT:=0x2)) )

ExitApp</code></pre></div><p>Этот код нужно скомпилировать с помощью <a href="http://www.autohotkey.com/forum/topic22975.html">Compile_AHK.exe</a>, добавив в качестве ресурса wav-файл.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Sun, 21 Nov 2010 23:17:59 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=42044#p42044</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: запуск файлов прикрепленных к скомпилированному скрипту]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=40530#p40530</link>
			<description><![CDATA[<div class="quotebox"><cite>InFlames пишет:</cite><blockquote><p>Возможно ли проиграть звук не извлекая его из .exe?</p></blockquote></div><p>На AHK — маловероятно, нужных функций для работы с ресурсами нет.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Sun, 17 Oct 2010 18:24:09 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=40530#p40530</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: запуск файлов прикрепленных к скомпилированному скрипту]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=40519#p40519</link>
			<description><![CDATA[<p>Экспериментировать можно и с изображением.<br />teadrinker&nbsp; думаю может всё <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /><br />Решил обойтись вариантом с &quot;разгрузкой&quot; файла во временную папку.</p>]]></description>
			<author><![CDATA[null@example.com (InFlames)]]></author>
			<pubDate>Sun, 17 Oct 2010 14:59:18 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=40519#p40519</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: запуск файлов прикрепленных к скомпилированному скрипту]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=40518#p40518</link>
			<description><![CDATA[<p>Ну, понятно. В ресурсах это уже не файл. Вообще, наверно, можно, но уж точно не через SoundPlay, ей же файл на диске нужен. Что-то мне подсказывает, что <strong>teadrinker</strong> может это раскурочить. Надо его нацелить и озадачить. <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /> У меня на машине звуковой карты нет, так что не поэкспериментируешь.</p>]]></description>
			<author><![CDATA[null@example.com (YMP)]]></author>
			<pubDate>Sun, 17 Oct 2010 14:53:25 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=40518#p40518</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: запуск файлов прикрепленных к скомпилированному скрипту]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=40516#p40516</link>
			<description><![CDATA[<p>Скомпилировал скрипт, прикрепив к нему звуковой файл on.wav<br />Запускаю скрипт следующего содержания, и звук не проигрывается<br /></p><div class="codebox"><pre><code>soundplay, on.wav</code></pre></div><p>Если запускать вот такой скомпилированный скрипт с этим же звуковым файлом внутри, то звук проигрывается<br /></p><div class="codebox"><pre><code>PathToInstall=%a_temp%
FileInstall, on.wav, %PathToInstall%\on.wav, 1</code></pre></div><p>Т.е. сначала требуется выгрузить этот файл в какую-либо папку, а затем проиграть его.<br />А нельзя сделать так, что бы этот звук можно было проиграть, не извлекая его из .exe?</p>]]></description>
			<author><![CDATA[null@example.com (InFlames)]]></author>
			<pubDate>Sun, 17 Oct 2010 13:18:29 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=40516#p40516</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: запуск файлов прикрепленных к скомпилированному скрипту]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=40515#p40515</link>
			<description><![CDATA[<p>А как он должен понять? Что Вы для этого делаете?</p>]]></description>
			<author><![CDATA[null@example.com (YMP)]]></author>
			<pubDate>Sun, 17 Oct 2010 13:04:08 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=40515#p40515</guid>
		</item>
		<item>
			<title><![CDATA[AHK: запуск файлов прикрепленных к скомпилированному скрипту]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=40514#p40514</link>
			<description><![CDATA[<p>Не знаю на сколько название понятно, но мне нужно следующее:<br />с помощью <a href="http://www.autohotkey.com/forum/topic22975.html">Compile_AHK II</a> компилирую скрипт, и в ресурсах добавляю звуковой файл. При запуске скрипта выполняется команда на проигрывание этого звука. Но скомпилированный файл &quot;не понимает&quot;, что ему надо проиграть звук именно из своего ресурса. Приходится командой FileInstall извлекать файл в какую либо папку, а только потом проигрывать этот звук.<br />Возможно ли проиграть звук не извлекая его из .exe?</p>]]></description>
			<author><![CDATA[null@example.com (InFlames)]]></author>
			<pubDate>Sun, 17 Oct 2010 12:17:15 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=40514#p40514</guid>
		</item>
	</channel>
</rss>
