AutoHotkey does ignore the failure, but Windows sometimes doesn't.
I am not able to reproduce your problem on Windows 7 or Windows XP, specifying either a drive which doesn't exist or an empty DVD drive. Do you get any error dialogs (excluding the script's MsgBoxes) if you run the following?
Code: Select all
MsgBox TEST #1
test1("f:\ahk_source\include.ahk")
test1("d:\ahk_source\include.ahk")
MsgBox TEST #2
test2("f:\ahk_source\include.ahk")
test2("d:\ahk_source\include.ahk")
test1(f) {
try {
FileOpen(f, "r").Read()
MsgBox File read.
} catch
MsgBox Exception thrown.
}
test2(f) {
try {
DllCall("SetErrorMode", "uint", 1)
FileOpen(f, "r").Read()
MsgBox File read.
} catch
MsgBox Exception thrown.
finally
DllCall("SetErrorMode", "uint", 0)
}