Autohotkey-Scripts
Autohotkey-Scripts copied to clipboard
[Error] WatchDirectory.ahk
This is exactly the function I was looking for. Thank you for your wonderful work.
I got an error when running with the latest version of AHK. Do you know the cause? +Start OK +An error occurs when a change is detected
Win10 Pro : latest AHK : AutoHotkey v1.1.34.03 U64
---------------------------
Critical Error: Invalid memory read/write.
Line#
047: Return
048: r += 1
049: CurrentFolder := Dir%r%Path
050: PointerFNI := &Dir%r%FNI
051: DllCall( "GetOverlappedResult", UInt, hDir, UInt, &Dir%r%Overlapped, UIntP, nReadLen, Int, true )
052: Loop
052: {
---> 053: pNext := NumGet( PointerFNI + 0 )
054: Action := NumGet( PointerFNI + 4 )
055: FileNameLen := NumGet( PointerFNI + 8 )
056: pFileName := ( PointerFNI + 12 )
057: if (Action < 0x6)
057: {
058: VarSetCapacity( FileNameANSI, FileNameLen )
059: DllCall( "WideCharToMultiByte",UInt,0,UInt,0,UInt,pFileName,UInt,FileNameLen,Str,FileNameANSI,UInt,FileNameLen,UInt,0,UInt,0)
The program is now unstable and will exit.
---------------------------
OK
---------------------------