ahkTerminate is used to stop and exit a running script in dll. ( Available in AutoHotkey[Mini].dll only, not in AutoHotkey_H.exe)
DllCall(dll_path "\ahkTerminate","Int",timeout,"Cdecl Int")
| timeout | Time in miliseconds to wait until thread exits. |
ahkTerminate will destroy script hotkeys and hotstrings and exit the thread. ahkTerminate uses SendMessageTimeout for better reliability.
AutoHotkey.dll, ahkdll, ahktextdll, ahkReady, addFile, addScript, ahkExec, ahkLabel, ahkFunction, ahkPostFunction, ahkassign, ahkgetvar, ahkReload, ahkFindFunc, ahkFindLabel, ahkPause, ahkExecuteLine, Alias, cacheEnable, FindFunc, FindLabel, getTokenValue, getVar, Static, AutoHotkeyMini, DynaCall, CriticalSection, CriticalObject, MemoryLoadLibrary, ResourceLoadLibrary, MemoryGetProcAddress, MemoryFreeLibrary, Other Changes
AhkDll:=AhkDllObject("AutoHotkey.dll")
AhkDll.ahktextdll("Persistent`nSplashTextOn,130,20, From AutoHotkey.dll,Hello World!")
MsgBox Press Ok to terminate Thread
ahkdll.ahkTerminate()
MsgBox Thread was terminated