It is very fast and supports selecting / editing / copying text
Even loading a few MB of text is also extremely responsive.
But the "WinWaitClose" command brought a huge disaster.
We know that a script can have multiple "MsgBox" windows at the same time,
Before you click "OK", the thread is in a paused state.
This is very friendly.
And "WinWaitClose" is the opposite
It hinders other threads,
Even if other processes use "Accessible" to view this window,
It will make this process stagnant.
I spent a lot of time looking for the cause of the process of stagnation.
I try to find a perfect solution like "MsgBox" treat threads
I think, can we make precise opening / closing of threads?
E.g:
Code: Select all
test(){
;
gui.show()
;A_CurrentThread
gui.OnEvent("Close",func("Closegui").Bind(A_CurrentThread))
Pause("off",A_CurrentThread)
k.Destroy()
}
CloseGui(id){
Pause("on",id)
}
In order to accurately control the state of the thread.
What do you think?
Code: Select all
test(p*){
static i:=0,_:=LoadLibrary("MsFtEdit.dll")
i++
if p.Length()
{
if p.Length()=1
s:=isobject(s:=p.1)?ov(s):s
else
s:=ov(p)
} else
s:=i
Varsetcapacity(Buf, strPut(s,"CP0"), 0),StrPut(s, &Buf, "CP0"),Varsetcapacity(SetText,8,0)
k:=GuiCreate(),h:=A_ScreenHeight*0.7,w:=A_ScreenWidth*0.7
r :=k.Add("Custom", "ClassRICHEDIT50W x0 y0 0x0004 0X0040 0x200000 w" w " h" h),r.Focus()
SendMessage_(r.hwnd,0x0461,&SetText, &Buf)
k.show("w" w " h" h)
WinWaitClose("ahk_id " k.hwnd)
k.Destroy()
return
}