thqby's AutoHotkey_H started as a fork of AutoHotkey_L v2, merging the branch HotKeyIt/ahkdll-v2, but with some changes.
See the README of each branch for details.
thqby's AutoHotkey_H v2.0 & v2.1
thqby's AutoHotkey_H v2.0 & v2.1
- Attachments
-
- Ahk2Exe.zip
- (468.07 KiB) Downloaded 48 times
Last edited by thqby on 28 Mar 2024, 21:31, edited 1 time in total.
Re: thqby's AutoHotkey_H v2.0 & v2.1
Any chance of merging v1 as well? Thanks.
Re: thqby's AutoHotkey_H v2.0 & v2.1
No interest in merging v1, debugging v1 scripts is maddening.
-
- Posts: 3
- Joined: 12 May 2024, 19:52
- Contact:
Re: thqby's AutoHotkey_H v2.0 & v2.1
I am an AutoHotkey beginner and wanted to use multi-threading, so I installed the exe and dll files you provided. I can use the NewThread function, but I get an error when using other functions like ahkPause, with the message "Error: This value of type 'Integer' has no method named 'ahkPause'." I have tried versions 2.0.12 and 2.0.14, both of which gave me errors, but it runs fine with the official download of v2.0-beta.1. Did I miss any installation steps? Below is the code I found in the official documentation and tried to run.
[Mod edit: Fixed the codebox tags. They go around the code, not both tags before the code.]
Code: Select all
#Requires AutoHotkey v2.0.12
#SingleInstance Force
dllpath:=A_AhkDir "\AutoHotkey.dll"
dll:=NewThread("
(
Persistent
Loop
ToolTip A_TickCount
)",,dllpath)
Sleep 1000
dll.ahkPause("On")
[Mod edit: Fixed the codebox tags. They go around the code, not both tags before the code.]
Re: thqby's AutoHotkey_H v2.0 & v2.1
Maybe you used to use ahk-wrapped function NewThread. I didn't package these into ahk. You can still use these features through functions like ahkPause(1, NewThread(...)).
You can see the changes in the readme of the github repository.
You can see the changes in the readme of the github repository.
-
- Posts: 3
- Joined: 12 May 2024, 19:52
- Contact:
Re: thqby's AutoHotkey_H v2.0 & v2.1
Thank you very much for your guidance. I've learned how to use ahkPause, but I have encountered another issue regarding terminating a thread.
I found that Thread("Terminate", false, dll) does not work, while ahkPause does work. I would like to know how to properly terminate a thread. I apologize for bothering you with such a simple question, but I have been struggling for an hour and still can't figure it out. Thank you again for your help.
Here is my code:
[Mod edit: Again, fixed the codebox tags. They go around the code, not both tags before the code.]
I found that Thread("Terminate", false, dll) does not work, while ahkPause does work. I would like to know how to properly terminate a thread. I apologize for bothering you with such a simple question, but I have been struggling for an hour and still can't figure it out. Thank you again for your help.
Here is my code:
Code: Select all
#Requires AutoHotkey v2.1-alpha.10
#SingleInstance Force
; Create a new thread and save its thread ID
dll := NewThread("
(
Loop {
ToolTip 'Thread running'
Sleep 1000
}
)")
Sleep 2000
; Attempt to terminate the newly created thread
Thread("Terminate", false, dll)
Sleep 2000
MsgBox "End"
[Mod edit: Again, fixed the codebox tags. They go around the code, not both tags before the code.]
Re: thqby's AutoHotkey_H v2.0 & v2.1
@changxiaotiao — Twice now we have fixed your codebox tags. The code goes in between the pair of tags, not after them. Please place the tags correctly when you post code. You can also use [code][/code] tags, which default to AHK syntax highlighting. They also go around the code, and there is an icon for their use above the reply area.
-
- Posts: 3
- Joined: 12 May 2024, 19:52
- Contact:
Re: thqby's AutoHotkey_H v2.0 & v2.1
I'm sorry for the mistakes I made in formatting the code. Thank you so much for fixing them.boiler wrote: ↑Yesterday, 22:39@changxiaotiao — Twice now we have fixed your codebox tags. The code goes in between the pair of tags, not after them. Please place the tags correctly when you post code. You can also use [code][/code] tags, which default to AHK syntax highlighting. They also go around the code, and there is an icon for their use above the reply area.
Re: thqby's AutoHotkey_H v2.0 & v2.1
idk if you can use normal newthread object but i found this
source := https://github.com/thqby/AutoHotkey_H/issues/74
Code: Select all
myvar := 50
Script := "
(
MsgBox Worker(A_MainThreadID)['myvar']
)"
Worker(Script)
MsgBox "end"
Who is online
Users browsing this forum: No registered users and 6 guests