thqby's AutoHotkey_H v2.0 & v2.1

Post AHK_H specific scripts & libraries and discuss the usage and development of HotKeyIt's fork/branch
User avatar
thqby
Posts: 417
Joined: 16 Apr 2021, 11:18
Contact:

thqby's AutoHotkey_H v2.0 & v2.1

29 Jan 2024, 07:11

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.
Attachments
Ahk2Exe.zip
(468.07 KiB) Downloaded 47 times
Last edited by thqby on 28 Mar 2024, 21:31, edited 1 time in total.
m3user
Posts: 235
Joined: 17 Jan 2014, 18:11

Re: thqby's AutoHotkey_H v2.0 & v2.1

29 Jan 2024, 10:50

Any chance of merging v1 as well? Thanks.
User avatar
thqby
Posts: 417
Joined: 16 Apr 2021, 11:18
Contact:

Re: thqby's AutoHotkey_H v2.0 & v2.1

30 Jan 2024, 10:33

No interest in merging v1, debugging v1 scripts is maddening.
changxiaotiao
Posts: 3
Joined: 12 May 2024, 19:52
Contact:

Re: thqby's AutoHotkey_H v2.0 & v2.1

12 May 2024, 20:05

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.

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.]
User avatar
thqby
Posts: 417
Joined: 16 Apr 2021, 11:18
Contact:

Re: thqby's AutoHotkey_H v2.0 & v2.1

Yesterday, 08:22

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.
changxiaotiao
Posts: 3
Joined: 12 May 2024, 19:52
Contact:

Re: thqby's AutoHotkey_H v2.0 & v2.1

Yesterday, 21:42

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:

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"
image.png
image.png (12.23 KiB) Viewed 119 times

[Mod edit: Again, fixed the codebox tags. They go around the code, not both tags before the code.]
User avatar
boiler
Posts: 17141
Joined: 21 Dec 2014, 02:44

Re: thqby's AutoHotkey_H v2.0 & v2.1

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.
changxiaotiao
Posts: 3
Joined: 12 May 2024, 19:52
Contact:

Re: thqby's AutoHotkey_H v2.0 & v2.1

Yesterday, 23:16

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.
I'm sorry for the mistakes I made in formatting the code. Thank you so much for fixing them.
User avatar
xMaxrayx
Posts: 187
Joined: 06 Dec 2022, 02:56
Contact:

Re: thqby's AutoHotkey_H v2.0 & v2.1

Today, 03:08

idk if you can use normal newthread object but i found this

Code: Select all


myvar := 50

Script := "
(
	MsgBox Worker(A_MainThreadID)['myvar']
)"
Worker(Script)
MsgBox "end"

source := https://github.com/thqby/AutoHotkey_H/issues/74
-----------------------ヾ(•ω•`)o------------------------------
https://github.com/xmaxrayx/

Return to “AutoHotkey_H”

Who is online

Users browsing this forum: No registered users and 14 guests