//*********************************************************
//* This portion of the file is from WINDOWS.SH           *
//* There are some lines that were imported from WIN31.SH *
//*********************************************************

// changed #DEFINE POINTER         LONGINT

#DEFINE Bool            WORD

#DEFINE Pchar           int
#DEFINE LongInt         DWORD     // changed int
#DEFINE PStr            ASCIIZ    // changed PChar
#DEFINE PBool           *BOOL     // changed *Word

// #DEFINE PInteger        *int16

#DEFINE PInteger        *WORD
#DEFINE PByte           *Byte
#DEFINE PWord           *Word
#DEFINE PLongInt        *DWORD    // changed *LongInt


#DEFINE PHandle         *THandle
#DEFINE LPHandle        PHandle
#DEFINE THandle         Word
#DEFINE TGlobalHandle   THandle
#DEFINE TLocalHandle    THandle


#DEFINE TFarProc    Pointer
#DEFINE LPVoid    Pointer


#DEFINE HWnd        THandle
#DEFINE HStr        THandle
#DEFINE HIcon       THandle
#DEFINE HDC         THandle
#DEFINE HMenu       THandle
#DEFINE HPen        THandle
#DEFINE HFont       THandle
#DEFINE HBrush      THandle
#DEFINE HBitmap     THandle
#DEFINE HCursor     THandle
#DEFINE HRGN        THandle
#DEFINE HPalette    THandle


#DEFINE TColorRef   Longint


#DEFINE _PRect POINTER
#DEFINE _TRect int16 left; int16 top; int16 right; int16 bottom

// #DEFINE PRect   *TRect

#DEFINE PRect  POINTER
structure TRect
{
		int16 left;
		int16 top;
		int16 right;
		int16 bottom;
}

#DEFINE _TPoint int16 x; int16 y

// #DEFINE PPoint    *TPoint
#DEFINE PPoint   POINTER
structure TPoint
{
		int16 x;
		int16 y;
}

#DEFINE MakePoint   _TPoint

//--------------------------------------------------------------------------
//  KERNEL Section
//--------------------------------------------------------------------------

// OpenFile structure


// #DEFINE POFStruct   *TOFStruct

#DEFINE POFStruct  POINTER
structure TOFStruct
{
    Byte    cBytes;
    Byte    fFixedDisk;
    Word    nErrCode;
    Byte    reserved[4];
    ASCIIZ  szPathName[128];
}

// OpenFile flags

#DEFINE   of_Read             0x0000
#DEFINE   of_Write            0x0001
#DEFINE   of_ReadWrite        0x0002
#DEFINE   of_Share_Compat     0x0000
#DEFINE   of_Share_Exclusive  0x0010
#DEFINE   of_Share_Deny_Write 0x0020
#DEFINE   of_Share_Deny_Read  0x0030
#DEFINE   of_Share_Deny_None  0x0040
#DEFINE   of_Parse            0x0100
#DEFINE   of_Delete           0x0200
#DEFINE   of_Verify           0x0400
#DEFINE   of_Cancel           0x0800
#DEFINE   of_Create           0x1000
#DEFINE   of_Prompt           0x2000
#DEFINE   of_Exist            0x4000
#DEFINE   of_Reopen           0x8000

// GetTempFileName flags

#DEFINE   tf_ForceDrive 0x80

// GetDriveType return values

#DEFINE   drive_Removable 2
#DEFINE   drive_Fixed     3
#DEFINE   drive_Remote    4

// Global Memory Flags

#DEFINE   gmem_Fixed       0x0000
#DEFINE   gmem_Moveable    0x0002
#DEFINE   gmem_NoCompact   0x0010
#DEFINE   gmem_NoDiscard   0x0020
#DEFINE   gmem_ZeroInit    0x0040
#DEFINE   gmem_Modify      0x0080
#DEFINE   gmem_Discardable 0x0100
#DEFINE   gmem_Not_Banked  0x1000
#DEFINE   gmem_Share       0x2000
#DEFINE   gmem_DDEShare    0x2000
#DEFINE   gmem_Notify      0x4000
#DEFINE   gmem_Lower       gmem_Not_Banked

#DEFINE   GHnd gmem_Moveable or gmem_ZeroInit
#DEFINE   GPtr gmem_Fixed or gmem_ZeroInit

// Flags returned by GlobalFlags (in addition to gmem_Discardable)

#DEFINE   gmem_Discarded 0x4000
#DEFINE   gmem_LockCount 0x00FF

// Local Memory Flags

#DEFINE   lmem_Fixed       0x0000
#DEFINE   lmem_Moveable    0x0002
#DEFINE   lmem_NoCompact   0x0010
#DEFINE   lmem_NoDiscard   0x0020
#DEFINE   lmem_ZeroInit    0x0040
#DEFINE   lmem_Modify      0x0080
#DEFINE   lmem_Discardable 0x0F00

#DEFINE   LHnd lmem_Moveable or lmem_ZeroInit
#DEFINE   LPtr lmem_Fixed or lmem_ZeroInit

#DEFINE   NonZeroLHnd lmem_Moveable
#DEFINE   NonZeroLPtr lmem_Fixed

#DEFINE   LNotify_OutOfMem 0
#DEFINE   LNotify_Move     1
#DEFINE   LNotify_Discard  2

// Flags returned by LocalFlags (in addition to LMEM_DISCARDABLE)

#DEFINE   lmem_Discarded 0x4000
#DEFINE   lmem_LockCount 0x00FF

#DEFINE   MakeIntResource   PStr

#DEFINE   Difference 11

// Predefined Resource Types

#DEFINE   rt_Cursor      MakeIntResource(1)
#DEFINE   rt_Bitmap      MakeIntResource(2)
#DEFINE   rt_Icon        MakeIntResource(3)
#DEFINE   rt_Menu        MakeIntResource(4)
#DEFINE   rt_Dialog      MakeIntResource(5)
#DEFINE   rt_String      MakeIntResource(6)
#DEFINE   rt_FontDir     MakeIntResource(7)
#DEFINE   rt_Font        MakeIntResource(8)
#DEFINE   rt_Accelerator MakeIntResource(9)
#DEFINE   rt_RCData      MakeIntResource(10)

// NOTE: if any new resource types are introduced above this point,
// then the value of Difference must be changed.
// (rt_Group_Cursor - rt_Cursor) must always be equal to Difference
// (rt_Group_Icon - rt_Icon) must always be equal to Difference

#DEFINE   rt_Group_Cursor MakeIntResource(LongInt(rt_Cursor) + Difference)

// The value 13 is intentionally unused

#DEFINE   rt_Group_Icon   MakeIntResource(LongInt(rt_Icon) + Difference)
//#DEFINE   rt_Group_Cursor rt_Cursor + Difference
//#DEFINE   rt_Group_Icon   rt_Icon + Difference

#DEFINE TAtom   Word

#DEFINE MakeIntAtom   PStr

// Catch and Throw


// #DEFINE PCatchBuf   *TCatchBuf
#DEFINE PCatchBuf   POINTER
structure TCatchBuf
{
	int i[9];
}

#DEFINE   wf_PMode      0x0001
#DEFINE   wf_CPU286     0x0002
#DEFINE   wf_CPU386     0x0004
#DEFINE   wf_CPU486     0x0008
#DEFINE   wf_Standard   0x0010
#DEFINE   wf_Win286     0x0010
#DEFINE   wf_Enhanced   0x0020
#DEFINE   wf_Win386     0x0020
#DEFINE   wf_CPU086     0x0040
#DEFINE   wf_CPU186     0x0080
#DEFINE   wf_LargeFrame 0x0100
#DEFINE   wf_SmallFrame 0x0200
#DEFINE   wf_80x87      0x0400
#DEFINE   wf_Paging     0x0800      //Imported from WIN31.SH
#DEFINE   wf_WLO        0x8000      //Imported from WIN31.SH

#DEFINE   wep_System_Exit  1
#DEFINE   wep_Free_DLL     0
//$IFDEF OEMRESOURCE

// OEM Resource Ordinal Numbers

#DEFINE   obm_Close    32754
#DEFINE   obm_UpArrow  32753
#DEFINE   obm_DnArrow  32752
#DEFINE   obm_RgArrow  32751
#DEFINE   obm_LfArrow  32750
#DEFINE   obm_Reduce   32749
#DEFINE   obm_Zoom     32748
#DEFINE   obm_Restore  32747
#DEFINE   obm_Reduced  32746
#DEFINE   obm_Zoomd    32745
#DEFINE   obm_Restored 32744
#DEFINE   obm_UpArrowD 32743
#DEFINE   obm_DnArrowD 32742
#DEFINE   obm_RgArrowD 32741
#DEFINE   obm_LfArrowD 32740
#DEFINE   obm_MnArrow  32739
#DEFINE   obm_Combo    32738
#DEFINE   obm_UpArrowI 32737
#DEFINE   obm_DnArrowI 32736
#DEFINE   obm_RgArrowI 32735
#DEFINE   obm_LfArrowI 32734

#DEFINE   obm_Old_Close   32767
#DEFINE   obm_Size        32766
#DEFINE   obm_Old_UpArrow 32765
#DEFINE   obm_Old_DnArrow 32764
#DEFINE   obm_Old_RgArrow 32763
#DEFINE   obm_Old_LfArrow 32762
#DEFINE   obm_BTSize      32761
#DEFINE   obm_Check       32760
#DEFINE   obm_CheckBoxes  32759
#DEFINE   obm_BTNCorners  32758
#DEFINE   obm_Old_Reduce  32757
#DEFINE   obm_Old_Zoom    32756
#DEFINE   obm_Old_Restore 32755

#DEFINE   ocr_Normal   32512
#DEFINE   ocr_IBeam    32513
#DEFINE   ocr_Wait     32514
#DEFINE   ocr_Cross    32515
#DEFINE   ocr_Up       32516
#DEFINE   ocr_Size     32640
#DEFINE   ocr_Icon     32641
#DEFINE   ocr_SizeNWSE 32642
#DEFINE   ocr_SizeNESW 32643
#DEFINE   ocr_SizeWE   32644
#DEFINE   ocr_SizeNS   32645
#DEFINE   ocr_SizeAll  32646
#DEFINE   ocr_ICOCUR   32647

#DEFINE   oic_Sample 32512
#DEFINE   oic_Hand   32513
#DEFINE   oic_Ques   32514
#DEFINE   oic_Bang   32515
#DEFINE   oic_Note   32516

//$ENDIF OEMRESOURCE

//--------------------------------------------------------------------------
//  GDI Section
//--------------------------------------------------------------------------

// Binary raster ops

#DEFINE   r2_Black       1   // 0
#DEFINE   r2_NotMergePen 2   // DPon
#DEFINE   r2_MaskNotPen  3   // DPna
#DEFINE   r2_NotCopyPen  4   // PN
#DEFINE   r2_MaskPenNot  5   // PDna
#DEFINE   r2_Not         6   // Dn
#DEFINE   r2_XORPen      7   // DPx
#DEFINE   r2_NotMaskPen  8   // DPan
#DEFINE   r2_MaskPen     9   // DPa
#DEFINE   r2_NotXORPen   10  // DPxn
#DEFINE   r2_NOP         11  // D
#DEFINE   r2_MergeNotPen 12  // DPno
#DEFINE   r2_CopyPen     13  // P
#DEFINE   r2_MergePenNot 14  // PDno
#DEFINE   r2_MergePen    15  // DPo
#DEFINE   r2_White       16  // 1

// Ternary raster operations

#DEFINE   SrcCopy     0x00CC0020  // dest = source
#DEFINE   SrcPaint    0x00EE0086  // dest = source OR dest
#DEFINE   SrcAnd      0x008800C6  // dest = source AND dest
#DEFINE   SrcInvert   0x00660046  // dest = source XOR dest
#DEFINE   SrcErase    0x00440328  // dest = source AND (NOT dest )
#DEFINE   NotSrcCopy  0x00330008  // dest = (NOT source)
#DEFINE   NotSrcErase 0x001100A6  // dest = (NOT src) AND (NOT dest)
#DEFINE   MergeCopy   0x00C000CA  // dest = (source AND pattern)
#DEFINE   MergePaint  0x00BB0226  // dest = (NOT source) OR dest
#DEFINE   PatCopy     0x00F00021  // dest = Pattern
#DEFINE   PatPaint    0x00FB0A09  // dest = DPSnoo
#DEFINE   PatInvert   0x005A0049  // dest = pattern XOR dest
#DEFINE   DstInvert   0x00550009  // dest = (NOT dest)
#DEFINE   Blackness   0x00000042  // dest = BLACK
#DEFINE   Whiteness   0x00FF0062  // dest = WHITE

// StretchBlt modes

#DEFINE   BlackOnWhite 1
#DEFINE   WhiteOnBlack 2
#DEFINE   ColorOnColor 3

// PolyFill modes

#DEFINE   Alternate 1
#DEFINE   Winding   2

// Text alignment options

#DEFINE   ta_NoUpdateCP 0
#DEFINE   ta_UpdateCP   1

#DEFINE   ta_Left   0
#DEFINE   ta_Right  2
#DEFINE   ta_Center 6

#DEFINE   ta_Top      0
#DEFINE   ta_Bottom   8
#DEFINE   ta_BaseLine 24

#DEFINE   eto_Grayed  1
#DEFINE   eto_Opaque  2
#DEFINE   eto_Clipped 4

#DEFINE   Aspect_Filtering 0x0001

// Metafile functions

#DEFINE   meta_StartPage            0x004F    //Imported from WIN31.SH
#DEFINE   meta_EndPage              0x0050    //Imported from WIN31.SH
#DEFINE   meta_AbortDoc             0x0052    //Imported from WIN31.SH
#DEFINE   meta_EndDoc               0x005E    //Imported from WIN31.SH
#DEFINE   meta_SetBKColor           0x0201
#DEFINE   meta_SetBKMode            0x0102
#DEFINE   meta_SetMapMode           0x0103
#DEFINE   meta_SetROP2              0x0104
#DEFINE   meta_SetRelAbs            0x0105
#DEFINE   meta_SetPolyFillMode      0x0106
#DEFINE   meta_SetStretchBltMode    0x0107
#DEFINE   meta_SetTextCharExtra     0x0108
#DEFINE   meta_ResetDC              0x014C    //Imported from WIN31.SH
#DEFINE   meta_StartDoc             0x014D    //Imported from WIN31.SH
#DEFINE   meta_SetTextColor         0x0209
#DEFINE   meta_SetTextJustification 0x020A
#DEFINE   meta_SetWindowOrg         0x020B
#DEFINE   meta_SetWindowExt         0x020C
#DEFINE   meta_SetViewportOrg       0x020D
#DEFINE   meta_SetViewportExt       0x020E
#DEFINE   meta_OffsetWindowOrg      0x020F
#DEFINE   meta_ScaleWindowExt       0x0400
#DEFINE   meta_OffsetViewportOrg    0x0211
#DEFINE   meta_ScaleViewportExt     0x0412
#DEFINE   meta_LineTo               0x0213
#DEFINE   meta_MoveTo               0x0214
#DEFINE   meta_ExcludeClipRect      0x0415
#DEFINE   meta_IntersectClipRect    0x0416
#DEFINE   meta_Arc                  0x0817
#DEFINE   meta_Ellipse              0x0418
#DEFINE   meta_FloodFill            0x0419
#DEFINE   meta_ExtFloodFill         0x0548    //Imported from WIN31.SH
#DEFINE   meta_Pie                  0x081A
#DEFINE   meta_Rectangle            0x041B
#DEFINE   meta_RoundRect            0x061C
#DEFINE   meta_PatBlt               0x061D
#DEFINE   meta_SaveDC               0x001E
#DEFINE   meta_SetPixel             0x041F
#DEFINE   meta_OffsetClipRgn        0x0220
#DEFINE   meta_TextOut              0x0521
#DEFINE   meta_BitBlt               0x0922
#DEFINE   meta_StretchBlt           0x0B23
#DEFINE   meta_StretchDIB           0x0f43    //Imported from WIN31.SH
#DEFINE   meta_Polygon              0x0324
#DEFINE   meta_PolyLine             0x0325
#DEFINE   meta_Escape               0x0626
#DEFINE   meta_RestoreDC            0x0127
#DEFINE   meta_FillRegion           0x0228
#DEFINE   meta_FrameRegion          0x0429
#DEFINE   meta_InvertRegion         0x012A
#DEFINE   meta_PaintRegion          0x012B
#DEFINE   meta_SelectClipRegion     0x012C
#DEFINE   meta_SelectObject         0x012D
#DEFINE   meta_SetTextAlign         0x012E
#DEFINE   meta_DrawText             0x062F


#DEFINE   meta_Chord                0x0830
#DEFINE   meta_SetMapperFlags       0x0231
#DEFINE   meta_ExtTextOut           0x0a32
#DEFINE   meta_SetDIBToDev          0x0d33
#DEFINE   meta_SelectPalette        0x0234
#DEFINE   meta_RealizePalette       0x0035
#DEFINE   meta_AnimatePalette       0x0436
#DEFINE   meta_SetPalEntries        0x0037
#DEFINE   meta_PolyPolygon          0x0538
#DEFINE   meta_ResizePalette        0x0139


#DEFINE   meta_DIBBitBlt             0x0940
#DEFINE   meta_DIBStretchBlt         0x0b41
#DEFINE   meta_DIBCreatePatternBrush 0x0142


#DEFINE   meta_DeleteObject 0x01f0


#DEFINE   meta_CreatePalette        0x00f7
#DEFINE   meta_CreateBrush          0x00F8
#DEFINE   meta_CreatePatternBrush   0x01F9
#DEFINE   meta_CreatePenIndirect    0x02FA
#DEFINE   meta_CreateFontIndirect   0x02FB
#DEFINE   meta_CreateBrushIndirect  0x02FC
#DEFINE   meta_CreateBitmapIndirect 0x02FD
#DEFINE   meta_CreateBitmap         0x06FE
#DEFINE   meta_CreateRegion         0x06FF

// GDI Escapes


#DEFINE   NewFrame               1
#DEFINE   AbortDoc               2
#DEFINE   NextBand               3
#DEFINE   SetColorTable          4
#DEFINE   GetColorTable          5
#DEFINE   FlushOutput            6
#DEFINE   DraftMode              7
#DEFINE   QueryEscSupport        8
#DEFINE   SetAbortProc           9
#DEFINE   StartDoc               10
#DEFINE   EndDoc                 11
#DEFINE   GetPhysPageSize        12
#DEFINE   GetPrintingOffset      13
#DEFINE   GetScalingFactor       14
#DEFINE   MFComment              15
#DEFINE   GetPenWidth            16
#DEFINE   SetCopyCount           17
#DEFINE   SelectPaperSource      18
#DEFINE   DeviceData             19
#DEFINE   PassThrough            19
#DEFINE   GetTechnolgy           20
#DEFINE   GetTechnology          20
#DEFINE   SetEndCap              21
#DEFINE   SetLineJoin            22
#DEFINE   SetMiterLimit          23
#DEFINE   BandInfo               24
#DEFINE   DrawPatternRect        25
#DEFINE   GetVectorPenSize       26
#DEFINE   GetVectorBrushSize     27
#DEFINE   EnableDuplex           28
#DEFINE   GetSetPaperBins        29
#DEFINE   GetSetPrintOrient      30
#DEFINE   EnumPaperBins          31
#DEFINE   SetDIBScaling          32
#DEFINE   EPSPrinting            33
#DEFINE   EnumPaperMetrics       34
#DEFINE   GetSetPaperMetrics     35
#DEFINE   PostScript_Data        37
#DEFINE   PostScript_Ignore      38
#DEFINE   GetExtendedTextMetrics 256
#DEFINE   GetExtentTable         257
#DEFINE   GetPairKernTable       258
#DEFINE   GetTrackKernTable      259
#DEFINE   GDIExtTextOut          512    //! Renamed from EXTTEXTOUT !
#DEFINE   EnableRelativeWidths   768
#DEFINE   EnablePairKerning      769
#DEFINE   SetKernTrack           770
#DEFINE   SetAllJustValues       771
#DEFINE   SetCharSet             772


#DEFINE   GDIStretchBlt        2048    //! renamed from STRETCHBLT !
#DEFINE   Begin_Path           4096
#DEFINE   Clip_To_Path         4097
#DEFINE   End_Path             4098
#DEFINE   Ext_Device_Caps      4099
#DEFINE   Restore_CTM          4100
#DEFINE   Save_Ctm             4101
#DEFINE   Set_Arc_Direction    4102
#DEFINE   Set_Background_Color 4103
#DEFINE   Set_Poly_Mode        4104
#DEFINE   Set_Screen_Angle     4105
#DEFINE   Set_Spread           4106
#DEFINE   Transform_CTM        4107
#DEFINE   Set_Clip_Box         4108
#DEFINE   Set_Bounds           4109

// Spooler error codes


#DEFINE   sp_NotReported 0x4000
#DEFINE   sp_Error       (-1)
#DEFINE   sp_AppAbort    (-2)
#DEFINE   sp_UserAbort   (-3)
#DEFINE   sp_OutOfDisk   (-4)
#DEFINE   sp_OutOfMemory (-5)


#DEFINE   pr_JobStatus 0x0000

// Object definitions for EnumObjects


#DEFINE   obj_Pen   1
#DEFINE   obj_Brush 2

// Bitmap header definition


// #DEFINE PBitmap   *TBitmap
#DEFINE PBitmap   POINTER
structure TBitmap
{
		int16   bmType;
		int16   bmWidth;
		int16   bmHeight;
		int16   bmWidthBytes;
		Byte    bmPlanes;
		Byte    bmBitsPixel;
		int     bmBits;
		// Pointer bmBits;  Pointer isn't supported thus we use LongInt

}


structure TRGBTriple
{
		Byte rgbtBlue;
		Byte rgbtGreen;
		Byte rgbtRed;
}


structure TRGBQuad
{
		Byte rgbBlue;
		Byte rgbGreen;
		Byte rgbRed;
		Byte rgbReserved;
}

// Structures for defining DIBs


// #DEFINE PBitmapCoreHeader   *TBitmapCoreHeader
#DEFINE PBitmapCoreHeader POINTER
structure TBitmapCoreHeader
{
	// Below was LongInt but the compiler doesn't like it, thus we use int
		int bcSize;              // used to get to color table
		Word bcWidth;
		Word bcHeight;
		Word bcPlanes;
		Word bcBitCount;
}


// #DEFINE PBitmapInfoHeader   *TBitmapInfoHeader
#DEFINE PBitmapInfoHeader  POINTER
structure TBitmapInfoHeader
{
		int biSize;   // was LongInt but CMACW doesn't like it, thus we use int
		int biWidth;  // was LongInt but CMACW doesn't like it, thus we use int
		int biHeight;  // was LongInt but CMACW doesn't like it, thus we use int
		Word biPlanes;
		Word biBitCount;
		int biCompression;    // was LongInt but CMACW doesn't like it, thus we use int
		int biSizeImage;      // was LongInt but CMACW doesn't like it, thus we use int
		int biXPelsPerMeter;  // was LongInt but CMACW doesn't like it, thus we use int
		int biYPelsPerMeter;  // was LongInt but CMACW doesn't like it, thus we use int
		int biClrUsed;        // was LongInt but CMACW doesn't like it, thus we use int
		int biClrImportant;   // was LongInt but CMACW doesn't like it, thus we use int
}

// Constants for the biCompression field


#DEFINE   bi_RGB  0
#DEFINE   bi_RLE8 1
#DEFINE   bi_RLE4 2

//#DEFINE PBitmapInfo   *TBitmapInfo
#DEFINE PBitmapInfo   POINTER
structure TBitmapInfo
{
		//The valuse below are grabbed directly from the TBitmapInfoHeader stcuct
		//TBitmapInfoHeader bmiHeader;
		int biSize;   // was LongInt but CMACW doesn't like it, thus we use int
		int biWidth;  // was LongInt but CMACW doesn't like it, thus we use int
		int biHeight;  // was LongInt but CMACW doesn't like it, thus we use int
		Word biPlanes;
		Word biBitCount;
		int biCompression;    // was LongInt but CMACW doesn't like it, thus we use int
		int biSizeImage;      // was LongInt but CMACW doesn't like it, thus we use int
		int biXPelsPerMeter;  // was LongInt but CMACW doesn't like it, thus we use int
		int biYPelsPerMeter;  // was LongInt but CMACW doesn't like it, thus we use int
		int biClrUsed;        // was LongInt but CMACW doesn't like it, thus we use int
		int biClrImportant;   // was LongInt but CMACW doesn't like it, thus we use int
		//No support for structs in structs so we use all the values
		//TRGBQuad bmiColors[1];
		Byte rgbBlue;
		Byte rgbGreen;
		Byte rgbRed;
		Byte rgbReserved;
}


#DEFINE PBitmapCoreInfo   *TBitmapCoreInfo
structure TBitmapCoreInfo
{
		//TBitmapCoreHeader bmciHeader;
		int bcSize;              // used to get to color table
		Word bcWidth;
		Word bcHeight;
		Word bcPlanes;
		Word bcBitCount;
		//No support for structs in structsso we use all the values
		// TRGBTriple bmciColors[1];
		Byte rgbtBlue;
		Byte rgbtGreen;
		Byte rgbtRed;
}
//#ENDIF

//#DEFINE PBitmapFileHeader   *TBitmapFileHeader
#DEFINE PBitmapFileHeader POINTER
structure TBitmapFileHeader
{
		Word  bfType;
		int   bfSize;           // was LongInt but CMACW doesn't like it, thus we use int
		Word  bfReserved1;
		Word  bfReserved2;
		int   bfOffBits;        // was LongInt but CMACW doesn't like it, thus we use int
}


// Clipboard Metafile Picture Structure


// #DEFINE PHandleTable    *THandleTable
#DEFINE PHandleTable POINTER
structure THandleTable
{
		 THandle objectHandle[1];
}


// #DEFINE PMetaRecord   *TMetaRecord
#DEFINE PMetaRecord  POINTER
structure TMetaRecord
{
		int rdSize;       // was LongInt but CMACW doesn't like it, thus we use int
		Word rdFunction;
		Word rdParm[1];
}

// #DEFINE PMetaHeader   *TMetaHeader
#DEFINE PMetaHeader   POINTER
structure TMetaHeader
{
		Word mtType;
		Word mtHeaderSize;
		Word mtVersion;
		int mtSize;   // was LongInt but CMACW doesn't like it, thus we use int
		Word mtNoObjects;
		int mtMaxRecord;  // was LongInt but CMACW doesn't like it, thus we use int
		Word mtNoParameters;
}


// #DEFINE PMetaFilePict   *TMetaFilePict
#DEFINE PMetaFilePict POINTER
structure TMetaFilePict
{
		int16 mm;
		int16 xExt;
		int16 yExt;
		THandle hMF;
}


// #DEFINE PTextMetric   *TTextMetric
#DEFINE PTextMetric   POINTER
structure TTextMetric
{
		int16 tmHeight;
		int16 tmAscent;
		int16 tmDescent;
		int16 tmInternalLeading;
		int16 tmExternalLeading;
		int16 tmAveCharWidth;
		int16 tmMaxCharWidth;
		int16 tmWeight;
		Byte tmItalic;
		Byte tmUnderlined;
		Byte tmStruckOut;
		Byte tmFirstChar;
		Byte tmLastChar;
		Byte tmDefaultChar;
		Byte tmBreakChar;
		Byte tmPitchAndFamily;
		Byte tmCharSet;
		int16 tmOverhang;
		int16 tmDigitizedAspectX;
		int16 tmDigitizedAspectY;
}

// GDI Logical Objects

// Pel Array


// #DEFINE PPelArray   *TPelArray
#DEFINE PPelArray  POINTER
structure TPelArray
{
		int16 paXCount;
		int16 paYCount;
		int16 paXExt;
		int16 paYExt;
		Byte paRGBs;
}

// Logical Brush (or Pattern)


// #DEFINE PLogBrush   *TLogBrush
#DEFINE PLogBrush  POINTER
structure TLogBrush
{
		Word lbStyle;
		int lbColor;    // was LongInt but CMACW doesn't like it, thus we use int
		int16 lbHatch;
}


// #DEFINE PPattern    *TPattern
#DEFINE PPattern    POINTER
#DEFINE TPattern    TLogBrush

// Logical Pen


// #DEFINE PLogPen   *TLogPen
#DEFINE PLogPen   POINTER
structure TLogPen
{
		Word lopnStyle;
		_Tpoint;
//    TPoint lopnWidth;         NOT YET SUPPORTED, SEE PREVIOUS
		int lopnColor;   // was LongInt but CMACW doesn't like it, thus we use int
}


// #DEFINE PPaletteEntry   *TPaletteEntry
#DEFINE PPaletteEntry POINTER
structure TPaletteEntry
{
		Byte peRed;
		Byte peGreen;
		Byte peBlue;
		Byte peFlags;
}

// Logical Palette

#IFDEF POINTER_SUPPORT
#DEFINE PLogPalette   *TLogPalette
structure TLogPalette
{
		Word palVersion;
		Word palNumEntries;
		TPaletteEntry palPalEntry[1];
}
#ENDIF

// Logical Font


#DEFINE   lf_FaceSize 32


// #DEFINE PLogFont    *TLogFont
#DEFINE PLogFont   POINTER
structure TLogFont
{
		int16 lfHeight;
		int16 lfWidth;
		int16 lfEscapement;
		int16 lfOrientation;
		int16 lfWeight;
		Byte lfItalic;
		Byte lfUnderline;
		Byte lfStrikeOut;
		Byte lfCharSet;
		Byte lfOutPrecision;
		Byte lfClipPrecision;
		Byte lfQuality;
		Byte lfPitchAndFamily;
		ASCIIZ lfFaceName[lf_FaceSize];
}

// OutPrecision values

#DEFINE   out_Default_Precis   0
#DEFINE   out_String_Precis    1
#DEFINE   out_Character_Precis 2
#DEFINE   out_Stroke_Precis    3
#DEFINE   out_TT_Precis        4      //Imported from WIN31.SH
#DEFINE   out_Device_Precis    5      //Imported from WIN31.SH
#DEFINE   out_Raster_Precis    6      //Imported from WIN31.SH
#DEFINE   out_TT_Only_Precis   7      //Imported from WIN31.SH


// ClipPrecision values

#DEFINE   clip_Default_Precis   0
#DEFINE   clip_Character_Precis 1
#DEFINE   clip_Stroke_Precis    2
#DEFINE   clip_Mask             0x0F
#DEFINE   clip_LH_Angles        0x10
#DEFINE   clip_TT_Always        0x20
#DEFINE   clip_Embedded         0x80


#DEFINE   Default_Quality 0
#DEFINE   Draft_Quality   1
#DEFINE   Proof_Quality   2


#DEFINE   Default_Pitch  0
#DEFINE   Fixed_Pitch    1
#DEFINE   Variable_Pitch 2


#DEFINE   Ansi_CharSet        0
#DEFINE   Default_Charset     1       //Imported from WIN31.SH
#DEFINE   Symbol_CharSet      2
#DEFINE   ShiftJIS_CharSet    128
#DEFINE   Hangeul_Charset     129     //Imported from WIN31.SH
#DEFINE   ChineseBig5_Charset 136     //Imported from WIN31.SH
#DEFINE   OEM_CharSet         255

// Font Families


#DEFINE   ff_DontCare   0 shl 4  // Don't care or don't know.
#DEFINE   ff_Roman      1 shl 4  // Variable stroke width, serifed.
														// Times Roman, Century Schoolbook, etc.
#DEFINE   ff_Swiss      2 shl 4  // Variable stroke width, sans-serifed.
														// Helvetica, Swiss, etc.
#DEFINE   ff_Modern     3 shl 4  // Constant stroke width, serifed or sans-serifed.
														// Pica, Elite, Courier, etc.
#DEFINE   ff_Script     4 shl 4  // Cursive, etc.
#DEFINE   ff_Decorative 5 shl 4  // Old English, etc.

// Font Weights


#DEFINE   fw_DontCare   0
#DEFINE   fw_Thin       100
#DEFINE   fw_ExtraLight 200
#DEFINE   fw_Light      300
#DEFINE   fw_Normal     400
#DEFINE   fw_Medium     500
#DEFINE   fw_SemiBold   600
#DEFINE   fw_Bold       700
#DEFINE   fw_ExtraBold  800
#DEFINE   fw_Heavy      900


#DEFINE   fw_UltraLight fw_ExtraLight
#DEFINE   fw_Regular    fw_Normal
#DEFINE   fw_DemiBold   fw_SemiBold
#DEFINE   fw_UltraBold  fw_ExtraBold
#DEFINE   fw_Black      fw_Heavy

// EnumFonts Masks


#DEFINE   Raster_FontType 0x0001
#DEFINE   Device_FontType 0x0002


// Background Modes


#DEFINE   Transparent 1
#DEFINE   Opaque      2

// Mapping Modes


#DEFINE   mm_Text        1
#DEFINE   mm_LoMetric    2
#DEFINE   mm_HiMetric    3
#DEFINE   mm_LoEnglish   4
#DEFINE   mm_HiEnglish   5
#DEFINE   mm_TWIPS       6
#DEFINE   mm_Isotropic   7
#DEFINE   mm_Anisotropic 8

// Coordinate Modes


#DEFINE   Absolute 1
#DEFINE   Relative 2

// Stock Logical Objects


#DEFINE   White_Brush         0
#DEFINE   LtGray_Brush        1
#DEFINE   Gray_Brush          2
#DEFINE   DkGray_Brush        3
#DEFINE   Black_Brush         4
#DEFINE   Null_Brush          5
#DEFINE   Hollow_Brush        Null_Brush
#DEFINE   White_Pen           6
#DEFINE   Black_Pen           7
#DEFINE   Null_Pen            8
#DEFINE   OEM_Fixed_Font      10
#DEFINE   ANSI_Fixed_Font     11
#DEFINE   ANSI_Var_Font       12
#DEFINE   System_Font         13
#DEFINE   Device_Default_Font 14
#DEFINE   Default_Palette     15
#DEFINE   System_Fixed_Font   16

// Brush Styles


#DEFINE   bs_Solid      0
#DEFINE   bs_Null       1
#DEFINE   bs_Hollow     bs_NULL
#DEFINE   bs_Hatched    2
#DEFINE   bs_Pattern    3
#DEFINE   bs_Indexed    4
#DEFINE   bs_DIBPattern 5

// Hatch Styles


#DEFINE   hs_Horizontal 0       // -----
#DEFINE   hs_Vertical   1       // |||||
#DEFINE   hs_FDiagonal  2       // /////
#DEFINE   hs_BDiagonal  3       // \\\\\
#DEFINE   hs_Cross      4       // +++++
#DEFINE   hs_DiagCross  5       // xxxxx


#DEFINE   ps_Solid       0
#DEFINE   ps_Dash        1      // -------
#DEFINE   ps_Dot         2      // .......
#DEFINE   ps_DashDot     3      // _._._._
#DEFINE   ps_DashDotDot  4      // _.._.._
#DEFINE   ps_Null        5
#DEFINE   ps_InsideFrame 6

// Device Parameters for GetDeviceCaps


#DEFINE   DriverVersion 0    // Device driver version
#DEFINE   Technology    2    // Device classification
#DEFINE   HorzSize      4    // Horizontal size in millimeters
#DEFINE   VertSize      6    // Vertical size in millimeters
#DEFINE   HorzRes       8    // Horizontal width in pixels
#DEFINE   VertRes       10   // Vertical width in pixels
#DEFINE   BitsPixel     12   // Number of bits per pixel
#DEFINE   Planes        14   // Number of planes
#DEFINE   NumBrushes    16   // Number of brushes the device has
#DEFINE   NumPens       18   // Number of pens the device has
#DEFINE   NumMarkers    20   // Number of markers the device has
#DEFINE   NumFonts      22   // Number of fonts the device has
#DEFINE   NumColors     24   // Number of colors the device supports
#DEFINE   PDeviceSize   26   // Size required for device descriptor
#DEFINE   CurveCaps     28   // Curve capabilities
#DEFINE   LineCaps      30   // Line capabilities
#DEFINE   PolygonalCaps 32   // Polygonal capabilities
#DEFINE   TextCaps      34   // Text capabilities
#DEFINE   ClipCaps      36   // Clipping capabilities
#DEFINE   RasterCaps    38   // Bitblt capabilities
#DEFINE   AspectX       40   // Length of the X leg
#DEFINE   AspectY       42   // Length of the Y leg
#DEFINE   AspectXY      44   // Length of the hypotenuse
#DEFINE   LogPixelsX    88   // Logical pixels/inch in X
#DEFINE   LogPixelsY    90   // Logical pixels/inch in Y
#DEFINE   SizePalette   104  // Number of entries in physical palette
#DEFINE   NumReserved   106  // Number of reserved entries in palette
#DEFINE   ColorRes      108  // Actual color resolution

// Device Capability Masks

// Device Technologies


#DEFINE   dt_Plotter    0   // Vector plotter
#DEFINE   dt_RasDisplay 1   // Raster display
#DEFINE   dt_RasPrinter 2   // Raster printer
#DEFINE   dt_RasCamera  3   // Raster camera
#DEFINE   dt_CharStream 4   // Character-stream, PLP
#DEFINE   dt_MetaFile   5   // Metafile, VDM
#DEFINE   dt_DispFile   6   // Display-file

// Curve Capabilities


#DEFINE   cc_None       0   // Curves not supported
#DEFINE   cc_Circles    1   // Can do circles
#DEFINE   cc_Pie        2   // Can do pie wedges
#DEFINE   cc_Chord      4   // Can do chord arcs
#DEFINE   cc_Ellipses   8   // Can do ellipese
#DEFINE   cc_Wide       16  // Can do wide lines
#DEFINE   cc_Styled     32  // Can do styled lines
#DEFINE   cc_WideStyled 64  // Can do wide styled lines
#DEFINE   cc_Interiors  128 // Can do interiors
#DEFINE   cc_RoundRect  256 //imported from WIN31.SH  was 0x100

// Line Capabilities


#DEFINE   lc_None       0   // Lines not supported
#DEFINE   lc_PolyLine   2   // Can do polylines
#DEFINE   lc_Marker     4   // Can do markers
#DEFINE   lc_PolyMarker 8   // Can do polymarkers
#DEFINE   lc_Wide       16  // Can do wide lines
#DEFINE   lc_Styled     32  // Can do styled lines
#DEFINE   lc_WideStyled 64  // Can do wide styled lines
#DEFINE   lc_Interiors  128 // Can do interiors

// Polygonal Capabilities


#DEFINE   pc_None       0   // Polygonals not supported
#DEFINE   pc_Polygon    1   // Can do polygons
#DEFINE   pc_Rectangle  2   // Can do rectangles
#DEFINE   pc_WindPolygon 4  // Can do winding polygons
#DEFINE   pc_Trapezoid  4   // Can do trapezoids
#DEFINE   pc_ScanLine   8   // Can do scanlines
#DEFINE   pc_Wide       16  // Can do wide borders
#DEFINE   pc_Styled     32  // Can do styled borders
#DEFINE   pc_WideStyled 64  // Can do wide styled borders
#DEFINE   pc_Interiors  128 // Can do interiors

// Polygonal Capabilities


#DEFINE   cp_None       0   // No clipping of output
#DEFINE   cp_Rectangle  1   // Output clipped to rects
#DEFINE   cp_Region     2   // imported from WIN31.SH was 0x0002

// Text Capabilities


#DEFINE   tc_op_Character 0x0001  // Can do OutputPrecision   CHARACTER
#DEFINE   tc_op_Stroke    0x0002  // Can do OutputPrecision   STROKE
#DEFINE   tc_cp_Stroke    0x0004  // Can do ClipPrecision     STROKE
#DEFINE   tc_cr_90        0x0008  // Can do CharRotAbility    90
#DEFINE   tc_cr_Any       0x0010  // Can do CharRotAbility    ANY
#DEFINE   tc_sf_X_YIndep  0x0020  // Can do ScaleFreedom      X_YINDEPENDENT
#DEFINE   tc_sa_Double    0x0040  // Can do ScaleAbility      DOUBLE
#DEFINE   tc_sa_Integer   0x0080  // Can do ScaleAbility      int16
#DEFINE   tc_sa_Contin    0x0100  // Can do ScaleAbility      CONTINUOUS
#DEFINE   tc_ea_Double    0x0200  // Can do EmboldenAbility   DOUBLE
#DEFINE   tc_ia_Able      0x0400  // Can do ItalisizeAbility  ABLE
#DEFINE   tc_ua_Able      0x0800  // Can do UnderlineAbility  ABLE
#DEFINE   tc_so_Able      0x1000  // Can do StrikeOutAbility  ABLE
#DEFINE   tc_ra_Able      0x2000  // Can do RasterFontAble    ABLE
#DEFINE   tc_va_Able      0x4000  // Can do VectorFontAble    ABLE
#DEFINE   tc_Reserved     0x8000

// Raster Capabilities


#DEFINE   rc_BitBlt       0x0001      // Can do standard Blt.
#DEFINE   rc_Banding      0x0002      // Device requires banding support
#DEFINE   rc_Scaling      0x0004      // Device requires scaling support
#DEFINE   rc_Bitmap64     0x0008      // Device can support >64K bitmap
#DEFINE   rc_GDI20_Output 0x0010      // has 2.0 output calls
#DEFINE   rc_GDI20_State  0x0020      // Imported from WIN31.SH
#DEFINE   rc_SaveBitmap   0x0040      // Imported from WIN31.SH
#DEFINE   rc_Di_Bitmap    0x0080      // supports DIB to memory
#DEFINE   rc_Palette      0x0100      // supports a palette
#DEFINE   rc_DIBToDev     0x0200      // supports DIBitsToDevice
#DEFINE   rc_BigFont      0x0400      // supports >64K fonts
#DEFINE   rc_StretchBlt   0x0800      // supports StretchBlt
#DEFINE   rc_FloodFill    0x1000      // supports FloodFill
#DEFINE   rc_StretchDIB   0x2000      // supports StretchDIBits
#DEFINE   rc_OP_DX_Output 0x4000      // Imported from WIN31.SH
#DEFINE   rc_DevBits      0x8000      // Imported from WIN31.SH
// Palette entry flags


#DEFINE   pc_Reserved 0x01    // palette index used for animation
#DEFINE   pc_Explicit 0x02    // palette index is explicit to device
#DEFINE   pc_NoCollapse 0x04   // do not match color to system palette

// DIB color table identifiers


#DEFINE   DIB_RGB_Colors 0       // color table in RGBTriples
#DEFINE   DIB_Pal_Colors 1       // color table in palette indices

// Constants for Get/SetSystemPaletteUse


#DEFINE   syspal_Static   1
#DEFINE   syspal_NoStatic 2

// constants for CreateDIBitmap


#DEFINE   cbm_Init  0x04    // initialize bitmap


// Indices in FontMapperWeights array


#DEFINE   PCharSet           0
#DEFINE   POutPrecisMismatch 1
#DEFINE   PPitchFixed        2
#DEFINE   PFaceName          3
#DEFINE   PFamily            4
#DEFINE   PFamilyUnknown     5
#DEFINE   PHeightBigger      6
#DEFINE   PPitchVariable     7
#DEFINE   PFHeightSmaller    8
#DEFINE   PFHeightBigger     9
#DEFINE   PFWidth            10
#DEFINE   PSizeSynth         11
#DEFINE   PFUnevenSizeSynth  12
#DEFINE   PFIntSizeSynth     13
#DEFINE   PFAspect           14
#DEFINE   PItalic            15
#DEFINE   PFWeight           16
#DEFINE   PUnderline         17
#DEFINE   PStrikeOut         18
#DEFINE   PDefaultPitchFixed 19
#DEFINE   PFVHeightSmaller   20
#DEFINE   PFVHeightBigger    21
#DEFINE   DeviceFavor        22
#DEFINE   PFWeightNumer      23
#DEFINE   PFWeightDenom      24

// DrawText Format Flags


#DEFINE   dt_Top             0x0000
#DEFINE   dt_Left            0x0000
#DEFINE   dt_Center          0x0001
#DEFINE   dt_Right           0x0002
#DEFINE   dt_VCenter         0x0004
#DEFINE   dt_Bottom          0x0008
#DEFINE   dt_WordBreak       0x0010
#DEFINE   dt_SingleLine      0x0020
#DEFINE   dt_ExpandTabs      0x0040
#DEFINE   dt_TabStop         0x0080
#DEFINE   dt_NoClip          0x0100
#DEFINE   dt_ExternalLeading 0x0200
#DEFINE   dt_CalcRect        0x0400
#DEFINE   dt_NoPrefix        0x0800
#DEFINE   dt_Internal        0x1000

// ExtFloodFill style flags


#DEFINE   FloodFillBorder  0
#DEFINE   FloodFillSurface 1

//--------------------------------------------------------------------------
//      USER Section
//--------------------------------------------------------------------------

// Scroll Bar Constants


#DEFINE   sb_HORZ 0
#DEFINE   sb_VERT 1
#DEFINE   sb_CTL  2
#DEFINE   sb_BOTH 3

// Scroll Bar Commands


#DEFINE   sb_LineUp        0
#DEFINE   sb_LineDown      1
#DEFINE   sb_PageUp        2
#DEFINE   sb_PageDown      3
#DEFINE   sb_ThumbPosition 4
#DEFINE   sb_ThumbTrack    5
#DEFINE   sb_Top           6
#DEFINE   sb_Bottom        7
#DEFINE   sb_EndScroll     8

#DEFINE   sb_LineLeft   0
#DEFINE   sb_LineRight  1
#DEFINE   sb_PageLeft   2
#DEFINE   sb_PageRight  3
#DEFINE   sb_Left       6
#DEFINE   sb_Right      7

// ShowWindow Commands


#DEFINE   sw_Hide            0
#DEFINE   sw_ShowNormal      1
#DEFINE   sw_Normal          1
#DEFINE   sw_ShowMinimized   2
#DEFINE   sw_ShowMaximized   3
#DEFINE   sw_Maximize        3
#DEFINE   sw_ShowNoActivate  4
#DEFINE   sw_Show            5
#DEFINE   sw_Minimize        6
#DEFINE   sw_ShowMinNoActive 7
#DEFINE   sw_ShowNA          8
#DEFINE   sw_Restore         9

// WM_SHOWWINDOW wParam codes

#DEFINE   sw_OtherMaximized   2       //Imported from WIN31.SH
#DEFINE   sw_OtherRestored    4       //Imported from WIN31.SH

#DEFINE   sw_ScrollChildren   0x0001  // Scroll children within *lprcScroll.  //Imported from WIN31.SH
#DEFINE   sw_Invalidate       0x0002  // Invalidate after scrolling           //Imported from WIN31.SH
#DEFINE   sw_Erase            0x0004  // If sw_Invalidate, don't send wm_EraseBackground  //Imported from WIN31.SH


// Old ShowWindow Commands


#DEFINE   hide_Window         0
#DEFINE   show_OpenWindow     1
#DEFINE   show_IconWindow     2
#DEFINE   show_FullScreen     3
#DEFINE   show_OpenNoActivate 4

// Identifiers for the wm_ShowWindow message


#DEFINE   sw_ParentClosing 1
#DEFINE   sw_OtherZoom     2
#DEFINE   sw_ParentOpening 3
#DEFINE   sw_OtherUnzoom   4

// Region Flags


#DEFINE   Error         0
#DEFINE   NullRegion    1
#DEFINE   SimpleRegion  2
#DEFINE   ComplexRegion 3

// CombineRgn Styles


#DEFINE   Rgn_And  1
#DEFINE   Rgn_Or   2
#DEFINE   Rgn_Xor  3
#DEFINE   Rgn_Diff 4
#DEFINE   Rgn_Copy 5

// Virtual Keys, Standard Set


#DEFINE   vk_LButton   0x01
#DEFINE   vk_RButton   0x02
#DEFINE   vk_Cancel    0x03
#DEFINE   vk_MButton   0x04   // NOT contiguous with L & RBUTTON
#DEFINE   vk_Back      0x08
#DEFINE   vk_Tab       0x09
#DEFINE   vk_Clear     0x0C
#DEFINE   vk_Return    0x0D
#DEFINE   vk_Shift     0x10
#DEFINE   vk_Control   0x11
#DEFINE   vk_Menu      0x12
#DEFINE   vk_Pause     0x13
#DEFINE   vk_Capital   0x14
#DEFINE   vk_Escape    0x1B
#DEFINE   vk_Space     0x20
#DEFINE   vk_Prior     0x21
#DEFINE   vk_Next      0x22
#DEFINE   vk_End       0x23
#DEFINE   vk_Home      0x24
#DEFINE   vk_Left      0x25
#DEFINE   vk_Up        0x26
#DEFINE   vk_Right     0x27
#DEFINE   vk_Down      0x28
#DEFINE   vk_Select    0x29
#DEFINE   vk_Print     0x2A
#DEFINE   vk_Execute   0x2B
#DEFINE   vk_SnapShot  0x2C
// vk_Copy      = $2C not used by keyboards
#DEFINE   vk_Insert    0x2D
#DEFINE   vk_Delete    0x2E
#DEFINE   vk_Help      0x2F
// vk_A thru vk_Z are the same as their ASCII equivalents: 'A' thru 'Z'
// vk_0 thru vk_9 are the same as their ASCII equivalents: '0' thru '9'
#DEFINE   vk_NumPad0   0x60
#DEFINE   vk_NumPad1   0x61
#DEFINE   vk_NumPad2   0x62
#DEFINE   vk_NumPad3   0x63
#DEFINE   vk_NumPad4   0x64
#DEFINE   vk_NumPad5   0x65
#DEFINE   vk_NumPad6   0x66
#DEFINE   vk_NumPad7   0x67
#DEFINE   vk_NumPad8   0x68
#DEFINE   vk_NumPad9   0x69
#DEFINE   vk_Multiply  0x6A
#DEFINE   vk_Add       0x6B
#DEFINE   vk_Separator 0x6C
#DEFINE   vk_Subtract  0x6D
#DEFINE   vk_Decimal   0x6E
#DEFINE   vk_Divide    0x6F
#DEFINE   vk_F1        0x70
#DEFINE   vk_F2        0x71
#DEFINE   vk_F3        0x72
#DEFINE   vk_F4        0x73
#DEFINE   vk_F5        0x74
#DEFINE   vk_F6        0x75
#DEFINE   vk_F7        0x76
#DEFINE   vk_F8        0x77
#DEFINE   vk_F9        0x78
#DEFINE   vk_F10       0x79
#DEFINE   vk_F11       0x7A
#DEFINE   vk_F12       0x7B
#DEFINE   vk_F13       0x7C
#DEFINE   vk_F14       0x7D
#DEFINE   vk_F15       0x7E
#DEFINE   vk_F16       0x7F
#DEFINE   vk_F17       0x80     //Imported from WIN31.SH
#DEFINE   vk_F18       0x81     //Imported from WIN31.SH
#DEFINE   vk_F19       0x82     //Imported from WIN31.SH
#DEFINE   vk_F20       0x83     //Imported from WIN31.SH
#DEFINE   vk_F21       0x84     //Imported from WIN31.SH
#DEFINE   vk_F22       0x85     //Imported from WIN31.SH
#DEFINE   vk_F23       0x86     //Imported from WIN31.SH
#DEFINE   vk_F24       0x87     //Imported from WIN31.SH
#DEFINE   vk_NumLock   0x90
#DEFINE   vk_Scroll    0x91     //Imported from WIN31.SH

#IFDEF POINTER_SUPPORT // This stuff can't be done yet since no pointers.
// SetWindowsHook codes

#DEFINE   wh_MsgFilter       (-1)
#DEFINE   wh_JournalRecord   0
#DEFINE   wh_JournalPlayback 1
#DEFINE   wh_Keyboard        2
#DEFINE   wh_GetMessage      3
#DEFINE   wh_CallWndProc     4
#DEFINE   wh_CBT             5
#DEFINE   wh_SysMsgFilter    6
#DEFINE   wh_WindowMgr       7
#DEFINE   wh_Mouse        7     //Imported from WIN31.SH
#DEFINE   wh_Hardware     8     //Imported from WIN31.SH
#DEFINE   wh_Debug        9     //Imported from WIN31.SH
#DEFINE   wh_Shell        10    //Imported from WIN31.SH


// Hook Codes
#DEFINE   hc_LPLPFnNext  (-2)
#DEFINE   hc_LPFnNext    (-1)
#DEFINE   hc_Action      0
#DEFINE   hc_GetNext     1
#DEFINE   hc_Skip        2
#DEFINE   hc_NoRem       3
#DEFINE   hc_NoRemove    3
#DEFINE   hc_SysModalOn  4
#DEFINE   hc_SysModalOff 5

// wh_MSGFILTER Filter Proc Codes


#DEFINE   msgf_DialogBox  0
#DEFINE   msgf_MessageBox 1
#DEFINE   msgf_Menu       2
#DEFINE   msgf_Move       3
#DEFINE   msgf_Size       4
#DEFINE   msgf_ScrollBar  5
#DEFINE   msgf_NextWindow 6

// CallMsgFilter() and WH_SYS/MSGFILTER context codes

#DEFINE   msgf_MainLoop   8         //Imported from WIN31.SH
#DEFINE   msgf_User       4096      //Imported from WIN31.SH

// Window Manager Hook Codes


#DEFINE   wc_Init          1
#DEFINE   wc_SWP           2
#DEFINE   wc_DefWindowProc 3
#DEFINE   wc_MinMax        4
#DEFINE   wc_Move          5
#DEFINE   wc_Size          6
#DEFINE   wc_DrawCaption   7

// Message Structure used in Journaling


#endif
// #DEFINE PEventMsg   *TEventMsg
#DEFINE PEventMsg   POINTER
structure TEventMsg
{
		Word message;
		Word paramL;
		Word paramH;
		int time;        // was LongInt but CMACW doesn't like it, thus we use int
}

#ifdef POINTER_SUPPORT
// #DEFINE PWndClass   *TWndClass
#DEFINE PWndClass POINTER
structure TWndClass
{
		Word      style;
		TFarProc  lpfnWndProc;   TFarProc not supported, thus we use int
		int       lpfnWndProc;
		int16     cbClsExtra;
		int16     cbWndExtra;
		THandle   hInstance;
		HIcon     _hIcon;                       // Name clash
		HCursor   _hCursor;                   // Name clash
		HBrush    hbrBackground;
		PChar     lpszMenuName;   PChar not supported, thus we use int
		PChar     lpszClassName;  PChar not supported, thus we use int
}
#endif

// Message structure


// #DEFINE PMsg    *TMsg
#DEFINE PMsg POINTER
structure TMsg
{
		HWnd  hwnd;
		Word  message;
		Word  wParam;
		int   lParam;  // was LongInt but it's not supported, thus we use int
		int   time;    // was LongInt but it's not supported, thus we use int
		_Tpoint;
//    TPoint pt;                   NOT YET SUPPORTED, SEE PREVIOUS
}


// Window field offsets for GetWindowLong and GetWindowWord


#DEFINE   gwl_WndProc    (-4)
#DEFINE   gww_HInstance  (-6)
#DEFINE   gww_HWndParent (-8)
#DEFINE   gww_ID         (-12)
#DEFINE   gwl_Style      (-16)
#DEFINE   gwl_EXStyle    (-20)

// Class field offsets for GetClassLong and GetClassWord


#DEFINE   gcl_MenuName      (-8)
#DEFINE   gcw_HBRBackGround (-10)
#DEFINE   gcw_HCursor       (-12)
#DEFINE   gcw_HIcon         (-14)
#DEFINE   gcw_HModule       (-16)
#DEFINE   gcw_CBWndExtra    (-18)
#DEFINE   gcw_CBClsExtra    (-20)
#DEFINE   gcl_WndProc       (-24)
#DEFINE   gcw_Style         (-26)
#DEFINE   gcw_Atom          (-32)   //Imported from WIN31.SH

// Window Messages


#DEFINE   wm_Null             0x0000
#DEFINE   wm_Create           0x0001
#DEFINE   wm_Destroy          0x0002
#DEFINE   wm_Move             0x0003
#DEFINE   wm_Size             0x0005
#DEFINE   wm_Activate         0x0006
#DEFINE   wm_SetFocus         0x0007
#DEFINE   wm_KillFocus        0x0008
#DEFINE   wm_Enable           0x000A
#DEFINE   wm_SetRedraw        0x000B
#DEFINE   wm_SetText          0x000C
#DEFINE   wm_GetText          0x000D
#DEFINE   wm_GetTextLength    0x000E
#DEFINE   wm_Paint            0x000F
#DEFINE   wm_Close            0x0010
#DEFINE   wm_QueryEndSession  0x0011
#DEFINE   wm_Quit             0x0012
#DEFINE   wm_QueryOpen        0x0013
#DEFINE   wm_EraseBkGnd       0x0014
#DEFINE   wm_SysColorChange   0x0015
#DEFINE   wm_EndSession       0x0016
#DEFINE   wm_ShowWindow       0x0018
#DEFINE   wm_CtlColor         0x0019
#DEFINE   wm_WinIniChange     0x001A
#DEFINE   wm_DevModeChange    0x001B
#DEFINE   wm_ActivateApp      0x001C
#DEFINE   wm_FontChange       0x001D
#DEFINE   wm_TimeChange       0x001E
#DEFINE   wm_CancelMode       0x001F
#DEFINE   wm_SetCursor        0x0020
#DEFINE   wm_MouseActivate    0x0021
#DEFINE   wm_ChildActivate    0x0022
#DEFINE   wm_QueueSync        0x0023
#DEFINE   wm_GetMinMaxInfo    0x0024
#DEFINE   wm_PaintIcon        0x0026
#DEFINE   wm_IconEraseBkGnd   0x0027
#DEFINE   wm_NextDlgCtl       0x0028
#DEFINE   wm_SpoolerStatus    0x002A
#DEFINE   wm_DrawItem         0x002B
#DEFINE   wm_MeasureItem      0x002C
#DEFINE   wm_DeleteItem       0x002D
#DEFINE   wm_VKeyToItem       0x002E
#DEFINE   wm_CharToItem       0x002F
#DEFINE   wm_SetFont          0x0030
#DEFINE   wm_GetFont          0x0031
#DEFINE   wm_QueryDragIcon    0x0037
#DEFINE   wm_CompareItem      0x0039
#DEFINE   wm_Compacting       0x0041

#DEFINE   wm_NCCreate         0x0081
#DEFINE   wm_NCDestroy        0x0082
#DEFINE   wm_NCCalcSize       0x0083
#DEFINE   wm_NCHitTest        0x0084
#DEFINE   wm_NCPaint          0x0085
#DEFINE   wm_NCActivate       0x0086
#DEFINE   wm_GetDlgCode       0x0087
#DEFINE   wm_NCMouseMove      0x00A0
#DEFINE   wm_NCLButtonDown    0x00A1
#DEFINE   wm_NCLButtonUp      0x00A2
#DEFINE   wm_NCLButtonDblClk  0x00A3
#DEFINE   wm_NCRButtonDown    0x00A4
#DEFINE   wm_NCRButtonUp      0x00A5
#DEFINE   wm_NCRButtonDblClk  0x00A6
#DEFINE   wm_NCMButtonDown    0x00A7
#DEFINE   wm_NCMButtonUp      0x00A8
#DEFINE   wm_NCMButtonDblClk  0x00A9

#DEFINE   wm_KeyFirst         0x0100
#DEFINE   wm_KeyDown          0x0100
#DEFINE   wm_KeyUp            0x0101
#DEFINE   wm_Char             0x0102
#DEFINE   wm_DeadChar         0x0103
#DEFINE   wm_SysKeyDown       0x0104
#DEFINE   wm_SysKeyUp         0x0105
#DEFINE   wm_SysChar          0x0106
#DEFINE   wm_SysDeadChar      0x0107
#DEFINE   wm_KeyLast          0x0108

#DEFINE   wm_InitDialog       0x0110
#DEFINE   wm_Command          0x0111
#DEFINE   wm_SysCommand       0x0112
#DEFINE   wm_Timer            0x0113
#DEFINE   wm_HScroll          0x0114
#DEFINE   wm_VScroll          0x0115
#DEFINE   wm_InitMenu         0x0116
#DEFINE   wm_InitMenuPopup    0x0117
#DEFINE   wm_MenuSelect       0x011F
#DEFINE   wm_MenuChar         0x0120
#DEFINE   wm_EnterIdle        0x0121


#DEFINE   wm_MouseFirst       0x0200
#DEFINE   wm_MouseMove        0x0200
#DEFINE   wm_LButtonDown      0x0201
#DEFINE   wm_LButtonUp        0x0202
#DEFINE   wm_LButtonDblClk    0x0203
#DEFINE   wm_RButtonDown      0x0204
#DEFINE   wm_RButtonUp        0x0205
#DEFINE   wm_RButtonDblClk    0x0206
#DEFINE   wm_MButtonDown      0x0207
#DEFINE   wm_MButtonUp        0x0208
#DEFINE   wm_MButtonDblClk    0x0209
#DEFINE   wm_MouseLast        0x0209

#DEFINE   wm_ParentNotify     0x0210
#DEFINE   wm_MDICreate        0x0220
#DEFINE   wm_MDIDestroy       0x0221
#DEFINE   wm_MDIActivate      0x0222
#DEFINE   wm_MDIRestore       0x0223
#DEFINE   wm_MDINext          0x0224
#DEFINE   wm_MDIMaximize      0x0225
#DEFINE   wm_MDITile          0x0226
#DEFINE   wm_MDICascade       0x0227
#DEFINE   wm_MDIIconArrange   0x0228
#DEFINE   wm_MDIGetActive     0x0229
#DEFINE   wm_MDISetMenu       0x0230

#DEFINE   wm_Cut              0x0300
#DEFINE   wm_Copy             0x0301
#DEFINE   wm_Paste            0x0302
#DEFINE   wm_Clear            0x0303
#DEFINE   wm_Undo             0x0304
#DEFINE   wm_RenderFormat     0x0305
#DEFINE   wm_RenderAllFormats 0x0306
#DEFINE   wm_DestroyClipboard 0x0307
#DEFINE   wm_DrawClipboard    0x0308
#DEFINE   wm_PaintClipboard   0x0309
#DEFINE   wm_VScrollClipboard 0x030A
#DEFINE   wm_SizeClipboard    0x030B
#DEFINE   wm_AskCBFormatName  0x030C
#DEFINE   wm_ChangeCBChain    0x030D
#DEFINE   wm_HScrollClipboard 0x030E
#DEFINE   wm_QueryNewPalette  0x030F
#DEFINE   wm_PaletteIsChanging 0x0310
#DEFINE   wm_PaletteChanged   0x0311


// WINDOWS 3.1 Messages

#DEFINE   wm_CommNotify         0x0044      //Imported from WIN31.SH

#DEFINE   wm_WindowPosChanging  0x0046      //Imported from WIN31.SH
#DEFINE   wm_WindowPosChanged   0x0047      //Imported from WIN31.SH
#DEFINE   wm_DropFiles          0x0233      //Imported from WIN31.SH

#DEFINE   wm_PenWinFirst        0x0380      //Imported from WIN31.SH
#DEFINE   wm_PenWinLast         0x038F      //Imported from WIN31.SH

#DEFINE   wm_Coalesce_First     0x0390      //Imported from WIN31.SH
#DEFINE   wm_Coalesce_Last      0x039F      //Imported from WIN31.SH

// NOTE: All Message Numbers below 0x0400 are RESERVED

// Private Window Messages Start Here

#DEFINE   wm_User               0x0400

// wm_SYNCTASK Commands


#DEFINE   st_BeginSwp 0
#DEFINE   st_EndSwp   1

// WinWhere Area Codes


#DEFINE   htError       (-2)
#DEFINE   htTransparent (-1)
#DEFINE   htNoWhere     0
#DEFINE   htClient      1
#DEFINE   htCaption     2
#DEFINE   htSysMenu     3
#DEFINE   htGrowBox     4
#DEFINE   htSize        htGrowBox
#DEFINE   htMenu        5
#DEFINE   htHScroll     6
#DEFINE   htVScroll     7
#DEFINE   htReduce      8
#DEFINE   htZoom        9
#DEFINE   htLeft        10
#DEFINE   htRight       11
#DEFINE   htTop         12
#DEFINE   htTopLeft     13
#DEFINE   htTopRight    14
#DEFINE   htBottom      15
#DEFINE   htBottomLeft  16
#DEFINE   htBottomRight 17
#DEFINE   htSizeFirst   htLeft
#DEFINE   htSizeLast    htBottomRight

// wm_MouseActivate Return Codes


#DEFINE   ma_Activate         1
#DEFINE   ma_ActivateAndEat   2
#DEFINE   ma_NoActivate       3
#DEFINE   ma_NOActivateAndEat 4   //Imported from WIN31.SH


// Size Message Commands


#DEFINE   sizeNormal     0
#DEFINE   sizeIconic     1
#DEFINE   sizeFullScreen 2
#DEFINE   sizeZoomShow   3
#DEFINE   sizeZoomHide   4

// Key State Masks for Mouse Messages


#DEFINE   mk_LButton 0x0001
#DEFINE   mk_RButton 0x0002
#DEFINE   mk_Shift   0x0004
#DEFINE   mk_Control 0x0008
#DEFINE   mk_MButton 0x0010

// Window Styles


#DEFINE   ws_Overlapped   0x00000000
#DEFINE   ws_Popup        0x80000000
#DEFINE   ws_Child        0x40000000
#DEFINE   ws_Minimize     0x20000000
#DEFINE   ws_Visible      0x10000000
#DEFINE   ws_Disabled     0x08000000
#DEFINE   ws_ClipSiblings 0x04000000
#DEFINE   ws_ClipChildren 0x02000000
#DEFINE   ws_Maximize     0x01000000
#DEFINE   ws_Caption      0x00C00000    // ws_Border + ws_DlgFrame
#DEFINE   ws_Border       0x00800000
#DEFINE   ws_DlgFrame     0x00400000
#DEFINE   ws_VScroll      0x00200000
#DEFINE   ws_HScroll      0x00100000
#DEFINE   ws_SysMenu      0x00080000
#DEFINE   ws_ThickFrame   0x00040000
#DEFINE   ws_Group        0x00020000
#DEFINE   ws_TabStop      0x00010000


#DEFINE   ws_MinimizeBox 0x00020000
#DEFINE   ws_MaximizeBox 0x00010000


#DEFINE   ws_Tiled   ws_Overlapped
#DEFINE   ws_Iconic  ws_Minimize
#DEFINE   ws_SizeBox ws_ThickFrame

// Common Window Styles


#DEFINE   ws_OverlappedWindow ws_Overlapped + ws_Caption + ws_SysMenu + ws_ThickFrame + ws_MinimizeBox + ws_MaximizeBox
#DEFINE   ws_PopupWindow      ws_Popup + ws_Border + ws_SysMenu
#DEFINE   ws_ChildWindow      ws_Child
#DEFINE   ws_TiledWindow      ws_OverlappedWindow

// Extended Window Styles


#DEFINE   ws_ex_DlgModalFrame  0x00000001
#DEFINE   ws_ex_NoParentNotify 0x00000004
#DEFINE   ws_ex_TopMost        0x00000008     //Imported from WIN31.SH
#DEFINE   ws_ex_AcceptFiles    0x00000010     //Imported from WIN31.SH
#DEFINE   ws_ex_Transparent    0x00000020     //Imported from WIN31.SH

// Class styles


#DEFINE   cs_VRedraw         0x0001
#DEFINE   cs_HRedraw         0x0002
#DEFINE   cs_KeyCvtWindow    0x0004
#DEFINE   cs_DblClks         0x0008
#DEFINE   cs_OwnDC           0x0020
#DEFINE   cs_ClassDC         0x0040
#DEFINE   cs_ParentDC        0x0080
#DEFINE   cs_NoKeyCvt        0x0100
#DEFINE   cs_NoClose         0x0200
#DEFINE   cs_SaveBits        0x0800
#DEFINE   cs_ByteAlignClient 0x1000
#DEFINE   cs_ByteAlignWindow 0x2000
#DEFINE   cs_GlobalClass     0x4000   // Global window class

// Predefined Clipboard Formats


#DEFINE   cf_Text         1
#DEFINE   cf_Bitmap       2
#DEFINE   cf_MetaFilePict 3
#DEFINE   cf_SYLK         4
#DEFINE   cf_DIF          5
#DEFINE   cf_TIFF         6
#DEFINE   cf_OEMText      7
#DEFINE   cf_DIB          8
#DEFINE   cf_Palette      9
#DEFINE   cf_PenData      10      //Imported from WIN31.SH
#DEFINE   cf_RIFF         11      //Imported from WIN31.SH
#DEFINE   cf_Wave         12      //Imported from WIN31.SH


#DEFINE   cf_OwnerDisplay    0x0080
#DEFINE   cf_DSPText         0x0081
#DEFINE   cf_DSPBitmap       0x0082
#DEFINE   cf_DSPMetaFilePict 0x0083

// "Private" formats don't get GlobalFree'd


#DEFINE   cf_PrivateFirst 0x0200
#DEFINE   cf_PrivateLast  0x02FF

// "GDIOBJ" formats do get DeleteObject'd


#DEFINE   cf_GDIObjFirst 0x0300
#DEFINE   cf_GDIObjLast  0x03FF


// #DEFINE PPaintStruct    *TPaintStruct
#DEFINE PPaintStruct POINTER
structure TPaintStruct
{
		HDC hdc;
		Bool fErase;
		_Trect;
//    TRect rcPaint;  NOT YET SUPPORTED, SEE ABOVE
		Bool fRestore;
		Bool fIncUpdate;
		 Byte rgbReserved[16];
}

#ifdef POINTER_SUPPORT
//#DEFINE PCreateStruct   *TCreateStruct
#DEFINE PCreateStruct   POINTER
structure TCreateStruct
{
		PChar lpCreateParams;  PChar not supported, thus we use int
		THandle hInstance;
		THandle hMenu;
		HWnd    hwndParent;
		int16   cy;
		int16   cx;
		int16   y;
		int16   x;
		int     style;  // was LongInt but it's not supported, thus we use int
		PChar   lpszName;  PChar not supported, thus we use int
		int     lpszName;
		PChar   lpszClass;  PChar not supported, thus we use int
		int     lpszClass;
		int     dwExStyle;   // Was LongInt but it's not supported, thus we use int
}
#ENDIF
// Owner draw control types


#DEFINE   odt_Menu     1
#DEFINE   odt_ListBox  2
#DEFINE   odt_ComboBox 3
#DEFINE   odt_Button   4

// Owner draw actions


#DEFINE   oda_DrawEntire 0x0001
#DEFINE   oda_Select     0x0002
#DEFINE   oda_Focus      0x0004

// Owner draw state


#DEFINE   ods_Selected 0x0001
#DEFINE   ods_Grayed   0x0002
#DEFINE   ods_Disabled 0x0004
#DEFINE   ods_Checked  0x0008
#DEFINE   ods_Focus    0x0010

// TMeasureItemStruct for ownerdraw


//#DEFINE PMeasureItemStruct    *TMeasureItemStruct
#DEFINE PMeasureItemStruct    POINTER
structure TMeasureItemStruct
{
		Word CtlType;
		Word CtlID;
		Word itemID;
		Word itemWidth;
		Word itemHeight;
		int itemData;  // was LongInt but it's not supported, thus we use int
}

// TDrawItemStruct for ownerdraw


//#DEFINE PDrawItemStruct   *TDrawItemStruct
#DEFINE PDrawItemStruct   POINTER
structure TDrawItemStruct
{
		Word CtlType;
		Word CtlID;
		Word itemID;
		Word itemAction;
		Word itemState;
		HWnd hwndItem;
		HDC hDC;
		_Trect;
//    TRect rcItem;   NOT YET SUPPORTED, SEE ABOVE
		int itemData;  //was LongInt but it's not supported, thus we use int
}

// TDeleteItemStruct for ownerdraw


//#DEFINE PDeleteItemStruct   *TDeleteItemStruct
#DEFINE PDeleteItemStruct   POINTER
structure TDeleteItemStruct
{
		Word CtlType;
		Word CtlID;
		Word itemID;
		HWnd hwndItem;
		int itemData;  //was LongInt but it's not supported, thus we use int
}

// TCompareItemStruct for ownerdraw sorting


//#DEFINE PCompareItemStruct    *TCompareItemStruct
#DEFINE PCompareItemStruct    POINTER
structure TCompareItemStruct
{
		Word CtlType;
		Word CtlID;
		HWnd hwndItem;
		Word itemID1;
		int itemData1;  //was LongInt but it's not supported, thus we use int
		Word itemID2;
		int itemData2;  //was LongInt but it's not supported, thus we use int
}

// PeekMessage Options


#DEFINE   pm_NoRemove 0x0000
#DEFINE   pm_Remove   0x0001
#DEFINE   pm_NoYield  0x0002


#DEFINE   cw_UseDefault int16(0x8000)

// SetWindowPos Flags


#DEFINE   swp_NoSize       0x0001
#DEFINE   swp_NoMove       0x0002
#DEFINE   swp_NoZOrder     0x0004
#DEFINE   swp_NoRedraw     0x0008
#DEFINE   swp_NoActivate   0x0010
#DEFINE   swp_DrawFrame    0x0020
#DEFINE   swp_ShowWindow   0x0040
#DEFINE   swp_HideWindow   0x0080
#DEFINE   swp_NoCopyBits   0x0100
#DEFINE   swp_NoReposition 0x0200
//Imported from WIN31.SH
#DEFINE   swp_FrameChanged    0x0020      //Imported from WIN31.SH
#DEFINE   swp_NoOwnerZOrder   0x0200      //Imported from WIN31.SH
#DEFINE   swp_NoSendChanging  0x0400      //Imported from WIN31.SH
#DEFINE   swp_DeferErase      0x2000      //Imported from WIN31.SH


#DEFINE   DlgWindowExtra 30  // Window extra byted for private dialog classes

// GetSystemMetrics codes


#DEFINE   sm_CXScreen      0
#DEFINE   sm_CYScreen      1
#DEFINE   sm_CXVScroll     2
#DEFINE   sm_CYHScroll     3
#DEFINE   sm_CYCaption     4
#DEFINE   sm_CXBorder      5
#DEFINE   sm_CYBorder      6
#DEFINE   sm_CXDlgFrame    7
#DEFINE   sm_CYDlgFrame    8
#DEFINE   sm_CYVThumb      9
#DEFINE   sm_CXHThumb      10
#DEFINE   sm_CXIcon        11
#DEFINE   sm_CYIcon        12
#DEFINE   sm_CXCursor      13
#DEFINE   sm_CYCursor      14
#DEFINE   sm_CYMenu        15
#DEFINE   sm_CXFullScreen  16
#DEFINE   sm_CYFullScreen  17
#DEFINE   sm_CYKanjiWindow 18
#DEFINE   sm_MousePresent  19
#DEFINE   sm_CYVScroll     20
#DEFINE   sm_CXHScroll     21
#DEFINE   sm_Debug         22
#DEFINE   sm_SwapButton    23
#DEFINE   sm_Reserved1     24
#DEFINE   sm_Reserved2     25
#DEFINE   sm_Reserved3     26
#DEFINE   sm_Reserved4     27
#DEFINE   sm_CXMin         28
#DEFINE   sm_CYMin         29
#DEFINE   sm_CXSize        30
#DEFINE   sm_CYSize        31
#DEFINE   sm_CXFrame       32
#DEFINE   sm_CYFrame       33
#DEFINE   sm_CXMinTrack    34
#DEFINE   sm_CYMinTrack    35
//#DEFINE   sm_CMetrics      36
//Imported from WIN31.SH
#DEFINE   sm_CXDoubleClk        36      //Imported from WIN31.SH
#DEFINE   sm_CYDoubleClk        37      //Imported from WIN31.SH
#DEFINE   sm_CXIconSpacing      38      //Imported from WIN31.SH
#DEFINE   sm_CYIconSpacing      39      //Imported from WIN31.SH
#DEFINE   sm_MenuDropAlignment  40      //Imported from WIN31.SH
#DEFINE   sm_PenWindows         41      //Imported from WIN31.SH
#DEFINE   sm_DBCSEnabled        42      //Imported from WIN31.SH

#DEFINE   sm_CMetrics           43 // this overrides WINTYPES.PAS //Imported from WIN31.SH

// MessageBox Flags


#DEFINE   mb_Ok               0x0000
#DEFINE   mb_OkCancel         0x0001
#DEFINE   mb_AbortRetryIgnore 0x0002
#DEFINE   mb_YesNoCancel      0x0003
#DEFINE   mb_YesNo            0x0004
#DEFINE   mb_RetryCancel      0x0005

#DEFINE   mb_IconHand         0x0010
#DEFINE   mb_IconQuestion     0x0020
#DEFINE   mb_IconExclamation  0x0030
#DEFINE   mb_IconAsterisk     0x0040

#DEFINE   mb_IconInformation  mb_IconAsterisk
#DEFINE   mb_IconStop         mb_IconHand

#DEFINE   mb_DefButton1       0x0000
#DEFINE   mb_DefButton2       0x0100
#DEFINE   mb_DefButton3       0x0200

#DEFINE   mb_ApplModal        0x0000
#DEFINE   mb_SystemModal      0x1000
#DEFINE   mb_TaskModal        0x2000

#DEFINE   mb_NoFocus          0x8000

#DEFINE   mb_TypeMask         0x000F
#DEFINE   mb_IconMask         0x00F0
#DEFINE   mb_DefMask          0x0F00
#DEFINE   mb_ModeMask         0x3000
#DEFINE   mb_MiscMask         0xC000

// Color Types


#DEFINE   ctlcolor_MsgBox    0
#DEFINE   ctlcolor_Edit      1
#DEFINE   ctlcolor_ListBox   2
#DEFINE   ctlcolor_Btn       3
#DEFINE   ctlcolor_Dlg       4
#DEFINE   ctlcolor_ScrollBar 5
#DEFINE   ctlcolor_Static    6
#DEFINE   ctlcolor_Max       8    // three bits max


#DEFINE   color_ScrollBar       0
#DEFINE   color_Background      1
#DEFINE   color_ActiveCaption   2
#DEFINE   color_InactiveCaption 3
#DEFINE   color_Menu            4
#DEFINE   color_Window          5
#DEFINE   color_WindowFrame     6
#DEFINE   color_MenuText        7
#DEFINE   color_WindowText      8
#DEFINE   color_CaptionText     9
#DEFINE   color_ActiveBorder    10
#DEFINE   color_InactiveBorder  11
#DEFINE   color_AppWorkSpace    12
#DEFINE   color_Highlight       13
#DEFINE   color_HighlightText   14
#DEFINE   color_BtnFace         15
#DEFINE   color_BtnShadow       16
#DEFINE   color_GrayText        17
#DEFINE   color_BtnText         18
// the constant below was COLOR_INACTIVECAPTIONTEXT but conflicted with the
// constant COLOR_INACTIVECAPTION so we changed it a bit.
#DEFINE   color_InactiveTextCaption 19      //Imported from WIN31.SH
#DEFINE   color_BtnHighlight        20      //Imported from WIN31.SH
#DEFINE   color_EndColors       color_BtnText
// GetWindow Constants


#DEFINE   gw_HWndFirst 0
#DEFINE   gw_HWndLast  1
#DEFINE   gw_HWndNext  2
#DEFINE   gw_HWndPrev  3
#DEFINE   gw_Owner     4
#DEFINE   gw_Child     5

// Menu flags for Add/Check/EnableMenuItem


#DEFINE   mf_Insert          0x0000
#DEFINE   mf_Change          0x0080
#DEFINE   mf_Append          0x0100
#DEFINE   mf_Delete          0x0200
#DEFINE   mf_Remove          0x1000

#DEFINE   mf_ByCommand       0x0000
#DEFINE   mf_ByPosition      0x0400

#DEFINE   mf_Separator       0x0800

#DEFINE   mf_Enabled         0x0000
#DEFINE   mf_Grayed          0x0001
#DEFINE   mf_Disabled        0x0002

#DEFINE   mf_Unchecked       0x0000
#DEFINE   mf_Checked         0x0008
#DEFINE   mf_UseCheckBitmaps 0x0200

#DEFINE   mf_String          0x0000
#DEFINE   mf_Bitmap          0x0004
#DEFINE   mf_OwnerDraw       0x0100

#DEFINE   mf_Popup           0x0010
#DEFINE   mf_MenuBarBreak    0x0020
#DEFINE   mf_MenuBreak       0x0040

#DEFINE   mf_Unhilite        0x0000
#DEFINE   mf_Hilite          0x0080

#DEFINE   mf_SysMenu         0x2000
#DEFINE   mf_Help            0x4000
#DEFINE   mf_MouseSelect     0x8000


structure TMenuItemTemplateHeader
{
		Word versionNumber;
		Word offset;
}

structure TMenuItemTemplate
{
		Word mtOption;
		Word mtID;
		Char mtString[1];
}


#DEFINE   mf_End 0x0080

// System Menu Command Values


#DEFINE   sc_Size       0xF000
#DEFINE   sc_Move       0xF010
#DEFINE   sc_Minimize   0xF020
#DEFINE   sc_Maximize   0xF030
#DEFINE   sc_NextWindow 0xF040
#DEFINE   sc_PrevWindow 0xF050
#DEFINE   sc_Close      0xF060
#DEFINE   sc_VScroll    0xF070
#DEFINE   sc_HScroll    0xF080
#DEFINE   sc_MouseMenu  0xF090
#DEFINE   sc_KeyMenu    0xF100
#DEFINE   sc_Arrange    0xF110
#DEFINE   sc_Restore    0xF120
#DEFINE   sc_TaskList   0xF130
#DEFINE   sc_ScreenSave 0xF140      //Imported from WIN31.SH
#DEFINE   sc_Hotkey     0xF150      //Imported from WIN31.SH

#DEFINE   sc_Icon       sc_Minimize
#DEFINE   sc_Zoom       sc_Maximize

// Standard Cursor IDs


#DEFINE   idc_Arrow    MakeIntResource(32512)
#DEFINE   idc_IBeam    MakeIntResource(32513)
#DEFINE   idc_Wait     MakeIntResource(32514)
#DEFINE   idc_Cross    MakeIntResource(32515)
#DEFINE   idc_UPArrow  MakeIntResource(32516)
#DEFINE   idc_Size     MakeIntResource(32640)
#DEFINE   idc_Icon     MakeIntResource(32641)
#DEFINE   idc_SizeNWSE MakeIntResource(32642)
#DEFINE   idc_SizeNESW MakeIntResource(32643)
#DEFINE   idc_SizeWE   MakeIntResource(32644)
#DEFINE   idc_SizeNS   MakeIntResource(32645)


#DEFINE   ord_LangDriver 1  // Ordinal number of entry point of language drivers

// Standard Icon IDs


#DEFINE   idi_Application MakeIntResource(32512)
#DEFINE   idi_Hand        MakeIntResource(32513)
#DEFINE   idi_Question    MakeIntResource(32514)
#DEFINE   idi_Exclamation MakeIntResource(32515)
#DEFINE   idi_Asterisk    MakeIntResource(32516)


#DEFINE   cp_HWnd   0
#DEFINE   cp_Open   1
#DEFINE   cp_Direct 2

// VK from the keyboard driver


#DEFINE   vk_Kana     0x15
#DEFINE   vk_Romaji   0x16
#DEFINE   vk_Zenkaku  0x17
#DEFINE   vk_Hiragana 0x18
#DEFINE   vk_Kanji    0x19

// VK to send to Applications


#DEFINE   vk_Convert    0x1C
#DEFINE   vk_NonConvert 0x1D
#DEFINE   vk_Accept     0x1E
#DEFINE   vk_ModeChange 0x1F

#IFDEF KANJI

#DEFINE   knj_Start       0x01
#DEFINE   knj_End         0x02
#DEFINE   knj_Query       0x03

#DEFINE   knj_Learn_Mode  0x10
#DEFINE   knj_GetMode     0x11
#DEFINE   knj_SetMode     0x12

#DEFINE   knj_CodeConvert 0x20
#DEFINE   knj_Convert     0x21
#DEFINE   knj_Next        0x22
#DEFINE   knj_Previous    0x23
#DEFINE   knj_Accept      0x24

#DEFINE   knj_Learn       0x30
#DEFINE   knj_Register    0x31
#DEFINE   knj_Remove      0x32
#DEFINE   knj_Change_UDIC 0x33

// NOTE: Default        = 0
//       JIS1           = 1
//       JIS2           = 2
//       SJIS2          = 3
//       JIS1Katakana   = 4
//       SJIS2Hiragana  = 5
//       SJIS2Katakana  = 6
//       OEM            = F


#DEFINE   knj_JIS1toJIS1Katakana  0x14
#DEFINE   knj_JIS1toSJIS2         0x13
#DEFINE   knj_JIS1toSJIS2Hiragana 0x15
#DEFINE   knj_JIS1toSJIS2Katakana 0x16
#DEFINE   knj_JIS1toDefault       0x10
#DEFINE   knj_JIS1toSJIS2OEM      0x1F
#DEFINE   knj_JIS2toSJIS2         0x23
#DEFINE   knj_SJIS2toJIS2         0x32

#DEFINE   knj_md_Alpha            0x01
#DEFINE   knj_md_Hiragana         0x02
#DEFINE   knj_md_HALF             0x04
#DEFINE   knj_md_JIS              0x08
#DEFINE   knj_md_SPECIAL          0x10

#DEFINE   knj_cvt_Next            0x01
#DEFINE   knj_cvt_Prev            0x02
#DEFINE   knj_cvt_Katakana        0x03
#DEFINE   knj_cvt_Hiragana        0x04
#DEFINE   knj_cvt_JIS1            0x05
#DEFINE   knj_cvt_SJIS2           0x06
#DEFINE   knj_cvt_Default         0x07
#DEFINE   knj_cvt_Typed           0x08


//#DEFINE PKanjiStruct    *TKanjiStruct
#DEFINE PKanjiStruct    POINTER
structure TKanjiStruct
{
		int16 fnc;
		int16 wParam;
		PChar lpSource;  PChar not supported, thus we use int
		PChar lpDest;  PChar not supported, thus we use int
		int16 wCount;
		Pointer lpReserved1;  Pointer isn't supported thus we use int
		Pointer lpReserved2;  Pointer isn't supported thus we use int
}
#ENDIF

// Dialog Box Command IDs


#DEFINE   idOk     1
#DEFINE   idCancel 2
#DEFINE   idAbort  3
#DEFINE   idRetry  4
#DEFINE   idIgnore 5
#DEFINE   idYes    6
#DEFINE   idNo     7


#DEFINE   id_Ok     1
#DEFINE   id_Cancel 2
#DEFINE   id_Abort  3
#DEFINE   id_Retry  4
#DEFINE   id_Ignore 5
#DEFINE   id_Yes    6
#DEFINE   id_No     7

// Logical Font


// Control Manager Structures and Definitions

// Edit Control Styles
#DEFINE   es_Left        0x0000
#DEFINE   es_Center      0x0001
#DEFINE   es_Right       0x0002
#DEFINE   es_MultiLine   0x0004
#DEFINE   es_UpperCase   0x0008
#DEFINE   es_LowerCase   0x0010
#DEFINE   es_Password    0x0020
#DEFINE   es_AutoVScroll 0x0040
#DEFINE   es_AutoHScroll 0x0080
#DEFINE   es_NoHideSel   0x0100
#DEFINE   es_OEMConvert  0x0400
#DEFINE   es_ReadOnly    0x0800     //Imported from WIN31.SH
#DEFINE   es_WantReturn  0x1000     //Imported from WIN31.SH

// Edit Control Notification Codes


#DEFINE   en_SetFocus  0x0100
#DEFINE   en_KillFocus 0x0200
#DEFINE   en_Change    0x0300
#DEFINE   en_Update    0x0400
#DEFINE   en_ErrSpace  0x0500
#DEFINE   en_MaxText   0x0501
#DEFINE   en_HScroll   0x0601
#DEFINE   en_VScroll   0x0602

// Edit Control Messages


#DEFINE   em_GetSel          (wm_User+0)
#DEFINE   em_SetSel          (wm_User+1)
#DEFINE   em_GetRect         (wm_User+2)
#DEFINE   em_SetRect         (wm_User+3)
#DEFINE   em_SetRectNP       (wm_User+4)
#DEFINE   em_Scroll          (wm_User+5)
#DEFINE   em_LineScroll      (wm_User+6)
#DEFINE   em_GetModify       (wm_User+8)
#DEFINE   em_SetModify       (wm_User+9)
#DEFINE   em_GetLineCount    (wm_User+10)
#DEFINE   em_LineIndex       (wm_User+11)
#DEFINE   em_SetHandle       (wm_User+12)
#DEFINE   em_GetHandle       (wm_User+13)
#DEFINE   em_GetThumb        (wm_User+14)
#DEFINE   em_LineLength      (wm_User+17)
#DEFINE   em_ReplaceSel      (wm_User+18)
#DEFINE   em_SetFont         (wm_User+19)
#DEFINE   em_GetLine         (wm_User+20)
#DEFINE   em_LimitText       (wm_User+21)
#DEFINE   em_CanUndo         (wm_User+22)
#DEFINE   em_Undo            (wm_User+23)
#DEFINE   em_FmtLines        (wm_User+24)
#DEFINE   em_LineFromChar    (wm_User+25)
#DEFINE   em_SetWordBreak    (wm_User+26)
#DEFINE   em_SetTabStops     (wm_User+27)
#DEFINE   em_SetPasswordChar (wm_User+28)
#DEFINE   em_EmptyUndoBuffer (wm_User+29)
#DEFINE   em_MsgMax          (wm_User+30)
//Imported from WIN31.SH
#DEFINE   em_GetFirstVisibleLine  (wm_User+30)      //Imported from WIN31.SH
#DEFINE   em_SetReadOnly          (wm_User+31)      //Imported from WIN31.SH
#DEFINE   em_SetWordBreakProc     (wm_User+32)      //Imported from WIN31.SH
#DEFINE   em_GetWordBreakProc     (wm_User+33)      //Imported from WIN31.SH
#DEFINE   em_GetPasswordChar      (wm_User+34)      //Imported from WIN31.SH

// Button Control Styles
#DEFINE   bs_PushButton      0x00
#DEFINE   bs_DefPushButton   0x01
#DEFINE   bs_CheckBox        0x02
#DEFINE   bs_AutoCheckBox    0x03
#DEFINE   bs_RadioButton     0x04
#DEFINE   bs_3State          0x05
#DEFINE   bs_Auto3State      0x06
#DEFINE   bs_GroupBox        0x07
#DEFINE   bs_UserButton      0x08
#DEFINE   bs_AutoRadioButton 0x09
#DEFINE   bs_PushBox         0x0A
#DEFINE   bs_OwnerDraw       0x0B
#DEFINE   bs_LeftText        0x20

// User Button Notification Codes


#DEFINE   bn_Clicked       0
#DEFINE   bn_Paint         1
#DEFINE   bn_Hilite        2
#DEFINE   bn_Unhilite      3
#DEFINE   bn_Disable       4
#DEFINE   bn_DoubleClicked 5

// Button Control Messages


#DEFINE   bm_GetCheck (wm_User+0)
#DEFINE   bm_SetCheck (wm_User+1)
#DEFINE   bm_GetState (wm_User+2)
#DEFINE   bm_SetState (wm_User+3)
#DEFINE   bm_SetStyle (wm_User+4)

// Static Control Constants


#DEFINE   ss_Left           0x00
#DEFINE   ss_Center         0x01
#DEFINE   ss_Right          0x02
#DEFINE   ss_Icon           0x03
#DEFINE   ss_BlackRect      0x04
#DEFINE   ss_GrayRect       0x05
#DEFINE   ss_WhiteRect      0x06
#DEFINE   ss_BlackFrame     0x07
#DEFINE   ss_GrayFrame      0x08
#DEFINE   ss_WhiteFrame     0x09
#DEFINE   ss_UserItem       0x0A
#DEFINE   ss_Simple         0x0B
#DEFINE   ss_LeftNoWordWrap 0x0C
#DEFINE   ss_NoPrefix       0x80   // Don't do "&" character translation

// Dialog Styles


#DEFINE   ds_AbsAlign   0x01
#DEFINE   ds_SysModal   0x02
#DEFINE   ds_LocalEdit  0x20   // Edit items get Local storage
#DEFINE   ds_SetFont    0x40   // User specified font for Dlg controls
#DEFINE   ds_ModalFrame 0x80   // Can be combined with ws_Caption
#DEFINE   ds_NoIdleMsg  0x100  // wm_EnterIdle message will not be sent


#DEFINE   dm_GetDefID (wm_User+0)
#DEFINE   dm_SetDefID (wm_User+1)
#DEFINE   dc_HasDefID 0x534B

// Dialog Codes


#DEFINE   dlgc_WantArrows      0x0001    // Control wants arrow keys
#DEFINE   dlgc_WantTab         0x0002    // Control wants tab keys
#DEFINE   dlgc_WantAllKeys     0x0004    // Control wants all keys
#DEFINE   dlgc_WantMessage     0x0004    // Pass message to control
#DEFINE   dlgc_HasSetSel       0x0008    // Understands em_SetSel message
#DEFINE   dlgc_DefPushButton   0x0010    // Default pushbutton
#DEFINE   dlgc_UndefPushButton 0x0020    // Non-default pushbutton
#DEFINE   dlgc_RadioButton     0x0040    // Radio button
#DEFINE   dlgc_WantChars       0x0080    // Want wm_Char messages
#DEFINE   dlgc_Static          0x0100    // Static item: don't include
#DEFINE   dlgc_Button          0x2000    // Button item: can be checked


#DEFINE   lb_CtlCode 0

// Listbox Return Values


#DEFINE   lb_Okay     0
#DEFINE   lb_Err      (-1)
#DEFINE   lb_ErrSpace (-2)

// The idStaticPath parameter to DlgDirList can have the following values
// ORed if the list box should show other details of the files along with
// the name of the files


// Listbox Notification Codes


#DEFINE   lbn_ErrSpace  (-2)
#DEFINE   lbn_SelChange 1
#DEFINE   lbn_DblClk    2
#DEFINE   lbn_SelCancel 3
#DEFINE   lbn_SetFocus  4
#DEFINE   lbn_KillFocus 5

// Listbox messages


#DEFINE   lb_AddString           (wm_User+1)
#DEFINE   lb_InsertString        (wm_User+2)
#DEFINE   lb_DeleteString        (wm_User+3)
#DEFINE   lb_ResetContent        (wm_User+5)
#DEFINE   lb_SetSel              (wm_User+6)
#DEFINE   lb_SetCurSel           (wm_User+7)
#DEFINE   lb_GetSel              (wm_User+8)
#DEFINE   lb_GetCurSel           (wm_User+9)
#DEFINE   lb_GetText             (wm_User+10)
#DEFINE   lb_GetTextLen          (wm_User+11)
#DEFINE   lb_GetCount            (wm_User+12)
#DEFINE   lb_SelectString        (wm_User+13)
#DEFINE   lb_Dir                 (wm_User+14)
#DEFINE   lb_GetTopIndex         (wm_User+15)
#DEFINE   lb_FindString          (wm_User+16)
#DEFINE   lb_GetSelCount         (wm_User+17)
#DEFINE   lb_GetSelItems         (wm_User+18)
#DEFINE   lb_SetTabStops         (wm_User+19)
#DEFINE   lb_GetHorizontalExt    (wm_User+20)
#DEFINE   lb_SetHorizontalExt    (wm_User+21)
#DEFINE   lb_SetColumnWidth      (wm_User+22)
#DEFINE   lb_SetTopIndex         (wm_User+24)
#DEFINE   lb_GetItemRect         (wm_User+25)
#DEFINE   lb_GetItemData         (wm_User+26)
#DEFINE   lb_SetItemData         (wm_User+27)
#DEFINE   lb_SelItemRange        (wm_User+28)
#DEFINE   lb_MsgMax              (wm_User+33)
//Imported from WIN31.SH
#DEFINE   lb_SetCaretIndex       (wm_User+31)      //Imported from WIN31.SH
#DEFINE   lb_GetCaretIndex       (wm_User+32)      //Imported from WIN31.SH
#DEFINE   lb_SetItemHeight       (wm_User+33)      //Imported from WIN31.SH
#DEFINE   lb_GetItemHeight       (wm_User+34)      //Imported from WIN31.SH
#DEFINE   lb_FindStringExact     (wm_User+35)      //Imported from WIN31.SH


// Listbox Styles


#DEFINE   lbs_Notify            0x0001
#DEFINE   lbs_Sort              0x0002
#DEFINE   lbs_NoRedraw          0x0004
#DEFINE   lbs_MultipleSel       0x0008
#DEFINE   lbs_OwnerDrawFixed    0x0010
#DEFINE   lbs_OwnerDrawVar      0x0020
#DEFINE   lbs_HasStrings        0x0040
#DEFINE   lbs_UseTabStops       0x0080
#DEFINE   lbs_NoIntegralHeight  0x0100
#DEFINE   lbs_MultiColumn       0x0200
#DEFINE   lbs_WantKeyInput      0x0400
#DEFINE   lbs_ExtendedSel       0x0800
#DEFINE   lbs_DisableNoScroll   0x1000      //Imported from WIN31.SH
#DEFINE   lbs_Standard          lbs_Notify + lbs_Sort + ws_VScroll + ws_Border

// Combo Box return Values


#DEFINE   cb_Okay     0
#DEFINE   cb_Err      (-1)
#DEFINE   cb_ErrSpace (-2)
// Combo Box Notification Codes


#DEFINE   cbn_ErrSpace      (-1)
#DEFINE   cbn_SelChange     1
#DEFINE   cbn_DblClk        2
#DEFINE   cbn_SetFocus      3
#DEFINE   cbn_KillFocus     4
#DEFINE   cbn_EditChange    5
#DEFINE   cbn_EditUpdate    6
#DEFINE   cbn_DropDown      7
#DEFINE   cbn_Closeup       8     //Imported from WIN31.SH
#DEFINE   cbn_SelEndOk      9     //Imported from WIN31.SH
#DEFINE   cbn_SelEndCancel  10    //Imported from WIN31.SH


// Combo Box styles


#DEFINE   cbs_Simple            0x0001
#DEFINE   cbs_DropDown          0x0002
#DEFINE   cbs_DropDownList      0x0003
#DEFINE   cbs_OwnerDrawFixed    0x0010
#DEFINE   cbs_OwnerDrawVariable 0x0020
#DEFINE   cbs_AutoHScroll       0x0040
#DEFINE   cbs_OEMConvert        0x0080
#DEFINE   cbs_Sort              0x0100
#DEFINE   cbs_HasStrings        0x0200
#DEFINE   cbs_NoIntegralHeight  0x0400
#DEFINE   cbs_DisableNoScroll   0x0800      //Imported from WIN31.SH

// Combo Box messages


#DEFINE   cb_GetEditSel            (wm_User+0)
#DEFINE   cb_LimitText             (wm_User+1)
#DEFINE   cb_SetEditSel            (wm_User+2)
#DEFINE   cb_AddString             (wm_User+3)
#DEFINE   cb_DeleteString          (wm_User+4)
#DEFINE   cb_Dir                   (wm_User+5)
#DEFINE   cb_GetCount              (wm_User+6)
#DEFINE   cb_GetCurSel             (wm_User+7)
#DEFINE   cb_GetLBText             (wm_User+8)
#DEFINE   cb_GetLBTextLen          (wm_User+9)
#DEFINE   cb_InsertString          (wm_User+10)
#DEFINE   cb_ResetContent          (wm_User+11)
#DEFINE   cb_FindString            (wm_User+12)
#DEFINE   cb_SelectString          (wm_User+13)
#DEFINE   cb_SetCurSel             (wm_User+14)
#DEFINE   cb_ShowDropDown          (wm_User+15)
#DEFINE   cb_GetItemData           (wm_User+16)
#DEFINE   cb_SetItemData           (wm_User+17)
//Imported from WIN31.SH
#DEFINE   cb_GetDroppedControlRect  (wm_User+18)      //Imported from WIN31.SH
#DEFINE   cb_SetItemHeight          (wm_User+19)      //Imported from WIN31.SH
#DEFINE   cb_GetItemHeight          (wm_User+20)      //Imported from WIN31.SH
#DEFINE   cb_SetExtendedUI          (wm_User+21)      //Imported from WIN31.SH
#DEFINE   cb_GetExtendedUI          (wm_User+22)      //Imported from WIN31.SH
#DEFINE   cb_GetDroppedState        (wm_User+23)      //Imported from WIN31.SH
#DEFINE   cb_FindStringExact        (wm_User+24)      //Imported from WIN31.SH


// Scroll Bar Styles


#DEFINE   sbs_Horz                    0x0000
#DEFINE   sbs_Vert                    0x0001
#DEFINE   sbs_TopAlign                0x0002
#DEFINE   sbs_LeftAlign               0x0002
#DEFINE   sbs_BottomAlign             0x0004
#DEFINE   sbs_RightAlign              0x0004
#DEFINE   sbs_SizeBoxTopLeftAlign     0x0002
#DEFINE   sbs_SizeBoxBottomRightAlign 0x0004
#DEFINE   sbs_SizeBox                 0x0008

// WaitSoundState Constants


#DEFINE   s_QueueEmpty   0
#DEFINE   s_Threshold    1
#DEFINE   s_AllThreshold 2

// Accent Modes


#DEFINE   s_Normal   0
#DEFINE   s_Legato   1
#DEFINE   s_Staccato 2

// SetSoundNoise Sources


#DEFINE   s_Period512   0   // Freq = N/512 high pitch, less coarse hiss
#DEFINE   s_Period1024  1   // Freq = N/1024
#DEFINE   s_Period2048  2   // Freq = N/2048 low pitch, more coarse hiss
#DEFINE   s_PeriodVoice 3   // Source is frequency from voice channel (3)
#DEFINE   s_White512    4   // Freq = N/512 high pitch, less coarse hiss
#DEFINE   s_White1024   5   // Freq = N/1024
#DEFINE   s_White2048   6   // Freq = N/2048 low pitch, more coarse hiss
#DEFINE   s_WhiteVoice  7   // Source is frequency from voice channel (3)


#DEFINE   s_SerDVNA (-1)    // Device not available
#DEFINE   s_SerOFM  (-2)    // Out of memory
#DEFINE   s_SerMACT (-3)    // Music active
#DEFINE   s_SerQFUL (-4)    // Queue full
#DEFINE   s_SerBDNT (-5)    // Invalid note
#DEFINE   s_SerDLN  (-6)    // Invalid note length
#DEFINE   s_SerDCC  (-7)    // Invalid note count
#DEFINE   s_SerDTP  (-8)    // Invalid tempo
#DEFINE   s_SerDVL  (-9)    // Invalid volume
#DEFINE   s_SerDMD  (-10)   // Invalid mode
#DEFINE   s_SerDSH  (-11)   // Invalid shape
#DEFINE   s_SerDPT  (-12)   // Invalid pitch
#DEFINE   s_SerDFQ  (-13)   // Invalid frequency
#DEFINE   s_SerDDR  (-14)   // Invalid duration
#DEFINE   s_SerDSR  (-15)   // Invalid source
#DEFINE   s_SerDST  (-16)   // Invalid state


#DEFINE   NoParity     0
#DEFINE   OddParity    1
#DEFINE   EvenParity   2
#DEFINE   MarkParity   3
#DEFINE   SpaceParity  4

#DEFINE   OneStopBit   0
#DEFINE   One5StopBits 1
#DEFINE   TwoStopBits  2

#DEFINE   Ignore       0       // Ignore signal
#DEFINE   Infinite     0xFFFF   // Infinite timeout

// Error Flags


#DEFINE   ce_RXOver   0x0001   // Receive Queue overflow
#DEFINE   ce_Overrun  0x0002   // Receive Overrun Error
#DEFINE   ce_RXParity 0x0004   // Receive Parity Error
#DEFINE   ce_Frame    0x0008   // Receive Framing error
#DEFINE   ce_Break    0x0010   // Break Detected
#DEFINE   ce_CTSTO    0x0020   // CTS Timeout
#DEFINE   ce_DSRTO    0x0040   // DSR Timeout
#DEFINE   ce_RLSDTO   0x0080   // RLSD Timeout
#DEFINE   ce_TXFull   0x0100   // TX Queue is full
#DEFINE   ce_PTO      0x0200   // LPTx Timeout
#DEFINE   ce_IOE      0x0400   // LPTx I/O Error
#DEFINE   ce_DNS      0x0800   // LPTx Device not selected
#DEFINE   ce_OOP      0x1000   // LPTx Out-Of-Paper
#DEFINE   ce_Mode     0x8000   // Requested mode unsupported


#DEFINE   ie_BadID    (-1)    // Invalid or unsupported id
#DEFINE   ie_Open     (-2)    // Device Already Open
#DEFINE   ie_NoPen    (-3)    // Device Not Open
#DEFINE   ie_Memory   (-4)    // Unable to allocate queues
#DEFINE   ie_Default  (-5)    // Error in default parameters
#DEFINE   ie_Hardware (-10)   // Hardware Not Present
#DEFINE   ie_ByteSize (-11)   // Illegal Byte Size
#DEFINE   ie_BaudRate (-12)   // Unsupported BaudRate

// Events


#DEFINE   ev_RXChar  0x0001    // Any Character received
#DEFINE   ev_RXFlag  0x0002    // Received certain character
#DEFINE   ev_TXEmpty 0x0004    // Transmitt Queue Empty
#DEFINE   ev_CTS     0x0008    // CTS changed state
#DEFINE   ev_DSR     0x0010    // DSR changed state
#DEFINE   ev_RLSD    0x0020    // RLSD changed state
#DEFINE   ev_Break   0x0040    // BREAK received
#DEFINE   ev_Err     0x0080    // Line status error occurred
#DEFINE   ev_Ring    0x0100    // Ring signal detected
#DEFINE   ev_PErr    0x0200    // Printer error occured
#DEFINE   ev_CTSS    0x0400    // CTS state   //Imported from WIN31.SH
#DEFINE   ev_DSRS    0x0800    // DSR state   //Imported from WIN31.SH
#DEFINE   ev_RLSDS   0x1000    // RLSD state  //Imported from WIN31.SH
#DEFINE   ev_RingTe  0x2000    // Ring trailing edge indicator    //Imported from WIN31.SH

// Escape Functions


#DEFINE   SetXOFF  1          // Simulate XOFF received
#DEFINE   SetXON   2          // Simulate XON received
#DEFINE   SetRTS   3          // Set RTS high
#DEFINE   ClrRTS   4          // Set RTS low
#DEFINE   SetDTR   5          // Set DTR high
#DEFINE   ClrDTR   6          // Set DTR low
#DEFINE   ResetDev 7          // Reset device if possible


#DEFINE   LPTx 0x80            // Set if ID is for LPT device


#DEFINE PDCB    POINTER
// #DEFINE PDCB    *TDCB
structure TDCB
{
		Byte Id;              // Internal Device ID
		Word BaudRate;        // Baudrate at which runing
		Byte ByteSize;        // Number of bits/byte, 4-8
		Byte Parity;          // 0-4=None,Odd,Even,Mark,Space
		Byte StopBits;        // 0,1,2 = 1, 1.5, 2
		Word RlsTimeout;      // Timeout for RLSD to be set
		Word CtsTimeout;      // Timeout for CTS to be set
		Word DsrTimeout;      // Timeout for DSR to be set
		Word Flags;
		char XonChar;         // Tx and Rx X-ON character
		char XoffChar;        // Tx and Rx X-OFF character
		Word XonLim;          // Transmit X-ON threshold
		Word XoffLim;         // Transmit X-OFF threshold
		char PeChar;          // Parity error replacement char
		char EofChar;         // End of Input character
		char EvtChar;         // Recieved Event character
		Word TxDelay;         // Amount of time between chars
}


#DEFINE   dcb_Binary         0x0001
#DEFINE   dcb_RtsDisable     0x0002
#DEFINE   dcb_Parity         0x0004
#DEFINE   dcb_OutxCtsFlow    0x0008
#DEFINE   dcb_OutxDsrFlow    0x0010
#DEFINE   dcb_DtrDisable     0x0080


#DEFINE   dcb_OutX           0x0100
#DEFINE   dcb_InX            0x0200
#DEFINE   dcb_PeChar         0x0400
#DEFINE   dcb_Null           0x0800
#DEFINE   dcb_ChEvt          0x1000
#DEFINE   dcb_Dtrflow        0x2000
#DEFINE   dcb_Rtsflow        0x4000

//#DEFINE PComStat    *TComStat
#DEFINE PComStat    POINTER
structure TComStat
{
		Byte status;
		Word cbInQue;
		Word cbOutQue;
}

#DEFINE   com_CtsHold    0x0001
#DEFINE   com_DsrHold    0x0002
#DEFINE   com_RlsdHold   0x0004
#DEFINE   com_XoffHold   0x0008
#DEFINE   com_XoffSent   0x0010
#DEFINE   com_Eof        0x0020
#DEFINE   com_Txim       0x0040

#IFDEF POINTER_SUPPORT
//#DEFINE PMDICreateStruct    *TMDICreateStruct
#DEFINE PMDICreateStruct    POINTER
structure TMDICreateStruct
{
		PChar szClass;  PChar not supported, thus we use int
		int szClass;
		PChar szTitle;  PChar not supported, thus we use int
		int szTitle;
		THandle hOwner;
		int16 x, y;
		int16 cx, cy;
		int style;  //was LongInt but it's not supported, thus we use int
		int lParam;        // app-defined stuff  //was LongInt but it's not supported, thus we use int
}


//#DEFINE PClientCreateStruct   *TClientCreateStruct
#DEFINE PClientCreateStruct   POINTER
structure TClientCreateStruct
{
		THandle hWindowMenu;
		Word idFirstChild;
}
#ENDIF
// Help engine section

// Commands to pass WinHelp


#DEFINE   help_Context    0x0001   // Display topic in ulTopic
#DEFINE   help_Quit       0x0002   // Terminate help
#DEFINE   help_Index      0x0003   // Display index
#DEFINE   help_HelpOnHelp 0x0004   // Display help on using help
#DEFINE   help_SetIndex   0x0005   // Set the current Index for multi index help
#DEFINE   help_Key        0x0101   // Display topic for keyword in offabData
#DEFINE   help_MultiKey   0x0201

// Constants passed to WinHelp

#DEFINE   help_Contents     0x0003  //Imported from WIN31.SH
#DEFINE   help_SetContents  0x0005  //Imported from WIN31.SH
#DEFINE   help_ContextPopup 0x0008  //Imported from WIN31.SH
#DEFINE   help_ForceFile    0x0009  //Imported from WIN31.SH
#DEFINE   help_Command      0x0102  //Imported from WIN31.SH
#DEFINE   help_PartialKey   0x0105  //Imported from WIN31.SH
#DEFINE   help_SetWinPos    0x0203  //Imported from WIN31.SH



structure TMultiKeyHelp
{
		Word mkSize;
		Char mkKeyList;
		Char szKeyPhrase[1];
}


// ---------------------- Types from DDE.H -------------------------


#DEFINE   wm_dde_First      0x03E0
#DEFINE   wm_dde_Initiate   wm_dde_First
#DEFINE   wm_dde_Terminate  wm_dde_First+1
#DEFINE   wm_dde_Advise     wm_dde_First+2
#DEFINE   wm_dde_Unadvise   wm_dde_First+3
#DEFINE   wm_dde_Ack      wm_dde_First+4
#DEFINE   wm_dde_Data     wm_dde_First+5
#DEFINE   wm_dde_Request    wm_dde_First+6
#DEFINE   wm_dde_Poke     wm_dde_First+7
#DEFINE   wm_dde_Execute    wm_dde_First+8
#DEFINE   wm_dde_Last     wm_dde_First+8

/* Constants used for a wm_dde_Ack message sent in responce to a wm_dde_Data
	wm_dde_Request, wm_dde_Poke, wm_dde_Advise, or wm_dde_Unadvise message.
	For example
		if lParam and dde_Ack <> 0 then ...
*/


#DEFINE   dde_AppReturnCode 0x00FF
#DEFINE   dde_Busy      0x4000
#DEFINE   dde_Ack     0x8000

// Record for the  ww_dde_Advise Options parameter (LoWord(lParam))


//#DEFINE PDDEAdvise    *TDDEAdvise
#DEFINE PDDEAdvise    POINTER
structure TDDEAdvise
{
		Word Flags;
		int16 cfFormat;
}


#DEFINE   dde_DeferUpd     0x4000
#DEFINE   dde_AckReq     0x8000

/* Record for the hData parameter of a wm_dde_Data message (LoWord(lParam)).
	The actual size of this record depends on the size of the Value
	array. */


//#DEFINE PDDEData    *TDDEData
#DEFINE PDDEData    POINTER
structure TDDEData
{
	Word Flags;
	int16 cfFormat;
	Char Value[1];
}


#DEFINE   dde_Response 0x1000
#DEFINE   dde_Release  0x2000

/* Record for the hData parameter of the wm_dde_Poke record (LoWord(lParam)).
	The actual size of this record depends on the size of the Value array. */


//#DEFINE PDDEPoke    *TDDEPoke
#DEFINE PDDEPoke    POINTER
structure TDDEPoke
{
		Word Flags;
		Word cfFormat;
		 Byte Value[1];
}


//#DEFINE PDDEAck   *TDDEAck
#DEFINE PDDEAck   POINTER
structure TDDEAck
{
		Word Flags;
}

// ------------------------ Types from DRIVINIT.H ----------------------
/* Header file for printer driver initialization using ExtDeviceMode()
	and DeviceCapabilities(). */



	// size of a device name string
#DEFINE   cchDeviceName   32

	// current version of specification
#DEFINE   dm_SpecVersion  0x300

	// field selection bits
#DEFINE   dm_Orientation  0x0000001
#DEFINE   dm_PaperSize    0x0000002
#DEFINE   dm_PaperLength  0x0000004
#DEFINE   dm_PaperWidth   0x0000008
#DEFINE   dm_Scale    0x0000010
#DEFINE   dm_Copies   0x0000100
#DEFINE   dm_DefaultSource  0x0000200
#DEFINE   dm_PrintQuality 0x0000400
#DEFINE   dm_Color    0x0000800
#DEFINE   dm_Duplex   0x0001000

	// orientation selections
#DEFINE   dmorient_Portrait 1
#DEFINE   dmorient_Landscape  2

	// paper selections
#DEFINE   dmpaper_First   1
#DEFINE   dmpaper_Letter  1    // Letter 8 1/2 x 11 in
#DEFINE   dmpaper_LetterSmall 2    // Letter Small 8 1/2 x 11 in
#DEFINE   dmpaper_Tabloid 3    // Tabloid 11 x 17 in
#DEFINE   dmpaper_Ledger  4    // Ledger 17 x 11 in
#DEFINE   dmpaper_Legal   5    // Legal 8 1/2 x 14 in
#DEFINE   dmpaper_Statement 6    // Statement 5 1/2 x 8 1/2 in
#DEFINE   dmpaper_Executive 7    // Executive"7 1/2 x 10 in
#DEFINE   dmpaper_A3    8    // A3 297 x 420 mm
#DEFINE   dmpaper_A4    9    // A4 210 x 297 mm
#DEFINE   dmpaper_A4Small 10   // A4 Small 210 x 297 mm
#DEFINE   dmpaper_A5    11   // A5 148 x 210 mm
#DEFINE   dmpaper_B4    12   // B4 250 x 354
#DEFINE   dmpaper_B5    13   // B5 182 x 257 mm
#DEFINE   dmpaper_Folio   14   // Folio 8 1/2 x 13 in
#DEFINE   dmpaper_Quarto  15   // Quarto 215 x 275 mm
#DEFINE   dmpaper_10X14   16   // 10x14 in
#DEFINE   dmpaper_11X17   17   // 11x17 in
#DEFINE   dmpaper_Note    18   // Note 8 1/2 x 11 in
#DEFINE   dmpaper_Env_9   19   // Envelope #9 3 7/8 x 8 7/8
#DEFINE   dmpaper_Env_10  20   // Envelope #10 4 1/8 x 9 1/2
#DEFINE   dmpaper_Env_11  21   // Envelope #11 4 1/2 x 10 3/8
#DEFINE   dmpaper_Env_12  22   // Envelope #12 4 \276 x 11
#DEFINE   dmpaper_Env_14  23   // Envelope #14 5 x 11 1/2
#DEFINE   dmpaper_CSheet  24   // C size sheet
#DEFINE   dmpaper_DSheet  25   // D size sheet
#DEFINE   dmpaper_ESheet  26   // E size sheet
#DEFINE   dmpaper_Last    dmpaper_ESheet

#DEFINE   dmpaper_User    256

	// bin selections
#DEFINE   dmbin_First   1
#DEFINE   dmbin_Upper   1
#DEFINE   dmbin_OnlyOne   1
#DEFINE   dmbin_Lower   2
#DEFINE   dmbin_Middle    3
#DEFINE   dmbin_Manual    4
#DEFINE   dmbin_Envelope  5
#DEFINE   dmbin_EnvManual 6
#DEFINE   dmbin_Auto    7
#DEFINE   dmbin_Tractor   8
#DEFINE   dmbin_SmallFmt  9
#DEFINE   dmbin_LargeFmt  10
#DEFINE   dmbin_LargeCapacity 11
#DEFINE   dmbin_Cassette  14
#DEFINE   dmbin_Last    dmbin_Cassette

#DEFINE   dmbin_User  256    // device specific bins start here

	// print qualities
#DEFINE   dmres_Draft -1
#DEFINE   dmres_Low -2
#DEFINE   dmres_Medium  -3
#DEFINE   dmres_High  -4

	// color enable/disable for color printers
#DEFINE   dmcolor_Monochrome  1
#DEFINE   dmcolor_Color 2

	// duplex enable
#DEFINE   dmdup_Simplex 1
#DEFINE   dmdup_Vertical  2
#DEFINE   dmdup_Horizontal  3


//#DEFINE PDevMode    *TDevMode
#DEFINE PDevMode    POINTER
structure TDevMode
{
    ASCIIZ  dmDeviceName[cchDeviceName];
    Word    dmSpecVersion;
    Word    dmDriverVersion;
    Word    dmSize;
    Word    dmDriverExtra;
    int     dmFields;   //was LongInt but it's not supported, thus we use int
    int16   dmOrientation;
    int16   dmPaperSize;
    int16   dmPaperLength;
    int16   dmPaperWidth;
    int16   dmScale;
    int16   dmCopies;
    int16   dmDefaultSource;
    int16   dmPrintQuality;
    int16   dmColor;
    int16   dmDuplex;
}



	// mode selections for the device mode function
#DEFINE   dm_Update 1
#DEFINE   dm_Copy   2
#DEFINE   dm_Prompt 4
#DEFINE   dm_Modify 8

#DEFINE   dm_In_Buffer    dm_Modify
#DEFINE   dm_In_Prompt    dm_Prompt
#DEFINE   dm_Out_Buffer   dm_Copy
#DEFINE   dm_Out_Default  dm_Update

	// device capabilities indices
#DEFINE   dc_Fields 1
#DEFINE   dc_Papers 2
#DEFINE   dc_Papersize  3
#DEFINE   dc_MinExtent  4
#DEFINE   dc_MaxExtent  5
#DEFINE   dc_Bins 6
#DEFINE   dc_Duplex 7
#DEFINE   dc_Size 8
#DEFINE   dc_Extra  9
#DEFINE   dc_Version  10
#DEFINE   dc_Driver 11

	// export ordinal definitions
#DEFINE   proc_ExtDeviceMode    MakeIntResource(90)
#DEFINE   proc_DeviceCapabilities MakeIntResource(91)
#DEFINE   proc_OldDeviceMode    MakeIntResource(13)

#DEFINE _int16  WORD
#DEFINE _char BYTE


// #DEFINE PKeyboardState *TKeyboardState
#DEFINE PKeyboardState POINTER
structure TKeyboardState
{
	BYTE k[256];
}


//*******************************************************************
//* This portion of the file was transferred over from WIN31.SH     *
//*******************************************************************
#DEFINE   err_Warning   0x8000
#DEFINE   err_Param     0x4000

#DEFINE   err_Size_Mask   0x3000
#DEFINE   err_Byte        0x1000
#DEFINE   err_Word        0x2000
#DEFINE   err_DWord       0x3000

//***** LogParamError() values

// Generic parameter values
#DEFINE   err_Bad_Value      0x6001
#DEFINE   err_Bad_Flags      0x6002
#DEFINE   err_Bad_Index      0x6003
#DEFINE   err_Bad_DValue     0x7004
#DEFINE   err_Bad_DFlags     0x7005
#DEFINE   err_Bad_DIndex     0x7006
#DEFINE   err_Bad_Ptr        0x7007
#DEFINE   err_Bad_Func_Ptr   0x7008
#DEFINE   err_Bad_Selector   0x6009
#DEFINE   err_Bad_String_ptr 0x700a
#DEFINE   err_Bad_Handle     0x600b

// KERNEL parameter errors
#DEFINE   err_Bad_HInstance       0x6020
#DEFINE   err_Bad_HModule         0x6021
#DEFINE   err_Bad_Global_Handle   0x6022
#DEFINE   err_Bad_Local_Handle    0x6023
#DEFINE   err_Bad_Atom            0x6024
#DEFINE   err_Bad_Hfile           0x6025

// USER parameter errors
#DEFINE   err_Bad_HWnd            0x6040
#DEFINE   err_Bad_HMenu           0x6041
#DEFINE   err_Bad_HCursor         0x6042
#DEFINE   err_Bad_HIcon           0x6043
#DEFINE   err_Bad_HDWP            0x6044
#DEFINE   err_Bad_CID             0x6045
#DEFINE   err_Bad_HDrvr           0x6046

// GDI parameter errors
#DEFINE   err_Bad_COORDS          0x7060
#DEFINE   err_Bad_GDI_OBJECT      0x6061
#DEFINE   err_Bad_HDC             0x6062
#DEFINE   err_Bad_HPEN            0x6063
#DEFINE   err_Bad_HFONT           0x6064
#DEFINE   err_Bad_HBRUSH          0x6065
#DEFINE   err_Bad_HBITMAP         0x6066
#DEFINE   err_Bad_HRGN            0x6067
#DEFINE   err_Bad_HPALETTE        0x6068
#DEFINE   err_Bad_HMETAFILE       0x6069

//**** LogError() values

// KERNEL errors
#DEFINE   err_GAlloc              0x0001
#DEFINE   err_GRealloc            0x0002
#DEFINE   err_GLock               0x0003
#DEFINE   err_LAlloc              0x0004
#DEFINE   err_LRealloc            0x0005
#DEFINE   err_LLock               0x0006
#DEFINE   err_ALlocres            0x0007
#DEFINE   err_LockRes             0x0008
#DEFINE   err_LoadModule          0x0009

// USER errors
#DEFINE   err_CreateDlg           0x0040
#DEFINE   err_CreateDlg2          0x0041
#DEFINE   err_RegisterClass       0x0042
#DEFINE   err_DCBusy              0x0043
#DEFINE   err_CreateWnd           0x0044
#DEFINE   err_StrucExtra          0x0045
#DEFINE   err_LoadStr             0x0046
#DEFINE   err_LoadMenu            0x0047
#DEFINE   err_NestedBeginPaint    0x0048
#DEFINE   err_BadIndex            0x0049
#DEFINE   err_CreateMenu          0x004a

// GDI errors
#DEFINE   err_CreateDC            0x0080
#DEFINE   err_CreateMeta          0x0081
#DEFINE   err_DelObjSelected      0x0082
#DEFINE   err_SelBitmap           0x0083


// WINDEBUGINFO flags values
#DEFINE   wdi_Options         0x0001
#DEFINE   wdi_Filter          0x0002
#DEFINE   wdi_AllocBreak      0x0004

// dwOptions values
#DEFINE   dbo_CheckHeap       0x0001
#DEFINE   dbo_BufferFill      0x0004
#DEFINE   dbo_DisableGPTrapping 0x0010
#DEFINE   dbo_CheckFree       0x0020

#DEFINE   dbo_Silent          0x8000

#DEFINE   dbo_TraceBreak      0x2000
#DEFINE   dbo_WarningBreak    0x1000
#DEFINE   dbo_NoErrorBreak    0x0800
#DEFINE   dbo_NofatalBreak    0x0400
#DEFINE   dbo_INT3Break       0x0100

// DebugOutput flags values
#DEFINE   dbf_Trace           0x0000
#DEFINE   dbf_Warning         0x4000
#DEFINE   dbf_Error           0x8000
#DEFINE   dbf_Fatal           0xc000

// dwFilter values
#DEFINE   dbf_Kernel          0x1000
#DEFINE   dbf_Krn_MemMan      0x0001
#DEFINE   dbf_Krn_LoadModule  0x0002
#DEFINE   dbf_Krn_SegmentLoad 0x0004
#DEFINE   dbf_User            0x0800
#DEFINE   dbf_GDI             0x0400
#DEFINE   dbf_MMSystem        0x0040
#DEFINE   dbf_Penwin          0x0020
#DEFINE   dbf_Application     0x0008
#DEFINE   dbf_Driver          0x0010


#DEFINE   ew_RestartWindows   0x42
#DEFINE   ew_RebootSystem     0x43

// SetErrorMode() constants
#DEFINE   sem_FailCriticalErrors  0x0001
#DEFINE   sem_NoGPFaultErrorBox   0x0002
#DEFINE   sem_NoOpenFileErrorBox  0x8000

#DEFINE   hInstance_Error THandle(32)

// _llseek origin values

#DEFINE   seek_set 0
#DEFINE   seek_cur 1
#DEFINE   seek_end 2


// Errors
#DEFINE   wn_Success       0x0000
#DEFINE   wn_Not_Supported 0x0001
#DEFINE   wn_Net_Error     0x0002
#DEFINE   wn_More_Data     0x0003
#DEFINE   wn_Bad_Pointer   0x0004
#DEFINE   wn_Bad_Value     0x0005
#DEFINE   wn_Bad_Password  0x0006
#DEFINE   wn_Access_Denied 0x0007
#DEFINE   wn_Function_Busy 0x0008
#DEFINE   wn_Windows_Error 0x0009
#DEFINE   wn_Bad_User      0x000A
#DEFINE   wn_Out_Of_Memory 0x000B
#DEFINE   wn_Cancel        0x000C
#DEFINE   wn_Continue      0x000D

// Connection errors
#DEFINE   wn_Not_Connected     0x0030
#DEFINE   wn_Open_Files        0x0031
#DEFINE   wn_Bad_Netname       0x0032
#DEFINE   wn_Bad_Localname     0x0033
#DEFINE   wn_Already_Connected 0x0034
#DEFINE   wn_Device_Error      0x0035
#DEFINE   wn_Connection_Closed 0x0036

// tmPitchAndFamily values

#DEFINE   tmpf_Fixed_Pitch    0x01
#DEFINE   tmpf_Vector         0x02
#DEFINE   tmpf_Device         0x08
#DEFINE   tmpf_Truetype       0x04

// new StretchBlt() Modes (simpler names)

#DEFINE   stretch_ANDScans        1
#DEFINE   stretch_ORScans         2
#DEFINE   stretch_DeleteScans     3

#DEFINE   GetFaceName        513

// wm_Size message wParam values


#DEFINE   size_Restored 0
#DEFINE   size_Minimized 1
#DEFINE   size_Maximized 2
#DEFINE   size_MaxShow 3
#DEFINE   size_MaxHide 4

// wm_KeyUp/Down/Char HiWord(lParam) flags

#DEFINE   kf_Extended 0x0100
#DEFINE   kf_DLGMode 0x0800
#DEFINE   kf_MenuMode 0x1000
#DEFINE   kf_AltDown 0x2000
#DEFINE   kf_Repeat 0x4000
#DEFINE   kf_Up 0x8000

// wm_Activate state values

#DEFINE   wa_Inactive 0
#DEFINE   wa_Active 1
#DEFINE   wa_ClickActive 2

// Dialog window class

#DEFINE   wc_Dialog MakeIntAtom(0x8002)

// Get/SetWindowWord/Long offsets for use with wc_Dialog windows

#DEFINE   dwl_MsgResult 0
#DEFINE   dwl_DLGProc 4
#DEFINE   dwl_User 8

// Redefined wm_NCHitTest return values

#DEFINE   htMinButton 8
#DEFINE   htMaxButton 9
#DEFINE   htBorder 18

// Special HWND value for use with PostMessage() and SendMessage()

#DEFINE   hWnd_Broadcast  0xFFFF

//***** Power management ***************************************************

#DEFINE   wm_Power      0x0048

// wParam for WM_POWER window message and DRV_POWER driver notification
#DEFINE   pwr_Ok              1
#DEFINE   pwr_Fail            -1
#DEFINE   pwr_SuspendRequest  1
#DEFINE   pwr_SuspendResume   2
#DEFINE   pwr_CriticalResume  3


#DEFINE   wm_SystemError 0x0017


// Special value for CreateWindow, et al.

#DEFINE   hWnd_Desktop 0

#DEFINE   MouseTrails 39

#DEFINE   GetSetScreenParams 800


//#DEFINE PNewTextMetric    *TNewTextMetric
//#DEFINE PNewTextMetric    POINTER
structure TNewTextMetric
{
		Int tmHeight;
		Int tmAscent;
		Int tmDescent;
		Int tmInternalLeading;
		Int tmExternalLeading;
		Int tmAveCharWidth;
		Int tmMaxCharWidth;
		Int tmWeight;
		Byte tmItalic;
		Byte tmUnderlined;
		Byte tmStruckOut;
		Byte tmFirstChar;
		Byte tmLastChar;
		Byte tmDefaultChar;
		Byte tmBreakChar;
		Byte tmPitchAndFamily;
		Byte tmCharSet;
		Int tmOverhang;
		Int tmDigitizedAspectX;
		Int tmDigitizedAspectY;
		_int16 ntmFlags;      // various flags (fsSelection)
		Word ntmSizeEM;      // size of EM
		Word ntmCellHeight;    // height of font in notional units
		Word ntmAvgWidth;      // average width in notional units
}


#DEFINE   ntm_Regular   0x00000040  // possible ntmFlags bits
#DEFINE   ntm_Bold      0x00000020
#DEFINE   ntm_Italic    0x00000001

#DEFINE   lf_FullFaceSize 64


//#DEFINE PEnumLogFont    *TEnumLogFont
#DEFINE PEnumLogFont    POINTER
structure TEnumLogFont
{
//    TLogFont elfLogFont;
	// structure TLogFont
    Int16   lfHeight;
    Int16   lfWidth;
    Int16   lfEscapement;
    Int16   lfOrientation;
    Int16   lfWeight;
    Byte    lfItalic;
    Byte    lfUnderline;
    Byte    lfStrikeOut;
    Byte    lfCharSet;
    Byte    lfOutPrecision;
    Byte    lfClipPrecision;
    Byte    lfQuality;
    Byte    lfPitchAndFamily;
    ASCIIZ  lfFaceName[lf_FaceSize];

    ASCIIZ  elfFullName  [LF_FULLFACESIZE];
    ASCIIZ  elfStyle     [LF_FACESIZE];
}


#DEFINE   dcx_Window 0x00000001
#DEFINE   dcx_Cache 0x00000002
#DEFINE   dcx_ClipChildren 0x00000008
#DEFINE   dcx_ClipSiblings 0x00000010
#DEFINE   dcx_ParentClip 0x00000020

#DEFINE   dcx_ExcludeRgn 0x00000040
#DEFINE   dcx_IntersectRgn 0x00000080

#DEFINE   dcx_LockWindowUpdate 0x00000400

#DEFINE   dcx_UseStyle 0x00010000

#DEFINE   dcb_Reset         0x0001
#DEFINE   dcb_Accumulate    0x0002
#DEFINE   dcb_Dirty         dcb_Accumulate
#DEFINE   dcb_Set           dcb_Reset or dcb_Accumulate
#DEFINE   dcb_Enable        0x0004
#DEFINE   dcb_Disable       0x0008



// GetGlyphOutline constants
#DEFINE   ggo_Metrics        0
#DEFINE   ggo_Bitmap         1
#DEFINE   ggo_Native         2

#DEFINE   tt_Polygon_Type   24

#DEFINE   tt_Prim_Line       1
#DEFINE   tt_Prim_QSPLine    2



// #DEFINE PPanose   *TPanose
#DEFINE PPanose   POINTER
structure TPanose
{
		Byte bFamilyType;
		Byte bSerifStyle;
		Byte bWeight;
		Byte bProportion;
		Byte bContrast;
		Byte bStrokeVariation;
		Byte bArmStyle;
		Byte bLetterform;
		Byte bMidline;
		Byte bXHeight;
}

// #DEFINE POutlineTextMetric    *TOutlineTextMetric
#DEFINE POutlineTextMetric    POINTER
/*
structure TOutlineTextMetric
{
		Word otmSize;      // I size of this structure
		// TTextMetric otmTextMetrics;    // regular text metrics
		Byte otmFiller;      // want to be word aligned
		// TPanose otmPanoseNumber;   // Panose number of font
		Word otmfsSelection;   // B Font selection flags (see #defines)
		Word otmfsType;      // B Type indicators (see #defines)
		Word otmsCharSlopeRise;    // Slope angle Rise / Run   1 vertical
		Word otmsCharSlopeRun;   //           0 vertical
		Word otmEMSquare;      // N size of EM
		Word otmAscent;      // D ascent above baseline
		Word otmDescent;     // D descent below baseline
		Word otmLineGap;     // D
		Word otmCapEmHeight;   // D height of upper case M
		Word otmXHeight;     // D height of lower case chars in font
		// TRect otmrcFontBox;      // D Font bounding box
		Word otmMacAscent;     // D ascent above baseline for Mac
		Word otmMacDescent;    // D descent below baseline for Mac
		Word otmMacLineGap;    // D
		Word otmusMinimumPPEM;   // D Minimum point ppem
		//TPoint otmptSubscriptSize;   // D Size of subscript
		//TPoint otmptSubscriptOffset;   // D Offset of subscript
		//TPoint otmptSuperscriptSize;   // D Size of superscript
		//TPoint otmptSuperscriptOffset; // D Offset of superscript
		Word otmsStrikeoutSize;    // D Strikeout size
		Word otmsStrikeoutPosition;   // D Strikeout position
		Word otmsUnderscoreSize;   // D Underscore size
		Word otmsUnderscorePosition;  // D Underscore position
		PChar otmpFamilyName;    // offset to family name
		PChar otmpFaceName;      // offset to face name
		PChar otmpStyleName;     // offset to Style string
		PChar otmpFullName;      // offset to full name
}
*/

//#DEFINE PFixed    *TFixed
#DEFINE PFixed    POINTER
structure TFixed
{
		Word    fract;
		_int16  value;
}

// #DEFINE PMat2   *TMat2
#DEFINE PMat2   POINTER
/*
structure TMat2
{
		 //TFixed eM11;
		 //TFixed eM12;
		 //TFixed eM21;
		 //TFixed eM22;
}
*/

//#DEFINE PGlyphMetrics   *TGlyphMetrics
#DEFINE PGlyphMetrics   POINTER
/*
structure TGlyphMetrics
{
		Word gmBlackBoxX;
		Word gmBlackBoxY;
		// TPoint gmptGlyphOrigin;
		_int16 gmCellIncX;
		_int16 gmCellIncY;
}
*/
//#DEFINE PPointFX    *TPointFX
#DEFINE PPointFX    POINTER
/*
structure TPointFX
{
		//TFixed x;
		//TFixed y;
}
*/

//#DEFINE PTTPolyCurve    *TTTPolyCurve
#DEFINE PTTPolyCurve    POINTER
/*
structure TTTPolyCurve
{
		Word wType;
		Word cpfx;
		 TPointFX apfx[0 + 1];
}
 */

//#DEFINE PPolygonHeader    *TPolygonHeader
#DEFINE PPolygonHeader    POINTER
/*
structure TPolygonHeader
{
		Int cb;
		Int dwType;
		//TPointFX pfxStart;
}
*/

//#DEFINE PABC    *TABC
#DEFINE PABC    POINTER
structure TABC
{
		_int16 abcA;
		Word abcB;
		_int16 abcC;
}

//#DEFINE PRasterizer_Status    *TRasterizer_Status
#DEFINE PRasterizer_Status    POINTER
structure TRasterizer_Status
{
		_int16 nSize;
		_int16 wFlags;
		_int16 nLanguageID;
}

// bits defined in wFlags of TRasterizer_Status

#DEFINE   tt_Available  0x0001
#DEFINE   tt_Enabled    0x0002

#DEFINE   esb_Enable_Both  0x0000
#DEFINE   esb_Disable_Both 0x0003

#DEFINE   esb_Disable_Left  0x0001
#DEFINE   esb_Disable_Right 0x0002

#DEFINE   esb_Disable_Up    0x0001
#DEFINE   esb_Disable_Down  0x0002

#DEFINE   esb_Disable_LtUp  esb_Disable_Left
#DEFINE   esb_Disable_RtDn  esb_Disable_Right

	// wm_WindowPosChanging/Changed record pointed to by lParam
//#DEFINE PWindowPos    *TWindowPos
#DEFINE PWindowPos    POINTER
structure TWindowPos
{
		HWnd hWnd;
		HWnd hWndInsertAfter;
		_int16 x;
		_int16 y;
		_int16 cx;
		_int16 cy;
		Word flags;
}

//#DEFINE PNCCalcSize_Params    *TNCCalcSize_Params
#DEFINE PNCCalcSize_Params    POINTER
/*
structure TNCCalcSize_Params
{
		 TRect rgrc[2 + 1];
		PWindowPos lppos;
}
 */


	// wm_NCCalcSize "window valid rect" return values
#DEFINE   wvr_AlignTop    0x0010
#DEFINE   wvr_AlignLeft   0x0020
#DEFINE   wvr_AlignBottom 0x0040
#DEFINE   wvr_AlignRight  0x0080
#DEFINE   wvr_HRedraw     0x0100
#DEFINE   wvr_VRedraw     0x0200
#DEFINE   wvr_Redraw      wvr_HRedraw or wvr_VRedraw
#DEFINE   wvr_ValidTRectS 0x0400

	// Special HWnd values for SetWindowPos() hwndInsertAfter
#DEFINE   hwnd_Top        0
#DEFINE   hwnd_Bottom     1
#DEFINE   hwnd_TopMost    -1
#DEFINE   hwnd_NoTopMost  -2

	// GetQueueStatus flags
#DEFINE   qs_Key              0x0001
#DEFINE   qs_MouseMove        0x0002
#DEFINE   qs_MouseButton      0x0004
#DEFINE   qs_Mouse            qs_MouseMove or qs_MouseButton
#DEFINE   qs_PostMessage      0x0008
#DEFINE   qs_Timer            0x0010
#DEFINE   qs_Paint            0x0020
#DEFINE   qs_SendMessage      0x0040
#DEFINE   qs_AllInput         0x007F

	// Flags for TrackPopupMenu
#DEFINE   tpm_LeftButton  0x0000

#DEFINE   tpm_RightButton 0x0002
#DEFINE   tpm_LeftAlign   0x0000
#DEFINE   tpm_CenterAlign 0x0004
#DEFINE   tpm_RightAlign  0x0008

	// RedrawWindow() flags
#DEFINE   rdw_Invalidate      0x0001
#DEFINE   rdw_InternalPaint   0x0002
#DEFINE   rdw_Erase           0x0004

#DEFINE   rdw_Validate        0x0008
#DEFINE   rdw_NoInternalPaint 0x0010
#DEFINE   rdw_NoErase         0x0020

#DEFINE   rdw_NoChildren      0x0040
#DEFINE   rdw_AllChildren     0x0080

#DEFINE   rdw_UpdateNow       0x0100
#DEFINE   rdw_EraseNow        0x0200
#DEFINE   rdw_Frame           0x0400
#DEFINE   rdw_NoFrame         0x0800

#DEFINE HHook   Integer
//#DEFINE THookProc   function (Code: _int16 : ; : : ;


#DEFINE   hshell_WindowCreated    1
#DEFINE   hshell_WindowDestroyed  2
#DEFINE   hshell_ActivateShellWindow 3

	// CBT Hook Codes
#DEFINE   hcbt_MoveSize   0
#DEFINE   hcbt_MinMax     1
#DEFINE   hcbt_QS         2
#DEFINE   hcbt_CreateWnd  3
#DEFINE   hcbt_DestroyWnd 4
#DEFINE   hcbt_Activate   5
#DEFINE   hcbt_ClickSkipped 6
#DEFINE   hcbt_KeySkipped 7
#DEFINE   hcbt_SysCommAnd 8
#DEFINE   hcbt_SetFocus   9


	// hcbt_CreateWnd parameters pointed to by lParam
#IFDEF POINTER_SUPPORT
// #DEFINE PCBT_CreateWnd    *TCBT_CreateWnd
#DEFINE PCBT_CreateWnd    POINTER
structure TCBT_CreateWnd
{
		PCreateStruct lpcs;
		HWnd hWndInsertAfter;
}
#DEFINE PMouseHookStruct    *TMouseHookStruct
structure TMouseHookStruct
{
		TPoint pt;
		HWnd hWnd;
		Word wHitTestCode;
		Longint dwExtraInfo;
}

#DEFINE PCBTActivateStruct    *TCBTActivateStruct
structure TCBTActivateStruct
{
		Bool fMouse;
		HWnd hWndActive;
}

#DEFINE PHardwareHookStruct   *THardwareHookStruct
structure THardwareHookStruct
{
		HWnd hWnd;
		Word wMessage;
		Word wParam;
		Longint lParam;
}

	// Message Structure used in Journaling
#DEFINE PEventMsg   TEventMsg
structure TEventMsg
{
		Word message;
		Word param;
		Word paramH;
		Longint time;
}
#ENDIF

//#DEFINE TEditWordBreakProc   function(lpch: PChar : ; : ;

// TEditWordBreakProc code values

#DEFINE   wb_Left 0
#DEFINE   wb_Right 1
#DEFINE   wb_IsDelimiter 2


#DEFINE   stm_SetIcon wm_User+0
#DEFINE   stm_GetIcon wm_User+1

	// DlgDirList, DlgDirListComboBox flags values
#DEFINE   ddl_ReadWrite 0x0001
#DEFINE   ddl_ReadOnly 0x0002
#DEFINE   ddl_Hidden 0x0004
#DEFINE   ddl_System 0x0008
#DEFINE   ddl_Directory 0x0010
#DEFINE   ddl_Archive 0x0020

#DEFINE   ddl_PostMsgs 0x2000
#DEFINE   ddl_Drives 0x4000
#DEFINE   ddl_Exclusive 0x8000

#DEFINE   GetMaxLPT 8  // Max supported LPT id
#DEFINE   GetMaxCOM 9  // Max supported COM id
#DEFINE   GetBaseIRQ 10  // Get port base & irq for a port

	// Comm Baud Rate indices
#DEFINE   cbr_110 0xFF10
#DEFINE   cbr_300 0xFF11
#DEFINE   cbr_600 0xFF12
#DEFINE   cbr_1200 0xFF13
#DEFINE   cbr_2400 0xFF14
#DEFINE   cbr_4800 0xFF15
#DEFINE   cbr_9600 0xFF16
#DEFINE   cbr_14400 0xFF17
#DEFINE   cbr_19200 0xFF18
#DEFINE   cbr_38400 0xFF1B
#DEFINE   cbr_56000 0xFF1F
#DEFINE   cbr_128000 0xFF23
#DEFINE   cbr_256000 0xFF27

	// notifications passed in low word of lParam on wm_CommNotify messages
#DEFINE   cn_Receive 0x01 // bytes are available in the input queue
#DEFINE   cn_Transmit 0x02    // fewer than wOutTrigger bytes still
			// remain in the output queue waiting
			// to be transmitted.
#DEFINE   cn_Event 0x0004

#DEFINE   drv_Load 0x0001
#DEFINE   drv_Enable 0x0002
#DEFINE   drv_Open 0x0003
#DEFINE   drv_Close 0x0004
#DEFINE   drv_Disable 0x0005
#DEFINE   drv_Free 0x0006
#DEFINE   drv_Configure 0x0007
#DEFINE   drv_QueryConfigure 0x0008
#DEFINE   drv_Install 0x0009
#DEFINE   drv_Remove 0x000A
#DEFINE   drv_ExitSession 0x000B
#DEFINE   drv_ExitApplication 0x000C
#DEFINE   drv_Power 0x000F

#DEFINE   drv_Reserved 0x0800
#DEFINE   drv_User 0x4000

	// Supported return values for drv_Configure message
#DEFINE   drvcnf_Cancel 0x0000
#DEFINE   drvcnf_OK 0x0001
#DEFINE   drvcnf_Restart 0x0002

#DEFINE   drvea_NormalExit 0x0001
#DEFINE   drvea_AbnormalExit 0x0002

	// GetNextDriver flags
#DEFINE   gnd_Forward           0x00000000
#DEFINE   gnd_FirstInstanceOnly 0x00000001
#DEFINE   gnd_Reverse           0x00000002


//#DEFINE PDriverInfoStruct   *TDriverInfoStruct
#DEFINE PDriverInfoStruct   POINTER
structure TDriverInfoStruct
{
    Word    length;
		THandle hDriver;
		THandle hModule;
    ASCIIZ  szAliasName[129];
}


//#DEFINE PDrvConfigInfo    *TDrvConfigInfo
#DEFINE PDrvConfigInfo    POINTER
structure TDrvConfigInfo
{
		Int    dwDCISize;
		ASCIIZ lpszDCISectionName;
		ASCIIZ lpszDCIAliasName;
}



	// MDI client style bits
#DEFINE   mdis_AllChildStyles   0x0001

	// wParam Flags for wm_MDITILE and wm_MDICASCADE messages.
#DEFINE   mditile_Vertical      0x0000
#DEFINE   mditile_Horizontal    0x0001
#DEFINE   mditile_SkipDisabled  0x0002

	// Parameter for SystemParametersInfo()
#DEFINE   spi_GetBeep 1
#DEFINE   spi_SetBeep 2
#DEFINE   spi_GetMouse 3
#DEFINE   spi_SetMouse 4
#DEFINE   spi_GetBorder 5
#DEFINE   spi_SetBorder 6
#DEFINE   spi_GetKeyBoardSpeed 10
#DEFINE   spi_SetKeyBoardSpeed 11
#DEFINE   spi_LangDriver 12
#DEFINE   spi_IconHorizontalSpacing 13
#DEFINE   spi_GetScreenSaveTimeout 14
#DEFINE   spi_SetScreenSaveTimeout 15
#DEFINE   spi_GetScreenSaveActive 16
#DEFINE   spi_SetScreenSaveActive 17
#DEFINE   spi_GetGridGranularity 18
#DEFINE   spi_SetGridGranularity 19
#DEFINE   spi_SetDeskWallpaper 20
#DEFINE   spi_SetDeskPattern 21
#DEFINE   spi_GetKeyBoardDelay 22
#DEFINE   spi_SetKeyBoardDelay 23
#DEFINE   spi_IconVerticalSpacing 24
#DEFINE   spi_GetIconTitleWrap 25
#DEFINE   spi_SetIconTitleWrap 26
#DEFINE   spi_GetMenuDropAlignment 27
#DEFINE   spi_SetMenuDropAlignment 28
#DEFINE   spi_SetDoubleClkWidth 29
#DEFINE   spi_SetDoubleClkHeight 30
#DEFINE   spi_GetIconTitleLogfont 31
#DEFINE   spi_SetDoubleClickTime 32
#DEFINE   spi_SetMouseButtonSwap 33
#DEFINE   spi_SetIconTitleLogfont 34
#DEFINE   spi_GetFastTaskSwitch 35
#DEFINE   spi_SetFastTaskSwitch 36


	// Flags
#DEFINE   spif_UpdateIniFile 0x0001
#DEFINE   spif_SendWinIniChange 0x0002


//#DEFINE PDocInfo    *TDocInfo
#DEFINE PDocInfo    POINTER
structure TDocInfo
{
		_int16 cbSize;
		ASCIIZ lpszDocName;
		ASCIIZ lpszOutput;
}


//#DEFINE TAbortProc    function (DC: HDC : : ;


#DEFINE TTask   Word


//#DEFINE PWinDebugInfo   *TWinDebugInfo
#DEFINE PWinDebugInfo   POINTER
structure TWinDebugInfo
{
		Word  Flags;
		Int   dwOptions;
		Int   dwFilter;
		Char  achAllocModule[8];
		Int   dwAllocBreak;
		Int   dwAllocCount;
}


#DEFINE   wpf_SetMinPosition      0x0001
#DEFINE   wpf_RestoreToMaximized  0x0002

#DEFINE PWindowPlacement POINTER
struct TWindowPlacement
{
		word length;
		word flags;
		word showCmd;
		//TPoint ptMinPosition;
		int16 ptMinPos_x;
		int16 ptMinPos_y;
		//TPoint ptMaxPosition;
		int16 ptMaxPos_x;
		int16 ptMaxPos_y;
		//TRect rcNormalPosition;
		int16 rcNormPos_left;
		int16 rcNormPos_top;
		int16 rcNormPos_right;
		int16 rcNormPos_bottom;
}

#DEFINE PSize   POINTER
structure TSize
{
		_int16 cX;
		_int16 cY;
}


#DEFINE TOldFontEnumProc    TFarProc
#DEFINE TFontEnumProc   TFarProc


#DEFINE   TrueType_FontType  0x0004



//#DEFINE PKerningPair    *TKerningPair
#DEFINE PKerningPair    POINTER
structure TKerningPair
{
		Word wFirst;
		Word wSecond;
		_int16 iKernAmount;
}



#DEFINE   cstf_ctsHold    0x01
#DEFINE   cstf_dsrHold    0x02
#DEFINE   cstf_rlsdHold   0x04
#DEFINE   cstf_xoffHold   0x08
#DEFINE   cstf_xoffSent   0x10
#DEFINE   cstf_Eof        0x20
#DEFINE   cstf_txim       0x40


#IFDEF POINTER_SUPPORT
#DEFINE PDebugHookInfo    *TDebugHookInfo
structure TDebugHookInfo
{
		THandle hModuleHook;
		Int     reserved;
		Int     lParam;
		Word    wParam;
		_int16  code;
}
#ENDIF

// Flags returned by GetSystemDebugState.

#DEFINE   sds_Menu        0x0001
#DEFINE   sds_SysModal    0x0002
#DEFINE   sds_NoTaskQueue 0x0004
#DEFINE   sds_Dialog      0x0008
#DEFINE   sds_TaskLocked  0x0010

//#DEFINE PHelpWinInfo    *THelpWinInfo
#DEFINE PHelpWinInfo    POINTER
structure THelpWinInfo
{
		_int16 wStructSize;
		_int16 x;
		_int16 y;
		_int16 dx;
		_int16 dy;
		_int16 wMax;
		 Char rgchMember[2];
}

// Struct pointed to by WM_GETMINMAXINFO lParam
#DEFINE PMinMaxInfo   *TMinMaxInfo
structure TMinMaxInfo
{
//    TPoint ptReserved;
		int16 ptReserved_x;
		int16 ptReserved_y;
		//TPoint ptMaxSize;
		int16 ptMaxSize_x;
		int16 ptMaxSize_y;
		//TPoint ptMaxPosition;
		int16 ptMaxPosition_x;
		int16 ptMaxPosition_y;
		//TPoint ptMinTrackSize;
		int16 ptMinTrackSize_x;
		int16 ptMinTrackSize_y;
		//TPoint ptMaxTrackSize;
		int16 ptMaxTrackSize_x;
		int16 ptMaxTrackSize_y;
}

//#DEFINE PSegInfo    *TSegInfo
#DEFINE PSegInfo   POINTER
structure TSegInfo
{
		Word offSegment;
		Word cbSegment;
		Word flags;
		Word cbAlloc;
		THandle h;
		Word alignShift;
		Word reserved[2];
}



#DEFINE   gfsr_SystemResources  0x0000
#DEFINE   gfsr_GDIResources     0x0001
#DEFINE   gfsr_UserResources    0x0002



import _int16   AccessResource(THandle Instance, THandle ResInfo)  KERNEL 64;
import TAtom    AddAtom(ASCIIZ Str)  KERNEL 70;
import _int16   AddFontResource(ASCIIZ Filename)  GDI 119;
import void     AdjustWindowRect(_PRect Rect, LongInt Style, Bool Menu) USER 102;
import void     AdjustWindowRectEx(_PRect Rect, LongInt Style, Bool Menu, LongInt ExtStyle) USER 454;
import Word     AllocCStoDSAlias(Word Selector)  KERNEL 170;
import Word     AllocDStoCSAlias(Word Selector)  KERNEL 171;
import THandle  AllocResource(THandle Instance, THandle ResInfo, LongInt Size)  KERNEL 66;
import Word     AllocSelector(Word Selector)  KERNEL 175;
import void     AnimatePalette(HPalette Palette, Word StartIndex, Word NumEntires, POINTER PaletteColors) GDI 367;
import *ASCIIZ  AnsiLower(*ASCIIZ Str)  USER 432;
import Word     AnsiLowerBuff(*ASCIIZ Str, Word Length)  USER 438;
import *ASCIIZ  AnsiNext(*ASCIIZ CurrentChar)  USER 472;
import *ASCIIZ  AnsiPrev(*ASCIIZ Start, *ASCIIZ CurrentChar)  USER 473;
//import _int16 AnsiToOem(*ASCIIZ AnsiStr, *ASCIIZ OemStr)  KEYBOARD 5;
//import void AnsiToOemBuff(*ASCIIZ AnsiStr, *ASCIIZ OemStr, _int16 Length) KEYBOARD 134;
import void     AnsiToOem     (ASCIIZ AnsiStr, ASCIIZ OemStr) KEYBOARD 5;   //Imported from WIN31.SH
import void     AnsiToOemBuff (ASCIIZ AnsiStr, ASCIIZ OemStr, Word Length) KEYBOARD 134; //Imported from WIN31.SH
import *ASCIIZ  AnsiUpper(*ASCIIZ Str)  USER 431;
import Word     AnsiUpperBuff(*ASCIIZ Str, Word Length)  USER 437;
import Bool     AnyPopup()  USER 52;
import Bool     AppendMenu(HMenu Menu, Word Flags, Word IDNewItem, ASCIIZ NewItem)  USER 411;
import Bool     Arc(HDC DC, _int16 X1, _int16 Y1, _int16 X2, _int16 Y2, _int16 X3, _int16 Y3, _int16 X4, _int16 Y4)  GDI 23;
import Word     ArrangeIconicWindows(HWnd Wnd)  USER 170;
import THandle  BeginDeferWindowPos(_int16 NumWindows)  USER 259;
import HDC      BeginPaint(HWnd Wnd, PPaintStruct Paint)  USER 39;
import Bool     BitBlt  (HDC DestDC, _int16 X, _int16 Y, _int16 nWidth, _int16 Height, HDC SrcDC,
												_int16 XSrc, _int16 YSrc, LongInt Rop)  GDI 34;
import Bool     BringWindowToTop  (HWnd Wnd) USER 45;      //Imported from WIN31.SH
import _int16   BuildCommDCB(ASCIIZ Def, *PDCB DCB)  USER 213;
import Bool     CallMsgFilter(PMsg Msg, _int16 Code)  USER 123;
import LongInt  CallWindowProc(TFarProc PrevWndFunc, HWnd Wnd, Word Msg, Word wParam, LongInt lParam)  USER 122;
import _int16   Catch(PCatchBuf CatchBuf)  KERNEL 55;
import Bool     ChangeClipboardChain(HWnd Wnd, HWnd WndNext)  USER 149;
import Bool     ChangeMenu(HMenu A, Word B, ASCIIZ C, Word D, Word E)  USER 153;
import Word     ChangeSelector(Word DestSelector, Word SourceSelector)  KERNEL 177;
import void     CheckDlgButton(HWnd Dlg, _int16 IDButton, Word Check) USER 97;
import Bool     CheckMenuItem(HMenu Menu, Word IDCheckItem, Word Check)  USER 154;
import void     CheckRadioButton(HWnd Dlg, _int16 IDFirstButton, _int16 IDLastButton,_int16 IDCheckButton) USER 96;
import HWnd     ChildWindowFromPoint(HWnd Wnd, DWORD Point)  USER 191;
import Bool     Chord(HDC DC, _int16 X1, _int16 Y1, _int16 X2, _int16 Y2, _int16 X3, _int16 Y3, _int16 X4, _int16 Y4)  GDI 348;
import _int16   ClearCommBreak(_int16 Cid)  USER 211;
import void     ClientToScreen(HWnd Wnd, PPoint Point) USER 28;
import void     ClipCursor(PRect Rect) USER 16;
import Bool     CloseClipboard()  USER 138;
import _int16   CloseComm(_int16 Cid)  USER 207;
import THandle  CloseMetaFile(THandle DC)  GDI 126;
import void     CloseSound() SOUND 2;
import void     CloseWindow(HWnd Wnd) USER 43;
import _int16   CombineRgn(HRgn DestRgn, HRgn SrcRgn1, HRgn SrcRgn2, _int16 CombineMode)  GDI 47;
import THandle  CopyMetaFile(THandle SrcMetaFile, ASCIIZ FileName)  GDI 151;
import void     CopyRect(_PRect DestRect, _PRect SourceRect) USER 74;
import _int16   CountClipboardFormats()  USER 143;
import _int16   CountVoiceNotes(_int16 Voice)  SOUND 13;
//import HBitmap CreateBitmap(_int16 Width, _int16 Height, Byte Planes, Byte BitCount,
//  Pointer Bits)  GDI 48;
import HBitmap  CreateBitmap(_int16 Width, _int16 Height, Word Planes, Word BitCount, Pointer Bits)  GDI 48;      //Imported from WIN31.SH
import HBitmap  CreateBitmapIndirect(PBitmap Bitmap)  GDI 49;
import HBrush   CreateBrushIndirect(PLogbrush LogBrush)  GDI 50;
import void     CreateCaret(HWnd Wnd, HBitmap Bitmap, _int16 Width, _int16 Height) USER 163;
import HBitmap  CreateCompatibleBitmap(HDC DC, _int16 Width, _int16 Height)  GDI 51;
import HDC      CreateCompatibleDC(HDC DC)  GDI 52;
import HCursor  CreateCursor(THandle Instance, _int16 Xhotspot, _int16 Yhotspot,
										_int16 Width, _int16 Height, Pointer ANDbitPlane, Pointer XORbitPlane)  USER 406;
import HDC      CreateDC(ASCIIZ DriverName, ASCIIZ DeviceName, ASCIIZ OutPut, Pointer InitData)  GDI 53;
#IFDEF POINTER_SUPPORT
import HWnd     CreateDialog(THandle Instance, ASCIIZ TemplateName, HWnd WndParent, TFarProc DialogFunc)  USER 89;
import HWnd     CreateDialogIndirect(THandle Instance, Pointer DialogTemplate, HWnd WndParent, TFarProc DialogFunc)  USER 219;
import HWnd     CreateDialogIndirectParam(THandle Instance, Pointer DialogTemplate, HWnd WndParent, TFarProc DialogFunc, LongInt InitParam)  USER 242;
import HWnd     CreateDialogParam(THandle Instance, ASCIIZ TemplateName, HWnd WndParent, TFarProc DialogFunc, LongInt InitParam)  USER 241;
#ENDIF
import HBitmap  CreateDIBitmap  (HDC DC, PBitmapInfoHeader InfoHeader, LongInt dwUsage, *ASCIIZ InitBits, PBitmapInfo InitInfo, Word wUsage)  GDI 442;
//import HBitmap  CreateDIBitmap  (HDC DC, PBitmapInfoHeader InfoHeader, LongInt dwUsage, *ASCIIZ InitBits, *TBitmapInfo InitInfo, Word wUsage)  GDI 442;
import HBrush   CreateDIBPatternBrush(THandle PackedDIB, Word Usage)  GDI 445;
import HBitmap  CreateDiscardableBitmap(HDC DC, _int16 Width, _int16 Height)  GDI 156;
import HRgn     CreateEllipticRgn(_int16 X1, _int16 Y1, _int16 X2, _int16 Y2)  GDI 54;
import HRgn     CreateEllipticRgnIndirect(_PRect Rect)  GDI 55;
import HFont    CreateFont(_int16 Height, _int16 Width, _int16 Escapement, _int16 Orientation,_int16
									Weight, Byte Italic, Byte Underline, Byte StrikeOut, Byte CharSet, Byte OutputPrecision,Byte
									ClipPrecision, Byte Quality, Byte PitchAndFamily, ASCIIZ Facename)  GDI 56;
import HFont    CreateFontIndirect(PLogfont LogFont)  GDI 57;
import HBrush   CreateHatchBrush(_int16 Index, TColorRef Color)  GDI 58;
import HDC      CreateIC(ASCIIZ DriverName, ASCIIZ DeviceName, ASCIIZ Output, Pointer InitData)  GDI 153;
import HIcon    CreateIcon(THandle Instance, _int16 Width, _int16 Height, Byte Planes, Byte BitsPixel, Pointer ANDbits, Pointer XORbits)  USER 407;
import HMenu    CreateMenu()  USER 151;
import THandle  CreateMetaFile(ASCIIZ Filename)  GDI 125;
#IFDEF POINTER_SUPPORT
import HPalette CreatePalette(*TLogPalette LogPalette)  GDI 360;
#ENDIF
import HBrush   CreatePatternBrush(HBitmap Bitmap)  GDI 60;
import HPen     CreatePen(_int16 PenStyle, _int16 Width, TColorRef Color)  GDI 61;
import HPen     CreatePenIndirect(PLogPen LogPen)  GDI 62;
import HRgn     CreatePolygonRgn(POINTER Points, _int16 Count, _int16 PolyFillMode)  GDI 63;
import HRgn     CreatePolyPolygonRgn(POINTER Points, POINTER PolyCounts, _int16 Count,_int16 PolyFillMode)  GDI 451;
import HMenu    CreatePopupMenu()  USER 415;
import HRgn     CreateRectRgn(_int16 X1, _int16 Y1, _int16 X2, _int16 Y2)  GDI 64;
import HRgn     CreateRectRgnIndirect(_PRect Rect)  GDI 65;
import HRgn     CreateRoundRectRgn(_int16 X1, _int16 Y1, _int16 X2, _int16 Y2, _int16 X3, _int16 Y3)  GDI 444;
import HBrush   CreateSolidBrush(TColorRef Color)  GDI 66;
import HWnd     CreateWindow(ASCIIZ ClassName, ASCIIZ WindowName, LongInt Style,
										_int16 X, _int16 Y, _int16 Width, _int16 Height, HWnd WndParent, HMenu Menu,
										THandle Instance, Pointer Param)  USER 41;
import HWnd     CreateWindowEx(LongInt ExStyle, ASCIIZ ClassName, ASCIIZ WindowName,
										LongInt Style, _int16 X, _int16 Y, _int16 Width, _int16 Height, HWnd WndParent,
										HMenu Menu, THandle Instance, Pointer Param)  USER 452;
import void     DebugBreak() KERNEL 203;
import LongInt  DefDlgProc (HWnd Dlg, Word Msg, Word wParam, LongInt lParam)  USER 308;
import THandle  DeferWindowPos(THandle WinPosInfo, HWnd Wnd, HWnd WndInsertAfter,
										_int16 x, _int16 y, _int16 cx, _int16 cy, Word Flags)  USER 260;
import LongInt  DefFrameProc(HWnd Wnd, HWnd WndMDIClient, Word Msg, Word wParam, LongInt lParam)  USER 445;
#IFDEF POINTER_SUPPORT
import LongInt  DefHookProc(_int16 Code, Word wParam, LongInt lParam, TFarProc lpfnNextHook)  USER 235;
#ENDIF
import Bool     DefineHandleTable(Word Offset)  KERNEL 94;
import LongInt  DefMDIChildProc(HWnd Wnd, Word Msg, Word wParam, LongInt lParam)  USER 447;
import LongInt  DefWindowProc(HWnd Wnd, Word Msg, Word wParam, LongInt lParam)  USER 107;
import TAtom    DeleteAtom(TAtom AnAtom)  KERNEL 71;
import Bool     DeleteDC(HDC DC)  GDI 68;
import Bool     DeleteMenu(HMenu Menu, Word Position, Word Flags)  USER 413;
import Bool     DeleteMetaFile(THandle MF)  GDI 127;
import Bool     DeleteObject(THandle Handle)  GDI 69;
import void     DestroyCaret() USER 164;
import Bool     DestroyCursor(HCursor Cursor)  USER 458;
import Bool     DestroyIcon(HIcon Icon)  USER 457;
import Bool     DestroyMenu(HMenu Menu)  USER 152;
import Bool     DestroyWindow(HWnd Wnd)  USER 53;
#IFDEF POINTER_SUPPORT
import _int16   DialogBox(THandle Instance, ASCIIZ Templatename, HWnd WndParent, TFarProc DialogFunc)  USER 87;
import _int16   DialogBoxIndirect(THandle Instance, THandle DialogTemplate, HWnd WndParent,   TFarProc DialogFunc)  USER 218;
import _int16   DialogBoxIndirectParam(THandle Instance, THandle DialogTemplate, HWnd WndParent, TFarProc DialogFunc, LongInt InitParam)  USER 240;
import _int16   DialogBoxParam(THandle Instance, ASCIIZ TemplateName, HWnd WndParent, TFarProc DialogFunc, LongInt InitParam)  USER 239;
#ENDIF
import LongInt  DispatchMessage(PMsg Msg)  USER 114;
import _int16   DlgDirList(HWnd Dlg, ASCIIZ PathSpec, _int16 IDListBox,_int16 IDStaticPath, Word Filetype)  USER 100;
import _int16   DlgDirListComboBox(HWnd Dlg, ASCIIZ PathSpec, _int16 IDComboBox,_int16 IDStaticText, Word Filetype)  USER 195;
import Bool     DlgDirSelect(HWnd Dlg, ASCIIZ Str, _int16 IDListBox)  USER 99;
import Bool     DlgDirSelectComboBox(HWnd Dlg, ASCIIZ Str, _int16 IDComboBox)  USER 194;
import void     DOS3Call() KERNEL 102;
import Bool     DPtoLP(HDC DC, POINTER Points, _int16 Count)  GDI 67;
import void     DrawFocusRect(HDC DC, _PRect Rect) USER 466;
import Bool     DrawIcon(HDC DC, _int16 X, _int16 Y, HIcon Icon)  USER 84;
import void     DrawMenuBar(HWnd Wnd) USER 160;
import _int16   DrawText(HDC DC, ASCIIZ Str, _int16 Count, _PRect Rect, Word Format)  USER 85;
import Bool     Ellipse(HDC DC, _int16 X1, _int16 Y1, _int16 X2, _int16 Y2)  GDI 24;
import Bool     EmptyClipboard()  USER 139;
import Bool     EnableHardwareInput(Bool EnableInput)  USER 331;
import Bool     EnableMenuItem(HMenu Menu, Word IDEnableItem, Word Enable)  USER 155;
import Bool     EnableWindow(HWnd Wnd, Bool Enable)  USER 34;
import Bool     EndDeferWindowPos (THandle WinPosInfo) USER 261;     //Imported from WIN31.SH
import void     EndDialog(HWnd Dlg, _int16 Result) USER 88;
import void     EndPaint(HWnd Wnd, PPaintStruct Paint) USER 40;
#IFDEF POINTER_SUPPORT
import Bool     EnumChildWindows(HWnd WndParent, TFarProc EnumFunc, LongInt lParam)  USER 55;
import Word     EnumClipboardFormats(Word Format)  USER 144;
import _int16   EnumFonts(HDC DC, ASCIIZ Facename, TFarProc FontFunc, Pointer Data)  GDI 70;
import Bool     EnumMetaFile(HDC DC, THandle MF, TFarProc CallbackFunc, Pointer ClientData)  GDI 175;
import _int16   EnumObjects(HDC DC, _int16 ObjectType, TFarProc ObjectFunc, Pointer Data)  GDI 71;
import _int16   EnumProps(HWnd Wnd, TFarProc EnumFunc)  USER 27;
import Bool     EnumTaskWindows(THandle Task, TFarProc EnumFunc, LongInt lParam)  USER 225;
import Bool     EnumWindows(TFarProc EnumFunc, LongInt lParam)  USER 54;
#ENDIF
import Bool     EqualRect(_PRect Rect1, _PRect Rect2)  USER 244;
import Bool     EqualRgn(HRgn SrcRgn1, HRgn SrcRgn2)  GDI 72;
import _int16   Escape  (HDC DC, _int16 Escape, _int16 Count, PChar InData, Pointer OutData) GDI 38;   //Imported from WIN31.SH
import LongInt  EscapeCommFunction(_int16 Cid, _int16 Func)  USER 214;
import _int16   ExcludeClipRect(HDC DC, _int16 X1, _int16 Y1, _int16 X2, _int16 Y2)  GDI 21;
import _int16   ExcludeUpdateRgn(HDC DC, HWnd Wnd)  USER 238;
import Bool     ExitWindows(LongInt Reserved, Word ReturnCode)  USER 7;
import Bool     ExtFloodFill(HDC DC, _int16 X, _int16 Y, TColorRef Color, Word FillType)  GDI 372;
import Bool     ExtTextOut(HDC DC, _int16 X, _int16 Y, Word Options, PRect Rect, ASCIIZ Str, Word Count, Pointer Dx)  GDI 351;
import void     FatalAppExit(Word Action, ASCIIZ MessageText) KERNEL 137;
import void     FatalExit(_int16 Code) KERNEL 1;
import _int16   FillRect(HDC DC, _PRect Rect, HBrush Brush)  USER 81;
import Bool     FillRgn(HDC DC, HRgn Rgn, HBrush Brush)  GDI 40;
import TAtom    FindAtom(ASCIIZ Str)  KERNEL 69;
import THandle  FindResource(THandle Instance, ASCIIZ Name, ASCIIZ ResType)  KERNEL 60;
import THandle  FindResourceP(THandle Instance, ASCIIZ Name, DWORD resType)  KERNEL 60;
import HWnd     FindWindow(ASCIIZ Classname, ASCIIZ WindowName)  USER 50;
import HWnd     FindWindowN(ASCIIZ Classname, DWORD WindowName)  USER 50;
import HWnd     FindWindowC(DWORD Classname, ASCIIZ WindowName)  USER 50;
import Bool     FlashWindow(HWnd Wnd, Bool Invert)  USER 105;
import Bool     FloodFill(HDC DC, _int16 X, _int16 Y, TColorRef Color)  GDI 25;
import _int16   FlushComm(_int16 Cid, _int16 Queue)  USER 215;
import _int16   FrameRect (HDC DC, PRect Rect, HBrush Brush) USER 83;      //Imported from WIN31.SH
import Bool     FrameRgn(HDC DC, HRgn Rgn, HBrush Brush, _int16 Width,_int16 Height)  GDI 41;
import void     FreeLibrary(THandle LibModule) KERNEL 96;
import Bool     FreeModule(THandle Module)  KERNEL 46;
#IFDEF POINTER_SUPPORT
import void     FreeProcInstance(TFarProc Proc) KERNEL 52;
#ENDIF
import Bool     FreeResource(THandle ResData)  KERNEL 63;
import Word     FreeSelector(Word Selector)  KERNEL 176;
import HWnd     GetActiveWindow()  USER 60;
import LongInt  GetAspectRatioFilter(HDC DC)  GDI 353;
import _int16   GetAsyncKeyState(_int16 Key)  USER 249;
import THandle  GetAtomHandle(TAtom AnAtom)  KERNEL 73;
import Word     GetAtomName(TAtom AnAtom, *ASCIIZ Buffer, _int16 Size)  KERNEL 72;
import LongInt  GetBitmapBits(HBitmap Bitmap, LongInt Count, Pointer Bits)  GDI 74;
import LongInt  GetBitmapDimension(HBitmap Bitmap)  GDI 162;
import LongInt  GetBkColor(HDC DC)  GDI 75;
import _int16   GetBkMode(HDC DC)  GDI 76;
import LongInt  GetBrushOrg(HDC DC)  GDI 149;
import HWnd     GetCapture()  USER 236;
import Word     GetCaretBlinkTime()  USER 169;
import void     GetCaretPos(PPoint Point) USER 183;
import Bool     GetCharWidth(HDC DC, Word FirstChar, Word LastChar, POINTER Buffer)  GDI 350;
#IFDEF POINTER_SUPPORT
import Bool     GetClassInfo(THandle Instance, ASCIIZ ClassInfo, PWndClass WndClass)  USER 404;
#ENDIF
import LongInt  GetClassLong(HWnd Wnd, _int16 Index)  USER 131;
import _int16   GetClassName(HWnd Wnd, *ASCIIZ ClassName, _int16 MaxCount)  USER 58;
import Word     GetClassWord(HWnd Wnd, _int16 Index)  USER 129;
import void     GetClientRect(HWnd Wnd, _PRect Rect) USER 33;
import THandle  GetClipboardData(Word Format)  USER 142;
import _int16   GetClipboardFormatName(Word Format, *ASCIIZ FormatName, _int16 MaxCount)  USER 146;
import HWnd     GetClipboardOwner()  USER 140;
import HWnd     GetClipboardViewer()  USER 148;
import _int16   GetClipBox(HDC DC, _PRect Rect)  GDI 77;
#IFDEF POINTER_SUPPORT
import THandle  GetCodeHandle(TFarProc Proc)  KERNEL 93;
import void     GetCodeInfo(TFarProc Proc, Pointer SegInfo) KERNEL 104;
#ENDIF
import _int16   GetCommError(_int16 Cid, PComStat Stat)  USER 203;
import Word     GetCommEventMask(_int16 Cid, _int16 EvtMask)  USER 209;
import _int16   GetCommState(_int16 Cid, *PDCB DCB)  USER 202;
import Word     GetCurrentPDB()  KERNEL 37;
import LongInt  GetCurrentPosition(HDC DC)  GDI 78;
import THandle  GetCurrentTask()  KERNEL 36;
import LongInt  GetCurrentTime()  USER 15;
import void     GetCursorPos(PPoint Point) USER 17;
import HDC      GetDC(HWnd Wnd)  USER 66;
import LongInt  GetDCOrg(HDC DC)  GDI 79;
import HWnd     GetDesktopHwnd()  USER 278;
import HWnd     GetDesktopWindow()  USER 286;
import _int16   GetDeviceCaps(HDC DC, _int16 Index)  GDI 80;
import LongInt  GetDialogBaseUnits()  USER 243;
import _int16   GetDIBits(HDC DC, HBitmap Bitmap, Word StartScan, Word NumScans,
										Pointer Bits, PBitmapInfo BitInfo, Word Usage)  GDI 441;
										//Pointer Bits, *TBitmapInfo BitInfo, Word Usage)  GDI 441;
import _int16   GetDlgCtrlID(HWnd Wnd)  USER 277;
import HWnd     GetDlgItem(HWnd Dlg, _int16 IDDlgItem)  USER 91;
import Word     GetDlgItemInt(HWnd Dlg, _int16 IDDlgItem, PBool Translate, Bool Signed)  USER 95;
import _int16   GetDlgItemText(HWnd Dlg, _int16 IDDlgItem, *ASCIIZ Str, _int16 MaxCount)  USER 93;
import *ASCIIZ  GetDOSEnvironment()  KERNEL 131;
import Word     GetDoubleClickTime()  USER 21;
import Word     GetDriveType(_int16 Drive)  KERNEL 136;
import _int16   GetEnvironment(ASCIIZ PortName, Pointer Environ, Word MaxCount)  GDI 133;
import HWnd     GetFocus()  USER 23;
import LongInt  GetFreeSpace(Word Flag)  KERNEL 169;
import Bool     GetInputState()  USER 335;
import _int16   GetInstanceData (THandle Instance, PByte Data, _int16 Count) KERNEL 54;      //Imported from WIN31.SH
import _int16   GetKBCodePage()  KEYBOARD 132;
import void     GetKeyboardState(PKeyboardState KeyState) USER 222;
import _int16   GetKeyboardType(_int16 TypeFlag)  KEYBOARD 130;
import _int16   GetKeyNameText(LongInt lParam, *ASCIIZ Buffer, _int16 Size)  KEYBOARD 133;
import _int16   GetKeyState(_int16 VirtKey)  USER 106;
import HWnd     GetLastActivePopup(HWnd Owner)  USER 287;
import _int16   GetMapMode(HDC DC)  GDI 81;
import HMenu    GetMenu(HWnd Wnd)  USER 157;
import LongInt  GetMenuCheckMarkDimensions()  USER 417;
import _int16   GetMenuItemCount  (HMenu Menu) USER 263;   //Imported from WIN31.SH
import Word     GetMenuItemID(HMenu Menu, _int16 Pos)  USER 264;
import Word     GetMenuState(HMenu Menu, Word Id, Word Flags)  USER 250;
import _int16   GetMenuString(HMenu Menu, Word IDItem, *ASCIIZ Str, _int16 MaxCount, Word Flag)  USER 161;
import Bool     GetMessage(PMsg Msg, HWnd Wnd, Word MsgFilterMin,Word MsgFilterMax)  USER 108;
import LongInt  GetMessagePos()  USER 119;
import LongInt  GetMessageTime()  USER 120;
import THandle  GetMetaFile(ASCIIZ Filename)  GDI 124;
import THandle  GetMetaFileBits(THandle MF)  GDI 159;
import _int16   GetModuleFileName(THandle Module, *ASCIIZ Filename, _int16 Size)  KERNEL 49;
import THandle  GetModuleHandle(ASCIIZ ModuleName)  KERNEL 47;
import _int16   GetModuleUsage(THandle Module)  KERNEL 48;
import TColorRef GetNearestColor(HDC DC, TColorRef Color)  GDI 154;
import Word     GetNearestPaletteIndex(HPalette Palette, TColorRef Color)  GDI 370;
import HWnd     GetNextDlgGroupItem(HWnd Dlg, HWnd Ctl, Bool Previous)  USER 227;
import HWnd     GetNextDlgTabItem(HWnd Dlg, HWnd Ctl, Bool Previous)  USER 228;
import HWnd     GetNextWindow(HWnd Wnd, Word Flag)  USER 230;
import Word     GetNumTasks()  KERNEL 152;
import _int16   GetObject(THandle hObject, _int16 Count, Pointer lpObject)  GDI 82;
import Word     GetPaletteEntries(HPalette Palette, Word StartIndex, Word NumEntries, POINTER PaletteEntries)  GDI 363;
import HWnd     GetParent(HWnd Wnd)  USER 46;
import TColorRef GetPixel(HDC DC, _int16 X, _int16 Y)  GDI 83;
import _int16   GetPolyFillMode(HDC DC)  GDI 84;
import _int16   GetPriorityClipboardFormat(POINTER PriorityList, _int16 Count)  USER 402;
import Word     GetPrivateProfileInt(ASCIIZ ApplicationName, ASCIIZ KeyName, _int16 Default, ASCIIZ FileName)  KERNEL 127;
import _int16   GetPrivateProfileString(ASCIIZ ApplicationName, ASCIIZ KeyName, ASCIIZ Default, *ASCIIZ ReturnedString, _int16 Size, ASCIIZ FileName)  KERNEL 128;
#IFDEF POINTER_SUPPORT
import TFarProc GetProcAddress(THandle Module, ASCIIZ ProcName)  KERNEL 50;
#ENDIF
import Word     GetProfileInt(ASCIIZ AppName, ASCIIZ KeyName, _int16 Default)  KERNEL 57;
import _int16   GetProfileString(ASCIIZ AppName, ASCIIZ KeyName, ASCIIZ Default, *ASCIIZ ReturnedString, _int16 Size)  KERNEL 58;
import THandle  GetProp(HWnd Wnd, ASCIIZ Str)  USER 25;
import _int16   GetRgnBox(HRgn Rgn, _PRect Rect)  GDI 134;
import _int16   GetROP2(HDC DC)  GDI 85;
import _int16   GetScrollPos(HWnd Wnd, _int16 Bar)  USER 63;
import void     GetScrollRange(HWnd Wnd, _int16 Bar, *_int16 MinPos,*_int16 MaxPos) USER 65;
import THandle  GetStockObject(_int16 Index)  GDI 87;
import _int16   GetStretchBltMode(HDC DC)  GDI 88;
import HMenu    GetSubMenu(HMenu Menu, _int16 Pos)  USER 159;
import TColorRef GetSysColor(_int16 Index)  USER 180;
import HWnd     GetSysModalWindow()  USER 189;
import Word     GetSystemDirectory(*ASCIIZ Buffer, Word Size)  KERNEL 135;
import HMenu    GetSystemMenu(HWnd Wnd, Bool bRevert)  USER 156;
import _int16   GetSystemMetrics(_int16 Index)  USER 179;
import Word     GetSystemPaletteEntries(HDC DC, Word StartIndex, Word NumEntries, POINTER PaletteEntries)  GDI 375;
import Word     GetSystemPaletteUse(HDC DC)  GDI 374;
import LongInt  GetTabbedTextExtent(HDC DC, ASCIIZ Str, _int16 Count, _int16 TabPostions, POINTER TabStopPostions)  USER 197;
import BYTE     GetTempDrive(BYTE DriveLetter)  KERNEL 92;
import _int16   GetTempFileName(BYTE DriveLetter, ASCIIZ PrefixString, Word Unique, *ASCIIZ TempFileName)  KERNEL 97;
import Word     GetTextAlign(HDC DC)  GDI 345;
import _int16   GetTextCharacterExtra(HDC DC)  GDI 89;
import TColorRef GetTextColor(HDC DC)  GDI 90;
import LongInt  GetTextExtent(HDC DC, ASCIIZ Str, _int16 Count)  GDI 91;
import _int16   GetTextFace(HDC DC, _int16 Count, *ASCIIZ Facename)  GDI 92;
import Bool     GetTextMetrics(HDC DC, PTextMetric Metrics)  GDI 93;
import PInteger GetThresholdEvent()  SOUND 14;
import _int16   GetThresholdStatus()  SOUND 15;
import LongInt  GetTickCount()  USER 13;
import HWnd     GetTopWindow(HWnd Wnd)  USER 229;
import Bool     GetUpdateRect(HWnd Wnd, _PRect Rect, Bool Erase)  USER 190;
import _int16   GetUpdateRgn(HWnd Wnd, HRgn Rgn, Bool Erase)  USER 237;
import LongInt  GetVersion()  KERNEL 3;
import LongInt  GetViewportExt(HDC DC)  GDI 94;
import LongInt  GetViewportOrg(HDC DC)  GDI 95;
import HWnd     GetWindow(HWnd Wnd, Word Cmd)  USER 262;
import HDC      GetWindowDC(HWnd Wnd)  USER 67;
import LongInt  GetWindowExt(HDC DC)  GDI 96;
import LongInt  GetWindowLong(HWnd Wnd, _int16 Index)  USER 135;
import LongInt  GetWindowOrg(HDC DC)  GDI 97;
import void     GetWindowRect(HWnd Wnd, _PRect Rect) USER 32;
import Word     GetWindowsDirectory(*ASCIIZ Buffer, Word Size)  KERNEL 134;
import THandle  GetWindowTask(HWnd Wnd)  USER 224;
import _int16   GetWindowText(HWnd Wnd, *ASCIIZ Str, _int16 MaxCount)  USER 36;
import _int16   GetWindowTextLength(HWnd Wnd)  USER 38;
import Word     GetWindowWord(HWnd Wnd, _int16 Index)  USER 133;
import LongInt  GetWinFlags()  KERNEL 132;
import TAtom    GlobalAddAtom(ASCIIZ Str)  USER 268;
// Should we get rid of these ???
import THandle  GlobalAlloc(Word Flags, LongInt Bytes)  KERNEL 15;
import LongInt  GlobalCompact(LongInt MinFree)  KERNEL 25;
import TAtom    GlobalDeleteAtom(TAtom AnAtom)  USER 269;
import LongInt  GlobalDosAlloc(LongInt Bytes)  KERNEL 184;
import Word     GlobalDosFree(Word Selector)  KERNEL 185;
import TAtom    GlobalFindAtom(ASCIIZ Str)  USER 270;
import void     GlobalFix(THandle Mem) KERNEL 197;
import Word     GlobalFlags(THandle Mem)  KERNEL 22;
import THandle  GlobalFree(THandle Mem)  KERNEL 17;
import Word     GlobalGetAtomName(TAtom AnAtom, ASCIIZ Buffer, _int16 Size)  USER 271;
import LongInt  GlobalHandle(Word Mem)  KERNEL 21;
import Pointer  GlobalLock(THandle Mem)  KERNEL 18;
import THandle  GlobalLRUNewest(THandle Mem)  KERNEL 164;
import THandle  GlobalLRUOldest(THandle Mem)  KERNEL 163;
#IFDEF POINTER_SUPPORT
import void     GlobalNotify(TFarProc NotifyProc) KERNEL 154;
#ENDIF
import Word     GlobalPageLock(THandle Selector)  KERNEL 191;
import Word     GlobalPageUnlock(THandle Selector)  KERNEL 192;
import THandle  GlobalReAlloc(THandle Mem, LongInt Bytes, Word Flags)  KERNEL 16;
import LongInt  GlobalSize(THandle Mem)  KERNEL 20;
import void     GlobalUnfix(THandle Mem) KERNEL 198;     //Imported from WIN31.SH
import Bool     GlobalUnlock(THandle Mem)  KERNEL 19;
import Bool     GlobalUnWire(THandle Mem)  KERNEL 112;
import Pointer  GlobalWire(THandle Mem)  KERNEL 111;
// End of these
#IFDEF POINTER_SUPPORT
import Bool     GrayString(HDC DC, HBrush Brush, TFarProc OutputFunc, LongInt Data, _int16 Count, _int16 X, _int16 Y, _int16 Width, _int16 Height)  USER 185;
#ENDIF
import void     HideCaret(HWnd Wnd) USER 166;
import Bool     HiliteMenuItem(HWnd Wnd, HMenu Menu, Word IDHilite,Word Hilite)  USER 162;
import void     InflateRect(_PRect Rect, _int16 X, _int16 Y) USER 78;
import Bool     InitAtomTable(_int16 Size)  KERNEL 68;
import Bool     InSendMessage()  USER 192;
import Bool     InsertMenu(HMenu Menu, Word Position, Word Flags, Word IDNewItem, ASCIIZ NewItem)  USER 410;
import _int16 IntersectClipRect(HDC DC, _int16 X1, _int16 Y1, _int16 X2, _int16 Y2)  GDI 22;
import _int16 IntersectRect(_PRect DestRect, _PRect Src1Rect, _PRect Src2Rect)  USER 79;
import void InvalidateRect(HWnd Wnd, PRect Rect, Bool Erase) USER 125;
import void InvalidateRgn(HWnd Wnd, HRgn Rgn, Bool Erase) USER 126;
import void InvertRect(HDC DC, _PRect Rect) USER 82;
import Bool InvertRgn(HDC DC, HRgn Rgn)  GDI 42;
import Bool IsCharAlpha(_char Chr)  USER 433;
import Bool IsCharAlphaNumeric(_char Chr)  USER 434;
import Bool IsCharLower(_char Chr)  USER 436;
import Bool IsCharUpper(_char Chr)  USER 435;
import Bool IsChild(HWnd WndParent, HWnd Wnd)  USER 48;
import Bool IsClipboardFormatAvailable(Word Format)  USER 193;
import Bool IsDialogMessage(HWnd Dlg, PMsg Msg)  USER 90;
import Word IsDlgButtonChecked(HWnd Wnd, _int16 IDButton)  USER 98;
import Bool IsIconic(HWnd Wnd)  USER 31;
import Bool IsRectEmpty(_PRect Rect)  USER 75;
import Bool IsTwoByteCharPrefix(_char Chr)  USER 51;
import Bool IsWindow(HWnd Wnd)  USER 47;
import Bool IsWindowEnabled(HWnd Wnd)  USER 35;
import Bool IsWindowVisible(HWnd Wnd)  USER 49;
import Bool IsZoomed(HWnd Wnd)  USER 272;
import Bool KillTimer(HWnd Wnd, _int16 IDEvent)  USER 12;
import void LimitEmsPages(LongInt Kbytes) KERNEL 156;
#IFDEF POINTER_SUPPORT
import void LineDDA(_int16 X1, _int16 Y1, _int16 X2, _int16 Y2, TFarProc LineFunc,
	Pointer Data) GDI 100;
#ENDIF
import Bool LineTo(HDC DC, _int16 X, _int16 Y)  GDI 19;
import THandle LoadAccelerators(THandle Instance, ASCIIZ TableName)  USER 177;
import HBitmap LoadBitmap(THandle Instance, ASCIIZ BitmapName)  USER 175;
import HCursor LoadCursor(THandle Instance, ASCIIZ CursorName)  USER 173;
import HIcon LoadIcon(THandle Instance, ASCIIZ IconName)  USER 174;
import THandle LoadLibrary(ASCIIZ LibFileName)  KERNEL 95;
import HMenu LoadMenu(THandle Instance, ASCIIZ MenuName)  USER 150;
import HMenu LoadMenuIndirect(Pointer MenuTemplate)  USER 220;
import THandle LoadModule(ASCIIZ ModuleName, Pointer ParameterBlock)  KERNEL 45;
import THandle LoadResource(THandle Instance, THandle ResInfo)  KERNEL 61;
import _int16 LoadString(THandle Instance, Word ID, *ASCIIZ Buffer,
	_int16 BufferMax)  USER 176;
import THandle LocalAlloc(Word Flags, Word Bytes)  KERNEL 5;
import Word LocalCompact(Word MinFree)  KERNEL 13;
import Word LocalFlags(THandle Mem)  KERNEL 12;
import THandle LocalFree(THandle Mem)  KERNEL 7;
import THandle LocalHandle(Word Mem)  KERNEL 11;
import Bool LocalInit(Word Segment, Word Start, Word EndPos)  KERNEL 4;
#IFDEF POINTER_SUPPORT
import TFarProc LocalNotify(TFarProc NotifyProc)  KERNEL 14;
#ENDIF
import THandle LocalReAlloc(THandle Mem, Word Bytes, Word Flags)  KERNEL 6;
import Word LocalShrink(THandle Seg, Word Size)  KERNEL 121;
import Word LocalSize(THandle Mem)  KERNEL 10;
import Bool LocalUnlock(THandle Mem)  KERNEL 9;
import Pointer LockResource(THandle ResData)  KERNEL 62;
import THandle LockSegment(Word Segment)  KERNEL 23;
import Bool LPtoDP(HDC DC, POINTER Points, _int16 Count)  GDI 99;
import *ASCIIZ lstrcat(ASCIIZ Str1, ASCIIZ Str2)  KERNEL 89;
import _int16 lstrcmp(ASCIIZ Str1, ASCIIZ Str2)  USER 430;
import _int16 lstrcmpi(ASCIIZ Str1, ASCIIZ Str2)  USER 471;
import *ASCIIZ lstrcpy(*ASCIIZ Str1, ASCIIZ Str2)  KERNEL 88;
import _int16 lstrlen(ASCIIZ Str)  KERNEL 90;
#IFDEF POINTER_SUPPORT
import TFarProc MakeProcInstance(TFarProc Proc, THandle Instance)  KERNEL 51;
#ENDIF
import void MapDialogRect(HWnd Dlg, _PRect Rect) USER 103;
import Word MapVirtualKey(Word Code, Word MapType)  KEYBOARD 131;
import void MessageBeep(Word BeepType) USER 104;
import _int16 MessageBox(HWnd WndParent, ASCIIZ Txt, ASCIIZ Caption,
	Word TextType)  USER 1;
import Bool ModifyMenu(HMenu Menu, Word Position, Word Flags, Word IDNewItem,
	ASCIIZ NewItem)  USER 414;
import LongInt MoveTo(HDC DC, _int16 X, _int16 Y)  GDI 20;
import void MoveWindow(HWnd Wnd, _int16 X, _int16 Y, _int16 Width, _int16 Height, Bool Repaint) USER 56;
import _int16 MulDiv(_int16 Number, _int16 Numerator,
	_int16 Denominator)  GDI 128;
import void NetBIOSCall() KERNEL 103;
import LongInt OemKeyScan(Word OemChar)  KEYBOARD 128;
//import Bool OemToAnsi(ASCIIZ OemStr, ASCIIZ AnsiStr)  KEYBOARD 6;
import void OemToAnsi(ASCIIZ OemStr, ASCIIZ AnsiStr)
				KEYBOARD 6;     //Imported from WIN31.SH
//import void OemToAnsiBuff(ASCIIZ OemStr, ASCIIZ AnsiStr, _int16 Length) KEYBOARD 135;
import void OemToAnsiBuff (ASCIIZ OemStr, ASCIIZ AnsiStr, Word Length)
				KEYBOARD 135;   //Imported from WIN31.SH
import _int16 OffsetClipRgn(HDC DC, _int16 X, _int16 Y)  GDI 32;
import void OffsetRect(_PRect Rect, _int16 X, _int16 Y) USER 77;
import _int16 OffsetRgn(HRgn Rgn, _int16 X, _int16 Y)  GDI 101;
import LongInt OffsetViewportOrg(HDC DC, _int16 X, _int16 Y)  GDI 17;
import LongInt OffsetWindowOrg(HDC DC, _int16 X, _int16 Y)  GDI 15;
import Bool OpenClipboard(HWnd Wnd)  USER 137;
import _int16 OpenComm(ASCIIZ ComName, Word InQueue, Word OutQueue)  USER 200;
import _int16 OpenFile(ASCIIZ FileName, POfStruct ReOpenBuff,
	Word Style)  KERNEL 74;
import Bool OpenIcon(HWnd Wnd)  USER 44;
import _int16 OpenSound()  SOUND 1;
import void OutputDebugString(ASCIIZ OutputString) KERNEL 115;
import Bool PaintRgn(HDC DC, HRgn Rgn)  GDI 43;
import Bool PatBlt(HDC DC, _int16 X, _int16 Y, _int16 Width, _int16 Height, LongInt Rop)  GDI 29;
import Bool PeekMessage(PMsg Msg, HWnd Wnd, Word MsgFilterMin,Word
	MsgFilterMax, Word RemoveMsg)  USER 109;
import Bool Pie(HDC DC, _int16 X1, _int16 Y1, _int16 X2, _int16 Y2, _int16 X3, _int16 Y3, _int16 X4, _int16 Y4)  GDI 26;
import Bool PlayMetaFile(HDC DC, THandle MF)  GDI 123;
import void PlayMetaFileRecord(HDC DC, PHandleTable HandleTable,
	PMetaRecord MetaRecord, Word Handles) GDI 176;
import Bool Polygon(HDC DC, POINTER Points, _int16 Count)  GDI 36;
import Bool Polyline(HDC DC, POINTER Points, _int16 Count)  GDI 37;
import Bool PolyPolygon(HDC DC, POINTER Points, POINTER PolyCounts,
	_int16 Count)  GDI 450;
import Bool PostAppMessage(THandle Task, Word Msg, Word wParam,
	LongInt lParam)  USER 116;
import Bool PostMessage(HWnd Wnd, Word Msg, Word wParam, LongInt lParam)  USER 110;
import void PostQuitMessage(_int16 ExitCode) USER 6;
import Bool PtInRect(_PRect Rect, DWORD Point)  USER 76;
import Bool PtInRegion(HRgn Rgn, _int16 X, _int16 Y)  GDI 161;
import Bool PtVisible(HDC DC, _int16 X, _int16 Y)  GDI 103;
import _int16 ReadComm(_int16 Cid, ASCIIZ Buf, _int16 Size)  USER 204;
import Word RealizePalette(HDC DC)  USER 283;
import Bool Rectangle(HDC DC, _int16 X1, _int16 Y1, _int16 X2, _int16 Y2)  GDI 27;
import Bool RectInRegion(HRgn Rgn, _PRect Rect)  GDI 181;
import Bool RectVisible(HDC DC, _PRect Rect)  GDI 104;
IMPORT BOOL RedrawWindow(HWnd Wnd, POINTER UpdateRect, HRgn UpdateRgn,WORD Flags)
												USER 290;
#IFDEF POINTER_SUPPORT
import Bool RegisterClass(PWndClass WndClass)  USER 57;
#ENDIF
import Word RegisterClipboardFormat(ASCIIZ FormatName)  USER 145;
import Word RegisterWindowMessage(ASCIIZ Str)  USER 118;
import void ReleaseCapture() USER 19;
import _int16 ReleaseDC(HWnd Wnd, HDC DC)  USER 68;
import Bool RemoveFontResource(ASCIIZ Filename)  GDI 136;
import Bool RemoveMenu(HMenu Menu, Word Position, Word Flags)  USER 412;
import THandle RemoveProp(HWnd Wnd, ASCIIZ Str)  USER 24;
import void ReplyMessage(LongInt Reply) USER 115;
import Bool ResizePalette(HPalette Palette, Word NumEntries)  GDI 368;
import Bool RestoreDC(HDC DC, _int16 SavedDC)  GDI 39;
import Bool RoundRect(HDC DC, _int16 X1, _int16 Y1, _int16 X2, _int16 Y2, _int16 X3, _int16 Y3)  GDI 28;
import _int16 SaveDC(HDC DC)  GDI 30;
import LongInt ScaleViewportExt(HDC DC, _int16 Xnum, _int16 Xdenom, _int16 Ynum,_int16
	Ydenom)  GDI 18;
import LongInt ScaleWindowExt(HDC DC, _int16 Xnum, _int16 Xdenom, _int16 Ynum, _int16 Ydenom)  GDI 16;
import void ScreenToClient(HWnd Wnd, PPoint Point) USER 29;
import Bool ScrollDC(HDC DC, _int16 dx, _int16 dy, _PRect Scroll, _PRect Clip,
	HRgn UpdateRgn, PRect UpdateRect)  USER 221;
import void ScrollWindow(HWnd Wnd, _int16 XAmount, _int16 YAmount, PRect Rect,
	PRect ClipRect) USER 61;
import _int16 SelectClipRgn(HDC DC, HRgn Rgn)  GDI 44;
import THandle SelectObject(HDC DC, THandle hObject)  GDI 45;
import HPalette SelectPalette(HDC DC, HPalette Palette,
	Bool ForceBackground)  USER 282;


import LongInt SendDlgItemMessage(HWnd Dlg, _int16 IDDlgItem, Word Msg, Word wParam,
	LongInt lParam)  USER 101;

	// This is a modified version of SendDlgItemMessage that passes a *ASCIIZ
	//   instead of a DWORD
import DWORD SendDlgItemMessageStr(WORD Dlg, WORD IDDlgItem, WORD Msg, WORD wParam,
	*ASCIIZ lParam) USER 101;

import LongInt SendMessage(HWnd Wnd, Word Msg, Word wParam, LongInt lParam)  USER 111;
IMPORT DWORD SendMessageStr( WORD win, WORD msg, WORD wParam, *ASCIIZ lParam)
												USER 111;
import HWnd SetActiveWindow(HWnd Wnd)  USER 59;
import LongInt SetBitmapBits(HBitmap Bitmap, LongInt Count, Pointer Bits)  GDI 106;
import LongInt SetBitmapDimension(HBitmap Bitmap, _int16 X, _int16 Y)  GDI 163;
import TColorRef SetBkColor(HDC DC, TColorRef Color)  GDI 1;
import _int16 SetBkMode(HDC DC, _int16 BkMode)  GDI 2;
import LongInt SetBrushOrg(HDC DC, _int16 X, _int16 Y)  GDI 148;
import HWnd SetCapture(HWnd Wnd)  USER 18;
import void SetCaretBlinkTime(Word MSeconds) USER 168;
import void SetCaretPos(_int16 X, _int16 Y) USER 165;
import LongInt SetClassLong(HWnd Wnd, _int16 Index, LongInt NewLong)  USER 132;
import Word SetClassWord(HWnd Wnd, _int16 Index, Word NewWord)  USER 130;
import THandle SetClipboardData(Word Format, THandle Mem)  USER 141;
import HWnd SetClipboardViewer(HWnd Wnd)  USER 147;
import _int16 SetCommBreak(_int16 Cid)  USER 210;
import PWord SetCommEventMask(_int16 Cid, Word EvtMask)  USER 208;
import _int16 SetCommState(*PDCB DCB)  USER 201;
import HCursor SetCursor(HCursor Cursor)  USER 69;
import void SetCursorPos(_int16 X, _int16 Y) USER 70;
	/* NOT YET SUPPORTED
import _int16 SetDIBits(HDC DC, THandle Bitmap, Word StartScan, Word NumScans,
	Pointer Bits, *TBitmapInfo BitsInfo, Word Usage)  GDI 440;
import _int16 SetDIBitsToDevice(HDC DC, Word DestX, Word DestY, Word Width, Word Height, Word SrcX, Word SrcY,Word
	nStartScan, Word NumScans, Pointer Bits, *TBitmapInfo BitsInfo,
	Word Usage)  GDI 443;
	*/
import void SetDlgItemInt(HWnd Dlg, _int16 IDDlgItem, Word Value,
	Bool Signed) USER 94;
import void SetDlgItemText(HWnd Dlg, _int16 IDDlgItem, ASCIIZ Str) USER 92;
import void SetDoubleClickTime(Word Count) USER 20;
import _int16 SetEnvironment(ASCIIZ PortName, Pointer Environ,
	Word Count)  GDI 132;
import Word SetErrorMode(Word Mode)  KERNEL 107;
import HWnd SetFocus(HWnd Wnd)  USER 22;
import Word SetHandleCount(Word Number)  KERNEL 199;
import void SetKeyboardState(PKeyboardState KeyState) USER 223;
import _int16 SetMapMode(HDC DC, _int16 MapMode)  GDI 3;
import LongInt SetMapperFlags(HDC DC, LongInt Flag)  GDI 349;
import Bool SetMenu(HWnd Wnd, HMenu Menu)  USER 158;
import Bool SetMenuItemBitmaps(HMenu Menu, Word Position, Word Flags,
	HBitmap BitmapUnchecked, HBitmap BitmapChecked)  USER 418;
import Bool SetMessageQueue(_int16 Msg)  USER 266;
import THandle SetMetaFileBits(THandle Mem)  GDI 160;
import Word SetPaletteEntries(HPalette Palette, Word StartIndex, Word NumEntries,
	POINTER PaletteEntries)  GDI 364;
import HWnd SetParent(HWnd WndChild, HWnd WndNewParent)  USER 233;
import LongInt SetPixel(HDC DC, _int16 X, _int16 Y, TColorRef Color)  GDI 31;
import _int16 SetPolyFillMode(HDC DC, _int16 PolyFillMode)  GDI 6;
import Bool SetProp(HWnd Wnd, ASCIIZ Str, THandle Data)  USER 26;
import void SetRect(_PRect Rect, _int16 X1, _int16 Y1, _int16 X2, _int16 Y2) USER 72;
import void SetRectEmpty(_PRect Rect) USER 73;
import void SetRectRgn(HRgn Rgn, _int16 X1, _int16 Y1, _int16 X2, _int16 Y2) GDI 172;
#IFDEF POINTER_SUPPORT
import TFarProc SetResourceHandler(THandle Instance, Pointer ResType,
	TFarProc LoadFunc)  KERNEL 67;
#ENDIF
import _int16   SetROP2(HDC DC, _int16 DrawMode)  GDI 4;
import _int16   SetScrollPos(HWnd Wnd, _int16 Bar, _int16 Pos, Bool Redraw)  USER 62;
import void     SetScrollRange(HWnd Wnd, _int16 Bar, _int16 MinPos, _int16 MaxPos, Bool Redraw) USER 64;
import _int16   SetSoundNoise(_int16 Source, _int16 Duration)  SOUND 7;
import _int16   SetStretchBltMode(HDC DC, _int16 StretchMode)  GDI 7;
import LongInt  SetSwapAreaSize(Word Size)  KERNEL 106;
import void     SetSysColors(_int16 Changes, POINTER SysColor, POINTER ColorValues) USER 181;
import HWnd     SetSysModalWindow(HWnd Wnd)  USER 188;
import Word     SetSystemPaletteUse(HDC DC, Word Usage)  GDI 373;
import Word     SetTextAlign(HDC DC, Word Flags)  GDI 346;
import _int16   SetTextCharacterExtra(HDC DC, _int16 CharExtra)  GDI 8;
import TColorRef SetTextColor(HDC DC, TColorRef Color)  GDI 9;
import _int16   SetTextJustification(HDC DC, _int16 BreakExtra,_int16 BreakCount)  GDI 10;
import Word     SetTimer(HWnd Wnd, _int16 IDEvent, Word Elapse, TFarProc TimerFunc)  USER 10;
import LongInt  SetViewportExt(HDC DC, _int16 X, _int16 Y)  GDI 14;
import LongInt  SetViewportOrg(HDC DC, _int16 X, _int16 Y)  GDI 13;
import _int16   SetVoiceAccent(_int16 Voice, _int16 Tempo, _int16 Volume, _int16 Mode, _int16 Pitch)  SOUND 5;
import _int16   SetVoiceEnvelope(_int16 Voice, _int16 Shape, _int16 RepeatCount)  SOUND 6;
import _int16   SetVoiceNote(_int16 Voice, _int16 Value, _int16 Length, _int16 Cdots)  SOUND 4;
import _int16   SetVoiceQueueSize(_int16 Voice, _int16 Bytes)  SOUND 3;
import _int16   SetVoiceSound(_int16 Voice, LongInt Frequency, _int16 Duration)  SOUND 8;
import _int16   SetVoiceThreshold(_int16 Voice, _int16 Notes)  SOUND 16;
import LongInt  SetWindowExt(HDC DC, _int16 X, _int16 Y)  GDI 12;
import LongInt  SetWindowLong(HWnd Wnd, _int16 Index, LongInt NewLong)  USER 136;
import LongInt  SetWindowOrg(HDC DC, _int16 X, _int16 Y) GDI 11;
import void     SetWindowPos(HWnd Wnd, HWnd WndInsertAfter, _int16 X, _int16 Y, _int16 cx, _int16 cy, Word Flags) USER 232;
#IFDEF POINTER_SUPPORT
import TFarProc SetWindowsHook(_int16 FilterType, TFarProc FilterFunc)  USER 121;
#ENDIF
import void     SetWindowText(HWnd Wnd, ASCIIZ Str) USER 37;
import Word     SetWindowWord(HWnd Wnd, _int16 Index, Word NewWord)  USER 134;
import void     ShowCaret(HWnd Wnd) USER 167;
import _int16   ShowCursor(Bool Show)  USER 71;
import void     ShowOwnedPopups(HWnd Wnd, Bool Show) USER 265;
import void     ShowScrollBar(HWnd Wnd, Word Bar, Bool Show) USER 267;
import Bool     ShowWindow(HWnd Wnd, _int16 CmdShow)  USER 42;
import LongInt  SizeofResource(THandle Instance, THandle ResInfo)  KERNEL 65;
import _int16   StartSound()  SOUND 9;
import _int16   StopSound()  SOUND 10;
import Bool     StretchBlt(HDC DestDC, _int16 X, _int16 Y, _int16 Width, _int16 Height, HDC SrcDC,
									_int16 XSrc, _int16 YSrc, _int16 SrcWidth, _int16 SrcHeight, LongInt Rop)  GDI 35;
import _int16   StretchDIBits(HDC DC, Word DestX, Word DestY, Word DestWidth, Word DestHegiht, Word SrcX,Word
									SrcY, Word SrcWidth, Word SrcHeight, Pointer Bits, PBitmapInfo BitsInfo,
									Word Usage, LongInt Rop)  GDI 439;
import Bool     SwapMouseButton(Bool Swap)  USER 186;
import void     SwapRecording(Word Flag) KERNEL 204;
import void     SwitchStackBack() KERNEL 109;
import void     SwitchStackTo(Word StackSegment, Word StackPointer, Word StackTop) KERNEL 108;
import _int16   SyncAllVoices()  SOUND 12;
import LongInt  TabbedTextOut(HDC HC, _int16 X, _int16 Y, ASCIIZ Str, _int16 Count, _int16 TabPositions, POINTER TabStopPositions, _int16 TabOrigin)  USER 196;
import Bool     TextOut(HDC DC, _int16 X, _int16 Y, ASCIIZ Str, _int16 Count)  GDI 33;
import void     Throw(PCatchBuf CatchBuf, _int16 ThrowBack) KERNEL 56;
import _int16   ToAscii(Word VirtKey, Word ScanCode, POINTER KeyState, POINTER cx, Word Flags)  KEYBOARD 4;
import Bool     TrackPopupMenu(HMenu Menu, Word Flags, _int16 x, _int16 y, _int16 Reserved, HWnd Wnd, Pointer Reserved)  USER 416;
import _int16   TranslateAccelerator(HWnd Wnd, THandle AccTable, PMsg Msg)  USER 178;
import Bool     TranslateMDISysAccel(HWnd Wnd, PMsg Msg)  USER 451;
import Bool     TranslateMessage(PMsg Msg)  USER 113;
import _int16   TransmitCommChar(_int16 Cid, _char Chr)  USER 206;
import _int16   UngetCommChar(_int16 Cid, _char Chr)  USER 212;
#IFDEF POINTER_SUPPORT
import Bool     UnhookWindowsHook(_int16 Hook, TFarProc HookFunc)  USER 234;
#ENDIF
import _int16   UnionRect(_PRect DestRect, _PRect Src1Rect, _PRect Src2Rect)  USER 80;
import Bool     UnlockResource(THandle ResData)  KERNEL 19;
import void     UnlockSegment   (Word Segment) KERNEL 24;      //Imported from WIN31.SH
import Bool     UnrealizeObject(HBrush hObject)  GDI 150;
import Bool     UnregisterClass(ASCIIZ ClassName, THandle Instance)  USER 403;
import _int16   UpdateColors(HDC DC)  GDI 366;
import void     UpdateWindow(HWnd Wnd) USER 124;
import void     ValidateCodeSegments() KERNEL 100;
import void     ValidateFreeSpaces() KERNEL 200;
import void     ValidateRect(HWnd Wnd, PRect Rect) USER 127;
import void     ValidateRgn(HWnd Wnd, HRgn Rgn) USER 128;
import Word     VkKeyScan(Word Chr)  KEYBOARD 129;
import void     WaitMessage() USER 112;
import _int16   WaitSoundState(_int16 State)  SOUND 11;
import HWnd     WindowFromPoint(DWORD Point)  USER 30;
import Word     WinExec(ASCIIZ CmdLine, Word CmdShow)  KERNEL 166;
import Bool     WinHelp(HWnd Wnd, ASCIIZ HelpFile, Word Command, LongInt Data)  USER 171;
import Bool     WinHelpStr(HWnd Wnd, ASCIIZ HelpFile, Word Command, ASCIIZ s )  USER 171;
// Network support        //Imported from WIN31.SH

import Word     WNetAddConnection(ASCIIZ lpszNetPath, ASCIIZ lpszPassword, ASCIIZ lpszLocalName) USER 517;   //Imported from WIN31.SH
import Word     WNetGetConnection(ASCIIZ lpszLocalName, ASCIIZ lpszRemoteName, *WORD cbBufferSize) USER 512;   //Imported from WIN31.SH
import Word     WNetCancelConnection(ASCIIZ lpszName, Bool tForce) USER 518;   //Imported from WIN31.SH

import _int16   WriteComm(_int16 Cid, ASCIIZ Buf, _int16 Size)  USER 205;
import Bool     WritePrivateProfileString(ASCIIZ ApplicationName, ASCIIZ KeyName, ASCIIZ Str,ASCIIZ FileName)  KERNEL 129;
import Bool     WritePrivateProfileString1(ASCIIZ ApplicationName, ASCIIZ s1, DWORD s2,ASCIIZ FileName)  KERNEL 129;
import Bool     WritePrivateProfileString2(ASCIIZ ApplicationName, DWORD s1, DWORD s2,ASCIIZ FileName)  KERNEL 129;
import Bool     WriteProfileString(ASCIIZ ApplicationName, ASCIIZ KeyName, ASCIIZ Str)  KERNEL 59;
import _int16   wvsprintf(*ASCIIZ DestStr, ASCIIZ Format, POINTER ArgList)  USER 421;
import Bool     Yield()  KERNEL 29;
import _int16   _lclose(_int16 FileHandle)  KERNEL 81;
import _int16   _lcreat(ASCIIZ PathName, _int16 Atribute)  KERNEL 83;
import LongInt  _llseek(_int16 FileHandle, LongInt Offset, _int16 Origin)  KERNEL 84;
import _int16   _lopen(ASCIIZ PathName, _int16 ReadWrite)  KERNEL 85;
import Word     _lread(_int16 FileHandle, *ASCIIZ Buffer, _int16 Bytes)  KERNEL 82;
import Word     _lwrite(_int16 FileHandle, ASCIIZ Buffer, _int16 Bytes)  KERNEL 86;


// functions new to Windows 3.1
import Bool GetTextExtentPoint(HDC DC, PChar Str, _int16 Count, *_int16 Size)
				GDI 471;
import Longint GetSystemDebugState()
				USER 231;
import Bool LockInput(THandle h1, HWnd hwndInput, Bool fLock)
				USER 226;
import Bool QuerySendMessage(THandle h1, THandle h2, THandle h3, PMsg lpmsg)
				USER 184;
import _int16 EnumFonts(HDC DC, PChar lpszFace, TOldFontEnumProc fntenmprc, ASCIIZ lpszData)
				GDI 70;
import Bool GetWinDebugInfo(PWinDebugInfo DebugInfo, Word Flags)
				KERNEL 355;
import Bool SetWinDebugInfo(PWinDebugInfo DebugInfo)
				KERNEL 356;
/*
import Bool IsBadReadPtr(Pointer lp, Word cb)  KERNEL 334;
import Bool IsBadWritePtr(Pointer lp, Word cb)  KERNEL 335;
import Bool IsBadHugeReadPtr(Pointer lp, Longint cb)  KERNEL 346;
import Bool IsBadHugeWritePtr(Pointer lp, Longint cb)  KERNEL 347;
import Bool IsBadCodePtr(TFarProc lpfn)  KERNEL 336;
import Bool IsBadStringPtr(PChar lpsz, Word cchMax)  KERNEL 337;
 */
import void DirectedYield(TTask Task)
			KERNEL 150;
//import Word PrestoChangoSelector(Word SourceSel, Word DestSel)
//      KERNEL 177;
//import Longint GetSelectorBase(Word Selector)
//    KERNEL 186;
//import Word SetSelectorBase(Word Selector, Longint Base)
//    KERNEL 187;
//import Longint GetSelectorLimit(Word Selector)
//    KERNEL 188;
//import Word SetSelectorLimit(Word Selector, Longint Base)
//    KERNEL 189;
//import Bool GetDriverInfo(THandle hDriver, PDriverInfoStruct lpdis)
//    USER 256;
import Bool GetWindowPlacement(HWnd Wnd, PWindowPlacement Placement)
			USER 370;
import Bool SetWindowPlacement(HWnd Wnd, PWindowPlacement Placement)
			USER 371;
import Bool DlgDirSelectEx(HWnd Dlg, PChar Path, _int16 cbPath, _int16 ListBox)
			USER 422;
import Bool DlgDirSelectComboBoxEx(HWnd Dlg, PChar Path, _int16 cbPath, _int16 ComboBox)
			USER 423;
import Longint GetTimerResolution()
			USER 14;
import Bool ExitWindowsExec(PChar Exe, PChar Params)
			USER 246;
import THandle SpoolFile(PChar Printer, PChar Port, PChar Job, PChar F)
			GDI 254;
import Bool QueryAbort(HDC DC, _int16 Reserved)
			GDI 155;
import Bool SetWindowOrgEx(HDC DC, _int16 nX, _int16 nY, PPoint Point)
			GDI 482;
import Bool GetWindowOrgEx(HDC DC, PPoint Point)
			GDI 475;
import Bool SetWindowExtEx(HDC DC, _int16 nX, _int16 nY, PSize Size)
			GDI 481;
import Bool GetWindowExtEx(HDC DC, PSize Size)
			GDI 474;
import Bool OffsetWindowOrgEx(HDC DC, _int16 nX, _int16 nY, PPoint Point)
			GDI 477;
import Bool ScaleWindowExtEx(HDC DC, _int16 Xnum, _int16 Xdenom, _int16 Ynum, _int16 Ydenom, PSize Size)
			GDI 485;
import Bool SetViewportExtEx(HDC DC, _int16 nX, _int16 nY, PSize Size)
			GDI 479;
import Bool GetViewportExtEx(HDC DC, PSize Size)
			GDI 472;
import Bool SetViewportOrgEx(HDC DC, _int16 nX, _int16 nY, PPoint Point)
			GDI 480;
import Bool GetViewportOrgEx(HDC DC, PPoint Point)
			GDI 473;
import Bool OffsetViewportOrgEx(HDC DC, _int16 nX, _int16 nY, PPoint Point)
			GDI 476;
import Bool ScaleViewportExtEx(HDC DC, _int16 Xnum, _int16 Xdenom, _int16 Ynum, _int16 Ydenom, PSize Size)
			GDI 484;
import Bool GetBrushOrgEx(HDC DC, PPoint Point)
			GDI 469;
import Bool MoveToEx(HDC DC, _int16 nX, _int16 nY, PPoint Point)
			GDI 483;
import Bool GetCurrentPositionEx(HDC DC, PPoint Point)
			GDI 470;
import Bool GetAspectRatioFilterEx(HDC DC, PSize Size)
			GDI 486;
import _int16 EnumFontFamilies(HDC DC, PChar Family, TFontEnumProc EnumProc, PChar Data)
			GDI 330;
import _int16 GetKerningPairs(HDC DC, _int16 i, PKerningPair Pair)
			GDI 332;
import Bool SetBitmapDimensionEx(HBitmap BM, _int16 nX, _int16 nY, PSize Size)
			GDI 478;
import Bool GetBitmapDimensionEx(HBitmap BM, PSize Size)
			GDI 468;
import THandle SetMetaFileBitsBetter(THandle mf)
			GDI 196;
import _int16 StartDoc(HDC DC, PDocInfo di)
			GDI 377;
import _int16 StartPage(HDC DC)
			GDI 379;
import _int16 EndPage(HDC DC)
			GDI 380;
import _int16 EndDoc(HDC DC)
			GDI 378;
import _int16 AbortDoc(HDC DC)
			GDI 382;
//import _int16 SetAbortProc(HDC DC, TAbortProc AbortProc)
//      GDI 381;

import Bool IsTask(THandle Task)
			KERNEL 320;
//import Word GetFreeSystemResources(Word SysResource)  USER 284;
//import THandle GlobalPtrHandle(Pointer P)  ;
//import Pointer GlobalAllocPtr(Word Flags, Longint Bytes)  ;
//import Pointer GlobalReAllocPtr(Pointer P, Longint Bytes, Word Flags)  ;
//import THandle GlobalFreePtr(Pointer P)  ;
//import Pointer GlobalLockPtr(Pointer P)  ;
//import Bool GlobalUnlockPtr(Pointer P)  ;
//import THandle GetInstanceModule(THandle Instance)  ;
//import void LogError(Word Err, Pointer Info)
//    KERNEL 324;
//import void LogParamError(Word Err, TFarProc fn, Pointer Param)
//      KERNEL 325;
import Bool IsDBCSLeadByte(Byte Ch)
			KERNEL 207;
import HDC GetDCEx(HWnd Wnd, HRgn Clip, Longint Flags)
			USER 359;
import Bool IsGDIObject(THandle Obj)
			GDI 462;
import Word SetBoundsRect(HDC DC, PRect Bounds, Word Flags)
			GDI 193;
import Word GetBoundsRect(HDC DC, PRect Bounds, Word Flags)
			GDI 194;
//import Longint ConvertOutlineFontFile(PChar A, PChar B, PChar C)
//      GDI 312;
//import Longint GetFontData(HDC hdc, Longint dwTable, Longint dwOffset, PChar lpvBuffer, Longint cbData)
//      GDI 311;
//import Longint GetGlyphOutline(HDC hdc, Word uChar, Word fuFormat,
//  *TGlyphMetrics lpgm, Longint cbBuffer, PChar lpBuffer,
//  *TMat2 lpMat2)  GDI 309;
//import Bool CreateScalableFontResource(Word fHidden, PChar lpszResourceFile,PChar lpszFontFile, PChar lpszCurrentPath)
//      GDI 310;
//import Bool GetCharABCWidths(HDC hdc, Word uFirstChar, Word uLastChar,  *TABC lpabc)
//      GDI 307;
//import Bool GetRasterizerCaps(*TRasterizer_Status lpRastStat, _int16 cbNumBytes)
 //     GDI 313;
//import Word GetOutlineTextMetrics(HDC hdc, Word cbData,  POutlineTextMetric lpotm)
//      GDI 308;
import Longint GetMessageExtraInfo()
			USER 288;
import HWnd GetOpenClipboardWindow()
			USER 248;
import Longint GetQueueStatus(Word Flags)
			USER 334;
import Bool IsMenu(HMenu Menu)
			USER 358;
import Bool RedrawWindow(HWnd Wnd, PRect UpdateRect, HRgn UpdateRgn, Word Flags)
			USER 290;
import Bool LockWindowUpdate(HWnd Wnd)
			USER 294;
import _int16 ScrollWindowEx(HWnd Wnd, _int16 dx, _int16 dy, PRect Scroll, PRect Clip, HRgn UpdateRgn, PRect UpdateRect, Word Flags)
			USER 31;
import Bool EnableScrollBar(HWnd hwnd, _int16 fnSBFlags, Word fuArrowFlags)
			USER 482;
import HCursor CopyCursor(THandle hInst, HCursor hCur)
			USER 369;
import HCursor GetCursor()
			USER 247;
import void GetClipCursor(PRect Rect)
			USER 309;
import HIcon CopyIcon(THandle hInst, HIcon Icon)
			USER 368;
import void MapWindowPoints(HWnd FromWnd, HWnd ToWnd, POINTER Point, Word Count)
			USER 258;
//import void MapWindowRect(HWnd FromWnd, HWnd ToWnd, *TRect Rect) ;
import Bool SubtractRect(PRect Dest, PRect Source1, PRect Source2)
			USER 373;
//import HHook SetWindowsHookEx(_int16 HookId, THookProc Hook, THandle Module, THandle Task)  USER 291;
//import Bool UnhookWindowsHookEx(HHook Hook)  USER 292;
//import Longint CallNextHookEx(HHook Hook, _int16 Code, Word wParam, Longint lParam)  USER 293;
import Bool EnableCommNotification(_int16 idComDev, HWnd hwnd, _int16 cbWriteNotify, _int16 cbOutQueue)
			USER 245;
import THandle OpenDriver(PChar DriverName, PChar SectionName, Longint lParam2)
			USER 252;
import Longint CloseDriver(THandle Driver, Longint lParam1, Longint lParam2)
			USER 253;
import THandle GetDriverModuleHandle(THandle Driver)
			USER 254;
import Int SendDriverMessage(THandle Driver, Word message, Int lParam1, Int lParam2)
			USER 251;
import THandle GetNextDriver(THandle Driver, Longint lParam)
			USER 257;

//import PChar lstrcpyn(PChar String1, PChar String2, _int16 i)  KERNEL 353;
//import void hmemcpy(Pointer p1, Pointer p2, Longint L) KERNEL 348;


/*  Not exported by any DLL but included in WINDOWS.H
	function SetDriverMessage(Driver: THandle; Message: Word; lParam1, lParam2: LongInt): LongInt; */

// import Longint DefDriverProc(Longint DriverIdentifier, THandle DriverId, Word Message, Longint lParam1, Longint lParam2)  USER 255;
import Bool SystemParametersInfo(Word Action, Word wParam, Pointer lParam, Word UpdateWinIni)
    USER 483;