关于多线程!

LittleStar 2000-06-21 09:40:00
在delphi中如何动态生成一线程、停止一线程!
...全文
137 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
zyb 2000-06-23
  • 打赏
  • 举报
回复
创建线程先定义线程句柄hthread : THandle ;
hthread := CreateThread(nil,0,@ThreadFunc,nil,0,ThreadID) ;
(安全属性,堆栈大小,线程函数指针,传递参数指针,线程标志,线程ID)
shylsz 2000-06-22
  • 打赏
  • 举报
回复
Deiphi里有个例子。
Limu 2000-06-21
  • 打赏
  • 举报
回复
First you generate a unit that include a class derive from TThread,like this:
TThread1=class(TThread)
var
Thread:TThread1;
and then uses this unit in your main program.So you can start the thread and stop it like these:
//Start:
Thread=TThread1.create(True);//you can use false if you don't want to run the thread and then use Thread.run starting it.
//pause,Stop:
Thread.suspend;
Thread.ternimate;

5,386

社区成员

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

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