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 日期字符串转换日期格式

Delphi 利用sendinput模拟鼠标键盘

Delphi 中拖动无边框窗口的5种方法

Delphi 取得当前运行窗口的标题

Delphi tzipfile 用法

Delphi 内存加载并运行exe程序

Delphi 取整算法集合

Delphi-xe5-开发 android uri简介

Delphi用mapfileandchecksum 函数检测 exe 或 dll 是否被修改

Delphi 通过系统api函数实现精确记时

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



打赏

取消

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

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

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

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

评论

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