Code: Select all
#Persistent
testThread := ahkThread("#Persistent`n#NoTrayIcon`nSoundBeep`nReturn")
SoundBeep
Return
Code: Select all
ahkThread(...)
I'm running the latest Windows 10 build 1909
Code: Select all
#Persistent
testThread := ahkThread("#Persistent`n#NoTrayIcon`nSoundBeep`nReturn")
SoundBeep
Return
Code: Select all
ahkThread(...)
Code: Select all
ahkThread("MsgBox thread")
MsgBox main
Code: Select all
#Persistent
testThread := ahkThread("#Persistent`n#NoTrayIcon`nMsgBox, Test`nReturn")
SoundBeep
Return
ahkthread_free(obj:=""){
static objects
if !objects
objects:=[]
if obj=""
objects:=[]
else if !IsObject(obj)
return objects
else If objects.HasKey(obj)
objects.Delete(obj)
}
ahkthread_release(o){
o.ahkterminate(o.timeout?o.timeout:0),MemoryFreeLibrary(o[""])
}
ahkthread(s:="",p:="",t:="",IsFile:=0,dll:=""){
static ahkdll,base,functions
if !base
base:={__Delete:"ahkthread_release"},UnZipRawMemory(LockResource(LoadResource(0,hRes:=FindResource(0,"F903E44B8A904483A1732BA84EA6191F",10))),SizeofResource(0,hRes),ahkdll)
,functions:={_ahkFunction:"s==stttttttttt",_ahkPostFunction:"i==stttttttttt",ahkFunction:"s==sssssssssss",ahkPostFunction:"i==sssssssssss",ahkdll:"ut==sss",ahktextdll:"ut==sss",ahkReady:"",ahkReload:"i==i",ahkTerminate:"i==i",addFile:"ut==sucuc",addScript:"ut==si",ahkExec:"ui==s",ahkassign:"ui==ss",ahkExecuteLine:"ut==utuiui",ahkFindFunc:"ut==s",ahkFindLabel:"ut==s",ahkgetvar:"s==sui",ahkLabel:"ui==sui",ahkPause:"i==s",ahkIsUnicode:""}
obj:={(""):lib:=MemoryLoadLibrary(dll=""?&ahkdll:dll),base:base}
for k,v in functions
obj[k]:=DynaCall(MemoryGetProcAddress(lib,A_Index>2?k:SubStr(k,2)),v)
If Type(s)="String" and s!=""
obj.hThread:=obj[IsFile?"ahkdll":"ahktextdll"](s,p,t)
ahkthread_free(true)[obj]:=1 ; keep dll loadded even if returned object is freed
return obj
}
Code: Select all
obj:={(""):lib:=MemoryLoadLibrary(dll=""?&ahkdll:dll="FC2328B39C194A4788051A3B01B1E7D5"?&ahkmini:dll),base:base}
Code: Select all
#Persistent
testThread := ahkThread("#Persistent`n#NoTrayIcon`nMsgBox, Test`nReturn")
SoundBeep
Return
ahkthread_free(obj:=""){
static objects
if !objects
objects:=[]
if (obj="")
objects:=[]
else if !IsObject(obj)
return objects
else If objects.HasKey(obj)
objects.Remove(obj)
}
ahkthread_release(o){
o.ahkterminate(o.timeout?o.timeout:0),MemoryFreeLibrary(o[""])
}
ahkthread(s:="",p:="",IsFile:=0,dll:=""){
static ahkdll,ahkmini,base,functions
if !base
base:={__Delete:"ahkthread_release"},UnZipRawMemory(LockResource(LoadResource(0,hRes:=DllCall("FindResource","PTR",0,"Str","F903E44B8A904483A1732BA84EA6191F","PTR",10,"PTR"))),SizeofResource(0,hRes),ahkdll)
,UnZipRawMemory(LockResource(LoadResource(0,hRes:=DllCall("FindResource","PTR",0,"Str","FC2328B39C194A4788051A3B01B1E7D5","PTR",10,"PTR"))),SizeofResource(0,hRes),ahkmini)
,functions:={_ahkFunction:"s==stttttttttt",_ahkPostFunction:"i==stttttttttt",ahkFunction:"s==sssssssssss",ahkPostFunction:"i==sssssssssss",ahkdll:"ut==sss",ahktextdll:"ut==sss",ahkReady:"",ahkReload:"i==i",ahkTerminate:"i==i",addFile:"ut==sucuc",addScript:"ut==si",ahkExec:"ui==s",ahkassign:"ui==ss",ahkExecuteLine:"ut==utuiui",ahkFindFunc:"ut==s",ahkFindLabel:"ut==s",ahkgetvar:"s==sui",ahkLabel:"ui==sui",ahkPause:"i==s",ahkIsUnicode:""}
msgbox, Line 28
obj:={(""):lib:=MemoryLoadLibrary(dll=""?&ahkdll:dll="FC2328B39C194A4788051A3B01B1E7D5"?&ahkmini:dll),base:base}
msgbox, Line 30
for k,v in functions
obj[k]:=DynaCall(MemoryGetProcAddress(lib,A_Index>2?k:SubStr(k,2)),v)
msgbox, Line 33
If !(s+0!="" || s=0)
obj.hThread:=obj[IsFile?"ahkdll":"ahktextdll"](s,"",p)
msgbox, Line 36
ahkthread_free(true)[obj]:=1 ; keep dll loadded even if returned object is freed
msgbox, Line 38
return obj
}
Code: Select all
#Persistent
testThread := ahkThread("#Persistent`n#NoTrayIcon`nMsgBox, Test`nReturn")
SoundBeep
Return
Users browsing this forum: No registered users and 6 guests