<?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=13048</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=13048&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Скачивание файлов».]]></description>
		<lastBuildDate>Tue, 03 Oct 2017 17:03:13 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Скачивание файлов]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=119750#p119750</link>
			<description><![CDATA[<div class="codebox"><pre><code>
SetWorkingDir, %A_ScriptDir%
DownloadFile(&quot;https://autohotkey.com/download/ahk-install.exe&quot;, &quot;ahk-install.exe&quot;)
While !FileExist(&quot;ahk-install.exe&quot;)
	Continue
MsgBox, Скачано!
Return

DownloadFile(UrlToFile = &quot;&quot;, SaveFileAs = &quot;&quot;, Overwrite := False, UseProgressBar := True) {
	  If (UrlToFile = &quot;&quot; &amp;&amp; SaveFileAs != &quot;&quot;) {
			If FileExist(SaveFileAs)
				Return &quot;Downloaded&quot;
			Else
				Return &quot;No&quot;
		}
      If (!Overwrite &amp;&amp; FileExist(SaveFileAs))
          Return
      If (UseProgressBar) {
            WebRequest := ComObjCreate(&quot;WinHttp.WinHttpRequest.5.1&quot;)
            WebRequest.Open(&quot;HEAD&quot;, UrlToFile)
            WebRequest.Send()
            FinalSize := WebRequest.GetResponseHeader(&quot;Content-Length&quot;)
            Progress, H80, , Downloading..., %UrlToFile%
            SetTimer, __UpdateProgressBar, 100
      }
      UrlDownloadToFile, %UrlToFile%, %SaveFileAs%
      If (UseProgressBar) {
          Progress, Off
          SetTimer, __UpdateProgressBar, Off
      }
    Return

      __UpdateProgressBar:
            CurrentSize := FileOpen(SaveFileAs, &quot;r&quot;).Length 
            CurrentSizeTick := A_TickCount
            Speed := Round((CurrentSize/1024-LastSize/1024)/((CurrentSizeTick-LastSizeTick)/1000)) . &quot; Kb/s&quot;
            LastSizeTick := CurrentSizeTick
            LastSize := FileOpen(SaveFileAs, &quot;r&quot;).Length
            PercentDone := Round(CurrentSize/FinalSize*100)
            Progress, %PercentDone%, %PercentDone%`% Done, Downloading...  (%Speed%), Downloading %SaveFileAs% (%PercentDone%`%)
      Return
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Странникх)]]></author>
			<pubDate>Tue, 03 Oct 2017 17:03:13 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=119750#p119750</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Скачивание файлов]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=119746#p119746</link>
			<description><![CDATA[<p>Сразу после urldownloadtofile просто пишите ваше сообщение. Пока скачивается файл, скрипт замораживается.</p>]]></description>
			<author><![CDATA[null@example.com (belyankin12)]]></author>
			<pubDate>Tue, 03 Oct 2017 15:48:18 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=119746#p119746</guid>
		</item>
		<item>
			<title><![CDATA[AHK: Скачивание файлов]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=119735#p119735</link>
			<description><![CDATA[<p>Здравствуйте ребята, прошу Вас в очередной раз мне помочь, я не так давно знаю язык ahk.<br />Помогите пожалуйста сделать загрузку приложений по ссылке. Я знаю что есть команда: &quot;URLDownloadToFile&quot; но я бы хотел узнать, можно ли как то уведомить пользователя о том что загрузка окончена? Если да, то пожалуйста киньте код, буду очень сильно благодарен! Спасибо заранее!</p>]]></description>
			<author><![CDATA[null@example.com (andrew.drob71)]]></author>
			<pubDate>Tue, 03 Oct 2017 13:48:12 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=119735#p119735</guid>
		</item>
	</channel>
</rss>
