unit
Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,Pogoda, IdBaseComponent, IdComponent, IdTCPConnection,
IdTCPClient, IdHTTP, ComCtrls;
type
TForm1 =
class
(TForm)
Button1: TButton;
IdHTTP1: TIdHTTP;
ProgressBar1: TProgressBar;
procedure
Button1Click(Sender: TObject);
private
public
end
;
TMyThread =
class
(TThread)
private
protected
procedure
Execute; override;
procedure
UpdateCaption;
end
;
var
Form1: TForm1;
MyThread: TMyThread;
implementation
{$R *.dfm}
procedure
TMyThread
.
UpdateCaption;
begin
Form1
.
Caption:=
'Ïîòîê çàâåðø¸í'
;
end
;
procedure
TMyThread
.
Execute;
begin
pogoda1;
Synchronize(UpdateCaption);
end
;
procedure
TForm1
.
Button1Click(Sender: TObject);
begin
MyThread:=TMyThread
.
Create(
False
);
MyThread
.
Priority:=tpNormal;
MyThread
.
FreeOnTerminate:=
true
;
end
;
end
.