delphi取代Sleep的延时代码


本文整理自网络,侵删。

 delphi取代Sleep的延时代码

procedure Delay(msecs:integer);
var
Tick: DWord;
Event: THandle;
begin
Event := CreateEvent(nil, False, False, nil);
try
Tick := GetTickCount + DWord(msecs);
while (msecs > 0) and (MsgWaitForMultipleObjects(1, Event, False, msecs, QS_ALLINPUT) <> WAIT_TIMEOUT) do
begin
Application.ProcessMessages;
msecs := Tick - GetTickcount;
end;
finally
CloseHandle(Event);
end;
end;

相关阅读 >>

Delphi将xm音乐文件嵌入自己的程序

Delphi 在firemonkey应用程序中使用torientationsensor获取设备倾斜和指南针航向

两种方法用Delphi实现域名转ip地址---用nmhttp控件和winsock

Delphi strutils.leftstr、strutils.rightstr - 提取左右字符串

Delphi制作移动文字、图片

Delphi 图像自动调整显示

Delphi 使用int3进行hook处理

Delphi xe firemonkey的stylebook皮肤控件的使用

Delphi 读取流 image1 stream 加载到image2 timage 对象

Delphi 10.3 处理csv tstreamreader 自带split用法

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



打赏

取消

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

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

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

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

评论

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