Как создавать потоки без класса TThread 2




unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
procedure printh(p: pointer); stdcall;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure printh(p: pointer);
begin
TForm1(p).caption := 'Hello from thread';
ExitThread(0);
end;
procedure TForm1.Button1Click(Sender: TObject);
var
h1: cardinal;
begin
createthread(nil, 128, @printh, self, 0, h1);
end;
end.


Далее: Копирование файлов потоком »»