delphi判断线程是否释放


本文整理自网络,侵删。

 delphi判断线程是否释放
function CheckThreadFreed(aThread: TThread): Byte;
var
i: DWord;
IsQuit: Boolean;
begin
if Assigned(aThread) then
begin
IsQuit := GetExitCodeThread(aThread.Handle, i);
if IsQuit then // If the function succeeds, the return value is nonzero.
begin
if i = STILL_ACTIVE then // If the specified thread has not terminated,
Result := 1
else
Result := 2; //aThread未Free,因为Tthread.Destroy中有执行语句
end else
Result := 0; //可以用GetLastError取得错误代码
end else
Result := 3;
end;

相关阅读 >>

Delphi计算两个时间差

Delphi 时间到就触发事件

Delphi 在目录后面加上一个 "\"

Delphi删除cookie和ie缓存

Delphi著名皮肤控件库大全评测

winapi 字符及字符串函数(13): lstrcmp、lstrcmpi - 对比串

Delphi tdictionary保存到文件

Delphi webbrowser 查找对话框

Delphi 使用indy idftp 通过android 上传文件

Delphi 自带gif控件的动画图片加载和播放

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...