博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
给线程发送消息让它执行不同的处理
阅读量:6857 次
发布时间:2019-06-26

本文共 431 字,大约阅读时间需要 1 分钟。

unit Unit2;

interface
uses
System.Classes, Windows, Messages;
const
WM_DO = WM_USER + 1;
type
TDemoThread = class(TThread)
private
{ Private declarations }
protected
procedure Execute; override;
end;
implementation
{ TDemoThread }
procedure TDemoThread.Execute;
var
Msg: TMsg;
begin
{ Place thread code here }
while GetMessage(Msg, 0, 0, 0) do
begin
case Msg.message of
WM_DO:
; // do it
WM_CLOSE:
Break;
end;
Sleep(100);
end;
end;

转载地址:http://rynyl.baihongyu.com/

你可能感兴趣的文章
MySQL重置ROOT密码
查看>>
Maven搭建SpringMVC+Mybatis项目详解【转】
查看>>
js中获取随机数
查看>>
测试 Resources
查看>>
从百度地图API中抠出来的一个js方法,计算百度地图坐标距离
查看>>
【硬派网络计费系统】用户手册
查看>>
自动化运维之-ansible入门
查看>>
Mac-OSX下安装Git
查看>>
xshell 设置屏幕字体
查看>>
其他三维对象的表示---BSP树
查看>>
idea运行eclipse/myeclipse工程编译问题记录
查看>>
怎样转换LaTeX与MathType之间的公式
查看>>
【原创】libevent2中锁相关代码
查看>>
css常用知识点整理
查看>>
mysql中int、bigint、smallint 和 tinyint的区别与长度
查看>>
CentOS 7安装chrome浏览器
查看>>
支付宝 sdk
查看>>
Java之实现枚举原理
查看>>
Servlet之HttpSession验证码
查看>>
C#脚本续集
查看>>