[Wish List] ExitThreads Command Topic is solved

Ask for help, how to use AHK_H, etc.
Guest6637377373

[Wish List] ExitThreads Command

03 Mar 2017, 19:52

"ExitThreads" Command that forces any running threads from a given label, hotkey, etc to Exit

ExitThreads, Label, Generate

ExitThreads, Hotkey, F12
HotKeyIt
Posts: 2364
Joined: 29 Sep 2013, 18:35
Contact:

Re: [Wish List] ExitThreads Command  Topic is solved

04 Mar 2017, 04:37

You can use AutoHotkey.dll if you want to exit running threads, therefore the code needs to be run by AutoHotkey.dll.

Code: Select all

thread:=AhkThread("Loop`nToolTip `% A_Now`nReturn")
#Esc::thread.ahkterminate()
Esc::ExitApp
In AHK_H v2 you can also run/terminate a thread without AutoHotkey.dll:

Code: Select all

thread:=ExeThread("Loop`nToolTip `% A_Now`nReturn")
#Esc::thread.ahkterminate()
Esc::ExitApp
Guest

Re: [Wish List] ExitThreads Command

05 Mar 2017, 08:10

Is the example below possible?

Code: Select all

F12::

F12HotkeyThread.ahkterminate()

F12HotkeyCode =
(
line 1
line 2
line 3
...
line 1000
)

F12HotkeyThread:=AhkThread(F12HotkeyCode)

return
What is the best way to use "AutoHotkey.dll" with AHK_L?
HotKeyIt
Posts: 2364
Joined: 29 Sep 2013, 18:35
Contact:

Re: [Wish List] ExitThreads Command

05 Mar 2017, 15:05

Code: Select all

F12HotkeyCode =
(
line 1
line 2
line 3
...
line 1000
)
F12::F12HotkeyThread?F12HotkeyThread.ahkReload():F12HotkeyThread:=AhkThread(F12HotkeyCode)
Guest wrote:What is the best way to use "AutoHotkey.dll" with AHK_L?
DllCall, see AutoHotkey Module.
Note that in v1 third parameter is for Commandline Parameters and second will be passed to script in A_ScriptOptions (see included help file in v1 download).

Return to “Ask for Help”

Who is online

Users browsing this forum: No registered users and 22 guests