MMTHREAD.INT 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. {========================================================================}
  2. {= (c) 1995-98 SwiftSoft Ronald Dittrich =}
  3. {========================================================================}
  4. {= All Rights Reserved =}
  5. {========================================================================}
  6. {= D 01099 Dresden = Tel.: +0351-8012255 =}
  7. {= Loewenstr.7a = info@swiftsoft.de =}
  8. {========================================================================}
  9. {= Actual versions on http://www.swiftsoft.de/mmtools.html =}
  10. {========================================================================}
  11. {= This code is for reference purposes only and may not be copied or =}
  12. {= distributed in any format electronic or otherwise except one copy =}
  13. {= for backup purposes. =}
  14. {= =}
  15. {= No Delphi Component Kit or Component individually or in a collection=}
  16. {= subclassed or otherwise from the code in this unit, or associated =}
  17. {= .pas, .dfm, .dcu, .asm or .obj files may be sold or distributed =}
  18. {= without express permission from SwiftSoft. =}
  19. {= =}
  20. {= For more licence informations please refer to the associated =}
  21. {= HelpFile. =}
  22. {========================================================================}
  23. {= $Date: 20.01.1998 - 18:00:00 $ =}
  24. {========================================================================}
  25. unit MMThread;
  26. {$I COMPILER.INC}
  27. {$C FIXED PRELOAD PERMANENT}
  28. {.$DEFINE _MMDEBUG}
  29. interface
  30. Uses
  31. Windows,
  32. Forms,
  33. Classes,
  34. SysUtils,
  35. MMObj,
  36. MMString,
  37. MMUtils;
  38. type
  39. EMMThreadError = class(Exception);
  40. TMMThread = class;
  41. {-- TMMRealThread --------------------------------------------------}
  42. TMMRealThread = class(TThread)
  43. {-- TMLThread ------------------------------------------------------}
  44. TMMThread = class(TMMComponent)
  45. public
  46. constructor Create(AOwner : TComponent); override;
  47. destructor Destroy; override;
  48. procedure Execute; virtual;
  49. procedure Terminate; virtual;
  50. procedure SynchronizeVCL(VCLProc: TThreadMethod);
  51. property Handle: THandle read GetHandle;
  52. property ThreadID: THandle read GetThreadID;
  53. published
  54. { Events }
  55. property OnStart: TNotifyEvent read FOnStart write FOnStart;
  56. property OnThread: TNotifyEvent read FOnThread write FOnThread;
  57. property OnTerminate: TNotifyEvent read FOnTerminate write FOnTerminate;
  58. property AutoExecute: Boolean read FAutoExecute write SetAutoExecute default False;
  59. property Enabled: Boolean read FEnabled write SetEnabled default True;
  60. property Priority: TThreadPriority read FPriority write SetPriority default tpNormal;
  61. property Synchronize: Boolean read FSynchronize write FSynchronize default True;
  62. property WaitForTerminate: Boolean read FWaitForTerminate write FWaitForTerminate default False;
  63. end;
  64. implementation