<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: асинхронный вызов Wait-функции]]></title>
	<link rel="self" href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=6739&amp;type=atom" />
	<updated>2014-04-25T10:45:56Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=6739</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: асинхронный вызов Wait-функции]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=82277#p82277" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>priorProcName := EventList.Remove(eventHandle).UserDefinedProc.Name</code></pre></div><p>eventHandle - число, Remove(eventHandle) может изменить остальные сохранённые хендлы.<br />Должно быть:<br /></p><div class="codebox"><pre><code>priorProcName := EventList.Remove(eventHandle, &quot;&quot;).UserDefinedProc.Name</code></pre></div>]]></content>
			<author>
				<name><![CDATA[bWRmeA]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=31915</uri>
			</author>
			<updated>2014-04-25T10:45:56Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=82277#p82277</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: асинхронный вызов Wait-функции]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=65477#p65477" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Александр_ пишет:</cite><blockquote><p>WMI сравнивает состояние системы в разные моменты времени</p></blockquote></div><p>Да, согласен, это не Wait-функция. Но я только сейчас узнал, каков механизм работы WMI в данном случае. <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2012-11-08T19:53:56Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=65477#p65477</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: асинхронный вызов Wait-функции]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=65476#p65476" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Да, а чем это хуже? Ведь тоже можно выполнять асинхронно.</p></blockquote></div><p>Ну начнём с того, что это совершенно разные механизмы- ReadDirectoryChangesW ждёт изменений, а WMI сравнивает состояние системы в разные моменты времени. Т.е. в первом случае мы гарантированно узнаем о событии, а во втором только если оно будет достаточно продолжительным. Если установить маленький промежуток времени между проверками, то можно сильно загрузить процессор. В этой теме рассмотрено слежение в реальном времени, для него WMI не подходит. Обычное слежение можно организовать и в синхронном режиме, просто задав буфер побольше и периодически проверяя события, так мы тоже ничего не упустим, а WMI опять пролетает. Можно и плюсы у WMI найти, например у его процесса может быть больше прав и он сможет работать с папками, которые по каким-то причинам не удалось открыть.</p>]]></content>
			<author>
				<name><![CDATA[Александр_]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24888</uri>
			</author>
			<updated>2012-11-08T19:44:50Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=65476#p65476</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: асинхронный вызов Wait-функции]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=65475#p65475" />
			<content type="html"><![CDATA[<p>Да, а чем это хуже? Ведь тоже можно выполнять асинхронно.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2012-11-08T19:21:14Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=65475#p65475</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: асинхронный вызов Wait-функции]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=65474#p65474" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Да не, сейчас вот смотрю, там ещё __InstanceDeletionEvent и __InstanceModificationEvent.</p></blockquote></div><p>Ну и один хрен ведь, просто проверка состояния через равные промежутки времени, разве нет?</p>]]></content>
			<author>
				<name><![CDATA[Александр_]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24888</uri>
			</author>
			<updated>2012-11-08T19:13:17Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=65474#p65474</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: асинхронный вызов Wait-функции]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=65473#p65473" />
			<content type="html"><![CDATA[<p>Да не, сейчас вот смотрю, там ещё __InstanceDeletionEvent и __InstanceModificationEvent.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2012-11-08T19:09:32Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=65473#p65473</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: асинхронный вызов Wait-функции]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=65472#p65472" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Вообще подозреваю, что с помощью WMI всё это можно организовать куда проще.</p></blockquote></div><p>По-моему там только&nbsp; __InstanceCreationEvent, который никак нельзя считать достойной альтернативой.</p>]]></content>
			<author>
				<name><![CDATA[Александр_]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24888</uri>
			</author>
			<updated>2012-11-08T19:00:14Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=65472#p65472</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: асинхронный вызов Wait-функции]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=65467#p65467" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>Откуда пользователю должно быть известно про 15?</p></blockquote></div><p>Предложи интуитивно понятный пользователю вариант задания фильтра событий, у меня идей нет <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[creature.ws]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26105</uri>
			</author>
			<updated>2012-11-08T12:29:23Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=65467#p65467</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: асинхронный вызов Wait-функции]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=65466#p65466" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>creature.ws пишет:</cite><blockquote><p>Буду рад увидеть пример использующий WMI.</p></blockquote></div><p>Вечером посмотрю.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2012-11-08T12:27:43Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=65466#p65466</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: асинхронный вызов Wait-функции]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=65465#p65465" />
			<content type="html"><![CDATA[<p>Ну вот, а ты говорил — «Дружелюбный к пользователю»! <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /> Откуда пользователю должно быть известно про 15?</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2012-11-08T12:27:08Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=65465#p65465</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: асинхронный вызов Wait-функции]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=65464#p65464" />
			<content type="html"><![CDATA[<p>Третий параметр OnDirectoryChanges — ссылка на dwNotifyFilter, для дополнительного реагирования на изменение атрибутов и времени записи указать нужно 15.<br />По-умолчанию 3 — изменнения имени папки или файла.</p><p>Буду рад видеть пример использующий WMI.</p>]]></content>
			<author>
				<name><![CDATA[creature.ws]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26105</uri>
			</author>
			<updated>2012-11-08T12:23:53Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=65464#p65464</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: асинхронный вызов Wait-функции]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=65463#p65463" />
			<content type="html"><![CDATA[<p>У меня на изменение содержания и атрибутов файла на рабочем столе не среагировало.</p><p>Вообще подозреваю, что с помощью WMI всё это можно организовать куда проще.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2012-11-08T12:16:59Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=65463#p65463</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: асинхронный вызов Wait-функции]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=65461#p65461" />
			<content type="html"><![CDATA[<p>«Дружелюбный к пользователю» пример использования асинхронного вызова ReadDirectoryChangesW:<br /></p><div class="codebox"><pre><code>#NoEnv
SetBatchLines -1

OnDirectoryChanges(A_ScriptDir, &quot;Test0&quot;)
OnDirectoryChanges(A_Desktop, &quot;Test1&quot;)

Test0(filePath, action) {
    MsgBox % A_ThisFunc . &quot;`n&quot; . [&quot;Added&quot;, &quot;Removed&quot;, &quot;Modified&quot;, &quot;Renamed, old name&quot;, &quot;Renamed, new name&quot;][action] &quot;: &quot; filePath
}

Test1(filePath, action) {
    MsgBox % A_ThisFunc . &quot;`n&quot; . [&quot;Added&quot;, &quot;Removed&quot;, &quot;Modified&quot;, &quot;Renamed, old name&quot;, &quot;Renamed, new name&quot;][action] &quot;: &quot; filePath
}

OnDirectoryChanges(dirPath, procName := -1, notifyFilter := 3) {
    static DirList := {}
    static EventList
    static AHK_ReadDirectoryChanges := DllCall(&quot;RegisterWindowMessage&quot;, &quot;Str&quot;, &quot;AHK_ReadDirectoryChanges&quot;, &quot;UInt&quot;)

    IsObject(EventList) || EventList := DirectoryChangesEventListener(-1, 0, 0)

    if (procName = -1) {
        return EventList[DirList[dirPath]].UserDefinedProc.Name
    }

    else if (procName = &quot;&quot;) {
        if DirList.HasKey(dirPath) &amp;&amp; eventHandle := DirList.Remove(dirPath)
            return EventList.Remove(eventHandle).UserDefinedProc.Name
    }

    else if IsFunc(procName) {
        if DirList.HasKey(dirPath) &amp;&amp; eventHandle := DirList.Remove(dirPath)
            priorProcName := EventList.Remove(eventHandle).UserDefinedProc.Name
        else priorProcName := procName

        if OnMessage(AHK_ReadDirectoryChanges) != &quot;DirectoryChangesEventListener&quot;
            OnMessage(AHK_ReadDirectoryChanges, &quot;DirectoryChangesEventListener&quot;, 30)

        Event := new _Event
        Event.Proc := new _AsyncReadDirectoryChanges(dirPath, notifyFilter)
        Event.Wait := new _AsyncWaitFunc(Event.handle, A_ScriptHWND, AHK_ReadDirectoryChanges)
        Event.UserDefinedProc := Func(procName)
        Event.dirPath := dirPath

        DirList[dirPath] := Event.handle
        EventList[Event.handle] := Event

        Event.Proc()
        Event.Wait()

        return priorProcName
    }
    else return false
}

DirectoryChangesEventListener(wParam, lParam, msg) {
    static EventList := {}
    static AHK_ReadDirectoryChanges := DllCall(&quot;RegisterWindowMessage&quot;, &quot;Str&quot;, &quot;AHK_ReadDirectoryChanges&quot;, &quot;UInt&quot;)

    if (msg = AHK_ReadDirectoryChanges &amp;&amp; Event := EventList[wParam]) {
        action := Event.Proc.GetEventType()
        name := Event.Proc.GetObjectName()
        path := Event.dirPath . &quot;\&quot; . name
        Proc := Event.UserDefinedProc
        %Proc%(path, action)

        Event.Proc()
        Event.Wait()
    }
    else if (wParam = -1)
        return EventList
}

class _Event
{
    __New() {
        this.SetCapacity(6)

        if !this.handle := DllCall(&quot;CreateEvent&quot;, &quot;Int&quot;, 0, &quot;Int&quot;, 0, &quot;Int&quot;, 1, &quot;Int&quot;, 0, &quot;Ptr&quot;)
            Throw Exception(&quot;Failed to create new event.`n`nError code:`t&quot; . A_LastError)

        if !ObjSetCapacity(this, &quot;overlapped&quot;, 32)
            Throw Exception(&quot;Failed to allocate memory for overlapped structure`n`nErrorLevel:`t&quot; . ErrorLevel)

        if !NumPut(this.handle, 0+ObjGetAddress(this, &quot;overlapped&quot;), A_PtrSize*2+8, &quot;ptr&quot;)
            Throw Exception(&quot;Failed to create overlapped structure.`n`nErrorLevel:`t&quot; . ErrorLevel)
    }

    __Delete() {
        if !DllCall(&quot;CloseHandle&quot;, &quot;Ptr&quot;, this.handle, &quot;UInt&quot;)
            Throw Exception(&quot;Failed to close event handle.`n`nError code:`t&quot; . A_LastError)
    }
}

class _AsyncWaitFunc
{
    __New(eventObjHandle, hWnd, msg, timeout := -1) {
        this.SetCapacity(1)

        if !this.startAddress := CreateWaitFunc(eventObjHandle, hWnd, msg, timeout)
            Throw Exception(&quot;Failed to create wait function.`n`nError code:`t&quot; . A_LastError)
    }

    __Call(EventObj) {
        if IsObject(EventObj) {
            if !threadHandle := DllCall(&quot;CreateThread&quot;, &quot;Int&quot;, 0, &quot;Int&quot;, 0, &quot;Ptr&quot;, 0|this.startAddress, &quot;Int&quot;, 0, &quot;UInt&quot;, 0, &quot;Int&quot;, 0, &quot;Ptr&quot;)
                Throw Exception(&quot;Failed to create thread.`n`nError code:`t&quot; . A_LastError)

            return threadHandle
        }
    }

    __Delete() {
        FreeWaitFunc(this.startAddress)
    }
}

class _AsyncReadDirectoryChanges
{
    __New(dirPath, notifyFilter) {
        this.SetCapacity(3)
        this.notifyFilter := notifyFilter

        if !this.handle := DllCall(&quot;CreateFile&quot;, &quot;Str&quot;, dirPath, &quot;UInt&quot;, 1, &quot;UInt&quot;, 3, &quot;Int&quot;, 0, &quot;UInt&quot;, 3, &quot;UInt&quot;, 0x42000000, &quot;Int&quot;, 0, &quot;Ptr&quot;)
            Throw Exception(&quot;Failed to open specified path.`n`nError code:`t&quot; . A_LastError)

        if !ObjSetCapacity(this, &quot;buffer&quot;, 1024)
            Throw Exception(&quot;Failed to set ReadDirectoryChangesW output buffer size`n`nErrorLevel:`t&quot; . ErrorLevel)
    }

    GetEventType() {
        if !bufferRef := ObjGetAddress(this, &quot;buffer&quot;)
            Throw Exception(&quot;Failed to get ReadDirectoryChangesW output buffer address`n`nErrorLevel:`t&quot; . ErrorLevel)

        return NumGet(0+bufferRef, 4,  &quot;UInt&quot;)
    }

    GetObjectName() {
        if !bufferRef := ObjGetAddress(this, &quot;buffer&quot;)
            Throw Exception(&quot;Failed to get ReadDirectoryChangesW output buffer address`n`nErrorLevel:`t&quot; . ErrorLevel)

        return StrGet(bufferRef+12, NumGet(0+bufferRef, 8, &quot;UInt&quot;)//2)
    }

    __Call(EventObj) {
        if IsObject(EventObj) {
            if !bufferRef := ObjGetAddress(this, &quot;buffer&quot;)
                Throw Exception(&quot;Failed to get ReadDirectoryChangesW output buffer address`n`nErrorLevel:`t&quot; . ErrorLevel)

            if !overlappedStructRef := ObjGetAddress(EventObj, &quot;overlapped&quot;)
                Throw Exception(&quot;Failed to get ReadDirectoryChangesW overlapped struct address`n`nErrorLevel:`t&quot; . ErrorLevel)

            return DllCall(&quot;ReadDirectoryChangesW&quot;
                , &quot;Ptr&quot;, this.handle
                , &quot;Ptr&quot;, bufferRef
                , &quot;UInt&quot;, 1024
                , &quot;Int&quot;, 1
                , &quot;UInt&quot;, this.notifyFilter
                , &quot;UInt&quot;, 0
                , &quot;Ptr&quot;, overlappedStructRef
                , &quot;Int&quot;, 0)
        }
    }

    __Delete() {
        if !DllCall(&quot;CloseHandle&quot;, &quot;Ptr&quot;, this.handle, &quot;UInt&quot;)
            Throw Exception(&quot;Failed to close directory handle.`n`nError code:`t&quot; . A_LastError)
    }

}

FreeWaitFunc(ptr)
{
    global __Free__
    __Free__.Insert(ptr)
}

CreateWaitFunc(Handle, hWnd, Msg, Timeout := -1)
{
    static __PageSize__, __Offset__, __Ptr__, __PageNum__
    global __Free__

    if((!__Offset__)||((__PageSize__-__Offset__&lt;(A_PtrSize = 4 ? 49 : 85))&amp;&amp;(!__Free__.MaxIndex())))
    {
        if(!__Ptr__)
        {
            __Ptr__ := Array()
            __Free__ := Array()
        }
        __PageNum__++
        VarSetCapacity(FuncName, 0x30, 0)
        __Ptr__[__PageNum__] := DllCall(&quot;VirtualAlloc&quot;, &quot;ptr&quot;, 0, &quot;ptr&quot;, 1, &quot;uint&quot;, 0x1000, &quot;uint&quot;, 0x40, &quot;ptr&quot;)
        DllCall(&quot;VirtualQuery&quot;, &quot;ptr&quot;, 0|__Ptr__[__PageNum__], &quot;ptr&quot;, &amp;FuncName, &quot;ptr&quot;, 0x30)
        __PageSize__ := NumGet(&amp;FuncName, 3*A_PtrSize, &quot;ptr&quot;)
        StrPut(&quot;WaitForSingleObject&quot;, &amp;FuncName, 0x30, &quot;CP1250&quot;)
        NumPut(DllCall(&quot;GetProcAddress&quot;, &quot;ptr&quot;, DllCall(&quot;GetModuleHandle&quot;, &quot;str&quot;, &quot;kernel32.dll&quot;), &quot;ptr&quot;, &amp;FuncName, &quot;ptr&quot;), 0|__Ptr__[__PageNum__], 0, &quot;ptr&quot;)
        StrPut(&quot;PostMessageW&quot;, &amp;FuncName, 0x30, &quot;CP1250&quot;)
        NumPut(DllCall(&quot;GetProcAddress&quot;, &quot;ptr&quot;, DllCall(&quot;GetModuleHandle&quot;, &quot;str&quot;, &quot;user32.dll&quot;), &quot;ptr&quot;, &amp;FuncName, &quot;ptr&quot;), 0|__Ptr__[__PageNum__], A_PtrSize, &quot;ptr&quot;)
        __Offset__ := 2*A_PtrSize
    }
    if(!__Free__.MaxIndex())
    {
        ptr := __Ptr__[__PageNum__]+__Offset__
        __Offset__+=(A_PtrSize = 4 ? 49 : 85)
    }
    else
        ptr := __Free__.Remove(1)
    if(A_PtrSize=4)
    {
        NumPut(0x68, 0|ptr, 0, &quot;uchar&quot;)
        NumPut(Timeout, 0|ptr, 1, &quot;uint&quot;)
        NumPut(0x68, 0|ptr, 5, &quot;uchar&quot;)
        NumPut(Handle, 0|ptr, 6, &quot;ptr&quot;)
        NumPut(0x15FF, 0|ptr, 10, &quot;ushort&quot;)
        NumPut(0|__Ptr__[__PageNum__], 0|ptr, 12, &quot;ptr&quot;)
        NumPut(0x50, 0|ptr, 16, &quot;uchar&quot;)
        NumPut(0x68, 0|ptr, 17, &quot;uchar&quot;)
        NumPut(Handle, 0|ptr, 18, &quot;ptr&quot;)
        NumPut(0x68, 0|ptr, 22, &quot;uchar&quot;)
        NumPut(Msg, 0|ptr, 23, &quot;uint&quot;)
        NumPut(0x68, 0|ptr, 27, &quot;uchar&quot;)
        NumPut(hWnd, 0|ptr, 28, &quot;ptr&quot;)
        NumPut(0x15FF, 0|ptr, 32, &quot;ushort&quot;)
        NumPut(0|__Ptr__[__PageNum__]+4, 0|ptr, 34, &quot;ptr&quot;)
        NumPut(0xC2, 0|ptr, 38, &quot;uchar&quot;)
        NumPut(4, 0|ptr, 39, &quot;ushort&quot;)
    }
    else
    {
        NumPut(0x53, 0|ptr, 0, &quot;uchar&quot;)
        NumPut(0x20EC8348, 0|ptr, 1, &quot;uint&quot;)
        NumPut(0xBACB8948, 0|ptr, 5, &quot;uint&quot;)
        NumPut(Timeout, 0|ptr, 9, &quot;uint&quot;)
        NumPut(0xB948, 0|ptr, 13, &quot;ushort&quot;)
        NumPut(Handle, 0|ptr, 15, &quot;ptr&quot;)
        NumPut(0x15FF, 0|ptr, 23, &quot;ushort&quot;)
        NumPut(-29-(ptr-__Ptr__[__PageNum__]), 0|ptr, 25, &quot;uint&quot;)
        NumPut(0xB849, 0|ptr, 29, &quot;ushort&quot;)
        NumPut(Handle, 0|ptr, 31, &quot;ptr&quot;)
        NumPut(0xBA, 0|ptr, 39, &quot;uchar&quot;)
        NumPut(Msg, 0|ptr, 40, &quot;uint&quot;)
        NumPut(0xB948, 0|ptr, 44, &quot;ushort&quot;)
        NumPut(hWnd, 0|ptr, 46, &quot;ptr&quot;)
        NumPut(0xC18941, 0|ptr, 54, &quot;uint&quot;)
        NumPut(0x15FF, 0|ptr, 57, &quot;ushort&quot;)
        NumPut(-55-(ptr-__Ptr__[__PageNum__]), 0|ptr, 59, &quot;uint&quot;)
        NumPut(0x20C48348, 0|ptr, 63, &quot;uint&quot;)
        NumPut(0x5B, 0|ptr, 67, &quot;uchar&quot;)
        NumPut(0xC3, 0|ptr, 68, &quot;uchar&quot;)
    }
    return ptr
}</code></pre></div><p>Использование: вызов OnDirectoryChanges с первым параметром — имя папки за которой нужно следить, вторым параметром — именем процедуры которая будет выполняться при каждом зафиксированном изменении.</p><p>Процедура, имя которой передаётся в качестве второго параметра должна обрабатывать два параметра: первый — полный путь к файлу который был изменён, второй — тип события.</p><p>В прочих аспектах OnDirectoryChanges подобна OnMessage.</p>]]></content>
			<author>
				<name><![CDATA[creature.ws]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26105</uri>
			</author>
			<updated>2012-11-08T09:06:57Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=65461#p65461</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: асинхронный вызов Wait-функции]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=65451#p65451" />
			<content type="html"><![CDATA[<p>Поспешил с вопросом я. Причина неожиданного поведения в неопределённой ошибке допущенной при редактировании примера. Переписанный «начисто» пример работает как ожидалось.</p>]]></content>
			<author>
				<name><![CDATA[creature.ws]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26105</uri>
			</author>
			<updated>2012-11-08T00:19:33Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=65451#p65451</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: асинхронный вызов Wait-функции]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=65448#p65448" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>creature.ws пишет:</cite><blockquote><p>Не понимаю, почему DlgProc выполняется дважды при каждом событии, первый раз с hWnd = A_ScriptHWND, второй — hWnd = 0.</p></blockquote></div><p>Второго срабатывания быть не должно, вообще сообщений для hWnd = 0 не должно быть, ведь такого окна не существует.</p>]]></content>
			<author>
				<name><![CDATA[Александр_]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24888</uri>
			</author>
			<updated>2012-11-07T10:52:24Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=65448#p65448</id>
		</entry>
</feed>
