Guest User

Untitled

a guest
May 15th, 2012
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. Periodical tasks in Delphi app
  2. repeat
  3. try
  4. Application.HandleMessage;
  5. except
  6. Application.HandleException(Application);
  7. end;
  8. until Terminated;//this is the Terminated property of the thread
  9.  
  10. procedure PerformThreadLoop;
  11. var
  12. Msg: TMsg;
  13. begin
  14. repeat
  15. Try
  16. while PeekMessage(Msg, 0, 0, 0, PM_REMOVE) do begin
  17. TranslateMessage(Msg);
  18. DispatchMessage(Msg);
  19. end;
  20. WaitMessage;
  21. Except
  22. Application.HandleException(Self);
  23. End;
  24. until Terminated;//this is the Terminated property of the thread
  25. end;
Advertisement
Add Comment
Please, Sign In to add comment