This procedure will let your programs process Windows messages. The only thing is that this function may stop only this procedure while not stopping the rest
var
dtNow: TDateTime;
begin
{ Before pause }
dtNow := Now;
repeat
Application.ProcessMessages; { Process Windows messages }
until dtNow + 5 / SecsPerDay < Now; { Pause for 5 seconds }
{ After pause }
end;
Categories: General Tags: application, borland, code, codegear, delay, Delphi, Kylix, messages, pause, period, period of time, process, program, stop, tdatetime, time, windows, windows messages
The easiest way to stop execution of your program is to use the Windows API Sleep() function. The function stops the program for n milliseconds. The only problem is that this function does not properly support multitasking, so during this time your program will not process any Windows messages, so you may want to check out tip 4.17. This function can be very useful in shareware and demo programs
uses
Windows;
...
Sleep(10000); { Stops program for 10 seconds }
Categories: General Tags: Delphi, execution, function, milliseconds, object pascal, period, program, seconds, sleep, stop, time, tip, trick, windows