Delphi Sources

Как создавать потоки без класса 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.





Похожие по теме исходники

Потоки NTFS

Потоки Multi Thread

База данных без BDE

БД без BDE

 

Кривая Безье

Bezier Curves (кривые Безье)

Splay Line (Безье)

Сплайн на 8 точек (Безье)

 

Text Bezier Curve (Безье)

Кривые Безье на OpenGL

TThreadComponent

TThreads File Monitor