ThreadObj() Not Found

Ask for help, how to use AHK_H, etc.
Posts: 78
Joined: 10 Feb 2018, 19:05

ThreadObj() Not Found

22 Jul 2020, 00:00

I'm trying to use the ThreadObj() function to monitor when I press the RWin key and retrieve the timestamps created. However, when I try to run a script that uses the function, I get a message saying that it doesn't exist. Here's my code:

Code: Select all

MonitorRWin := ThreadObj("Loop {`nKeyWait RWin, D`nDllCall(""QueryPerformanceCounter"", ""Int64*"", RWinP)`nKeyWait RWin`n} return")
Does anyone know what I need to do to resolve this?
Posts: 2219
Joined: 29 Sep 2013, 18:35

Re: ThreadObj() Not Found

23 Jul 2020, 08:05

ThreadObj exists only in v2, simply use AhkThread:

Code: Select all

MonitorRWin := Ahkthread("RWin:=0`nLoop {`nKeyWait RWin, D`nQueryPerformanceCounter(getvar(RWinP1:=0))`nKeyWait RWin`nQueryPerformanceCounter(getvar(RWinP2:=0))`nRWin:=RWinP2-RWinP1`n} return")
Loop {
	ToolTip % RWin

Return to “Ask For Help”

Who is online

Users browsing this forum: No registered users and 2 guests