一个关于线程的问题。

lazecat 2001-12-03 09:43:57
怎么样可以将一个窗体放入线程?最好有代码。谢谢啦。
...全文
82 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
lazecat 2001-12-03
  • 打赏
  • 举报
回复
我是这样做的啊。可是当在我创建的时候总是出错!
lzzqqq 2001-12-03
  • 打赏
  • 举报
回复
创建一个工程,有两个窗体,是form1,form2
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;

type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

uses Unit2;

{$R *.DFM}

function ThreadFunc(Ptr:Pointer):LongInt;stdcall;
begin
form2.show;
end;

procedure TForm1.Button1Click(Sender: TObject);
var
thread1:thandle;
threadid:dword;
begin
thread1:=createthread(nil,0,@threadfunc,nil,0,threadid);
end;

end.
lazecat 2001-12-03
  • 打赏
  • 举报
回复
没有人关注一下吗?

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧