I have looked into how to do multiple threads in autohotkey v2, but either i dont understand it, or its not possible.
Basically i am trying to make a progress bar that updates in realtime as my script runs, but the whole window appears frozen and nonresponsive between updates, although the script is still apparently doing it’s job despite the gui being frozen.
the freezing apparently happens because of the file copying and directory copying im doing. while writing and testing the minimal example below, i didnt run into the issue, as noted, despite the script’s “flow” being identical to my actual script.
in autohotkey v1, this was not an issue at all- and im trying to figure out how to replicate that functionality.
here is my best attempt to write a minimal code example:
myGui := Constructor()
myGui.Show("w604 h147")
Constructor()
{
myGui := Gui()
ProgressPrg := myGui.Add("Progress", "vPrg x40 y56 w503 h32 -Smooth", "33")
return myGui
}
mainfunction()
{
myGui["Prg"].Value := 50
; some file copies and such go here, during which the window is frozen. note that this
example doesnt freeze- it only freezes when an ACTUAL file copy is happening!
Msgbox("Hello! for some reason the gui is not frozen while this message box is up!")
myGui["Prg"].Value := 60
}
;call the main function
mainfunction()