home *** CD-ROM | disk | FTP | other *** search
/ Turbo Toolbox / Turbo_Toolbox.iso / dtx9303 / alcheck / alchkmsg.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1993-04-05  |  2.1 KB  |  75 lines

  1. {!$define RETAIL_VERSION}
  2. {!define Win32}
  3. {***************************************************************************
  4.   Source File Name     :  ALCHKMSG.PAS
  5.   Autor                :  Mario M. Westphal
  6.   Erstellt am          :  07.03.1993
  7.  
  8.   Compiler             :  Borland Pascal for Windows 1.x
  9.   Betriebssystem       :  DOS 5.0, Windows 3.x
  10.   Compiler-Schalter    :  -
  11.  
  12.   Bemerkungen          :  -
  13.  
  14.   Beschreibung         :  Message-Interface fⁿr ALCHECK
  15.  
  16.   Revisionen           :  07.03.1993 created
  17.  
  18. ****************************************************************************}
  19. {$A+,B-,D+,F-,G+,I+,L+,N-,R+,S+,V+,W-,X+,Q+}
  20.  
  21. {$ifdef RETAIL_VERSION}
  22.   {$D-,L-,S-,R-,Q-,I-}
  23. {$endif}
  24.  
  25. unit ALCHKMSG;
  26.  
  27. INTERFACE
  28. uses
  29.   WinTypes,
  30.   WinProcs,
  31.   WinCRT,
  32.   Strings;
  33.  
  34.  
  35.   function AlCheckNotify (Format: PChar; ArgList: Pointer; Fix: Boolean) : Boolean;
  36.  
  37.  
  38. IMPLEMENTATION
  39. var
  40.   { Nachrichtencode }
  41.   wRegMsg : Word;
  42.  
  43. {-------------------------------------------------------------------------------
  44.   Diese Funktion sendet eine Nachricht an das ALCHECK-Fenster und bewirkt ein
  45.   Aktualisieren der dargestellten Werte.
  46.   Format und ArgList haben dieselbe Bedeutung wie bei der Funktion "wvsprintf",
  47.   allerdings kann fⁿr Arglist auch NIL ⁿbergeben werden.
  48.   Wird fⁿr den Parameter Fix true ⁿbergeben, werden in AlCheck die Werte neu
  49.   fixiert, ansonsten werden nur die aktuellen Werte neu eingelesen.
  50.  
  51.   Die Funktion liefert true, wenn die Nachricht an ALCHECK gesendet wurde.
  52. }
  53. function AlCheckNotify (Format: PChar; ArgList: Pointer; Fix: Boolean) : Boolean;
  54. var
  55.   hwndAlCheck : HWnd;
  56.   lpszMsg     : array[0..1024] of Char;
  57.  
  58. begin
  59.   if ArgList <> nil then wvsprintf(lpszMsg,Format,ArgList^)
  60.                     else StrCopy(lpszMsg,Format);
  61.  
  62.   hwndAlCheck := FindWindow('BorDlgWin-ALCHECK',nil);
  63.   if hwndAlCheck <> 0 then
  64.   begin
  65.     SendMessage(hwndAlCheck,wRegMsg,Word(Fix),LongInt(@lpszMsg));
  66.     AlCheckNotify := true;
  67.   end
  68.   else
  69.     AlCheckNotify := false;
  70. end; { AlCheckNotify }
  71.  
  72. BEGIN
  73.   { Erzeuge eine systemweit eindeutige Nachricht }
  74.   wRegMsg := RegisterWindowMessage('ALCHECK_NOTIFY');
  75. END.