I make simple thread Desktop application at Windows 10.
But, UI is freeze while thread running.
at PushButton1.Action
Thread1.Start
at Thread1.Run
Dim Command as new Shell
Command.ExecuteMode = Shell.ExecuteModes.Synchronous
Command.TimeOut = -1 // for Windows
Command.Execute("start /w notepad %USERPROFILE%\\Documents\\test.txt && type %USERPROFILE%\\DOcuments\\test.txt")
Me.AddUserInterfaceUpdate("TextField1":Command.Result)
at Thread1.UserInterfaceUpdate
For Each arg As Dictionary In data
If arg.HasKey("TextField1") Then
TextField1.text = arg.Value("TextField1")
End If
Next
I made this on MS-Windows10.
This is edit test.txt by notepad.exe and show test.txt to TextField1.
It is work, but while notepad is running, the xojo program will freeze.
What can I do to avoid freeze?
Dim Command as new Shell
// Command.ExecuteMode = Shell.ExecuteModes.Synchronous
Command.ExecuteMode = Shell.ExecuteModes.Asynchronous
Command.TimeOut = -1 // for Windows
Command.Execute("start /w notepad %USERPROFILE%\\Documents\\test.txt && type %USERPROFILE%\\DOcuments\\test.txt")
Me.AddUserInterfaceUpdate("TextField1":Command.Result)
It work without UI freeze. But, it can not get Command.Result as “type %USERPROFILE%\DOcuments\test.txt”.
Any help?