delphi 线程创建线程
A lot of questions regard threads in Delphi.
关于Delphi中的线程有很多问题。
One of the more specific questions is how to show progress of the thread.
更具体的问题之一是如何显示线程进度。
Updating a progressbar from inside a thread is a mistake.
从线程内部更新进度条是一个错误。
A solution to this would be to send a synchronized message to the main thread.
一种解决方案是将同步消息发送到主线程。
This message would then contain the progress of the thread from 0 to 100.
然后,此消息将包含线程从0到100的进度。
1.设置进度条 (1. Setting the progress bar)
The progressbar will be displaying from 0 to 100
进度条将显示为0到100
Property Max = 100
属性最大= 100
Property Min = 0
属性最小值= 0
2.基本线程:TProgressThread (2. The base thread: TProgressThread)
I defined a thread class for sending messages back via a synchronize procedure
我定义了一个线程类,用于通过同步过程将消息发送回去
type
TProgressProc = procedure (aProgress: Integer) of object; // 0 to 100
TProgres