TERRA Datentechnik, Technical Support Sheet 
=====================================================================

Ref. TZ-920518.1/Bj
     TZ-920522.1/Bj
Prog: Standard Library
Rel : 4.0
Sub : Errors in file 'WINDOWS.DEF'

List with all known bugs and typing errors in file 'WINDOWS.DEF'
----------------------------------------------------------------


The export name of the function 'IsClipboardFormatAvailable' should
be ['ISCLIPBOARDFORMATAVAILABLE'] and not ['ISCLIPBOARDAVAILABLE'].
  
Change file: SRC\WINDOWS.DEF  (approx. line 6200) to:

PROCEDURE IsClipboardFormatAvailable
                      ['ISCLIPBOARDFORMATAVAILABLE']
                                     (format : UINT)     : BOOL
       [LARGE, LONG, ALTERS(AX, BX, CX, DX, ES)];

----------------------------------------------------------------

The functions 'RemoveMenu' and 'DeleteMenu' has the wrong export
name (['INSERTMENU']):

Change file: SRC\WINDOWS.DEF  (approx. line 5887) to:

PROCEDURE RemoveMenu 	['REMOVEMENU']     (menu : HMENU;
					position : UINT;
					   flags : UINT)     : BOOL
       [LARGE, LONG, ALTERS(AX, BX, CX, DX, ES)];

PROCEDURE DeleteMenu 	['DELETEMENU']     (menu : HMENU;
					position : UINT;
					   flags : UINT)     : BOOL
       [LARGE, LONG, ALTERS(AX, BX, CX, DX, ES)];

----------------------------------------------------------------
The function 'GetLastActivPopup' has the wrong export
name (['GATLASTACTIVEPOPUP']):

Change file: SRC\WINDOWS.DEF  (approx. line 5480) to:

PROCEDURE GetLastActivePopup
			['GETLASTACTIVEPOPUP']
			               (wndOwner : HWND)     : HWND
       [LARGE, LONG, ALTERS(AX, BX, CX, DX, ES)];            

----------------------------------------------------------------
The function 'GetInstanceData()' needs a short pointer type 
(2 byte) for the parameter 'data' and not a long pointer (4 byte).
Calling the function with the wrong parameter length causes Windows
to an UAE or will wake up Dr. Watson with Win 3.1.

Change file: SRC\WINDOWS.DEF  (approx. line 583) to:

PROCEDURE GetInstanceData ['GETINSTANCEDATA'] 
		            (instance : HINSTANCE;
			         data : NPSTR; (* instead of ADDRESS *) 
			        count : INTEGER)  : INTEGER
       [LARGE, LONG, ALTERS(AX, BX, CX, DX, ES)];

----------------------------------------------------------------
The function 'GetVersion()' returns the Windows version as
unsigned word and not as double word. The low-order byte 
specifies the major version number, the high order byte the 
minor version.

Change file: SRC\WINDOWS.DEF  (approx. line 231) to:

PROCEDURE  GetVersion   ['GETVERSION']( ) : WORD (* instead of DWORD *)
        [LARGE, LONG, ALTERS(AX, BX, CX, DX, ES)];

----------------------------------------------------------------
The functions 'PtInRect', 'WindowFromPoint' and 'ChildWindowFromPoint'
have to pass a POINT structure by value to windows.
By default the compiler will generate address passing for record types.
Therefore, you will never find the point in the given rectangle  
('PtInRect').

Change file: SRC\WINDOWS.DEF  (approx. line 4246) to:

PROCEDURE PtInRect  ['PTINRECT']       (          rect : LPRECT;
                                point [VALUE] : POINT)    : BOOL
       [LARGE, LONG, ALTERS(AX, BX, CX, DX, ES)];

Change file: SRC\WINDOWS.DEF  (approx. line 5119) to:

PROCEDURE WindowFromPoint
                    ['WINDOWFROMPOINT']
                    ( point [VALUE] : POINT)    : HWND
       [LARGE, LONG, ALTERS(AX, BX, CX, DX, ES)];

Change file: SRC\WINDOWS.DEF  (approx. line 5124) to:

PROCEDURE  ChildWindowFromPoint
                    ['CHILDWINDOWFROMPOINT']
                           (           wnd : HWND;
                           point [VALUE] : POINT)    : HWND
       [LARGE, LONG, ALTERS(AX, BX, CX, DX, ES)];

----------------------------------------------------------------
The message WM_PAINTICON is not present in Windows.DEF. It should 
be present in the neighbourhood of messages like WM_PAINT 

Add in file : SRC\WINDOWS.DEF (approx. line 5260):

    WM_PAINTICON   = 0028H;

----------------------------------------------------------------
The C-macro function RGB() is not present in Windows.DEF
and Windows.MOD. The definition could be something like:

      PROCEDURE RGB( r,g,b:BYTE (* in *) ):COLORREF;

The implementation could equal:

      PROCEDURE RGB ( r,g,b:BYTE (* in *) ):COLORREF;
      (* Converts Red/Green/Blue values to double word COLORREF *)
      BEGIN
        RETURN COLORREF(VAL(LONGCARD,ORD(r)+(ORD(g)*100H) )
                        +(VAL(LONGCARD,ORD(b))*10000H) );
      END RGB;

----------------------------------------------------------------

After you made the changes you can compile the module with default 
options.  Dont't worry about version checking since the module is 
flagged with  '\NOCHECK:M'.

Please do not hesitate to send us any bugs or typos which you have
discovered in 'WINDOWS.DEF'.