码迷,mamicode.com
首页 > 编程语言 > 详细

delphi 多线程

时间:2014-08-21 22:46:54      阅读:219      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   io   ar   art   div   log   

CoInitialize(nil);       //调用COM,需要初始化

 

HThread: THandle;
ID: DWord;
HThread:= CreateThread(nil, 0, @start, nil, 0, ID);
ResumeThread(HThread_1);        //返回值为1,继续线程
SuspendThread(HThread_1);       //挂起线程

 

//写入INI配置,决定是否暂停线程
while
True do begin cap:= IniFile.ReadString(UI,Button10.Caption,‘‘); if cap = 暂停(F2) then begin repeat i:= ResumeThread(HThread_1); i1:= ResumeThread(HThread_2); until ((i <= 1) and (i1 <= 1)); IniFile.WriteString(UI,Button10.Caption,‘‘); end else if cap = 继续(F2) then begin SuspendThread(HThread_1); SuspendThread(HThread_2); IniFile.WriteString(UI,Button10.Caption,‘‘); end; Delay(500); end;

 

delphi 多线程,布布扣,bubuko.com

delphi 多线程

标签:style   blog   color   io   ar   art   div   log   

原文地址:http://www.cnblogs.com/didiwei/p/3928189.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!