home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 February / Chip_2002-02_cd1.bin / zkuste / delphi / nastroje / d23456 / PRODEL.ZIP / PROFINTC.PAS < prev    next >
Pascal/Delphi Source File  |  2001-05-05  |  22KB  |  580 lines

  1. //PROFILE-NO
  2. {$O-}
  3. {$D-}
  4. {$B-}
  5. {$Q-}
  6. {$I-}
  7. {$R-}
  8. {$X+}
  9.  
  10. unit Profintc;
  11.  
  12. interface
  13.  
  14. USES
  15.   QForms,
  16.   QDialogs, Windows, QGraphics, Types;
  17.  
  18. TYPE
  19.   TMyComp  = Int64;
  20.  
  21.   TMyLargeInteger = RECORD
  22.                     CASE Byte OF
  23.                      0 : ( LowPart  : DWord; HighPart : LongInt );
  24.                      1 : ( QuadPart : TMyComp );
  25.                   END;
  26.   TPLargeInteger = ^TMyLargeInteger;
  27.  
  28.   TObjFunction = FUNCTION ( CONST Text, Caption : PChar;
  29.                             Flags : Longint ) : Integer OF Object;
  30.  
  31. // Profiler-Measurement-Functions
  32. PROCEDURE ProfStop  ( l : DWord; h : Integer);    external 'PROFMEAS.DLL';
  33. FUNCTION  ProfEnter ( mptr : Pointer; prozNr : Integer ) : TPLargeInteger; external 'PROFMEAS.DLL';
  34. FUNCTION  ProfExit  ( lc   : DWord;   hc : Integer; prozNr : Integer ) : TPLargeInteger; external 'PROFMEAS.DLL';
  35. PROCEDURE ProfActivate;     external 'PROFMEAS.DLL';
  36. PROCEDURE ProfDeActivate;   external 'PROFMEAS.DLL';
  37. PROCEDURE ProfSetComment  ( comm   : PChar );     external 'PROFMEAS.DLL';
  38. PROCEDURE ProfAppendResults ( progEnd : Boolean );external 'PROFMEAS.DLL';
  39.  
  40. // Post-Mortem-Review-Functions
  41. PROCEDURE PomoEnter       ( prozNr : SmallInt );  external 'PROFMEAS.DLL';
  42. PROCEDURE PomoExceStr     ( name   : pChar    );  external 'PROFMEAS.DLL';
  43. PROCEDURE PomoExce;
  44. PROCEDURE PomoExit        ( prozNr : SmallInt );  external 'PROFMEAS.DLL';
  45.  
  46. // Functions to interrupt and continue measurement for calls which could set the
  47. //  Process idle. Use these calls to implement own Non-measured Calls. If METHODS
  48. //  can set a process idle, the only possibility is, to put these calls into your
  49. //  sources (included by an IFDEF-statement).
  50. //  USE 2 or more spaces between IFDEF and PROFILE, otherwise it will be deleted
  51. //  by the ProDelphi. Example:
  52. //  {$IFDEF     PROFILE } StopCounting;     {$ENDIF }
  53. //    ObjectReference.MethodThatMightSetProcessIdle;
  54. //  {$IFDEF     PROFILE } ContinueCounting; {$ENDIF }
  55.  
  56. // Normal procedures that set the process idle can be handled like the Sleep-
  57. //  function in this unit.
  58. PROCEDURE StopCounting;                           external 'PROFMEAS.DLL';
  59. PROCEDURE ContinueCounting;                       external 'PROFMEAS.DLL';
  60.  
  61. // Delphi-Functions that set process idle
  62. procedure ShowMessage(const Msg : AnsiString); overload;
  63.  
  64. procedure ShowMessage(const Msg : ShortString); overload;
  65.  
  66. procedure ShowMessage(const Msg : AnsiString; Params : array of const); overload;
  67.  
  68. procedure ShowMessage(const Msg : ShortString; Params : array of const); overload;
  69.  
  70. PROCEDURE ShowMessageFmt(const Msg : WideString; Params : array of const );
  71.           // If you need to compile the CLX-Lib, the next functions must be deleted,
  72.           // Sorry ! The USES statement for QDialogs has to be moved to the
  73.           // Implementation part !!!
  74.  
  75. procedure ShowMessagePos(const Msg : WideString; X, Y : Integer);
  76.  
  77. // CLX-Functions
  78. function MessageDlg(const Msg        : AnsiString;     DlgType : TMsgDlgType;
  79.                           Buttons    : TMsgDlgButtons; HelpCtx : Longint;
  80.                           DefaultBtn : TMsgDlgBtn = mbNone;
  81.                           Bitmap     : TBitmap = NIL) : Integer; overload;
  82.  
  83. function MessageDlg(const Msg        : ShortString;     DlgType : TMsgDlgType;
  84.                           Buttons    : TMsgDlgButtons; HelpCtx : Longint;
  85.                           DefaultBtn : TMsgDlgBtn = mbNone;
  86.                           Bitmap     : TBitmap = NIL) : Integer; overload;
  87.  
  88. function MessageDlg(const Caption    : AnsiString;   const Msg  : AnsiString;
  89.                           DlgType    : TMsgDlgType;  Buttons    : TMsgDlgButtons;
  90.                           HelpCtx    : Longint;      DefaultBtn : TMsgDlgBtn = mbNone;
  91.                           Bitmap     : TBitmap = nil) : Integer; overload;
  92.  
  93. function MessageDlg(const Caption    : ShortString;   const Msg  : ShortString;
  94.                           DlgType    : TMsgDlgType;  Buttons    : TMsgDlgButtons;
  95.                           HelpCtx    : Longint;      DefaultBtn : TMsgDlgBtn = mbNone;
  96.                           Bitmap     : TBitmap = nil) : Integer; overload;
  97.  
  98. function MessageDlg(const Caption    : AnsiString;   const Msg  : AnsiString;
  99.                           DlgType    : TMsgDlgType;  Buttons    : TMsgDlgButtons;
  100.                           HelpCtx    : Longint;      X, Y       : Integer;
  101.                           DefaultBtn : TMsgDlgBtn = mbNone;
  102.                           Bitmap     : TBitmap = nil) : Integer; overload;
  103.  
  104. function MessageDlg(const Caption    : ShortString;   const Msg  : ShortString;
  105.                           DlgType    : TMsgDlgType;  Buttons    : TMsgDlgButtons;
  106.                           HelpCtx    : Longint;      X, Y       : Integer;
  107.                           DefaultBtn : TMsgDlgBtn = mbNone;
  108.                           Bitmap     : TBitmap = nil) : Integer; overload;
  109.  
  110. function MessageDlg(const Caption    : AnsiString;   const Msg  : AnsiString;
  111.                           DlgType    : TMsgDlgType;
  112.                           Button1, Button2, Button3   : TMsgDlgBtn;
  113.                           HelpCtx    : Longint;      X, Y       : Integer;
  114.                           DefaultBtn : TMsgDlgBtn = mbNone;
  115.                           Bitmap     : TBitmap = nil) : Integer; overload;
  116.  
  117. function MessageDlg(const Caption    : ShortString;   const Msg  : ShortString;
  118.                           DlgType    : TMsgDlgType;
  119.                           Button1, Button2, Button3   : TMsgDlgBtn;
  120.                           HelpCtx    : Longint;      X, Y       : Integer;
  121.                           DefaultBtn : TMsgDlgBtn = mbNone;
  122.                           Bitmap     : TBitmap = nil) : Integer; overload;
  123.  
  124. function MessageDlgPos(const Msg         : WideString;     DlgType    : TMsgDlgType;
  125.                              Buttons     : TMsgDlgButtons; HelpCtx    : Longint;
  126.                              X, Y        : Integer;
  127.                              DefaultBtn  : TMsgDlgBtn = mbNone;
  128.                              Bitmap      : TBitmap = nil) : Integer;
  129.  
  130. //
  131. // Delphi-TApplication-Functions that set process idle (handled in DLL)
  132. PROCEDURE ProcessMessages;
  133. PROCEDURE HandleMessage;
  134.  
  135. FUNCTION  AMessageBox ( CONST Text : WideString; Caption : WideString = '';
  136.                         Buttons : TMessageButtons = [smbOK];
  137.                         Style   : TMessageStyle   = smsInformation;
  138.                         Default : TMessageButton  = smbOK;
  139.                         Escape  : TMessageButton  = smbCancel) : TMessageButton;
  140.  
  141.  
  142. // Windows-Functions that set process idle
  143. FUNCTION  DispatchMessage(CONST lpMsg  : TMsg) : Longint;
  144. FUNCTION  DialogBox( hInstance  : HINST; lpTemplate   : PChar;
  145.                      hWndParent : HWND;  lpDialogFunc : TFNDlgProc): Integer;
  146. FUNCTION  DialogBoxIndirect( hInstance  : HINST; const lpDialogTemplate : TDlgTemplate;
  147.                              hWndParent : HWND;        lpDialogFunc     : TFNDlgProc): Integer;
  148. FUNCTION  MessageBox ( hWnd : HWND; lpText, lpCaption: PChar; uType : UINT ) : Integer;
  149. FUNCTION  MessageBoxEx( hWnd : HWND; lpText, lpCaption: PChar; uType : UINT; lang : Word ) : Integer;
  150. FUNCTION  SignalObjectAndWait ( h1, h2 : THandle;
  151.                                 ms     : DWord;
  152.                                 al     : BOOL) : BOOL;
  153. FUNCTION  WaitForSingleObject ( h1     : THandle;
  154.                                 MS     : DWORD ) : DWORD;
  155. FUNCTION  WaitForSingleObjectEx ( h1   : THandle;
  156.                                   MS   : DWORD;
  157.                                   al   : BOOL ) : DWORD;
  158.  
  159. FUNCTION  WaitForMultipleObjects ( ct  : DWORD;
  160.                                    CONST pH : PWOHandleArray;
  161.                                    wait     : BOOL;
  162.                                    ms       : DWORD ) : DWORD;
  163. FUNCTION  WaitForMultipleObjectsEx ( ct  : DWORD;
  164.                                      CONST pH : PWOHandleArray;
  165.                                      wait     : BOOL;
  166.                                      ms       : DWORD;
  167.                                      al       : Boolean) : DWORD;
  168. FUNCTION  MsgWaitForMultipleObjects ( ct      : DWORD;
  169.                                       VAR pHandles;
  170.                                       wait    : BOOL;
  171.                                       ms      : DWORD;
  172.                                       wm      : DWORD ) : DWORD;
  173. FUNCTION  MsgWaitForMultipleObjectsEx ( ct     : DWORD;
  174.                                         VAR pHandles;
  175.                                         ms     : DWORD;
  176.                                         wm     : DWORD;
  177.                                         fl     : DWORD ) : DWORD;
  178. PROCEDURE Sleep   (zeit : DWORD );
  179. PROCEDURE SleepEx (zeit : DWORD; alertable : BOOL );
  180. FUNCTION  WaitCommEvent ( hd  : THandle; VAR em : DWORD;
  181.                           lpo : POverlapped ) : BOOL;
  182. FUNCTION  WaitForInputIdle ( hp : THandle; ms : DWORD ) : DWORD;
  183. FUNCTION  WaitMessage : BOOL;
  184. FUNCTION  WaitNamedPipe ( np : PAnsiChar; ms : DWORD ) : BOOL;
  185.  
  186. IMPLEMENTATION
  187. USES
  188.   SysUtils;
  189.  
  190. TYPE
  191.   TObjProzedur = PROCEDURE OF Object;
  192.  
  193. // Profiler-Internal-Functions, DO NOT USE
  194. FUNCTION  ProfGlobalInit1 : Boolean;              external 'PROFMEAS.DLL';
  195. PROCEDURE ProfGlobalInit2 ( j : Integer );        external 'PROFMEAS.DLL';
  196. PROCEDURE ProfUnInitTimer;                        external 'PROFMEAS.DLL';
  197. FUNCTION  ProfIsInitialised : Integer;            external 'PROFMEAS.DLL';
  198. FUNCTION  ProfMustBeUnInitialised : Integer;      external 'PROFMEAS.DLL';
  199.  
  200. // Calibration - Function - DO NOT USE
  201. PROCEDURE CalcQPCTime802; external 'PROFCALI.DLL';
  202. PROCEDURE ProfSetDelphiVersion ( vers : Integer ); external 'PROFCALI.DLL';
  203.  
  204. // Check if CPU is intel-Compatible
  205. PROCEDURE PruefeKompatibilitaet;
  206. VAR
  207.   tsh, tsl : DWORD;
  208. BEGIN
  209.   Try
  210.     asm
  211.       DW 310FH;
  212.       mov tsh,edx
  213.       mov tsl,eax
  214.     end;
  215.   Except
  216.     Windows.MessageBox(0, 'This CPU is not Intel-Compatible', 'ProDelphi - ERROR', MB_OK);
  217.     halt(0);
  218.   End;
  219. END;
  220.  
  221. FUNCTION  AMessageBox ( CONST Text : WideString; Caption : WideString = '';
  222.                         Buttons : TMessageButtons = [smbOK];
  223.                         Style   : TMessageStyle   = smsInformation;
  224.                         Default : TMessageButton  = smbOK;
  225.                         Escape  : TMessageButton  = smbCancel) : TMessageButton;
  226. BEGIN
  227.   StopCounting;
  228.   Result := Application.MessageBox(Text,Caption,Buttons,Style,Default,Escape);
  229.   ContinueCounting;
  230. END;
  231.  
  232. procedure ShowMessage(const Msg : AnsiString);
  233. BEGIN
  234.   StopCounting;
  235.   QDialogs.ShowMessage(Msg);
  236.   ContinueCounting;
  237. END;
  238.  
  239. procedure ShowMessage(const Msg : ShortString);
  240. BEGIN
  241.   StopCounting;
  242.   QDialogs.ShowMessage(Msg);
  243.   ContinueCounting;
  244. END;
  245.  
  246. procedure ShowMessage(const Msg : AnsiString; Params : array of const);
  247. BEGIN
  248.   StopCounting;
  249.   QDialogs.ShowMessage(Msg, Params);
  250.   ContinueCounting;
  251. END;
  252.  
  253. procedure ShowMessage(const Msg : ShortString; Params : array of const);
  254. BEGIN
  255.   StopCounting;
  256.   QDialogs.ShowMessage(Msg, Params);
  257.   ContinueCounting;
  258. END;
  259.  
  260. procedure ShowMessagePos(const Msg : WideString; X, Y : Integer);
  261. BEGIN
  262.   StopCounting;
  263.   QDialogs.ShowMessagePos(Msg, X, Y);
  264.   ContinueCounting;
  265. END;
  266.  
  267. PROCEDURE ShowMessageFmt(const Msg : WideString; Params : array of const );
  268. BEGIN
  269.   StopCounting;
  270.   QDialogs.ShowMessageFmt(Msg, Params);
  271.   ContinueCounting;
  272. END;
  273.  
  274. function MessageDlg(const Msg        : AnsiString;     DlgType : TMsgDlgType;
  275.                           Buttons    : TMsgDlgButtons; HelpCtx : Longint;
  276.                           DefaultBtn : TMsgDlgBtn = mbNone;
  277.                           Bitmap     : TBitmap = nil) : Integer;
  278. BEGIN
  279.   StopCounting;
  280.   Result := QDialogs.MessageDlg(Msg, DlgType, Buttons, HelpCtx, DefaultBtn, Bitmap);
  281.   ContinueCounting;
  282. END;
  283.  
  284. function MessageDlg(const Msg        : ShortString;     DlgType : TMsgDlgType;
  285.                           Buttons    : TMsgDlgButtons; HelpCtx : Longint;
  286.                           DefaultBtn : TMsgDlgBtn = mbNone;
  287.                           Bitmap     : TBitmap = nil) : Integer;
  288. BEGIN
  289.   StopCounting;
  290.   Result := QDialogs.MessageDlg(Msg, DlgType, Buttons, HelpCtx, DefaultBtn, Bitmap);
  291.   ContinueCounting;
  292. END;
  293.  
  294. function MessageDlg(const Caption    : AnsiString;   const Msg  : AnsiString;
  295.                           DlgType    : TMsgDlgType;  Buttons    : TMsgDlgButtons;
  296.                           HelpCtx    : Longint;      DefaultBtn : TMsgDlgBtn = mbNone;
  297.                           Bitmap     : TBitmap = nil) : Integer;
  298. BEGIN
  299.   StopCounting;
  300.   Result := QDialogs.MessageDlg(Caption, Msg, DlgType, Buttons, HelpCtx,
  301.                                 DefaultBtn, Bitmap);
  302.   ContinueCounting;
  303. END;
  304.  
  305. function MessageDlg(const Caption    : ShortString;   const Msg  : ShortString;
  306.                           DlgType    : TMsgDlgType;  Buttons    : TMsgDlgButtons;
  307.                           HelpCtx    : Longint;      DefaultBtn : TMsgDlgBtn = mbNone;
  308.                           Bitmap     : TBitmap = nil) : Integer;
  309. BEGIN
  310.   StopCounting;
  311.   Result := QDialogs.MessageDlg(Caption, Msg, DlgType, Buttons, HelpCtx,
  312.                                 DefaultBtn, Bitmap);
  313.   ContinueCounting;
  314. END;
  315.  
  316. function MessageDlg(const Caption    : AnsiString;   const Msg  : AnsiString;
  317.                           DlgType    : TMsgDlgType;  Buttons    : TMsgDlgButtons;
  318.                           HelpCtx    : Longint;      X, Y       : Integer;
  319.                           DefaultBtn : TMsgDlgBtn = mbNone;
  320.                           Bitmap     : TBitmap = nil) : Integer;
  321. BEGIN
  322.   StopCounting;
  323.   Result := QDialogs.MessageDlg(Caption, Msg, DlgType, Buttons, HelpCtx, X, Y,
  324.                                 DefaultBtn, Bitmap);
  325.   ContinueCounting;
  326. END;
  327.  
  328. function MessageDlg(const Caption    : ShortString;   const Msg  : ShortString;
  329.                           DlgType    : TMsgDlgType;  Buttons    : TMsgDlgButtons;
  330.                           HelpCtx    : Longint;      X, Y       : Integer;
  331.                           DefaultBtn : TMsgDlgBtn = mbNone;
  332.                           Bitmap     : TBitmap = nil) : Integer;
  333. BEGIN
  334.   StopCounting;
  335.   Result := QDialogs.MessageDlg(Caption, Msg, DlgType, Buttons, HelpCtx, X, Y,
  336.                                 DefaultBtn, Bitmap);
  337.   ContinueCounting;
  338. END;
  339.  
  340. function MessageDlg(const Caption    : AnsiString;    const Msg : AnsiString;
  341.                           DlgType    : TMsgDlgType;
  342.                           Button1, Button2, Button3             : TMsgDlgBtn;
  343.                           HelpCtx    : Longint;       X, Y      : Integer;
  344.                           DefaultBtn : TMsgDlgBtn = mbNone;
  345.                           Bitmap     : TBitmap = nil) : Integer;
  346. BEGIN
  347.   StopCounting;
  348.   Result := QDialogs.MessageDlg(Caption, Msg, DlgType,
  349.                                 Button1, Button2, Button3, HelpCtx, X, Y,
  350.                                 DefaultBtn, Bitmap);
  351.   ContinueCounting;
  352. END;
  353.  
  354. function MessageDlg(const Caption    : ShortString;    const Msg : ShortString;
  355.                           DlgType    : TMsgDlgType;
  356.                           Button1, Button2, Button3             : TMsgDlgBtn;
  357.                           HelpCtx    : Longint;       X, Y      : Integer;
  358.                           DefaultBtn : TMsgDlgBtn = mbNone;
  359.                           Bitmap     : TBitmap = nil) : Integer;
  360. BEGIN
  361.   StopCounting;
  362.   Result := QDialogs.MessageDlg(Caption, Msg, DlgType,
  363.                                 Button1, Button2, Button3, HelpCtx, X, Y,
  364.                                 DefaultBtn, Bitmap);
  365.   ContinueCounting;
  366. END;
  367.  
  368. function MessageDlgPos(const Msg         : WideString;     DlgType    : TMsgDlgType;
  369.                              Buttons     : TMsgDlgButtons; HelpCtx    : Longint;
  370.                              X, Y        : Integer;
  371.                              DefaultBtn  : TMsgDlgBtn = mbNone;
  372.                              Bitmap      : TBitmap = nil) : Integer;
  373. BEGIN
  374.   StopCounting;
  375.   Result := QDialogs.MessageDlgPos(Msg, DlgType, Buttons, HelpCtx, X, Y, DefaultBtn, Bitmap);
  376.   ContinueCounting;
  377. END;
  378.  
  379. FUNCTION  DialogBox( hInstance  : HINST; lpTemplate   : PChar;
  380.                      hWndParent : HWND;  lpDialogFunc : TFNDlgProc): Integer;
  381. BEGIN
  382.   StopCounting;
  383.   Result := Windows.DialogBox(hInstance, lpTemplate, hWndParent, lpDialogFunc);
  384.   ContinueCounting;
  385. END;
  386.  
  387. FUNCTION  DialogBoxIndirect( hInstance  : HINST; const lpDialogTemplate : TDlgTemplate;
  388.                              hWndParent : HWND;        lpDialogFunc     : TFNDlgProc): Integer;
  389. BEGIN
  390.   StopCounting;
  391.   Result := Windows.DialogBoxIndirect(hInstance, lpDialogTemplate, hWndParent, lpDialogFunc);
  392.   ContinueCounting;
  393. END;
  394.  
  395. FUNCTION MessageBox ( hWnd : HWND; lpText, lpCaption: PChar; uType : UINT ) : Integer;
  396. BEGIN
  397.   StopCounting;
  398.   Result := Windows.MessageBox(hWnd, lpText, lpCaption, uType);
  399.   ContinueCounting;
  400. END;
  401.  
  402. FUNCTION MessageBoxEx ( hWnd : HWND; lpText, lpCaption: PChar; uType : UINT; lang : Word ) : Integer;
  403. BEGIN
  404.   StopCounting;
  405.   Result := Windows.MessageBoxEx(hWnd, lpText, lpCaption, uType, lang);
  406.   ContinueCounting;
  407. END;
  408.  
  409. FUNCTION DispatchMessage( CONST lpMsg: TMsg ) : Longint;
  410. BEGIN
  411.   StopCounting;
  412.   Result := Windows.DispatchMessage(lpMsg);
  413.   ContinueCounting;
  414. END;
  415.  
  416. PROCEDURE HandleMessage;
  417. BEGIN
  418.   StopCounting;
  419.   Application.HandleMessage;
  420.   ContinueCounting;
  421. END;
  422.  
  423. PROCEDURE ProcessMessages;
  424. BEGIN
  425.   StopCounting;
  426.   Application.ProcessMessages;
  427.   ContinueCounting;
  428. END;
  429.  
  430. PROCEDURE Sleep( zeit : DWORD );
  431. BEGIN
  432.   StopCounting;
  433.   Windows.Sleep(zeit);
  434.   ContinueCounting;
  435. END;
  436.  
  437. PROCEDURE SleepEx( zeit : DWORD; alertable : BOOL );
  438. BEGIN
  439.   StopCounting;
  440.   Windows.SleepEx(zeit, alertable);
  441.   ContinueCounting;
  442. END;
  443.  
  444. FUNCTION SignalObjectAndWait ( h1, h2 : THandle;
  445.                                ms     : DWord;
  446.                                al     : BOOL) : BOOL;
  447. BEGIN
  448.   StopCounting;
  449.   Result := Windows.SignalObjectAndWait(h1, h2, ms, al);
  450.   ContinueCounting;
  451. END;
  452.  
  453. FUNCTION WaitForSingleObject ( h1     : THandle;
  454.                                MS     : DWORD ) : DWORD;
  455. BEGIN
  456.   StopCounting;
  457.   Result := Windows.WaitForSingleObject ( h1, MS );
  458.   ContinueCounting;
  459. END;
  460.  
  461. FUNCTION WaitForSingleObjectEx ( h1   : THandle;
  462.                                  MS   : DWORD;
  463.                                  al   : BOOL ) : DWORD;
  464. BEGIN
  465.   StopCounting;
  466.   Result := Windows.WaitForSingleObjectEx (h1, MS, al);
  467.   ContinueCounting;
  468. END;
  469.  
  470. FUNCTION WaitForMultipleObjects ( ct  : DWORD;
  471.                                   CONST pH : PWOHandleArray;
  472.                                   wait     : BOOL;
  473.                                   ms       : DWORD ) : DWORD;
  474. BEGIN
  475.   StopCounting;
  476.   Result := Windows.WaitForMultipleObjects(ct, pH, wait, ms);
  477.   ContinueCounting;
  478. END;
  479.  
  480. FUNCTION WaitForMultipleObjectsEx ( ct  : DWORD;
  481.                                     CONST pH : PWOHandleArray;
  482.                                     wait     : BOOL;
  483.                                     ms       : DWORD;
  484.                                     al       : Boolean ) : DWORD;
  485. BEGIN
  486.   StopCounting;
  487.   Result := Windows.WaitForMultipleObjectsEx(ct, pH, wait, ms, al);
  488.   ContinueCounting;
  489. END;
  490.  
  491. FUNCTION MsgWaitForMultipleObjects ( ct     : DWORD;
  492.                                      VAR pHandles;
  493.                                      wait   : BOOL;
  494.                                      ms     : DWORD;
  495.                                      wm     : DWORD ) : DWORD;
  496. BEGIN
  497.   StopCounting;
  498.   Result := Windows.MsgWaitForMultipleObjects(ct, pHandles, wait, ms, wm);
  499.   ContinueCounting;
  500. END;
  501.  
  502. FUNCTION MsgWaitForMultipleObjectsEx ( ct     : DWORD;
  503.                                        VAR pHandles;
  504.                                        ms     : DWORD;
  505.                                        wm     : DWORD;
  506.                                        fl     : DWORD ) : DWORD;
  507. BEGIN
  508.   StopCounting;
  509.   Result := Windows.MsgWaitForMultipleObjectsEx(ct, pHandles, ms, wm, fl);
  510.   ContinueCounting;
  511. END;
  512.  
  513. FUNCTION WaitCommEvent ( hd : THandle; VAR em : DWORD; lpo : POverlapped ) : BOOL;
  514. BEGIN
  515.   StopCounting;
  516.   Result := Windows.WaitCommEvent(hd, em, lpo);
  517.   ContinueCounting;
  518. END;
  519.  
  520. FUNCTION WaitForInputIdle ( hp : THandle; ms : DWORD ) : DWORD;
  521. BEGIN
  522.   StopCounting;
  523.   Result := Windows.WaitForInputIdle(hp, ms);
  524.   ContinueCounting;
  525. END;
  526.  
  527. FUNCTION WaitMessage : BOOL;
  528. BEGIN
  529.   StopCounting;
  530.   Result := Windows.WaitMessage;
  531.   ContinueCounting;
  532. END;
  533.  
  534. FUNCTION WaitNamedPipe ( np : PAnsiChar; ms : DWORD ) : BOOL;
  535. BEGIN
  536.   StopCounting;
  537.   Result := Windows.WaitNamedPipe(np, ms);
  538.   ContinueCounting;
  539. END;
  540.  
  541. PROCEDURE PomoExce;
  542. VAR
  543.   exname : Array[0..100] OF Char;
  544.   ExOb   : TObject;
  545. BEGIN
  546.   exname[0] := Char(0);
  547.   ExOb := ExceptObject;
  548.   IF Assigned(ExOb) THEN BEGIN
  549.     IF ExceptObject IS Exception THEN
  550.       StrPLCopy(exname, Exception(ExceptObject).Message, SizeOf(exname));
  551.   END;
  552.   PomoExceStr(exname);
  553. END;
  554.  
  555. INITIALIZATION
  556.   IF ProfIsInitialised = 1 THEN BEGIN
  557.     PruefeKompatibilitaet;
  558.     IF ProfGlobalInit1 = TRUE THEN BEGIN
  559. {$IFDEF VER140 }
  560.       ProfSetDelphiVersion( 6 );
  561. {$ELSE }
  562.    {$IFDEF VER150 }
  563.         ProfSetDelphiVersion( 7 );
  564.    {$ELSE }
  565.         ProfSetDelphiVersion( 8 );
  566.    {$ENDIF }
  567. {$ENDIF }
  568.       CalcQPCTime802;
  569.     END;
  570.     ProfGlobalInit2(0);
  571.   END;
  572. FINALIZATION
  573.   IF ProfMustBeUnInitialised = 1 THEN BEGIN
  574.     ProfSetComment('At finishing application');
  575.     ProfAppendResults(TRUE);
  576.     ProfUnInitTimer;
  577.   END;
  578. end.
  579.  
  580.