sleep
procedure Delay(msecs:integer);
var
FirstTickCount:longint;
begin
FirstTickCount:=GetTickCount;
repeat
Application
until ((GetTickCount
end;
procedure timerfun(handle:Thandle;msg:word;identer:word;dwtime:longword);stdcall;
begin
showmessage(
killtimer(handle
end;
//其中的identer是定時器的句柄
procedure TForm
var
identer:integer;
begin
identer:=settimer(
if identer=
end;
function TForm
var I:Integer;
var WaitedTime:Cardinal;
begin
WaitedTime:=
while (WaitedTime<MaxWaitTime) do
begin
SleepEx(
Inc(WaitedTime
Application
end
end;
From:http://tw.wingwit.com/Article/program/net/201311/13342.html