ahkTerminate


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")

Parameters

timeout

Time in miliseconds to wait until thread exits.
If this parameter is 0 it defaults to 500.

Return Value

Returns always 0.

Remarks

ahkTerminate will destroy script hotkeys and hotstrings and exit the thread. ahkTerminate uses SendMessageTimeout for better reliability.

Related

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

Example

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