<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: ProgressBar при копировании иногда пишет Not Responding]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=10964</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=10964&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: ProgressBar при копировании иногда пишет Not Responding».]]></description>
		<lastBuildDate>Fri, 25 Sep 2015 20:36:56 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: ProgressBar при копировании иногда пишет Not Responding]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=97695#p97695</link>
			<description><![CDATA[<p>Почитайте <a href="http://www.izcity.com/faq/winxp/question1818.html">здесь</a>. Возможно, какая-то из описанных проблем.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Fri, 25 Sep 2015 20:36:56 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=97695#p97695</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: ProgressBar при копировании иногда пишет Not Responding]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=97694#p97694</link>
			<description><![CDATA[<p>Скачал инсталлер по приведённой мною ссылке, запустил его-modify-32 unicod. Проблема осталась.</p>]]></description>
			<author><![CDATA[null@example.com (unKn0wn)]]></author>
			<pubDate>Fri, 25 Sep 2015 19:25:11 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=97694#p97694</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: ProgressBar при копировании иногда пишет Not Responding]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=97692#p97692</link>
			<description><![CDATA[<div class="quotebox"><blockquote><p>скрипт пишет, что autohotkey не является приложением win32</p></blockquote></div><p>Переустановите ещё раз с помощью инсталлера, смотрите внимательно, что устанавливаете.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Fri, 25 Sep 2015 18:24:15 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=97692#p97692</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: ProgressBar при копировании иногда пишет Not Responding]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=97691#p97691</link>
			<description><![CDATA[<p>Любой код на форуме пишется в расчёте на самую последнюю версию AHK.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Fri, 25 Sep 2015 18:05:43 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=97691#p97691</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: ProgressBar при копировании иногда пишет Not Responding]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=97690#p97690</link>
			<description><![CDATA[<p>Точно, спасибо. Для тех, кто столкнётся, с проблемой при запуске: <a href="http://ahkscript.org/download/ahk-install.exe">Autohotkey_L</a></p><p>Всё-же рано радовался, теперь мне скрипт пишет, что autohotkey не является приложением win32 -хотя, я устанавливал версию 32 unicod.</p>]]></description>
			<author><![CDATA[null@example.com (unKn0wn)]]></author>
			<pubDate>Fri, 25 Sep 2015 17:55:54 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=97690#p97690</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: ProgressBar при копировании иногда пишет Not Responding]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=97689#p97689</link>
			<description><![CDATA[<p>Обновите AHK.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Fri, 25 Sep 2015 17:47:24 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=97689#p97689</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: ProgressBar при копировании иногда пишет Not Responding]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=97688#p97688</link>
			<description><![CDATA[<p>Пытался выполнить код, что сообщением выше, но не получилось. Не подскажите в чем дело?<br /></p><div class="quotebox"><blockquote><p>(7) : ==&gt; The following variable name contains an illegal character:<br />&quot;CopyFile.end&quot;</p></blockquote></div>]]></description>
			<author><![CDATA[null@example.com (unKn0wn)]]></author>
			<pubDate>Fri, 25 Sep 2015 17:39:50 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=97688#p97688</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: ProgressBar при копировании иногда пишет Not Responding]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=97649#p97649</link>
			<description><![CDATA[<p>Или так всё-таки, не знаю, как лучше.<br /></p><div class="codebox"><pre><code>CopyFile.Start( &quot;source.txt&quot;   ; путь к файлу 
               , &quot;dest.txt&quot;    ; путь копирования
               , 250           ; ширина прогрессбара
               , 400           ; x-координата окна
               , 300 )         ; y-координата окна

while !CopyFile.end
   Sleep, 500
ExitApp

class CopyFile
{
   Start(source, dest, w = 300, x = &quot;&quot;, y = &quot;&quot;)  {
      this.end := 0
      if FileExist(dest)  {
         MsgBox, 0x34,, Файл &quot;%dest%&quot; уже существует.`nПерезаписать?
         IfMsgBox, No
            Return,, this.end := 1
      }
      Gui, New, +hwndhGui
      this.hGui := hGui
      Gui, Margin,, 10
      Gui, Add, Progress, w%w% h20 -Smooth, 0
      Gui, Add, Button, gCancelCopy x+-80 y+10 w80, Cancel
      Gui, Show, % (x != &quot;&quot; &amp;&amp; y != &quot;&quot;) ? &quot;x&quot; x &quot; y&quot; y : &quot;&quot;, Идёт копирование...
      
      OnMessage(DllCall(&quot;RegisterWindowMessage&quot;, Str, &quot;WM_INFO&quot;), &quot;WM_INFO&quot;)
      this.CopyPID := ExecScript(this.GetScript(source, dest))
      OnExit(&quot;CancelCopy&quot;)
   }
   
   GetScript(source, dest)  {
      CopyScript =
      (
         #NoTrayIcon
         ERROR_REQUEST_ABORTED := 1235, COPY_FILE_NO_BUFFERING := 0x1000
         source := &quot;%source%&quot;, dest := &quot;%dest%&quot;
         WM_INFO := DllCall(&quot;RegisterWindowMessage&quot;, Str, &quot;WM_INFO&quot;)
         DetectHiddenWindows, On
         WinWait, ahk_id %A_ScriptHwnd%
         VarSetCapacity(cancel, 4, 0)
         PostMessage, WM_INFO, 1, &amp;cancel
         
         addr := RegisterCallback(&quot;ProgressControl&quot;, &quot;F&quot;, 4, WM_INFO)
         FileGetSize, size, `% source, M
         if !DllCall(&quot;CopyFileEx&quot;, Str, source, Str, dest, Ptr, addr, Ptr, 0, Ptr, &amp;cancel, UInt, size &gt; 1024 ? COPY_FILE_NO_BUFFERING : 0)
            PostMessage, WM_INFO, 0, A_LastError = ERROR_REQUEST_ABORTED ? 0 : A_LastError
         else
            PostMessage, WM_INFO, 3
         ExitApp
         
         ProgressControl(TotalFileSize, TotalBytesTransferred, StreamSize, StreamBytesTransferred)  {
            PostMessage, A_EventInfo, 2, Round((A_PtrSize = 8 ? TotalBytesTransferred : StreamSize)/TotalFileSize * 100)
         }
      )
      Return CopyScript
   }
}

CancelCopy()
{
   static PROCESS_VM_OPERATION := 0x8, PROCESS_VM_WRITE := 0x20
   Process, Exist, % CopyFile.CopyPID
   if !ErrorLevel
      Return
   
   hProc := DllCall(&quot;OpenProcess&quot;, UInt, PROCESS_VM_OPERATION|PROCESS_VM_WRITE, Int, 0, UInt, CopyFile.CopyPID, Ptr)
   DllCall(&quot;WriteProcessMemory&quot;, Ptr, hProc, Ptr, CopyFile.CancelPtr, UIntP, 1, Ptr, 4, PtrP, Written)
   DllCall(&quot;CloseHandle&quot;, Ptr, hProc)
   OnExit(&quot;CancelCopy&quot;, 0)
}

WM_INFO(wp, lp)
{
   Critical
   Gui, % CopyFile.hGui &quot;:Default&quot;
   if (wp = 1)
      CopyFile.CancelPtr := lp
   
   if (wp = 2)  {
      GuiControl,, msctls_progress321, % lp
      Gui, Show, NA, % &quot;Идёт копирование... &quot; . lp . &quot;%&quot;
   }
   if (wp = 0 &amp;&amp; lp = 0)  {
      GuiControl,, msctls_progress321, 0
      Gui, Show, NA, Отменено
      Sleep, 1000
      Gui, Destroy
   }
   if (wp = 0 &amp;&amp; lp != 0)  {
      GuiControl,, msctls_progress321, 0
      Gui, Show, NA, Ошибка
      MsgBox, 16, Error, Ошибка копирования %lp%
      Gui, Destroy
   }
   if (wp = 3)  {
      GuiControl,, msctls_progress321, 100
      Gui, Show, NA, Успешно завершено
      Sleep, 1000
      Gui, Destroy
   }
   if wp in 0,3
      OnExit(&quot;CancelCopy&quot;, 0), CopyFile.end := 1
}

ExecScript(Script)
{
   shell := ComObjCreate(&quot;WScript.Shell&quot;)
   exec := shell.Exec(A_AhkPath &quot; *&quot;)
   exec.StdIn.Write(script)
   exec.StdIn.Close()
   return exec.ProcessID
}</code></pre></div><p>Так можно параллельно с копированием делать что-то ещё.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Tue, 22 Sep 2015 11:05:03 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=97649#p97649</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: ProgressBar при копировании иногда пишет Not Responding]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=97648#p97648</link>
			<description><![CDATA[<p><a href="http://forum.script-coding.com/viewtopic.php?pid=97642#p97642">Подправил</a> немного.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Tue, 22 Sep 2015 10:51:26 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=97648#p97648</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: ProgressBar при копировании иногда пишет Not Responding]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=97645#p97645</link>
			<description><![CDATA[<p>Ну, какая разница? Так поведенчески логичней.</p>]]></description>
			<author><![CDATA[null@example.com (Flasher)]]></author>
			<pubDate>Tue, 22 Sep 2015 09:55:50 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=97645#p97645</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: ProgressBar при копировании иногда пишет Not Responding]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=97644#p97644</link>
			<description><![CDATA[<p>Почему, это ведь не самостоятельный скрипт, это просто функция для копирования, которую можно вставить куда угодно.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Tue, 22 Sep 2015 09:51:16 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=97644#p97644</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: ProgressBar при копировании иногда пишет Not Responding]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=97643#p97643</link>
			<description><![CDATA[<p><strong>teadrinker</strong><br />Гуд, только по окончанию надо бы убирать прогресс вместе со скриптом из трея, клавиша не назначена всё равно.</p>]]></description>
			<author><![CDATA[null@example.com (Flasher)]]></author>
			<pubDate>Tue, 22 Sep 2015 09:48:07 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=97643#p97643</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: ProgressBar при копировании иногда пишет Not Responding]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=97642#p97642</link>
			<description><![CDATA[<p>До кучи асинхронное копирование:<br /></p><div class="codebox"><pre><code>CopyFile.Start( &quot;source.txt&quot;   ; путь к файлу 
               , &quot;dest.txt&quot;    ; путь копирования
               , 250           ; ширина прогрессбара
               , 400           ; x-координата окна
               , 300 )         ; y-координата окна
               
ExitApp

class CopyFile
{
   Start(source, dest, w = 300, x = &quot;&quot;, y = &quot;&quot;)  {
      this.end := 0
      if FileExist(dest)  {
         MsgBox, 0x34,, Файл &quot;%dest%&quot; уже существует.`nПерезаписать?
         IfMsgBox, No
            Return
      }
      Gui, New, +hwndhGui
      this.hGui := hGui
      Gui, Margin,, 10
      Gui, Add, Progress, w%w% h20 -Smooth, 0
      Gui, Add, Button, gCancelCopy x+-80 y+10 w80, Cancel
      Gui, Show, % (x != &quot;&quot; &amp;&amp; y != &quot;&quot;) ? &quot;x&quot; x &quot; y&quot; y : &quot;&quot;, Идёт копирование...
      
      OnMessage(DllCall(&quot;RegisterWindowMessage&quot;, Str, &quot;WM_INFO&quot;), &quot;WM_INFO&quot;)
      this.CopyPID := ExecScript(this.GetScript(source, dest))
      OnExit(&quot;CancelCopy&quot;) 
      while !this.end
         Sleep, 500
   }
   
   GetScript(source, dest)  {
      CopyScript =
      (
         #NoTrayIcon
         ERROR_REQUEST_ABORTED := 1235, COPY_FILE_NO_BUFFERING := 0x1000
         source := &quot;%source%&quot;, dest := &quot;%dest%&quot;
         WM_INFO := DllCall(&quot;RegisterWindowMessage&quot;, Str, &quot;WM_INFO&quot;)
         DetectHiddenWindows, On
         WinWait, ahk_id %A_ScriptHwnd%
         VarSetCapacity(cancel, 4, 0)
         PostMessage, WM_INFO, 1, &amp;cancel
         
         addr := RegisterCallback(&quot;ProgressControl&quot;, &quot;F&quot;, 4, WM_INFO)
         FileGetSize, size, `% source, M
         if !DllCall(&quot;CopyFileEx&quot;, Str, source, Str, dest, Ptr, addr, Ptr, 0, Ptr, &amp;cancel, UInt, size &gt; 1024 ? COPY_FILE_NO_BUFFERING : 0)
            PostMessage, WM_INFO, 0, A_LastError = ERROR_REQUEST_ABORTED ? 0 : A_LastError
         else
            PostMessage, WM_INFO, 3
         ExitApp
         
         ProgressControl(TotalFileSize, TotalBytesTransferred, StreamSize, StreamBytesTransferred)  {
            PostMessage, A_EventInfo, 2, Round((A_PtrSize = 8 ? TotalBytesTransferred : StreamSize)/TotalFileSize * 100)
         }
      )
      Return CopyScript
   }
}

CancelCopy()
{
   static PROCESS_VM_OPERATION := 0x8, PROCESS_VM_WRITE := 0x20
   Process, Exist, % CopyFile.CopyPID
   if !ErrorLevel
      Return
   
   hProc := DllCall(&quot;OpenProcess&quot;, UInt, PROCESS_VM_OPERATION|PROCESS_VM_WRITE, Int, 0, UInt, CopyFile.CopyPID, Ptr)
   DllCall(&quot;WriteProcessMemory&quot;, Ptr, hProc, Ptr, CopyFile.CancelPtr, UIntP, 1, Ptr, 4, PtrP, Written)
   DllCall(&quot;CloseHandle&quot;, Ptr, hProc)
   OnExit(&quot;CancelCopy&quot;, 0)
}

WM_INFO(wp, lp)
{
   Critical
   Gui, % CopyFile.hGui &quot;:Default&quot;
   if (wp = 1)
      CopyFile.CancelPtr := lp
   
   if (wp = 2)  {
      GuiControl,, msctls_progress321, % lp
      Gui, Show, NA, % &quot;Идёт копирование... &quot; . lp . &quot;%&quot;
   }
   if (wp = 0 &amp;&amp; lp = 0)  {
      GuiControl,, msctls_progress321, 0
      Gui, Show, NA, Отменено
      Sleep, 1000
      Gui, Destroy
   }
   if (wp = 0 &amp;&amp; lp != 0)  {
      GuiControl,, msctls_progress321, 0
      Gui, Show, NA, Ошибка
      MsgBox, 16, Error, Ошибка копирования %lp%
      Gui, Destroy
   }
   if (wp = 3)  {
      GuiControl,, msctls_progress321, 100
      Gui, Show, NA, Успешно завершено
      Sleep, 1000
      Gui, Destroy
   }
   if wp in 0,3
      OnExit(&quot;CancelCopy&quot;, 0), CopyFile.end := 1
}

ExecScript(Script)
{
   shell := ComObjCreate(&quot;WScript.Shell&quot;)
   exec := shell.Exec(A_AhkPath &quot; *&quot;)
   exec.StdIn.Write(script)
   exec.StdIn.Close()
   return exec.ProcessID
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Tue, 22 Sep 2015 09:01:25 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=97642#p97642</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: ProgressBar при копировании иногда пишет Not Responding]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=97632#p97632</link>
			<description><![CDATA[<p>Вот еще один вариант:<br />Можно копировать через Robocopy и захватывать информацию с CMD с помощью:<br /><a href="http://www.autohotkey.com/board/topic/96903-simplified-versions-of-seans-stdouttovar/">http://www.autohotkey.com/board/topic/9 … douttovar/</a></p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Tue, 22 Sep 2015 05:47:00 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=97632#p97632</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: ProgressBar при копировании иногда пишет Not Responding]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=97610#p97610</link>
			<description><![CDATA[<p>Думаю нет.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Mon, 21 Sep 2015 09:42:29 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=97610#p97610</guid>
		</item>
	</channel>
</rss>
