Search found 2337 matches

by HotKeyIt
05 Dec 2021, 04:59
Forum: C/C++
Topic: [C++] The address of a thread-local variable may change when a COM function is called?
Replies: 3
Views: 2921

Re: [C++] The address of a thread-local variable may change when a COM function is called?

Do you mean &g? ThreadLocalStoragePointer does not change.
AFAIK g changes because it is called in new pseudo thread.
Can you provide example code.
by HotKeyIt
30 Nov 2021, 21:47
Forum: Ask for Help
Topic: AhkThread and memory usage Topic is solved
Replies: 4
Views: 1742

Re: AhkThread and memory usage Topic is solved

DynaRun should work fine, if you don't need to communicate to the threads.
I usually reuse my threads when they are not running anymore.
by HotKeyIt
29 Nov 2021, 21:28
Forum: Ask for Help
Topic: AhkThread and memory usage Topic is solved
Replies: 4
Views: 1742

Re: AhkThread and memory usage Topic is solved

You need to release/free the object used for the thread, see AhkThread.
by HotKeyIt
29 Nov 2021, 17:39
Forum: Ask for Help
Topic: Help with multi-threading AHK Script
Replies: 4
Views: 3914

Re: Help with multi-threading AHK Script

No, if you want repeating label, simply use loop: ahk1:=AhkThread("#Persistent`nReturn`nLabel:`nLoop {`nToolTip Script 1 `%A_Index`%, 250, 250`nSleep 100`n}`nReturn") ahk2:=AhkThread("#Persistent`nReturn`nLabel:`nLoop {`nToolTip Script 2 `%A_Index`%, 500, 500`nSleep 100`n}`nReturn") MsgBox Click Ok ...
by HotKeyIt
26 Nov 2021, 21:59
Forum: Ask for Help (v1)
Topic: Send ñ or Ñ
Replies: 6
Views: 1793

Re: ñ'Ñ'

Code: Select all

' & n::Send % getkeystate("Shift","P") ? "Ñ" : "ñ"
by HotKeyIt
26 Nov 2021, 21:57
Forum: Ask for Help
Topic: Help with multi-threading AHK Script
Replies: 4
Views: 3914

Re: Help with multi-threading AHK Script

To start a new thread simply use AhkThread but you will need AHK_H. Up to date AHK_H v2 will be available very soon but you can also use the latest one for the moment: AHK_H v2 or AHK_H v1 . Example for v1 where 2 Thread start kind of 'at the same time': ahk1:=AhkThread("#Persistent`nReturn`nLabel:`...
by HotKeyIt
14 Nov 2021, 04:55
Forum: Ask for Help (v1)
Topic: check whether I press neio at the same time
Replies: 10
Views: 812

Re: check whether I press neio at the same time

This might be impossible since the keyboard most likely does not support it, my does not. Pressing for example asdf is supported on my keyboard, then you can add all possible combinations: :*:asdf:: :*:asfd:: :*:adsf:: :*:adfs:: :*:afds:: :*:afsd:: ;.. add all combinations If GetKeyState("a","P") &&...
by HotKeyIt
08 Nov 2021, 05:26
Forum: Помощь
Topic: Автоматизация нажатия
Replies: 56
Views: 88594

Re: Автоматизация нажатия

Send {LCtrl down}
by HotKeyIt
28 Oct 2021, 15:29
Forum: AutoHotkey_H
Topic: Can AutoHotKey 1.1.33.10v1 implement similar c# nameof() functions? That is, the function is to obtain the variable name
Replies: 3
Views: 3118

Re: Can AutoHotKey 1.1.33.10v1 implement similar c# nameof() functions? That is, the function is to obtain the variable

aaa:="123" printvar(aaa) printvar(ByRef var_name:=""){ static _AHkVar,var if !var _AHkVar:="{Int64 ContentsInt64,Double ContentsDouble,PTR object},{char *mByteContents,LPTSTR CharContents},{UINT_PTR Length,_AHKVar *AliasFor},{UINT_PTR Capacity,UINT_PTR BIV},BYTE HowAllocated,BYTE Attrib,BYTE mScope...
by HotKeyIt
26 Oct 2021, 13:14
Forum: Scripts and Functions (v2)
Topic: WebView2
Replies: 139
Views: 34320

Re: 2.0-beta.1 - WebView2

Very nice, thanks for sharing. On my machine I had multiple runtimes installed and it did not work, to fix it had to pick up the latest, so I removed the break and all worked: if (!edgeruntime) { loop files "C:\Program Files (x86)\Microsoft\EdgeWebView\Application\*", "D" if (A_LoopFilePath ~= "\\[\...
by HotKeyIt
22 Oct 2021, 20:32
Forum: Ask for Help
Topic: Can AutoHotkey.dll include a function for external calls? Topic is solved
Replies: 11
Views: 4392

Re: Can AutoHotkey.dll include a function for external calls? Topic is solved

You can define a variable and wait until it is initialized so you know script is ready:
In ahk.dll:

Code: Select all

...
...
ready:=1
In ahk.exe

Code: Select all

While !DllCall(dll_path "\ahkgetvar","Str","ready","UInt",0,"Cdecl Str")
  Sleep 100
by HotKeyIt
22 Oct 2021, 09:00
Forum: Ask for Help (v1)
Topic: Macro 1 to 9999
Replies: 2
Views: 465

Re: Macro 1 to 9999

Code: Select all

i:=0
^j::
  i++
  Send, %i%{Enter}
return
by HotKeyIt
20 Oct 2021, 11:27
Forum: Ask for Help
Topic: Can AutoHotkey.dll include a function for external calls? Topic is solved
Replies: 11
Views: 4392

Re: Can AutoHotkey.dll include a function for external calls? Topic is solved

ahkFunction uses SendMessage and COM does not support multi-threading over SendMessage, that might be the problem.
by HotKeyIt
20 Oct 2021, 11:20
Forum: Scripts and Functions (v2)
Topic: A simple Class for calling V1's libs in V2
Replies: 11
Views: 3007

Re: A simple Class for calling V1's libs in V2

It should be DllCall(dll_path "\ahktextdll", "Str", "#Persistent `n#NoTrayIcon `n#include " . lib_path, "Str", "", "Str", "")
by HotKeyIt
19 Oct 2021, 03:13
Forum: Ask for Help
Topic: How to add a lib to script?
Replies: 5
Views: 1987

Re: How to add a lib to script?

It seems to clear memory as far as I can see:

Code: Select all

script:="#Persistent`n"
Loop % 102400
   script.="var" A_Index ":=" A_Index "`n"
thread_1:=AhkThread(script)
MsgBox started
thread_1.ahkterminate()
ahkthread_free(lib_thread_1)
thread_1:=""
MsgBox freed
by HotKeyIt
18 Oct 2021, 17:17
Forum: Gaming Help (v1)
Topic: Key spammer
Replies: 1
Views: 1427

Re: Key spammer

Code: Select all

#MaxThreadsPerHotkey 2
toggle:=0
F1::
  toggle:=!toggle
  While toggle{
    Send Q
    Sleep 1000
    Send W
    Sleep 1000
    Send E
    Sleep 1000
  }
Return
by HotKeyIt
18 Oct 2021, 17:11
Forum: Ask for Help
Topic: How to add a lib to script?
Replies: 5
Views: 1987

Re: How to add a lib to script?

Which version are you using?
I just downloaded latest version and it works without problems (tested on Win32w).
by HotKeyIt
18 Oct 2021, 09:01
Forum: Ask for Help
Topic: How to add a lib to script?
Replies: 5
Views: 1987

Re: How to add a lib to script?

#Persistent #SingleInstance, Force SetBatchLines, -1 test:={} test.lib_1:=Ahkthread(" ( #Persistent SetBatchLines, -1 ready:=1 class lib_test { func_test(a) { return `%a`% } } )") While !test.lib_1.ahkgetvar("ready") Sleep 100 test.thread_1:=Ahkthread(" ( #Persistent SetBatchLines, -1 exe:=AhkExpor...
by HotKeyIt
15 Oct 2021, 18:38
Forum: Ask for Help
Topic: Can AutoHotkey.dll include a function for external calls? Topic is solved
Replies: 11
Views: 4392

Re: Can AutoHotkey.dll include a function for external calls? Topic is solved

You can call the function directly, no need to use ahkExec. Also no need to load the script every time you call the function, load once, call as often as you want. You can also create Bound functions for different amount of parameters to use for all functions: script:= ( "#Persistent test(v1, v2) { ...

Go to advanced search