home *** CD-ROM | disk | FTP | other *** search
/ Turbo Toolbox / Turbo_Toolbox.iso / dtx9202 / apisearc / types.dat < prev    next >
Encoding:
Text File  |  1991-11-15  |  77.2 KB  |  2,970 lines

  1. type
  2.   Bool    = System.WordBool;
  3.  
  4.   PStr      = PChar;
  5.   PBool     = ^WordBool;
  6.   PInteger  = ^Integer;
  7.   PByte     = ^Byte;
  8.   PWord     = ^Word;
  9.   PLongInt  = ^LongInt;
  10.  
  11.   PHandle       = ^THandle;
  12.   LPHandle      = PHandle;
  13.   THandle       = Word;
  14.   TGlobalHandle = THandle;
  15.   TLocalHandle  = THandle;
  16.  
  17.   TFarProc = Pointer;
  18.   LPVoid  = Pointer;
  19.  
  20.   HWnd     = THandle;
  21.   HStr     = THandle;
  22.   HIcon    = THandle;
  23.   HDC      = THandle;
  24.   HMenu    = THandle;
  25.   HPen     = THandle;
  26.   HFont    = THandle;
  27.   HBrush   = THandle;
  28.   HBitmap  = THandle;
  29.   HCursor  = THandle;
  30.   HRGN     = THandle;
  31.   HPalette = THandle;
  32.  
  33.   TColorRef = Longint;
  34.  
  35.   PRect = ^TRect;
  36.   TRect = record
  37.     left: Integer;
  38.     top: Integer;
  39.     right: Integer;
  40.     bottom: Integer;
  41.   end;
  42.  
  43.   PPoint = ^TPoint;
  44.   TPoint = record
  45.     x: Integer;
  46.     y: Integer;
  47.   end;
  48.   MakePoint = TPoint;
  49.  
  50. {--------------------------------------------------------------------------}
  51. {  KERNEL Section                                                          }
  52. {--------------------------------------------------------------------------}
  53.  
  54. { OpenFile structure }
  55.  
  56. type
  57.   POFStruct = ^TOFStruct;
  58.   TOFStruct = record
  59.     cBytes: Byte;
  60.     fFixedDisk: Byte;
  61.     nErrCode: Word;
  62.     reserved: array[0..3] of Byte;
  63.     szPathName: array[0..127] of Char;
  64.   end;
  65.  
  66. { OpenFile flags }
  67.  
  68. const
  69.   of_Read             = $0000;
  70.   of_Write            = $0001;
  71.   of_ReadWrite        = $0002;
  72.   of_Share_Compat     = $0000;
  73.   of_Share_Exclusive  = $0010;
  74.   of_Share_Deny_Write = $0020;
  75.   of_Share_Deny_Read  = $0030;
  76.   of_Share_Deny_None  = $0040;
  77.   of_Parse            = $0100;
  78.   of_Delete           = $0200;
  79.   of_Verify           = $0400;
  80.   of_Cancel           = $0800;
  81.   of_Create           = $1000;
  82.   of_Prompt           = $2000;
  83.   of_Exist            = $4000;
  84.   of_Reopen           = $8000;
  85.  
  86. { GetTempFileName flags }
  87.  
  88. const
  89.   tf_ForceDrive = $80;
  90.  
  91. { GetDriveType return values }
  92.  
  93. const
  94.   drive_Removable = 2;
  95.   drive_Fixed     = 3;
  96.   drive_Remote    = 4;
  97.  
  98. { Global Memory Flags }
  99.  
  100. const
  101.   gmem_Fixed       = $0000;
  102.   gmem_Moveable    = $0002;
  103.   gmem_NoCompact   = $0010;
  104.   gmem_NoDiscard   = $0020;
  105.   gmem_ZeroInit    = $0040;
  106.   gmem_Modify      = $0080;
  107.   gmem_Discardable = $0100;
  108.   gmem_Not_Banked  = $1000;
  109.   gmem_Share       = $2000;
  110.   gmem_DDEShare    = $2000;
  111.   gmem_Notify      = $4000;
  112.   gmem_Lower       = gmem_Not_Banked;
  113.  
  114. const
  115.   GHnd = gmem_Moveable or gmem_ZeroInit;
  116.   GPtr = gmem_Fixed or gmem_ZeroInit;
  117.  
  118. { Flags returned by GlobalFlags (in addition to gmem_Discardable) }
  119.  
  120. const
  121.   gmem_Discarded = $4000;
  122.   gmem_LockCount = $00FF;
  123.  
  124. { Local Memory Flags }
  125.  
  126. const
  127.   lmem_Fixed       = $0000;
  128.   lmem_Moveable    = $0002;
  129.   lmem_NoCompact   = $0010;
  130.   lmem_NoDiscard   = $0020;
  131.   lmem_ZeroInit    = $0040;
  132.   lmem_Modify      = $0080;
  133.   lmem_Discardable = $0F00;
  134.  
  135. const
  136.   LHnd = lmem_Moveable or lmem_ZeroInit;
  137.   LPtr = lmem_Fixed or lmem_ZeroInit;
  138.  
  139. const
  140.   NonZeroLHnd = lmem_Moveable;
  141.   NonZeroLPtr = lmem_Fixed;
  142.  
  143. const
  144.   LNotify_OutOfMem = 0;
  145.   LNotify_Move     = 1;
  146.   LNotify_Discard  = 2;
  147.  
  148.  
  149. { Flags returned by LocalFlags (in addition to LMEM_DISCARDABLE) }
  150.  
  151. const
  152.   lmem_Discarded = $4000;
  153.   lmem_LockCount = $00FF;
  154.  
  155.  
  156. type
  157.   MakeIntResource = PStr;
  158.  
  159. const
  160.   Difference = 11;
  161.  
  162. { Predefined Resource Types }
  163.  
  164. const
  165.   rt_Cursor      = MakeIntResource(1);
  166.   rt_Bitmap      = MakeIntResource(2);
  167.   rt_Icon        = MakeIntResource(3);
  168.   rt_Menu        = MakeIntResource(4);
  169.   rt_Dialog      = MakeIntResource(5);
  170.   rt_String      = MakeIntResource(6);
  171.   rt_FontDir     = MakeIntResource(7);
  172.   rt_Font        = MakeIntResource(8);
  173.   rt_Accelerator = MakeIntResource(9);
  174.   rt_RCData      = MakeIntResource(10);
  175.  
  176. { NOTE: if any new resource types are introduced above this point, }
  177. { then the value of Difference must be changed. }
  178. { (rt_Group_Cursor - rt_Cursor) must always be equal to Difference }
  179. { (rt_Group_Icon - rt_Icon) must always be equal to Difference }
  180.  
  181.   rt_Group_Cursor = MakeIntResource(LongInt(rt_Cursor) + Difference);
  182.  
  183. { The value 13 is intentionally unused }
  184.  
  185.   rt_Group_Icon = MakeIntResource(LongInt(rt_Icon) + Difference);
  186.  
  187. type
  188.   TAtom = Word;
  189.  
  190. type
  191.   MakeIntAtom = PStr;
  192.  
  193. { Catch and Throw }
  194.  
  195. type
  196.   PCatchBuf = ^TCatchBuf;
  197.   TCatchBuf = array[0..8] of Integer;
  198.  
  199. const
  200.   wf_PMode      = $0001;
  201.   wf_CPU286     = $0002;
  202.   wf_CPU386     = $0004;
  203.   wf_CPU486     = $0008;
  204.   wf_Standard   = $0010;
  205.   wf_Win286     = $0010;
  206.   wf_Enhanced   = $0020;
  207.   wf_Win386     = $0020;
  208.   wf_CPU086     = $0040;
  209.   wf_CPU186     = $0080;
  210.   wf_LargeFrame = $0100;
  211.   wf_SmallFrame = $0200;
  212.   wf_80x87      = $0400;
  213.  
  214.   wep_System_Exit  = 1;
  215.   wep_Free_DLL     = 0;
  216. {$IFDEF OEMRESOURCE}
  217.  
  218. { OEM Resource Ordinal Numbers }
  219.  
  220. const
  221.   obm_Close    = 32754;
  222.   obm_UpArrow  = 32753;
  223.   obm_DnArrow  = 32752;
  224.   obm_RgArrow  = 32751;
  225.   obm_LfArrow  = 32750;
  226.   obm_Reduce   = 32749;
  227.   obm_Zoom     = 32748;
  228.   obm_Restore  = 32747;
  229.   obm_Reduced  = 32746;
  230.   obm_Zoomd    = 32745;
  231.   obm_Restored = 32744;
  232.   obm_UpArrowD = 32743;
  233.   obm_DnArrowD = 32742;
  234.   obm_RgArrowD = 32741;
  235.   obm_LfArrowD = 32740;
  236.   obm_MnArrow  = 32739;
  237.   obm_Combo    = 32738;
  238.  
  239. const
  240.   obm_Old_Close   = 32767;
  241.   obm_Size        = 32766;
  242.   obm_Old_UpArrow = 32765;
  243.   obm_Old_DnArrow = 32764;
  244.   obm_Old_RgArrow = 32763;
  245.   obm_Old_LfArrow = 32762;
  246.   obm_BTSize      = 32761;
  247.   obm_Check       = 32760;
  248.   obm_CheckBoxes  = 32759;
  249.   obm_BTNCorners  = 32758;
  250.   obm_Old_Reduce  = 32757;
  251.   obm_Old_Zoom    = 32756;
  252.   obm_Old_Restore = 32755;
  253.  
  254. const
  255.   ocr_Normal   = 32512;
  256.   ocr_IBeam    = 32513;
  257.   ocr_Wait     = 32514;
  258.   ocr_Cross    = 32515;
  259.   ocr_Up       = 32516;
  260.   ocr_Size     = 32640;
  261.   ocr_Icon     = 32641;
  262.   ocr_SizeNWSE = 32642;
  263.   ocr_SizeNESW = 32643;
  264.   ocr_SizeWE   = 32644;
  265.   ocr_SizeNS   = 32645;
  266.   ocr_SizeAll  = 32646;
  267.   ocr_ICOCUR   = 32647;
  268.  
  269. const
  270.   oic_Sample = 32512;
  271.   oic_Hand   = 32513;
  272.   oic_Ques   = 32514;
  273.   oic_Bang   = 32515;
  274.   oic_Note   = 32516;
  275.  
  276. {$ENDIF OEMRESOURCE}
  277.  
  278. {--------------------------------------------------------------------------}
  279. {  GDI Section                                                             }
  280. {--------------------------------------------------------------------------}
  281.  
  282. { Binary raster ops }
  283.  
  284. const
  285.   r2_Black       = 1;   { 0    }
  286.   r2_NotMergePen = 2;   { DPon }
  287.   r2_MaskNotPen  = 3;   { DPna }
  288.   r2_NotCopyPen  = 4;   { PN   }
  289.   r2_MaskPenNot  = 5;   { PDna }
  290.   r2_Not         = 6;   { Dn   }
  291.   r2_XORPen      = 7;   { DPx  }
  292.   r2_NotMaskPen  = 8;   { DPan }
  293.   r2_MaskPen     = 9;   { DPa  }
  294.   r2_NotXORPen   = 10;  { DPxn }
  295.   r2_NOP         = 11;  { D    }
  296.   r2_MergeNotPen = 12;  { DPno }
  297.   r2_CopyPen     = 13;  { P    }
  298.   r2_MergePenNot = 14;  { PDno }
  299.   r2_MergePen    = 15;  { DPo  }
  300.   r2_White       = 16;  { 1    }
  301.  
  302. { Ternary raster operations }
  303.  
  304.   SrcCopy     = $00CC0020;  { dest = source                   }
  305.   SrcPaint    = $00EE0086;  { dest = source OR dest           }
  306.   SrcAnd      = $008800C6;  { dest = source AND dest          }
  307.   SrcInvert   = $00660046;  { dest = source XOR dest          }
  308.   SrcErase    = $00440328;  { dest = source AND (NOT dest )   }
  309.   NotSrcCopy  = $00330008;  { dest = (NOT source)             }
  310.   NotSrcErase = $001100A6;  { dest = (NOT src) AND (NOT dest) }
  311.   MergeCopy   = $00C000CA;  { dest = (source AND pattern)     }
  312.   MergePaint  = $00BB0226;  { dest = (NOT source) OR dest     }
  313.   PatCopy     = $00F00021;  { dest = Pattern                  }
  314.   PatPaint    = $00FB0A09;  { dest = DPSnoo                   }
  315.   PatInvert   = $005A0049;  { dest = pattern XOR dest         }
  316.   DstInvert   = $00550009;  { dest = (NOT dest)               }
  317.   Blackness   = $00000042;  { dest = BLACK                    }
  318.   Whiteness   = $00FF0062;  { dest = WHITE                    }
  319.  
  320. { StretchBlt modes }
  321.  
  322. const
  323.   BlackOnWhite = 1;
  324.   WhiteOnBlack = 2;
  325.   ColorOnColor = 3;
  326.  
  327. { PolyFill modes }
  328.  
  329. const
  330.   Alternate = 1;
  331.   Winding   = 2;
  332.  
  333. { Text alignment options }
  334.  
  335. const
  336.   ta_NoUpdateCP = 0;
  337.   ta_UpdateCP   = 1;
  338.  
  339. const
  340.   ta_Left   = 0;
  341.   ta_Right  = 2;
  342.   ta_Center = 6;
  343.  
  344. const
  345.   ta_Top      = 0;
  346.   ta_Bottom   = 8;
  347.   ta_BaseLine = 24;
  348.  
  349. const
  350.   eto_Grayed  = 1;
  351.   eto_Opaque  = 2;
  352.   eto_Clipped = 4;
  353.  
  354. const
  355.   Aspect_Filtering = $0001;
  356.  
  357. { Metafile functions }
  358.  
  359. const
  360.   meta_SetBKColor           = $0201;
  361.   meta_SetBKMode            = $0102;
  362.   meta_SetMapMode           = $0103;
  363.   meta_SetROP2              = $0104;
  364.   meta_SetRelAbs            = $0105;
  365.   meta_SetPolyFillMode      = $0106;
  366.   meta_SetStretchBltMode    = $0107;
  367.   meta_SetTextCharExtra     = $0108;
  368.   meta_SetTextColor         = $0209;
  369.   meta_SetTextJustification = $020A;
  370.   meta_SetWindowOrg         = $020B;
  371.   meta_SetWindowExt         = $020C;
  372.   meta_SetViewportOrg       = $020D;
  373.   meta_SetViewportExt       = $020E;
  374.   meta_OffsetWindowOrg      = $020F;
  375.   meta_ScaleWindowExt       = $0400;
  376.   meta_OffsetViewportOrg    = $0211;
  377.   meta_ScaleViewportExt     = $0412;
  378.   meta_LineTo               = $0213;
  379.   meta_MoveTo               = $0214;
  380.   meta_ExcludeClipRect      = $0415;
  381.   meta_IntersectClipRect    = $0416;
  382.   meta_Arc                  = $0817;
  383.   meta_Ellipse              = $0418;
  384.   meta_FloodFill            = $0419;
  385.   meta_Pie                  = $081A;
  386.   meta_Rectangle            = $041B;
  387.   meta_RoundRect            = $061C;
  388.   meta_PatBlt               = $061D;
  389.   meta_SaveDC               = $001E;
  390.   meta_SetPixel             = $041F;
  391.   meta_OffsetClipRgn        = $0220;
  392.   meta_TextOut              = $0521;
  393.   meta_BitBlt               = $0922;
  394.   meta_StretchBlt           = $0B23;
  395.   meta_Polygon              = $0324;
  396.   meta_PolyLine             = $0325;
  397.   meta_Escape               = $0626;
  398.   meta_RestoreDC            = $0127;
  399.   meta_FillRegion           = $0228;
  400.   meta_FrameRegion          = $0429;
  401.   meta_InvertRegion         = $012A;
  402.   meta_PaintRegion          = $012B;
  403.   meta_SelectClipRegion     = $012C;
  404.   meta_SelectObject         = $012D;
  405.   meta_SetTextAlign         = $012E;
  406.   meta_DrawText             = $062F;
  407.  
  408. const
  409.   meta_Chord                  = $0830;
  410.   meta_SetMapperFlags       = $0231;
  411.   meta_ExtTextOut           = $0a32;
  412.   meta_SetDIBToDev          = $0d33;
  413.   meta_SelectPalette        = $0234;
  414.   meta_RealizePalette       = $0035;
  415.   meta_AnimatePalette       = $0436;
  416.   meta_SetPalEntries        = $0037;
  417.   meta_PolyPolygon          = $0538;
  418.   meta_ResizePalette        = $0139;
  419.  
  420. const
  421.   meta_DIBBitBlt             = $0940;
  422.   meta_DIBStretchBlt         = $0b41;
  423.   meta_DIBCreatePatternBrush = $0142;
  424.  
  425. const
  426.   meta_DeleteObject = $01f0;
  427.  
  428. const
  429.   meta_CreatePalette        = $00f7;
  430.   meta_CreateBrush          = $00F8;
  431.   meta_CreatePatternBrush   = $01F9;
  432.   meta_CreatePenIndirect    = $02FA;
  433.   meta_CreateFontIndirect   = $02FB;
  434.   meta_CreateBrushIndirect  = $02FC;
  435.   meta_CreateBitmapIndirect = $02FD;
  436.   meta_CreateBitmap         = $06FE;
  437.   meta_CreateRegion         = $06FF;
  438.  
  439. { GDI Escapes }
  440.  
  441. const
  442.   NewFrame               = 1;
  443.   AbortDoc               = 2;
  444.   NextBand               = 3;
  445.   SetColorTable          = 4;
  446.   GetColorTable          = 5;
  447.   FlushOutput            = 6;
  448.   DraftMode              = 7;
  449.   QueryEscSupport        = 8;
  450.   SetAbortProc           = 9;
  451.   StartDoc               = 10;
  452.   EndDoc                 = 11;
  453.   GetPhysPageSize        = 12;
  454.   GetPrintingOffset      = 13;
  455.   GetScalingFactor       = 14;
  456.   MFComment              = 15;
  457.   GetPenWidth            = 16;
  458.   SetCopyCount           = 17;
  459.   SelectPaperSource      = 18;
  460.   DeviceData             = 19;
  461.   PassThrough            = 19;
  462.   GetTechnolgy           = 20;
  463.   GetTechnology          = 20;
  464.   SetEndCap              = 21;
  465.   SetLineJoin            = 22;
  466.   SetMiterLimit          = 23;
  467.   BandInfo               = 24;
  468.   DrawPatternRect        = 25;
  469.   GetVectorPenSize       = 26;
  470.   GetVectorBrushSize     = 27;
  471.   EnableDuplex           = 28;
  472.   GetSetPaperBins        = 29;
  473.   GetSetPrintOrient      = 30;
  474.   EnumPaperBins          = 31;
  475.   SetDIBScaling          = 32;
  476.   EPSPrinting            = 33;
  477.   EnumPaperMetrics       = 34;
  478.   GetSetPaperMetrics     = 35;
  479.   PostScript_Data        = 37;
  480.   PostScript_Ignore      = 38;
  481.   GetExtendedTextMetrics = 256;
  482.   GetExtentTable         = 257;
  483.   GetPairKernTable       = 258;
  484.   GetTrackKernTable      = 259;
  485.   GDIExtTextOut          = 512;    {! Renamed from EXTTEXTOUT !}
  486.   EnableRelativeWidths   = 768;
  487.   EnablePairKerning      = 769;
  488.   SetKernTrack           = 770;
  489.   SetAllJustValues       = 771;
  490.   SetCharSet             = 772;
  491.  
  492. const
  493.   GDIStretchBlt        = 2048;    {! renamed from STRETCHBLT !}
  494.   Begin_Path           = 4096;
  495.   Clip_To_Path         = 4097;
  496.   End_Path             = 4098;
  497.   Ext_Device_Caps      = 4099;
  498.   Restore_CTM          = 4100;
  499.   Save_Ctm             = 4101;
  500.   Set_Arc_Direction    = 4102;
  501.   Set_Background_Color = 4103;
  502.   Set_Poly_Mode        = 4104;
  503.   Set_Screen_Angle     = 4105;
  504.   Set_Spread           = 4106;
  505.   Transform_CTM        = 4107;
  506.   Set_Clip_Box         = 4108;
  507.   Set_Bounds           = 4109;
  508.  
  509. { Spooler error codes }
  510.  
  511. const
  512.   sp_NotReported = $4000;
  513.   sp_Error       = (-1);
  514.   sp_AppAbort    = (-2);
  515.   sp_UserAbort   = (-3);
  516.   sp_OutOfDisk   = (-4);
  517.   sp_OutOfMemory = (-5);
  518.  
  519. const
  520.   pr_JobStatus = $0000;
  521.  
  522. { Object definitions for EnumObjects }
  523.  
  524. const
  525.   obj_Pen   = 1;
  526.   obj_Brush = 2;
  527.  
  528. { Bitmap header definition }
  529.  
  530. type
  531.   PBitmap = ^TBitmap;
  532.   TBitmap = record
  533.     bmType: Integer;
  534.     bmWidth: Integer;
  535.     bmHeight: Integer;
  536.     bmWidthBytes: Integer;
  537.     bmPlanes: Byte;
  538.     bmBitsPixel: Byte;
  539.     bmBits: Pointer;
  540.   end;
  541.  
  542. type
  543.   TRGBTriple = record
  544.     rgbtBlue: Byte;
  545.     rgbtGreen: Byte;
  546.     rgbtRed: Byte;
  547.   end;
  548.  
  549. type
  550.   TRGBQuad = record
  551.     rgbBlue: Byte;
  552.     rgbGreen: Byte;
  553.     rgbRed: Byte;
  554.     rgbReserved: Byte;
  555.   end;
  556.  
  557. { Structures for defining DIBs }
  558.  
  559. type
  560.   PBitmapCoreHeader = ^TBitmapCoreHeader;
  561.   TBitmapCoreHeader = record
  562.     bcSize: Longint;              { used to get to color table }
  563.     bcWidth: Word;
  564.     bcHeight: Word;
  565.     bcPlanes: Word;
  566.     bcBitCount: Word;
  567.   end;
  568.  
  569. type
  570.   PBitmapInfoHeader = ^TBitmapInfoHeader;
  571.   TBitmapInfoHeader = record
  572.     biSize: Longint;
  573.     biWidth: Longint;
  574.     biHeight: Longint;
  575.     biPlanes: Word;
  576.     biBitCount: Word;
  577.     biCompression: Longint;
  578.     biSizeImage: Longint;
  579.     biXPelsPerMeter: Longint;
  580.     biYPelsPerMeter: Longint;
  581.     biClrUsed: Longint;
  582.     biClrImportant: Longint;
  583.   end;
  584.  
  585. { Constants for the biCompression field }
  586.  
  587. const
  588.   bi_RGB  = 0;
  589.   bi_RLE8 = 1;
  590.   bi_RLE4 = 2;
  591.  
  592. type
  593.   PBitmapInfo = ^TBitmapInfo;
  594.   TBitmapInfo = record
  595.     bmiHeader: TBitmapInfoHeader;
  596.     bmiColors: array[0..0] of TRGBQuad;
  597.   end;
  598.  
  599. type
  600.   PBitmapCoreInfo = ^TBitmapCoreInfo;
  601.   TBitmapCoreInfo = record
  602.     bmciHeader: TBitmapCoreHeader;
  603.     bmciColors: array[0..0] of TRGBTriple;
  604.   end;
  605.  
  606. type
  607.   PBitmapFileHeader = ^TBitmapFileHeader;
  608.   TBitmapFileHeader = record
  609.     bfType: Word;
  610.     bfSize: Longint;
  611.     bfReserved1: Word;
  612.     bfReserved2: Word;
  613.     bfOffBits: Longint;
  614.   end;
  615.  
  616.  
  617. { Clipboard Metafile Picture Structure }
  618.  
  619. type
  620.   PHandleTable = ^THandleTable;
  621.   THandleTable = record
  622.     objectHandle: array[0..0] of THandle;
  623.   end;
  624.  
  625. type
  626.   PMetaRecord = ^TMetaRecord;
  627.   TMetaRecord = record
  628.     rdSize: Longint;
  629.     rdFunction: Word;
  630.     rdParm: array[0..0] of Word;
  631.   end;
  632.  
  633.   PMetaHeader = ^TMetaHeader;
  634.   TMetaHeader = record
  635.     mtType : Word;
  636.     mtHeaderSize : Word;
  637.     mtVersion : Word;
  638.     mtSize : Longint;
  639.     mtNoObjects : Word;
  640.     mtMaxRecord : Longint;
  641.     mtNoParameters : Word;
  642.   end;
  643.  
  644. type
  645.   PMetaFilePict = ^TMetaFilePict;
  646.   TMetaFilePict = record
  647.     mm: Integer;
  648.     xExt: Integer;
  649.     yExt: Integer;
  650.     hMF: THandle;
  651.   end;
  652.  
  653. type
  654.   PTextMetric = ^TTextMetric;
  655.   TTextMetric = record
  656.     tmHeight: Integer;
  657.     tmAscent: Integer;
  658.     tmDescent: Integer;
  659.     tmInternalLeading: Integer;
  660.     tmExternalLeading: Integer;
  661.     tmAveCharWidth: Integer;
  662.     tmMaxCharWidth: Integer;
  663.     tmWeight: Integer;
  664.     tmItalic: Byte;
  665.     tmUnderlined: Byte;
  666.     tmStruckOut: Byte;
  667.     tmFirstChar: Byte;
  668.     tmLastChar: Byte;
  669.     tmDefaultChar: Byte;
  670.     tmBreakChar: Byte;
  671.     tmPitchAndFamily: Byte;
  672.     tmCharSet: Byte;
  673.     tmOverhang: Integer;
  674.     tmDigitizedAspectX: Integer;
  675.     tmDigitizedAspectY: Integer;
  676.   end;
  677.  
  678. { GDI Logical Objects }
  679.  
  680. { Pel Array }
  681.  
  682. type
  683.   PPelArray = ^TPelArray;
  684.   TPelArray = record
  685.     paXCount: Integer;
  686.     paYCount: Integer;
  687.     paXExt: Integer;
  688.     paYExt: Integer;
  689.     paRGBs: Byte;
  690.   end;
  691.  
  692. { Logical Brush (or Pattern) }
  693.  
  694. type
  695.   PLogBrush = ^TLogBrush;
  696.   TLogBrush = record
  697.     lbStyle: Word;
  698.     lbColor: Longint;
  699.     lbHatch: Integer;
  700.   end;
  701.  
  702. type
  703.   PPattern = ^TPattern;
  704.   TPattern = TLogBrush;
  705.  
  706. { Logical Pen }
  707.  
  708. type
  709.   PLogPen = ^TLogPen;
  710.   TLogPen = record
  711.     lopnStyle: Word;
  712.     lopnWidth: TPoint;
  713.     lopnColor: Longint;
  714.   end;
  715.  
  716. type
  717.   PPaletteEntry = ^TPaletteEntry;
  718.   TPaletteEntry = record
  719.     peRed: Byte;
  720.     peGreen: Byte;
  721.     peBlue: Byte;
  722.     peFlags: Byte;
  723.   end;
  724.  
  725. { Logical Palette }
  726.  
  727. type
  728.   PLogPalette = ^TLogPalette;
  729.   TLogPalette = record
  730.     palVersion: Word;
  731.     palNumEntries: Word;
  732.     palPalEntry: array[0..0] of TPaletteEntry;
  733.   end;
  734.  
  735. { Logical Font }
  736.  
  737. const
  738.   lf_FaceSize = 32;
  739.  
  740. type
  741.   PLogFont = ^TLogFont;
  742.   TLogFont = record
  743.     lfHeight: Integer;
  744.     lfWidth: Integer;
  745.     lfEscapement: Integer;
  746.     lfOrientation: Integer;
  747.     lfWeight: Integer;
  748.     lfItalic: Byte;
  749.     lfUnderline: Byte;
  750.     lfStrikeOut: Byte;
  751.     lfCharSet: Byte;
  752.     lfOutPrecision: Byte;
  753.     lfClipPrecision: Byte;
  754.     lfQuality: Byte;
  755.     lfPitchAndFamily: Byte;
  756.     lfFaceName: array[0..lf_FaceSize - 1] of Char;
  757.   end;
  758.  
  759. const
  760.   out_Default_Precis   = 0;
  761.   out_String_Precis    = 1;
  762.   out_Character_Precis = 2;
  763.   out_Stroke_Precis    = 3;
  764.  
  765. const
  766.   clip_Default_Precis   = 0;
  767.   clip_Character_Precis = 1;
  768.   clip_Stroke_Precis    = 2;
  769.  
  770. const
  771.   Default_Quality = 0;
  772.   Draft_Quality   = 1;
  773.   Proof_Quality   = 2;
  774.  
  775. const
  776.   Default_Pitch  = 0;
  777.   Fixed_Pitch    = 1;
  778.   Variable_Pitch = 2;
  779.  
  780. const
  781.   Ansi_CharSet     = 0;
  782.   Symbol_CharSet   = 2;
  783.   ShiftJIS_CharSet = 128;
  784.   OEM_CharSet      = 255;
  785.  
  786. { Font Families }
  787.  
  788. const
  789.   ff_DontCare   = 0 shl 4;  { Don't care or don't know. }
  790.   ff_Roman      = 1 shl 4;  { Variable stroke width, serifed. }
  791.                             { Times Roman, Century Schoolbook, etc. }
  792.   ff_Swiss      = 2 shl 4;  { Variable stroke width, sans-serifed. }
  793.                             { Helvetica, Swiss, etc. }
  794.   ff_Modern     = 3 shl 4;  { Constant stroke width, serifed or sans-serifed. }
  795.                             { Pica, Elite, Courier, etc. }
  796.   ff_Script     = 4 shl 4;  { Cursive, etc. }
  797.   ff_Decorative = 5 shl 4;  { Old English, etc. }
  798.  
  799. { Font Weights }
  800.  
  801. const
  802.   fw_DontCare   = 0;
  803.   fw_Thin       = 100;
  804.   fw_ExtraLight = 200;
  805.   fw_Light      = 300;
  806.   fw_Normal     = 400;
  807.   fw_Medium     = 500;
  808.   fw_SemiBold   = 600;
  809.   fw_Bold       = 700;
  810.   fw_ExtraBold  = 800;
  811.   fw_Heavy      = 900;
  812.  
  813. const
  814.   fw_UltraLight = fw_ExtraLight;
  815.   fw_Regular    = fw_Normal;
  816.   fw_DemiBold   = fw_SemiBold;
  817.   fw_UltraBold  = fw_ExtraBold;
  818.   fw_Black      = fw_Heavy;
  819.  
  820. { EnumFonts Masks }
  821.  
  822. const
  823.   Raster_FontType = $0001;
  824.   Device_FontType = $0002;
  825.  
  826.  
  827. { Background Modes }
  828.  
  829. const
  830.   Transparent = 1;
  831.   Opaque      = 2;
  832.  
  833. { Mapping Modes }
  834.  
  835. const
  836.   mm_Text        = 1;
  837.   mm_LoMetric    = 2;
  838.   mm_HiMetric    = 3;
  839.   mm_LoEnglish   = 4;
  840.   mm_HiEnglish   = 5;
  841.   mm_TWIPS       = 6;
  842.   mm_Isotropic   = 7;
  843.   mm_Anisotropic = 8;
  844.  
  845. { Coordinate Modes }
  846.  
  847. const
  848.   Absolute = 1;
  849.   Relative = 2;
  850.  
  851. { Stock Logical Objects }
  852.  
  853. const
  854.   White_Brush         = 0;
  855.   LtGray_Brush        = 1;
  856.   Gray_Brush          = 2;
  857.   DkGray_Brush        = 3;
  858.   Black_Brush         = 4;
  859.   Null_Brush          = 5;
  860.   Hollow_Brush        = Null_Brush;
  861.   White_Pen           = 6;
  862.   Black_Pen           = 7;
  863.   Null_Pen            = 8;
  864.   OEM_Fixed_Font      = 10;
  865.   ANSI_Fixed_Font     = 11;
  866.   ANSI_Var_Font       = 12;
  867.   System_Font         = 13;
  868.   Device_Default_Font = 14;
  869.   Default_Palette     = 15;
  870.   System_Fixed_Font   = 16;
  871.  
  872. { Brush Styles }
  873.  
  874. const
  875.   bs_Solid      = 0;
  876.   bs_Null       = 1;
  877.   bs_Hollow     = bs_NULL;
  878.   bs_Hatched    = 2;
  879.   bs_Pattern    = 3;
  880.   bs_Indexed    = 4;
  881.   bs_DIBPattern = 5;
  882.  
  883. { Hatch Styles }
  884.  
  885. const
  886.   hs_Horizontal = 0;       { ----- }
  887.   hs_Vertical   = 1;       { ||||| }
  888.   hs_FDiagonal  = 2;       { ///// }
  889.   hs_BDiagonal  = 3;       { \\\\\ }
  890.   hs_Cross      = 4;       { +++++ }
  891.   hs_DiagCross  = 5;       { xxxxx }
  892.  
  893. const
  894.   ps_Solid       = 0;
  895.   ps_Dash        = 1;      { ------- }
  896.   ps_Dot         = 2;      { ....... }
  897.   ps_DashDot     = 3;      { _._._._ }
  898.   ps_DashDotDot  = 4;      { _.._.._ }
  899.   ps_Null        = 5;
  900.   ps_InsideFrame = 6;
  901.  
  902. { Device Parameters for GetDeviceCaps }
  903.  
  904. const
  905.   DriverVersion = 0;    { Device driver version                    }
  906.   Technology    = 2;    { Device classification                    }
  907.   HorzSize      = 4;    { Horizontal size in millimeters           }
  908.   VertSize      = 6;    { Vertical size in millimeters             }
  909.   HorzRes       = 8;    { Horizontal width in pixels               }
  910.   VertRes       = 10;   { Vertical width in pixels                 }
  911.   BitsPixel     = 12;   { Number of bits per pixel                 }
  912.   Planes        = 14;   { Number of planes                         }
  913.   NumBrushes    = 16;   { Number of brushes the device has         }
  914.   NumPens       = 18;   { Number of pens the device has            }
  915.   NumMarkers    = 20;   { Number of markers the device has         }
  916.   NumFonts      = 22;   { Number of fonts the device has           }
  917.   NumColors     = 24;   { Number of colors the device supports     }
  918.   PDeviceSize   = 26;   { Size required for device descriptor      }
  919.   CurveCaps     = 28;   { Curve capabilities                       }
  920.   LineCaps      = 30;   { Line capabilities                        }
  921.   PolygonalCaps = 32;   { Polygonal capabilities                   }
  922.   TextCaps      = 34;   { Text capabilities                        }
  923.   ClipCaps      = 36;   { Clipping capabilities                    }
  924.   RasterCaps    = 38;   { Bitblt capabilities                      }
  925.   AspectX       = 40;   { Length of the X leg                      }
  926.   AspectY       = 42;   { Length of the Y leg                      }
  927.   AspectXY      = 44;   { Length of the hypotenuse                 }
  928.   LogPixelsX    = 88;   { Logical pixels/inch in X                 }
  929.   LogPixelsY    = 90;   { Logical pixels/inch in Y                 }
  930.   SizePalette   = 104;  { Number of entries in physical palette    }
  931.   NumReserved   = 106;  { Number of reserved entries in palette    }
  932.   ColorRes      = 108;  { Actual color resolution                  }
  933.  
  934. { Device Capability Masks }
  935.  
  936. { Device Technologies }
  937.  
  938. const
  939.   dt_Plotter    = 0;   { Vector plotter                   }
  940.   dt_RasDisplay = 1;   { Raster display                   }
  941.   dt_RasPrinter = 2;   { Raster printer                   }
  942.   dt_RasCamera  = 3;   { Raster camera                    }
  943.   dt_CharStream = 4;   { Character-stream, PLP            }
  944.   dt_MetaFile   = 5;   { Metafile, VDM                    }
  945.   dt_DispFile   = 6;   { Display-file                     }
  946.  
  947. { Curve Capabilities }
  948.  
  949. const
  950.   cc_None       = 0;   { Curves not supported             }
  951.   cc_Circles    = 1;   { Can do circles                   }
  952.   cc_Pie        = 2;   { Can do pie wedges                }
  953.   cc_Chord      = 4;   { Can do chord arcs                }
  954.   cc_Ellipses   = 8;   { Can do ellipese                  }
  955.   cc_Wide       = 16;  { Can do wide lines                }
  956.   cc_Styled     = 32;  { Can do styled lines              }
  957.   cc_WideStyled = 64;  { Can do wide styled lines         }
  958.   cc_Interiors  = 128; { Can do interiors                 }
  959.  
  960. { Line Capabilities }
  961.  
  962. const
  963.   lc_None       = 0;   { Lines not supported              }
  964.   lc_PolyLine   = 2;   { Can do polylines                 }
  965.   lc_Marker     = 4;   { Can do markers                   }
  966.   lc_PolyMarker = 8;   { Can do polymarkers               }
  967.   lc_Wide       = 16;  { Can do wide lines                }
  968.   lc_Styled     = 32;  { Can do styled lines              }
  969.   lc_WideStyled = 64;  { Can do wide styled lines         }
  970.   lc_Interiors  = 128; { Can do interiors                 }
  971.  
  972. { Polygonal Capabilities }
  973.  
  974. const
  975.   pc_None       = 0;   { Polygonals not supported         }
  976.   pc_Polygon    = 1;   { Can do polygons                  }
  977.   pc_Rectangle  = 2;   { Can do rectangles                }
  978.   pc_WindPolygon = 4;  { Can do winding polygons          }
  979.   pc_Trapezoid  = 4;   { Can do trapezoids                }
  980.   pc_ScanLine   = 8;   { Can do scanlines                 }
  981.   pc_Wide       = 16;  { Can do wide borders              }
  982.   pc_Styled     = 32;  { Can do styled borders            }
  983.   pc_WideStyled = 64;  { Can do wide styled borders       }
  984.   pc_Interiors  = 128; { Can do interiors                 }
  985.  
  986. { Polygonal Capabilities }
  987.  
  988. const
  989.   cp_None       = 0;   { No clipping of output            }
  990.   cp_Rectangle  = 1;   { Output clipped to rects          }
  991.  
  992. { Text Capabilities }
  993.  
  994. const
  995.   tc_op_Character = $0001;  { Can do OutputPrecision   CHARACTER      }
  996.   tc_op_Stroke    = $0002;  { Can do OutputPrecision   STROKE         }
  997.   tc_cp_Stroke    = $0004;  { Can do ClipPrecision     STROKE         }
  998.   tc_cr_90        = $0008;  { Can do CharRotAbility    90             }
  999.   tc_cr_Any       = $0010;  { Can do CharRotAbility    ANY            }
  1000.   tc_sf_X_YIndep  = $0020;  { Can do ScaleFreedom      X_YINDEPENDENT }
  1001.   tc_sa_Double    = $0040;  { Can do ScaleAbility      DOUBLE         }
  1002.   tc_sa_Integer   = $0080;  { Can do ScaleAbility      INTEGER        }
  1003.   tc_sa_Contin    = $0100;  { Can do ScaleAbility      CONTINUOUS     }
  1004.   tc_ea_Double    = $0200;  { Can do EmboldenAbility   DOUBLE         }
  1005.   tc_ia_Able      = $0400;  { Can do ItalisizeAbility  ABLE           }
  1006.   tc_ua_Able      = $0800;  { Can do UnderlineAbility  ABLE           }
  1007.   tc_so_Able      = $1000;  { Can do StrikeOutAbility  ABLE           }
  1008.   tc_ra_Able      = $2000;  { Can do RasterFontAble    ABLE           }
  1009.   tc_va_Able      = $4000;  { Can do VectorFontAble    ABLE           }
  1010.   tc_Reserved     = $8000;
  1011.  
  1012. { Raster Capabilities }
  1013.  
  1014. const
  1015.   rc_BitBlt       = $0001;      { Can do standard Blt.            }
  1016.   rc_Banding      = $0002;      { Device requires banding support }
  1017.   rc_Scaling      = $0004;      { Device requires scaling support }
  1018.   rc_Bitmap64     = $0008;      { Device can support >64K bitmap  }
  1019.   rc_GDI20_Output = $0010;      { has 2.0 output calls            }
  1020.   rc_Di_Bitmap    = $0080;      { supports DIB to memory          }
  1021.   rc_Palette      = $0100;      { supports a palette              }
  1022.   rc_DIBToDev     = $0200;      { supports DIBitsToDevice         }
  1023.   rc_BigFont      = $0400;      { supports >64K fonts             }
  1024.   rc_StretchBlt   = $0800;      { supports StretchBlt             }
  1025.   rc_FloodFill    = $1000;      { supports FloodFill              }
  1026.   rc_StretchDIB   = $2000;      { supports StretchDIBits          }
  1027. { Palette entry flags }
  1028.  
  1029. const
  1030.   pc_Reserved = $01;    { palette index used for animation }
  1031.   pc_Explicit = $02;    { palette index is explicit to device }
  1032.   pc_NoCollapse = $04;   { do not match color to system palette }
  1033.  
  1034. { DIB color table identifiers }
  1035.  
  1036. const
  1037.   DIB_RGB_Colors = 0;       { color table in RGBTriples }
  1038.   DIB_Pal_Colors = 1;       { color table in palette indices }
  1039.  
  1040. { Constants for Get/SetSystemPaletteUse }
  1041.  
  1042. const
  1043.   syspal_Static   = 1;
  1044.   syspal_NoStatic = 2;
  1045.  
  1046. { constants for CreateDIBitmap }
  1047.  
  1048. const
  1049.   cbm_Init  = $04;    { initialize bitmap }
  1050.  
  1051.  
  1052. { Indices in FontMapperWeights array }
  1053.  
  1054. const
  1055.   PCharSet           = 0;
  1056.   POutPrecisMismatch = 1;
  1057.   PPitchFixed        = 2;
  1058.   PFaceName          = 3;
  1059.   PFamily            = 4;
  1060.   PFamilyUnknown     = 5;
  1061.   PHeightBigger      = 6;
  1062.   PPitchVariable     = 7;
  1063.   PFHeightSmaller    = 8;
  1064.   PFHeightBigger     = 9;
  1065.   PFWidth            = 10;
  1066.   PSizeSynth         = 11;
  1067.   PFUnevenSizeSynth  = 12;
  1068.   PFIntSizeSynth     = 13;
  1069.   PFAspect           = 14;
  1070.   PItalic            = 15;
  1071.   PFWeight           = 16;
  1072.   PUnderline         = 17;
  1073.   PStrikeOut         = 18;
  1074.   PDefaultPitchFixed = 19;
  1075.   PFVHeightSmaller   = 20;
  1076.   PFVHeightBigger    = 21;
  1077.   DeviceFavor        = 22;
  1078.   PFWeightNumer      = 23;
  1079.   PFWeightDenom      = 24;
  1080.  
  1081. { DrawText Format Flags }
  1082.  
  1083. const
  1084.   dt_Top             = $0000;
  1085.   dt_Left            = $0000;
  1086.   dt_Center          = $0001;
  1087.   dt_Right           = $0002;
  1088.   dt_VCenter         = $0004;
  1089.   dt_Bottom          = $0008;
  1090.   dt_WordBreak       = $0010;
  1091.   dt_SingleLine      = $0020;
  1092.   dt_ExpandTabs      = $0040;
  1093.   dt_TabStop         = $0080;
  1094.   dt_NoClip          = $0100;
  1095.   dt_ExternalLeading = $0200;
  1096.   dt_CalcRect        = $0400;
  1097.   dt_NoPrefix        = $0800;
  1098.   dt_Internal        = $1000;
  1099.  
  1100. { ExtFloodFill style flags }
  1101.  
  1102. const
  1103.   FloodFillBorder  = 0;
  1104.   FloodFillSurface = 1;
  1105.  
  1106. {--------------------------------------------------------------------------}
  1107. {      USER Section                                                        }
  1108. {--------------------------------------------------------------------------}
  1109.  
  1110. { Scroll Bar Constants }
  1111.  
  1112. const
  1113.   sb_HORZ = 0;
  1114.   sb_VERT = 1;
  1115.   sb_CTL  = 2;
  1116.   sb_BOTH = 3;
  1117.  
  1118. { Scroll Bar Commands }
  1119.  
  1120. const
  1121.   sb_LineUp        = 0;
  1122.   sb_LineDown      = 1;
  1123.   sb_PageUp        = 2;
  1124.   sb_PageDown      = 3;
  1125.   sb_ThumbPosition = 4;
  1126.   sb_ThumbTrack    = 5;
  1127.   sb_Top           = 6;
  1128.   sb_Bottom        = 7;
  1129.   sb_EndScroll     = 8;
  1130.  
  1131. { ShowWindow Commands }
  1132.  
  1133. const
  1134.   sw_Hide            = 0;
  1135.   sw_ShowNormal      = 1;
  1136.   sw_Normal          = 1;
  1137.   sw_ShowMinimized   = 2;
  1138.   sw_ShowMaximized   = 3;
  1139.   sw_Maximize        = 3;
  1140.   sw_ShowNoActivate  = 4;
  1141.   sw_Show            = 5;
  1142.   sw_Minimize        = 6;
  1143.   sw_ShowMinNoActive = 7;
  1144.   sw_ShowNA          = 8;
  1145.   sw_Restore         = 9;
  1146.  
  1147. { Old ShowWindow Commands }
  1148.  
  1149. const
  1150.   hide_Window         = 0;
  1151.   show_OpenWindow     = 1;
  1152.   show_IconWindow     = 2;
  1153.   show_FullScreen     = 3;
  1154.   show_OpenNoActivate = 4;
  1155.  
  1156. { Identifiers for the wm_ShowWindow message }
  1157.  
  1158. const
  1159.   sw_ParentClosing = 1;
  1160.   sw_OtherZoom     = 2;
  1161.   sw_ParentOpening = 3;
  1162.   sw_OtherUnzoom   = 4;
  1163.  
  1164. { Region Flags }
  1165.  
  1166. const
  1167.   Error         = 0;
  1168.   NullRegion    = 1;
  1169.   SimpleRegion  = 2;
  1170.   ComplexRegion = 3;
  1171.  
  1172. { CombineRgn Styles }
  1173.  
  1174. const
  1175.   Rgn_And  = 1;
  1176.   Rgn_Or   = 2;
  1177.   Rgn_Xor  = 3;
  1178.   Rgn_Diff = 4;
  1179.   Rgn_Copy = 5;
  1180.  
  1181. { Virtual Keys, Standard Set }
  1182.  
  1183. const
  1184.   vk_LButton   = $01;
  1185.   vk_RButton   = $02;
  1186.   vk_Cancel    = $03;
  1187.   vk_MButton   = $04;   { NOT contiguous with L & RBUTTON }
  1188.   vk_Back      = $08;
  1189.   vk_Tab       = $09;
  1190.   vk_Clear     = $0C;
  1191.   vk_Return    = $0D;
  1192.   vk_Shift     = $10;
  1193.   vk_Control   = $11;
  1194.   vk_Menu      = $12;
  1195.   vk_Pause     = $13;
  1196.   vk_Capital   = $14;
  1197.   vk_Escape    = $1B;
  1198.   vk_Space     = $20;
  1199.   vk_Prior     = $21;
  1200.   vk_Next      = $22;
  1201.   vk_End       = $23;
  1202.   vk_Home      = $24;
  1203.   vk_Left      = $25;
  1204.   vk_Up        = $26;
  1205.   vk_Right     = $27;
  1206.   vk_Down      = $28;
  1207.   vk_Select    = $29;
  1208.   vk_Print     = $2A;
  1209.   vk_Execute   = $2B;
  1210.   vk_SnapShot  = $2C;
  1211. { vk_Copy      = $2C not used by keyboards }
  1212.   vk_Insert    = $2D;
  1213.   vk_Delete    = $2E;
  1214.   vk_Help      = $2F;
  1215. { vk_A thru vk_Z are the same as their ASCII equivalents: 'A' thru 'Z' }
  1216. { vk_0 thru vk_9 are the same as their ASCII equivalents: '0' thru '9' }
  1217.   vk_NumPad0   = $60;
  1218.   vk_NumPad1   = $61;
  1219.   vk_NumPad2   = $62;
  1220.   vk_NumPad3   = $63;
  1221.   vk_NumPad4   = $64;
  1222.   vk_NumPad5   = $65;
  1223.   vk_NumPad6   = $66;
  1224.   vk_NumPad7   = $67;
  1225.   vk_NumPad8   = $68;
  1226.   vk_NumPad9   = $69;
  1227.   vk_Multiply  = $6A;
  1228.   vk_Add       = $6B;
  1229.   vk_Separator = $6C;
  1230.   vk_Subtract  = $6D;
  1231.   vk_Decimal   = $6E;
  1232.   vk_Divide    = $6F;
  1233.   vk_F1        = $70;
  1234.   vk_F2        = $71;
  1235.   vk_F3        = $72;
  1236.   vk_F4        = $73;
  1237.   vk_F5        = $74;
  1238.   vk_F6        = $75;
  1239.   vk_F7        = $76;
  1240.   vk_F8        = $77;
  1241.   vk_F9        = $78;
  1242.   vk_F10       = $79;
  1243.   vk_F11       = $7A;
  1244.   vk_F12       = $7B;
  1245.   vk_F13       = $7C;
  1246.   vk_F14       = $7D;
  1247.   vk_F15       = $7E;
  1248.   vk_F16       = $7F;
  1249.   vk_NumLock   = $90;
  1250.  
  1251. { SetWindowsHook codes }
  1252.  
  1253. const
  1254.   wh_MsgFilter       = (-1);
  1255.   wh_JournalRecord   = 0;
  1256.   wh_JournalPlayback = 1;
  1257.   wh_Keyboard        = 2;
  1258.   wh_GetMessage      = 3;
  1259.   wh_CallWndProc     = 4;
  1260.   wh_CBT             = 5;
  1261.   wh_SysMsgFilter    = 6;
  1262.   wh_WindowMgr       = 7;
  1263.  
  1264. { Hook Codes }
  1265.  
  1266. const
  1267.   hc_LPLPFnNext  = (-2);
  1268.   hc_LPFnNext    = (-1);
  1269.   hc_Action      = 0;
  1270.   hc_GetNext     = 1;
  1271.   hc_Skip        = 2;
  1272.   hc_NoRem       = 3;
  1273.   hc_NoRemove    = 3;
  1274.   hc_SysModalOn  = 4;
  1275.   hc_SysModalOff = 5;
  1276.  
  1277. { CBT Hook Codes }
  1278.  
  1279. const
  1280.   hcbt_MoveSize = 0;
  1281.   hcbt_MinMax   = 1;
  1282.   hcbt_QS       = 2;
  1283.  
  1284. { wh_MSGFILTER Filter Proc Codes }
  1285.  
  1286. const
  1287.   msgf_DialogBox  = 0;
  1288.   msgf_MessageBox = 1;
  1289.   msgf_Menu       = 2;
  1290.   msgf_Move       = 3;
  1291.   msgf_Size       = 4;
  1292.   msgf_ScrollBar  = 5;
  1293.   msgf_NextWindow = 6;
  1294.  
  1295. { Window Manager Hook Codes }
  1296.  
  1297. const
  1298.   wc_Init          = 1;
  1299.   wc_SWP           = 2;
  1300.   wc_DefWindowProc = 3;
  1301.   wc_MinMax        = 4;
  1302.   wc_Move          = 5;
  1303.   wc_Size          = 6;
  1304.   wc_DrawCaption   = 7;
  1305.  
  1306. { Message Structure used in Journaling }
  1307.  
  1308. type
  1309.   PEventMsg = ^TEventMsg;
  1310.   TEventMsg = record
  1311.     message: Word;
  1312.     paramL: Word;
  1313.     paramH: Word;
  1314.     time: Longint;
  1315.   end;
  1316.  
  1317. type
  1318.   PWndClass = ^TWndClass;
  1319.   TWndClass = record
  1320.     style: Word;
  1321.     lpfnWndProc: TFarProc;
  1322.     cbClsExtra: Integer;
  1323.     cbWndExtra: Integer;
  1324.     hInstance: THandle;
  1325.     hIcon: HIcon;                       { Name clash }
  1326.     hCursor: HCursor;                   { Name clash }
  1327.     hbrBackground: HBrush;
  1328.     lpszMenuName: PChar;
  1329.     lpszClassName: PChar;
  1330.   end;
  1331.  
  1332. { Message structure }
  1333.  
  1334. type
  1335.   PMsg = ^TMsg;
  1336.   TMsg = record
  1337.     hwnd: HWnd;
  1338.     message: Word;
  1339.     wParam: Word;
  1340.     lParam: LongInt;
  1341.     time: Longint;
  1342.     pt: TPoint;
  1343.   end;
  1344.  
  1345. { Window field offsets for GetWindowLong and GetWindowWord }
  1346.  
  1347. const
  1348.   gwl_WndProc    = (-4);
  1349.   gww_HInstance  = (-6);
  1350.   gww_HWndParent = (-8);
  1351.   gww_ID         = (-12);
  1352.   gwl_Style      = (-16);
  1353.   gwl_EXStyle    = (-20);
  1354.  
  1355. { Class field offsets for GetClassLong and GetClassWord }
  1356.  
  1357. const
  1358.   gcl_MenuName      = (-8);
  1359.   gcw_HBRBackGround = (-10);
  1360.   gcw_HCursor       = (-12);
  1361.   gcw_HIcon         = (-14);
  1362.   gcw_HModule       = (-16);
  1363.   gcw_CBWndExtra    = (-18);
  1364.   gcw_CBClsExtra    = (-20);
  1365.   gcl_WndProc       = (-24);
  1366.   gcw_Style         = (-26);
  1367.  
  1368. { Window Messages }
  1369.  
  1370. const
  1371.   wm_Null             = $0000;
  1372.   wm_Create           = $0001;
  1373.   wm_Destroy          = $0002;
  1374.   wm_Move             = $0003;
  1375.   wm_Size             = $0005;
  1376.   wm_Activate         = $0006;
  1377.   wm_SetFocus         = $0007;
  1378.   wm_KillFocus        = $0008;
  1379.   wm_Enable           = $000A;
  1380.   wm_SetRedraw        = $000B;
  1381.   wm_SetText          = $000C;
  1382.   wm_GetText          = $000D;
  1383.   wm_GetTextLength    = $000E;
  1384.   wm_Paint            = $000F;
  1385.   wm_Close            = $0010;
  1386.   wm_QueryEndSession  = $0011;
  1387.   wm_Quit             = $0012;
  1388.   wm_QueryOpen        = $0013;
  1389.   wm_EraseBkGnd       = $0014;
  1390.   wm_SysColorChange   = $0015;
  1391.   wm_EndSession       = $0016;
  1392.   wm_ShowWindow       = $0018;
  1393.   wm_CtlColor         = $0019;
  1394.   wm_WinIniChange     = $001A;
  1395.   wm_DevModeChange    = $001B;
  1396.   wm_ActivateApp      = $001C;
  1397.   wm_FontChange       = $001D;
  1398.   wm_TimeChange       = $001E;
  1399.   wm_CancelMode       = $001F;
  1400.   wm_SetCursor        = $0020;
  1401.   wm_MouseActivate    = $0021;
  1402.   wm_ChildActivate    = $0022;
  1403.   wm_QueueSync        = $0023;
  1404.   wm_GetMinMaxInfo    = $0024;
  1405.   wm_PaintIcon        = $0026;
  1406.   wm_IconEraseBkGnd   = $0027;
  1407.   wm_NextDlgCtl       = $0028;
  1408.   wm_SpoolerStatus    = $002A;
  1409.   wm_DrawItem         = $002B;
  1410.   wm_MeasureItem      = $002C;
  1411.   wm_DeleteItem       = $002D;
  1412.   wm_VKeyToItem       = $002E;
  1413.   wm_CharToItem       = $002F;
  1414.   wm_SetFont          = $0030;
  1415.   wm_GetFont          = $0031;
  1416.   wm_QueryDragIcon    = $0037;
  1417.   wm_CompareItem      = $0039;
  1418.   wm_Compacting       = $0041;
  1419.  
  1420.   wm_NCCreate         = $0081;
  1421.   wm_NCDestroy        = $0082;
  1422.   wm_NCCalcSize       = $0083;
  1423.   wm_NCHitTest        = $0084;
  1424.   wm_NCPaint          = $0085;
  1425.   wm_NCActivate       = $0086;
  1426.   wm_GetDlgCode       = $0087;
  1427.   wm_NCMouseMove      = $00A0;
  1428.   wm_NCLButtonDown    = $00A1;
  1429.   wm_NCLButtonUp      = $00A2;
  1430.   wm_NCLButtonDblClk  = $00A3;
  1431.   wm_NCRButtonDown    = $00A4;
  1432.   wm_NCRButtonUp      = $00A5;
  1433.   wm_NCRButtonDblClk  = $00A6;
  1434.   wm_NCMButtonDown    = $00A7;
  1435.   wm_NCMButtonUp      = $00A8;
  1436.   wm_NCMButtonDblClk  = $00A9;
  1437.  
  1438.   wm_KeyFirst         = $0100;
  1439.   wm_KeyDown          = $0100;
  1440.   wm_KeyUp            = $0101;
  1441.   wm_Char             = $0102;
  1442.   wm_DeadChar         = $0103;
  1443.   wm_SysKeyDown       = $0104;
  1444.   wm_SysKeyUp         = $0105;
  1445.   wm_SysChar          = $0106;
  1446.   wm_SysDeadChar      = $0107;
  1447.   wm_KeyLast          = $0108;
  1448.  
  1449.   wm_InitDialog       = $0110;
  1450.   wm_Command          = $0111;
  1451.   wm_SysCommand       = $0112;
  1452.   wm_Timer            = $0113;
  1453.   wm_HScroll          = $0114;
  1454.   wm_VScroll          = $0115;
  1455.   wm_InitMenu         = $0116;
  1456.   wm_InitMenuPopup    = $0117;
  1457.   wm_MenuSelect       = $011F;
  1458.   wm_MenuChar         = $0120;
  1459.   wm_EnterIdle        = $0121;
  1460.  
  1461.  
  1462.   wm_MouseFirst       = $0200;
  1463.   wm_MouseMove        = $0200;
  1464.   wm_LButtonDown      = $0201;
  1465.   wm_LButtonUp        = $0202;
  1466.   wm_LButtonDblClk    = $0203;
  1467.   wm_RButtonDown      = $0204;
  1468.   wm_RButtonUp        = $0205;
  1469.   wm_RButtonDblClk    = $0206;
  1470.   wm_MButtonDown      = $0207;
  1471.   wm_MButtonUp        = $0208;
  1472.   wm_MButtonDblClk    = $0209;
  1473.   wm_MouseLast        = $0209;
  1474.  
  1475.   wm_ParentNotify     = $0210;
  1476.   wm_MDICreate        = $0220;
  1477.   wm_MDIDestroy       = $0221;
  1478.   wm_MDIActivate      = $0222;
  1479.   wm_MDIRestore       = $0223;
  1480.   wm_MDINext          = $0224;
  1481.   wm_MDIMaximize      = $0225;
  1482.   wm_MDITile          = $0226;
  1483.   wm_MDICascade       = $0227;
  1484.   wm_MDIIconArrange   = $0228;
  1485.   wm_MDIGetActive     = $0229;
  1486.   wm_MDISetMenu       = $0230;
  1487.  
  1488.  
  1489.   wm_Cut              = $0300;
  1490.   wm_Copy             = $0301;
  1491.   wm_Paste            = $0302;
  1492.   wm_Clear            = $0303;
  1493.   wm_Undo             = $0304;
  1494.   wm_RenderFormat     = $0305;
  1495.   wm_RenderAllFormats = $0306;
  1496.   wm_DestroyClipboard = $0307;
  1497.   wm_DrawClipboard    = $0308;
  1498.   wm_PaintClipboard   = $0309;
  1499.   wm_VScrollClipboard = $030A;
  1500.   wm_SizeClipboard    = $030B;
  1501.   wm_AskCBFormatName  = $030C;
  1502.   wm_ChangeCBChain    = $030D;
  1503.   wm_HScrollClipboard = $030E;
  1504.   wm_QueryNewPalette  = $030F;
  1505.   wm_PaletteIsChanging = $0310;
  1506.   wm_PaletteChanged   = $0311;
  1507.  
  1508. { NOTE: All Message Numbers below 0x0400 are RESERVED }
  1509.  
  1510. { Private Window Messages Start Here }
  1511.  
  1512.   wm_User             = $0400;
  1513.  
  1514. { wm_SYNCTASK Commands }
  1515.  
  1516. const
  1517.   st_BeginSwp = 0;
  1518.   st_EndSwp   = 1;
  1519.  
  1520. { WinWhere Area Codes }
  1521.  
  1522. const
  1523.   htError       = (-2);
  1524.   htTransparent = (-1);
  1525.   htNoWhere     = 0;
  1526.   htClient      = 1;
  1527.   htCaption     = 2;
  1528.   htSysMenu     = 3;
  1529.   htGrowBox     = 4;
  1530.   htSize        = htGrowBox;
  1531.   htMenu        = 5;
  1532.   htHScroll     = 6;
  1533.   htVScroll     = 7;
  1534.   htReduce      = 8;
  1535.   htZoom        = 9;
  1536.   htLeft        = 10;
  1537.   htRight       = 11;
  1538.   htTop         = 12;
  1539.   htTopLeft     = 13;
  1540.   htTopRight    = 14;
  1541.   htBottom      = 15;
  1542.   htBottomLeft  = 16;
  1543.   htBottomRight = 17;
  1544.   htSizeFirst   = htLeft;
  1545.   htSizeLast    = htBottomRight;
  1546.  
  1547. { wm_MouseActivate Return Codes }
  1548.  
  1549. const
  1550.   ma_Activate       = 1;
  1551.   ma_ActivateAndEat = 2;
  1552.   ma_NoActivate     = 3;
  1553.  
  1554. { Size Message Commands }
  1555.  
  1556. const
  1557.   sizeNormal     = 0;
  1558.   sizeIconic     = 1;
  1559.   sizeFullScreen = 2;
  1560.   sizeZoomShow   = 3;
  1561.   sizeZoomHide   = 4;
  1562.  
  1563. { Key State Masks for Mouse Messages }
  1564.  
  1565. const
  1566.   mk_LButton = $0001;
  1567.   mk_RButton = $0002;
  1568.   mk_Shift   = $0004;
  1569.   mk_Control = $0008;
  1570.   mk_MButton = $0010;
  1571.  
  1572. { Window Styles }
  1573.  
  1574. const
  1575.   ws_Overlapped   = $00000000;
  1576.   ws_Popup        = $80000000;
  1577.   ws_Child        = $40000000;
  1578.   ws_Minimize     = $20000000;
  1579.   ws_Visible      = $10000000;
  1580.   ws_Disabled     = $08000000;
  1581.   ws_ClipSiblings = $04000000;
  1582.   ws_ClipChildren = $02000000;
  1583.   ws_Maximize     = $01000000;
  1584.   ws_Caption      = $00C00000;    { ws_Border + ws_DlgFrame }
  1585.   ws_Border       = $00800000;
  1586.   ws_DlgFrame     = $00400000;
  1587.   ws_VScroll      = $00200000;
  1588.   ws_HScroll      = $00100000;
  1589.   ws_SysMenu      = $00080000;
  1590.   ws_ThickFrame   = $00040000;
  1591.   ws_Group        = $00020000;
  1592.   ws_TabStop      = $00010000;
  1593.  
  1594. const
  1595.   ws_MinimizeBox = $00020000;
  1596.   ws_MaximizeBox = $00010000;
  1597.  
  1598. const
  1599.   ws_Tiled   = ws_Overlapped;
  1600.   ws_Iconic  = ws_Minimize;
  1601.   ws_SizeBox = ws_ThickFrame;
  1602.  
  1603. { Common Window Styles }
  1604.  
  1605. const
  1606.   ws_OverlappedWindow = ws_Overlapped + ws_Caption + ws_SysMenu +
  1607.                         ws_ThickFrame + ws_MinimizeBox + ws_MaximizeBox;
  1608.   ws_PopupWindow      = ws_Popup + ws_Border + ws_SysMenu;
  1609.   ws_ChildWindow      = ws_Child;
  1610.   ws_TiledWindow      = ws_OverlappedWindow;
  1611.  
  1612. { Extended Window Styles }
  1613.  
  1614. const
  1615.   ws_ex_DlgModalFrame  = $00000001;
  1616.   ws_ex_NoParentNotify = $00000004;
  1617.  
  1618. { Class styles }
  1619.  
  1620. const
  1621.   cs_VRedraw         = $0001;
  1622.   cs_HRedraw         = $0002;
  1623.   cs_KeyCvtWindow    = $0004;
  1624.   cs_DblClks         = $0008;
  1625.   cs_OwnDC           = $0020;
  1626.   cs_ClassDC         = $0040;
  1627.   cs_ParentDC        = $0080;
  1628.   cs_NoKeyCvt        = $0100;
  1629.   cs_NoClose         = $0200;
  1630.   cs_SaveBits        = $0800;
  1631.   cs_ByteAlignClient = $1000;
  1632.   cs_ByteAlignWindow = $2000;
  1633.   cs_GlobalClass     = $4000;   { Global window class }
  1634.  
  1635. { Predefined Clipboard Formats }
  1636.  
  1637. const
  1638.   cf_Text         = 1;
  1639.   cf_Bitmap       = 2;
  1640.   cf_MetaFilePict = 3;
  1641.   cf_SYLK         = 4;
  1642.   cf_DIF          = 5;
  1643.   cf_TIFF         = 6;
  1644.   cf_OEMText      = 7;
  1645.   cf_DIB          = 8;
  1646.   cf_Palette      = 9;
  1647.  
  1648. const
  1649.   cf_OwnerDisplay    = $0080;
  1650.   cf_DSPText         = $0081;
  1651.   cf_DSPBitmap       = $0082;
  1652.   cf_DSPMetaFilePict = $0083;
  1653.  
  1654. { "Private" formats don't get GlobalFree'd }
  1655.  
  1656. const
  1657.   cf_PrivateFirst = $0200;
  1658.   cf_PrivateLast  = $02FF;
  1659.  
  1660. { "GDIOBJ" formats do get DeleteObject'd }
  1661.  
  1662. const
  1663.   cf_GDIObjFirst = $0300;
  1664.   cf_GDIObjLast  = $03FF;
  1665.  
  1666. type
  1667.   PPaintStruct = ^TPaintStruct;
  1668.   TPaintStruct = record
  1669.     hdc: HDC;
  1670.     fErase: Bool;
  1671.     rcPaint: TRect;
  1672.     fRestore: Bool;
  1673.     fIncUpdate: Bool;
  1674.     rgbReserved: array[0..15] of Byte;
  1675.   end;
  1676.  
  1677. type
  1678.   PCreateStruct = ^TCreateStruct;
  1679.   TCreateStruct = record
  1680.     lpCreateParams: PChar;
  1681.     hInstance: THandle;
  1682.     hMenu: THandle;
  1683.     hwndParent: HWnd;
  1684.     cy: Integer;
  1685.     cx: Integer;
  1686.     y: Integer;
  1687.     x: Integer;
  1688.     style: LongInt;
  1689.     lpszName: PChar;
  1690.     lpszClass: PChar;
  1691.     dwExStyle: Longint;
  1692.   end;
  1693.  
  1694. { Owner draw control types }
  1695.  
  1696. const
  1697.   odt_Menu     = 1;
  1698.   odt_ListBox  = 2;
  1699.   odt_ComboBox = 3;
  1700.   odt_Button   = 4;
  1701.  
  1702. { Owner draw actions }
  1703.  
  1704. const
  1705.   oda_DrawEntire = $0001;
  1706.   oda_Select     = $0002;
  1707.   oda_Focus      = $0004;
  1708.  
  1709. { Owner draw state }
  1710.  
  1711. const
  1712.   ods_Selected = $0001;
  1713.   ods_Grayed   = $0002;
  1714.   ods_Disabled = $0004;
  1715.   ods_Checked  = $0008;
  1716.   ods_Focus    = $0010;
  1717.  
  1718. { TMeasureItemStruct for ownerdraw }
  1719.  
  1720. type
  1721.   PMeasureItemStruct = ^TMeasureItemStruct;
  1722.   TMeasureItemStruct = record
  1723.     CtlType: Word;
  1724.     CtlID: Word;
  1725.     itemID: Word;
  1726.     itemWidth: Word;
  1727.     itemHeight: Word;
  1728.     itemData: Longint;
  1729.   end;
  1730.  
  1731. { TDrawItemStruct for ownerdraw }
  1732.  
  1733. type
  1734.   PDrawItemStruct = ^TDrawItemStruct;
  1735.   TDrawItemStruct = record
  1736.     CtlType: Word;
  1737.     CtlID: Word;
  1738.     itemID: Word;
  1739.     itemAction: Word;
  1740.     itemState: Word;
  1741.     hwndItem: HWnd;
  1742.     hDC: HDC;
  1743.     rcItem: TRect;
  1744.     itemData: Longint;
  1745.   end;
  1746.  
  1747. { TDeleteItemStruct for ownerdraw }
  1748.   
  1749. type
  1750.   PDeleteItemStruct = ^TDeleteItemStruct;
  1751.   TDeleteItemStruct = record
  1752.     CtlType: Word;
  1753.     CtlID: Word;
  1754.     itemID: Word;
  1755.     hwndItem: HWnd;
  1756.     itemData: Longint;
  1757.   end;
  1758.  
  1759. { TCompareItemStruct for ownerdraw sorting }
  1760.  
  1761. type
  1762.   PCompareItemStruct = ^TCompareItemStruct;
  1763.   TCompareItemStruct = record
  1764.     CtlType: Word;
  1765.     CtlID: Word;
  1766.     hwndItem: HWnd;
  1767.     itemID1: Word;
  1768.     itemData1: Longint;
  1769.     itemID2: Word;
  1770.     itemData2: Longint;
  1771.   end;
  1772.  
  1773. { PeekMessage Options }
  1774.  
  1775. const
  1776.   pm_NoRemove = $0000;
  1777.   pm_Remove   = $0001;
  1778.   pm_NoYield  = $0002;
  1779.  
  1780. const
  1781.   cw_UseDefault = Integer($8000);
  1782.  
  1783. { SetWindowPos Flags }
  1784.  
  1785. const
  1786.   swp_NoSize       = $0001;
  1787.   swp_NoMove       = $0002;
  1788.   swp_NoZOrder     = $0004;
  1789.   swp_NoRedraw     = $0008;
  1790.   swp_NoActivate   = $0010;
  1791.   swp_DrawFrame    = $0020;
  1792.   swp_ShowWindow   = $0040;
  1793.   swp_HideWindow   = $0080;
  1794.   swp_NoCopyBits   = $0100;
  1795.   swp_NoReposition = $0200;
  1796.  
  1797. const
  1798.   DlgWindowExtra = 30;  { Window extra byted for private dialog classes }
  1799.  
  1800. { GetSystemMetrics codes }
  1801.  
  1802. const
  1803.   sm_CXScreen      = 0;
  1804.   sm_CYScreen      = 1;
  1805.   sm_CXVScroll     = 2;
  1806.   sm_CYHScroll     = 3;
  1807.   sm_CYCaption     = 4;
  1808.   sm_CXBorder      = 5;
  1809.   sm_CYBorder      = 6;
  1810.   sm_CXDlgFrame    = 7;
  1811.   sm_CYDlgFrame    = 8;
  1812.   sm_CYVThumb      = 9;
  1813.   sm_CXHThumb      = 10;
  1814.   sm_CXIcon        = 11;
  1815.   sm_CYIcon        = 12;
  1816.   sm_CXCursor      = 13;
  1817.   sm_CYCursor      = 14;
  1818.   sm_CYMenu        = 15;
  1819.   sm_CXFullScreen  = 16;
  1820.   sm_CYFullScreen  = 17;
  1821.   sm_CYKanjiWindow = 18;
  1822.   sm_MousePresent  = 19;
  1823.   sm_CYVScroll     = 20;
  1824.   sm_CXHScroll     = 21;
  1825.   sm_Debug         = 22;
  1826.   sm_SwapButton    = 23;
  1827.   sm_Reserved1     = 24;
  1828.   sm_Reserved2     = 25;
  1829.   sm_Reserved3     = 26;
  1830.   sm_Reserved4     = 27;
  1831.   sm_CXMin         = 28;
  1832.   sm_CYMin         = 29;
  1833.   sm_CXSize        = 30;
  1834.   sm_CYSize        = 31;
  1835.   sm_CXFrame       = 32;
  1836.   sm_CYFrame       = 33;
  1837.   sm_CXMinTrack    = 34;
  1838.   sm_CYMinTrack    = 35;
  1839.   sm_CMetrics      = 36;
  1840.  
  1841. { MessageBox Flags }
  1842.  
  1843. const
  1844.   mb_Ok               = $0000;
  1845.   mb_OkCancel         = $0001;
  1846.   mb_AbortRetryIgnore = $0002;
  1847.   mb_YesNoCancel      = $0003;
  1848.   mb_YesNo            = $0004;
  1849.   mb_RetryCancel      = $0005;
  1850.  
  1851.   mb_IconHand         = $0010;
  1852.   mb_IconQuestion     = $0020;
  1853.   mb_IconExclamation  = $0030;
  1854.   mb_IconAsterisk     = $0040;
  1855.  
  1856.   mb_IconInformation  = mb_IconAsterisk;
  1857.   mb_IconStop         = mb_IconHand;
  1858.  
  1859.   mb_DefButton1       = $0000;
  1860.   mb_DefButton2       = $0100;
  1861.   mb_DefButton3       = $0200;
  1862.  
  1863.   mb_ApplModal        = $0000;
  1864.   mb_SystemModal      = $1000;
  1865.   mb_TaskModal        = $2000;
  1866.  
  1867.   mb_NoFocus          = $8000;
  1868.  
  1869.   mb_TypeMask         = $000F;
  1870.   mb_IconMask         = $00F0;
  1871.   mb_DefMask          = $0F00;
  1872.   mb_ModeMask         = $3000;
  1873.   mb_MiscMask         = $C000;
  1874.  
  1875. { Color Types }
  1876.  
  1877. const
  1878.   ctlcolor_MsgBox    = 0;
  1879.   ctlcolor_Edit      = 1;
  1880.   ctlcolor_ListBox   = 2;
  1881.   ctlcolor_Btn       = 3;
  1882.   ctlcolor_Dlg       = 4;
  1883.   ctlcolor_ScrollBar = 5;
  1884.   ctlcolor_Static    = 6;
  1885.   ctlcolor_Max       = 8;    { three bits max }
  1886.  
  1887. const
  1888.   color_ScrollBar       = 0;
  1889.   color_Background      = 1;
  1890.   color_ActiveCaption   = 2;
  1891.   color_InactiveCaption = 3;
  1892.   color_Menu            = 4;
  1893.   color_Window          = 5;
  1894.   color_WindowFrame     = 6;
  1895.   color_MenuText        = 7;
  1896.   color_WindowText      = 8;
  1897.   color_CaptionText     = 9;
  1898.   color_ActiveBorder    = 10;
  1899.   color_InactiveBorder  = 11;
  1900.   color_AppWorkSpace    = 12;
  1901.   color_Highlight       = 13;
  1902.   color_HighlightText   = 14;
  1903.   color_BtnFace         = 15;
  1904.   color_BtnShadow       = 16;
  1905.   color_GrayText        = 17;
  1906.   color_BtnText         = 18;
  1907.   color_EndColors       = color_BtnText;
  1908. { GetWindow Constants }
  1909.  
  1910. const
  1911.   gw_HWndFirst = 0;
  1912.   gw_HWndLast  = 1;
  1913.   gw_HWndNext  = 2;
  1914.   gw_HWndPrev  = 3;
  1915.   gw_Owner     = 4;
  1916.   gw_Child     = 5;
  1917.  
  1918. { Menu flags for Add/Check/EnableMenuItem }
  1919.  
  1920. const
  1921.   mf_Insert          = $0000;
  1922.   mf_Change          = $0080;
  1923.   mf_Append          = $0100;
  1924.   mf_Delete          = $0200;
  1925.   mf_Remove          = $1000;
  1926.  
  1927.   mf_ByCommand       = $0000;
  1928.   mf_ByPosition      = $0400;
  1929.  
  1930.   mf_Separator       = $0800;
  1931.  
  1932.   mf_Enabled         = $0000;
  1933.   mf_Grayed          = $0001;
  1934.   mf_Disabled        = $0002;
  1935.  
  1936.   mf_Unchecked       = $0000;
  1937.   mf_Checked         = $0008;
  1938.   mf_UseCheckBitmaps = $0200;
  1939.  
  1940.   mf_String          = $0000;
  1941.   mf_Bitmap          = $0004;
  1942.   mf_OwnerDraw       = $0100;
  1943.  
  1944.   mf_Popup           = $0010;
  1945.   mf_MenuBarBreak    = $0020;
  1946.   mf_MenuBreak       = $0040;
  1947.  
  1948.   mf_Unhilite        = $0000;
  1949.   mf_Hilite          = $0080;
  1950.  
  1951.   mf_SysMenu         = $2000;
  1952.   mf_Help            = $4000;
  1953.   mf_MouseSelect     = $8000;
  1954.  
  1955. type
  1956.   TMenuItemTemplateHeader = record
  1957.     versionNumber: Word;
  1958.     offset: Word;
  1959.   end;
  1960.  
  1961.   TMenuItemTemplate = record
  1962.     mtOption: Word;
  1963.     mtID: Word;
  1964.     mtString: array[0..0] of Char;
  1965.   end;
  1966.  
  1967. const
  1968.   mf_End = $0080;
  1969.  
  1970. { System Menu Command Values }
  1971.  
  1972. const
  1973.   sc_Size       = $F000;
  1974.   sc_Move       = $F010;
  1975.   sc_Minimize   = $F020;
  1976.   sc_Maximize   = $F030;
  1977.   sc_NextWindow = $F040;
  1978.   sc_PrevWindow = $F050;
  1979.   sc_Close      = $F060;
  1980.   sc_VScroll    = $F070;
  1981.   sc_HScroll    = $F080;
  1982.   sc_MouseMenu  = $F090;
  1983.   sc_KeyMenu    = $F100;
  1984.   sc_Arrange    = $F110;
  1985.   sc_Restore    = $F120;
  1986.   sc_TaskList   = $F130;
  1987.  
  1988.   sc_Icon       = sc_Minimize;
  1989.   sc_Zoom       = sc_Maximize;
  1990.  
  1991. { Standard Cursor IDs }
  1992.  
  1993. const
  1994.   idc_Arrow    = MakeIntResource(32512);
  1995.   idc_IBeam    = MakeIntResource(32513);
  1996.   idc_Wait     = MakeIntResource(32514);
  1997.   idc_Cross    = MakeIntResource(32515);
  1998.   idc_UPArrow  = MakeIntResource(32516);
  1999.   idc_Size     = MakeIntResource(32640);
  2000.   idc_Icon     = MakeIntResource(32641);
  2001.   idc_SizeNWSE = MakeIntResource(32642);
  2002.   idc_SizeNESW = MakeIntResource(32643);
  2003.   idc_SizeWE   = MakeIntResource(32644);
  2004.   idc_SizeNS   = MakeIntResource(32645);
  2005.  
  2006. const
  2007.   ord_LangDriver = 1;  { Ordinal number of entry point of language drivers }
  2008.  
  2009. { Standard Icon IDs }
  2010.  
  2011. const
  2012.   idi_Application = MakeIntResource(32512);
  2013.   idi_Hand        = MakeIntResource(32513);
  2014.   idi_Question    = MakeIntResource(32514);
  2015.   idi_Exclamation = MakeIntResource(32515);
  2016.   idi_Asterisk    = MakeIntResource(32516);
  2017.  
  2018. const
  2019.   cp_HWnd   = 0;
  2020.   cp_Open   = 1;
  2021.   cp_Direct = 2;
  2022.  
  2023. { VK from the keyboard driver }
  2024.  
  2025. const
  2026.   vk_Kana     = $15;
  2027.   vk_Romaji   = $16;
  2028.   vk_Zenkaku  = $17;
  2029.   vk_Hiragana = $18;
  2030.   vk_Kanji    = $19;
  2031.  
  2032. { VK to send to Applications }
  2033.  
  2034. const
  2035.   vk_Convert    = $1C;
  2036.   vk_NonConvert = $1D;
  2037.   vk_Accept     = $1E;
  2038.   vk_ModeChange = $1F;
  2039.  
  2040. const
  2041.   knj_Start       = $01;
  2042.   knj_End         = $02;
  2043.   knj_Query       = $03;
  2044.  
  2045.   knj_Learn_Mode  = $10;
  2046.   knj_GetMode     = $11;
  2047.   knj_SetMode     = $12;
  2048.  
  2049.   knj_CodeConvert = $20;
  2050.   knj_Convert     = $21;
  2051.   knj_Next        = $22;
  2052.   knj_Previous    = $23;
  2053.   knj_Accept      = $24;
  2054.  
  2055.   knj_Learn       = $30;
  2056.   knj_Register    = $31;
  2057.   knj_Remove      = $32;
  2058.   knj_Change_UDIC = $33;
  2059.  
  2060. { NOTE: Default        = 0 }
  2061. {       JIS1           = 1 }
  2062. {       JIS2           = 2 }
  2063. {       SJIS2          = 3 }
  2064. {       JIS1Katakana   = 4 }
  2065. {       SJIS2Hiragana  = 5 }
  2066. {       SJIS2Katakana  = 6 }
  2067. {       OEM            = F }
  2068.  
  2069. const
  2070.   knj_JIS1toJIS1Katakana  = $14;
  2071.   knj_JIS1toSJIS2         = $13;
  2072.   knj_JIS1toSJIS2Hiragana = $15;
  2073.   knj_JIS1toSJIS2Katakana = $16;
  2074.   knj_JIS1toDefault       = $10;
  2075.   knj_JIS1toSJIS2OEM      = $1F;
  2076.   knj_JIS2toSJIS2         = $23;
  2077.   knj_SJIS2toJIS2         = $32;
  2078.  
  2079.   knj_md_Alpha            = $01;
  2080.   knj_md_Hiragana         = $02;
  2081.   knj_md_HALF             = $04;
  2082.   knj_md_JIS              = $08;
  2083.   knj_md_SPECIAL          = $10;
  2084.  
  2085.   knj_cvt_Next            = $01;
  2086.   knj_cvt_Prev            = $02;
  2087.   knj_cvt_Katakana        = $03;
  2088.   knj_cvt_Hiragana        = $04;
  2089.   knj_cvt_JIS1            = $05;
  2090.   knj_cvt_SJIS2           = $06;
  2091.   knj_cvt_Default         = $07;
  2092.   knj_cvt_Typed           = $08;
  2093.  
  2094. type
  2095.   PKanjiStruct = ^TKanjiStruct;
  2096.   TKanjiStruct = record
  2097.     fnc: Integer;
  2098.     wParam: Integer;
  2099.     lpSource: PChar;
  2100.     lpDest: PChar;
  2101.     wCount: Integer;
  2102.     lpReserved1: Pointer;
  2103.     lpReserved2: Pointer;
  2104.   end;
  2105.  
  2106. { Dialog Box Command IDs }
  2107.  
  2108. const
  2109.   idOk     = 1;
  2110.   idCancel = 2;
  2111.   idAbort  = 3;
  2112.   idRetry  = 4;
  2113.   idIgnore = 5;
  2114.   idYes    = 6;
  2115.   idNo     = 7;
  2116.  
  2117. const
  2118.   id_Ok     = 1;
  2119.   id_Cancel = 2;
  2120.   id_Abort  = 3;
  2121.   id_Retry  = 4;
  2122.   id_Ignore = 5;
  2123.   id_Yes    = 6;
  2124.   id_No     = 7;
  2125.  
  2126. { Control Manager Structures and Definitions }
  2127.  
  2128. { Edit Control Styles }
  2129.  
  2130. const
  2131.   es_Left        = $0000;
  2132.   es_Center      = $0001;
  2133.   es_Right       = $0002;
  2134.   es_MultiLine   = $0004;
  2135.   es_UpperCase   = $0008;
  2136.   es_LowerCase   = $0010;
  2137.   es_Password    = $0020;
  2138.   es_AutoVScroll = $0040;
  2139.   es_AutoHScroll = $0080;
  2140.   es_NoHideSel   = $0100;
  2141.   es_OEMConvert  = $0400;
  2142.  
  2143. { Edit Control Notification Codes }
  2144.  
  2145. const
  2146.   en_SetFocus  = $0100;
  2147.   en_KillFocus = $0200;
  2148.   en_Change    = $0300;
  2149.   en_Update    = $0400;
  2150.   en_ErrSpace  = $0500;
  2151.   en_MaxText   = $0501;
  2152.   en_HScroll   = $0601;
  2153.   en_VScroll   = $0602;
  2154.  
  2155. { Edit Control Messages }
  2156.  
  2157. const
  2158.   em_GetSel          = (wm_User+0);
  2159.   em_SetSel          = (wm_User+1);
  2160.   em_GetRect         = (wm_User+2);
  2161.   em_SetRect         = (wm_User+3);
  2162.   em_SetRectNP       = (wm_User+4);
  2163.   em_Scroll          = (wm_User+5);
  2164.   em_LineScroll      = (wm_User+6);
  2165.   em_GetModify       = (wm_User+8);
  2166.   em_SetModify       = (wm_User+9);
  2167.   em_GetLineCount    = (wm_User+10);
  2168.   em_LineIndex       = (wm_User+11);
  2169.   em_SetHandle       = (wm_User+12);
  2170.   em_GetHandle       = (wm_User+13);
  2171.   em_GetThumb        = (wm_User+14);
  2172.   em_LineLength      = (wm_User+17);
  2173.   em_ReplaceSel      = (wm_User+18);
  2174.   em_SetFont         = (wm_User+19);
  2175.   em_GetLine         = (wm_User+20);
  2176.   em_LimitText       = (wm_User+21);
  2177.   em_CanUndo         = (wm_User+22);
  2178.   em_Undo            = (wm_User+23);
  2179.   em_FmtLines        = (wm_User+24);
  2180.   em_LineFromChar    = (wm_User+25);
  2181.   em_SetWordBreak    = (wm_User+26);
  2182.   em_SetTabStops     = (wm_User+27);
  2183.   em_SetPasswordChar = (wm_User+28);
  2184.   em_EmptyUndoBuffer = (wm_User+29);
  2185.   em_MsgMax          = (wm_User+30);
  2186.  
  2187. { Button Control Styles }
  2188.  
  2189. const
  2190.   bs_PushButton      = $00;
  2191.   bs_DefPushButton   = $01;
  2192.   bs_CheckBox        = $02;
  2193.   bs_AutoCheckBox    = $03;
  2194.   bs_RadioButton     = $04;
  2195.   bs_3State          = $05;
  2196.   bs_Auto3State      = $06;
  2197.   bs_GroupBox        = $07;
  2198.   bs_UserButton      = $08;
  2199.   bs_AutoRadioButton = $09;
  2200.   bs_PushBox         = $0A;
  2201.   bs_OwnerDraw       = $0B;
  2202.   bs_LeftText        = $20;
  2203.  
  2204. { User Button Notification Codes }
  2205.  
  2206. const
  2207.   bn_Clicked       = 0;
  2208.   bn_Paint         = 1;
  2209.   bn_Hilite        = 2;
  2210.   bn_Unhilite      = 3;
  2211.   bn_Disable       = 4;
  2212.   bn_DoubleClicked = 5;
  2213.  
  2214. { Button Control Messages }
  2215.  
  2216. const
  2217.   bm_GetCheck = (wm_User+0);
  2218.   bm_SetCheck = (wm_User+1);
  2219.   bm_GetState = (wm_User+2);
  2220.   bm_SetState = (wm_User+3);
  2221.   bm_SetStyle = (wm_User+4);
  2222.  
  2223. { Static Control Constants }
  2224.  
  2225. const
  2226.   ss_Left           = $00;
  2227.   ss_Center         = $01;
  2228.   ss_Right          = $02;
  2229.   ss_Icon           = $03;
  2230.   ss_BlackRect      = $04;
  2231.   ss_GrayRect       = $05;
  2232.   ss_WhiteRect      = $06;
  2233.   ss_BlackFrame     = $07;
  2234.   ss_GrayFrame      = $08;
  2235.   ss_WhiteFrame     = $09;
  2236.   ss_UserItem       = $0A;
  2237.   ss_Simple         = $0B;
  2238.   ss_LeftNoWordWrap = $0C;
  2239.   ss_NoPrefix       = $80;   { Don't do "&" character translation }
  2240.  
  2241. { Dialog Styles }
  2242.  
  2243. const
  2244.   ds_AbsAlign   = $01;
  2245.   ds_SysModal   = $02;
  2246.   ds_LocalEdit  = $20;   { Edit items get Local storage }
  2247.   ds_SetFont    = $40;   { User specified font for Dlg controls }
  2248.   ds_ModalFrame = $80;   { Can be combined with ws_Caption }
  2249.   ds_NoIdleMsg  = $100;  { wm_EnterIdle message will not be sent }
  2250.  
  2251. const
  2252.   dm_GetDefID = (wm_User+0);
  2253.   dm_SetDefID = (wm_User+1);
  2254.   dc_HasDefID = $534B;
  2255.  
  2256. { Dialog Codes }
  2257.  
  2258. const
  2259.   dlgc_WantArrows      = $0001;    { Control wants arrow keys      }
  2260.   dlgc_WantTab         = $0002;    { Control wants tab keys        }
  2261.   dlgc_WantAllKeys     = $0004;    { Control wants all keys        }
  2262.   dlgc_WantMessage     = $0004;    { Pass message to control       }
  2263.   dlgc_HasSetSel       = $0008;    { Understands em_SetSel message }
  2264.   dlgc_DefPushButton   = $0010;    { Default pushbutton            }
  2265.   dlgc_UndefPushButton = $0020;    { Non-default pushbutton        }
  2266.   dlgc_RadioButton     = $0040;    { Radio button                  }
  2267.   dlgc_WantChars       = $0080;    { Want wm_Char messages         }
  2268.   dlgc_Static          = $0100;    { Static item: don't include    }
  2269.   dlgc_Button          = $2000;    { Button item: can be checked   }
  2270.  
  2271. const
  2272.   lb_CtlCode = 0;
  2273.  
  2274. { Listbox Return Values }
  2275.  
  2276. const
  2277.   lb_Okay     = 0;
  2278.   lb_Err      = (-1);
  2279.   lb_ErrSpace = (-2);
  2280.  
  2281. { The idStaticPath parameter to DlgDirList can have the following values }
  2282. { ORed if the list box should show other details of the files along with }
  2283. { the name of the files }
  2284.  
  2285.  
  2286. { Listbox Notification Codes }
  2287.  
  2288. const
  2289.   lbn_ErrSpace  = (-2);
  2290.   lbn_SelChange = 1;
  2291.   lbn_DblClk    = 2;
  2292.   lbn_SelCancel = 3;
  2293.   lbn_SetFocus  = 4;
  2294.   lbn_KillFocus = 5;
  2295.  
  2296. { Listbox messages }
  2297.  
  2298. const
  2299.   lb_AddString           = (wm_User+1);
  2300.   lb_InsertString        = (wm_User+2);
  2301.   lb_DeleteString        = (wm_User+3);
  2302.   lb_ResetContent        = (wm_User+5);
  2303.   lb_SetSel              = (wm_User+6);
  2304.   lb_SetCurSel           = (wm_User+7);
  2305.   lb_GetSel              = (wm_User+8);
  2306.   lb_GetCurSel           = (wm_User+9);
  2307.   lb_GetText             = (wm_User+10);
  2308.   lb_GetTextLen          = (wm_User+11);
  2309.   lb_GetCount            = (wm_User+12);
  2310.   lb_SelectString        = (wm_User+13);
  2311.   lb_Dir                 = (wm_User+14);
  2312.   lb_GetTopIndex         = (wm_User+15);
  2313.   lb_FindString          = (wm_User+16);
  2314.   lb_GetSelCount         = (wm_User+17);
  2315.   lb_GetSelItems         = (wm_User+18);
  2316.   lb_SetTabStops         = (wm_User+19);
  2317.   lb_GetHorizontalExtent = (wm_User+20);
  2318.   lb_SetHorizontalExtent = (wm_User+21);
  2319.   lb_SetColumnWidth      = (wm_User+22);
  2320.   lb_SetTopIndex         = (wm_User+24);
  2321.   lb_GetItemRect         = (wm_User+25);
  2322.   lb_GetItemData         = (wm_User+26);
  2323.   lb_SetItemData         = (wm_User+27);
  2324.   lb_SelItemRange        = (wm_User+28);
  2325.   lb_MsgMax              = (wm_User+33);
  2326.  
  2327. { Listbox Styles }
  2328.  
  2329. const
  2330.   lbs_Notify            = $0001;
  2331.   lbs_Sort              = $0002;
  2332.   lbs_NoRedraw          = $0004;
  2333.   lbs_MultipleSel       = $0008;
  2334.   lbs_OwnerDrawFixed    = $0010;
  2335.   lbs_OwnerDrawVariable = $0020;
  2336.   lbs_HasStrings        = $0040;
  2337.   lbs_UseTabStops       = $0080;
  2338.   lbs_NoIntegralHeight  = $0100;
  2339.   lbs_MultiColumn       = $0200;
  2340.   lbs_WantKeyboardInput = $0400;
  2341.   lbs_ExtendedSel       = $0800;
  2342.   lbs_Standard          = lbs_Notify + lbs_Sort + ws_VScroll + ws_Border;
  2343.  
  2344. { Combo Box return Values }
  2345.  
  2346. const
  2347.   cb_Okay     = 0;
  2348.   cb_Err      = (-1);
  2349.   cb_ErrSpace = (-2);
  2350.  
  2351. { Combo Box Notification Codes }
  2352.  
  2353. const
  2354.   cbn_ErrSpace   = (-1);
  2355.   cbn_SelChange  = 1;
  2356.   cbn_DblClk     = 2;
  2357.   cbn_SetFocus   = 3;
  2358.   cbn_KillFocus  = 4;
  2359.   cbn_EditChange = 5;
  2360.   cbn_EditUpdate = 6;
  2361.   cbn_DropDown   = 7;
  2362.  
  2363. { Combo Box styles }
  2364.  
  2365. const
  2366.   cbs_Simple            = $0001;
  2367.   cbs_DropDown          = $0002;
  2368.   cbs_DropDownList      = $0003;
  2369.   cbs_OwnerDrawFixed    = $0010;
  2370.   cbs_OwnerDrawVariable = $0020;
  2371.   cbs_AutoHScroll       = $0040;
  2372.   cbs_OEMConvert        = $0080;
  2373.   cbs_Sort              = $0100;
  2374.   cbs_HasStrings        = $0200;
  2375.   cbs_NoIntegralHeight  = $0400;
  2376.  
  2377. { Combo Box messages }
  2378.  
  2379. const
  2380.   cb_GetEditSel            = (wm_User+0);
  2381.   cb_LimitText             = (wm_User+1);
  2382.   cb_SetEditSel            = (wm_User+2);
  2383.   cb_AddString             = (wm_User+3);
  2384.   cb_DeleteString          = (wm_User+4);
  2385.   cb_Dir                   = (wm_User+5);
  2386.   cb_GetCount              = (wm_User+6);
  2387.   cb_GetCurSel             = (wm_User+7);
  2388.   cb_GetLBText             = (wm_User+8);
  2389.   cb_GetLBTextLen          = (wm_User+9);
  2390.   cb_InsertString          = (wm_User+10);
  2391.   cb_ResetContent          = (wm_User+11);
  2392.   cb_FindString            = (wm_User+12);
  2393.   cb_SelectString          = (wm_User+13);
  2394.   cb_SetCurSel             = (wm_User+14);
  2395.   cb_ShowDropDown          = (wm_User+15);
  2396.   cb_GetItemData           = (wm_User+16);
  2397.   cb_SetItemData           = (wm_User+17);
  2398.   cb_GetDroppedControlRect = (wm_User+18);
  2399.   cb_MsgMax                = (wm_User+19);
  2400.  
  2401. { Scroll Bar Styles }
  2402.  
  2403. const
  2404.   sbs_Horz                    = $0000;
  2405.   sbs_Vert                    = $0001;
  2406.   sbs_TopAlign                = $0002;
  2407.   sbs_LeftAlign               = $0002;
  2408.   sbs_BottomAlign             = $0004;
  2409.   sbs_RightAlign              = $0004;
  2410.   sbs_SizeBoxTopLeftAlign     = $0002;
  2411.   sbs_SizeBoxBottomRightAlign = $0004;
  2412.   sbs_SizeBox                 = $0008;
  2413.  
  2414. { WaitSoundState Constants }
  2415.  
  2416. const
  2417.   s_QueueEmpty   = 0;
  2418.   s_Threshold    = 1;
  2419.   s_AllThreshold = 2;
  2420.  
  2421. { Accent Modes }
  2422.  
  2423. const
  2424.   s_Normal   = 0;
  2425.   s_Legato   = 1;
  2426.   s_Staccato = 2;
  2427.  
  2428. { SetSoundNoise Sources }
  2429.  
  2430. const
  2431.   s_Period512   = 0;   { Freq = N/512 high pitch, less coarse hiss  }
  2432.   s_Period1024  = 1;   { Freq = N/1024                              }
  2433.   s_Period2048  = 2;   { Freq = N/2048 low pitch, more coarse hiss  }
  2434.   s_PeriodVoice = 3;   { Source is frequency from voice channel (3) }
  2435.   s_White512    = 4;   { Freq = N/512 high pitch, less coarse hiss  }
  2436.   s_White1024   = 5;   { Freq = N/1024                              }
  2437.   s_White2048   = 6;   { Freq = N/2048 low pitch, more coarse hiss  }
  2438.   s_WhiteVoice  = 7;   { Source is frequency from voice channel (3) }
  2439.  
  2440. const
  2441.   s_SerDVNA = (-1);    { Device not available }
  2442.   s_SerOFM  = (-2);    { Out of memory        }
  2443.   s_SerMACT = (-3);    { Music active         }
  2444.   s_SerQFUL = (-4);    { Queue full           }
  2445.   s_SerBDNT = (-5);    { Invalid note         }
  2446.   s_SerDLN  = (-6);    { Invalid note length  }
  2447.   s_SerDCC  = (-7);    { Invalid note count   }
  2448.   s_SerDTP  = (-8);    { Invalid tempo        }
  2449.   s_SerDVL  = (-9);    { Invalid volume       }
  2450.   s_SerDMD  = (-10);   { Invalid mode         }
  2451.   s_SerDSH  = (-11);   { Invalid shape        }
  2452.   s_SerDPT  = (-12);   { Invalid pitch        }
  2453.   s_SerDFQ  = (-13);   { Invalid frequency    }
  2454.   s_SerDDR  = (-14);   { Invalid duration     }
  2455.   s_SerDSR  = (-15);   { Invalid source       }
  2456.   s_SerDST  = (-16);   { Invalid state        }
  2457.  
  2458. const
  2459.   NoParity     = 0;
  2460.   OddParity    = 1;
  2461.   EvenParity   = 2;
  2462.   MarkParity   = 3;
  2463.   SpaceParity  = 4;
  2464.  
  2465.   OneStopBit   = 0;
  2466.   One5StopBits = 1;
  2467.   TwoStopBits  = 2;
  2468.  
  2469.   Ignore       = 0;       { Ignore signal    }
  2470.   Infinite     = $FFFF;   { Infinite timeout }
  2471.  
  2472. { Error Flags }
  2473.  
  2474. const
  2475.   ce_RXOver   = $0001;   { Receive Queue overflow       }
  2476.   ce_Overrun  = $0002;   { Receive Overrun Error        }
  2477.   ce_RXParity = $0004;   { Receive Parity Error         }
  2478.   ce_Frame    = $0008;   { Receive Framing error        }
  2479.   ce_Break    = $0010;   { Break Detected               }
  2480.   ce_CTSTO    = $0020;   { CTS Timeout                  }
  2481.   ce_DSRTO    = $0040;   { DSR Timeout                  }
  2482.   ce_RLSDTO   = $0080;   { RLSD Timeout                 }
  2483.   ce_TXFull   = $0100;   { TX Queue is full             }
  2484.   ce_PTO      = $0200;   { LPTx Timeout                 }
  2485.   ce_IOE      = $0400;   { LPTx I/O Error               }
  2486.   ce_DNS      = $0800;   { LPTx Device not selected     }
  2487.   ce_OOP      = $1000;   { LPTx Out-Of-Paper            }
  2488.   ce_Mode     = $8000;   { Requested mode unsupported   }
  2489.  
  2490. const
  2491.   ie_BadID    = (-1);    { Invalid or unsupported id    }
  2492.   ie_Open     = (-2);    { Device Already Open          }
  2493.   ie_NoPen    = (-3);    { Device Not Open              }
  2494.   ie_Memory   = (-4);    { Unable to allocate queues    }
  2495.   ie_Default  = (-5);    { Error in default parameters  }
  2496.   ie_Hardware = (-10);   { Hardware Not Present         }
  2497.   ie_ByteSize = (-11);   { Illegal Byte Size            }
  2498.   ie_BaudRate = (-12);   { Unsupported BaudRate         }
  2499.  
  2500. { Events }
  2501.  
  2502. const
  2503.   ev_RXChar  = $0001;    { Any Character received       }
  2504.   ev_RXFlag  = $0002;    { Received certain character   }
  2505.   ev_TXEmpty = $0004;    { Transmitt Queue Empty        }
  2506.   ev_CTS     = $0008;    { CTS changed state            }
  2507.   ev_DSR     = $0010;    { DSR changed state            }
  2508.   ev_RLSD    = $0020;    { RLSD changed state           }
  2509.   ev_Break   = $0040;    { BREAK received               }
  2510.   ev_Err     = $0080;    { Line status error occurred   }
  2511.   ev_Ring    = $0100;    { Ring signal detected         }
  2512.   ev_PErr    = $0200;    { Printer error occured        }
  2513.  
  2514. { Escape Functions }
  2515.  
  2516. const
  2517.   SetXOFF  = 1;          { Simulate XOFF received       }
  2518.   SetXON   = 2;          { Simulate XON received        }
  2519.   SetRTS   = 3;          { Set RTS high                 }
  2520.   ClrRTS   = 4;          { Set RTS low                  }
  2521.   SetDTR   = 5;          { Set DTR high                 }
  2522.   ClrDTR   = 6;          { Set DTR low                  }
  2523.   ResetDev = 7;          { Reset device if possible     }
  2524.  
  2525. const
  2526.   LPTx = $80;            { Set if ID is for LPT device  }
  2527.  
  2528. type
  2529.   PDCB = ^TDCB;
  2530.   TDCB = record
  2531.     Id: Byte;              { Internal Device ID             }
  2532.     BaudRate: Word;        { Baudrate at which runing       }
  2533.     ByteSize: Byte;        { Number of bits/byte, 4-8       }
  2534.     Parity: Byte;          { 0-4=None,Odd,Even,Mark,Space   }
  2535.     StopBits: Byte;        { 0,1,2 = 1, 1.5, 2              }
  2536.     RlsTimeout: Word;      { Timeout for RLSD to be set     }
  2537.     CtsTimeout: Word;      { Timeout for CTS to be set      }
  2538.     DsrTimeout: Word;      { Timeout for DSR to be set      }
  2539.     Flags: Word;
  2540. (*
  2541.     Byte fBinary: 1;       { Binary Mode (skip EOF check    }
  2542.     Byte fRtsDisable:1;    { Don't assert RTS at init time  }
  2543.     Byte fParity: 1;       { Enable parity checking         }
  2544.     Byte fOutxCtsFlow:1;   { CTS handshaking on output      }
  2545.     Byte fOutxDsrFlow:1;   { DSR handshaking on output      }
  2546.     Byte fDummy: 2;        { Reserved                       }
  2547.     Byte fDtrDisable:1;    { Don't assert DTR at init time  }
  2548.  
  2549.     Byte fOutX: 1;         { Enable output X-ON/X-OFF       }
  2550.     Byte fInX: 1;          { Enable input X-ON/X-OFF        }
  2551.     Byte fPeChar: 1;       { Enable Parity Err Replacement  }
  2552.     Byte fNull: 1;         { Enable Null stripping          }
  2553.     Byte fChEvt: 1;        { Enable Rx character event.     }
  2554.     Byte fDtrflow: 1;      { DTR handshake on input         }
  2555.     Byte fRtsflow: 1;      { RTS handshake on input         }
  2556.     Byte fDummy2: 1;
  2557. *)
  2558.     XonChar: char;         { Tx and Rx X-ON character       }
  2559.     XoffChar: char;        { Tx and Rx X-OFF character      }
  2560.     XonLim: Word;          { Transmit X-ON threshold        }
  2561.     XoffLim: Word;         { Transmit X-OFF threshold       }
  2562.     PeChar: char;          { Parity error replacement char  }
  2563.     EofChar: char;         { End of Input character         }
  2564.     EvtChar: char;         { Recieved Event character       }
  2565.     TxDelay: Word;         { Amount of time between chars   }
  2566.   end;
  2567.  
  2568. const
  2569.   dcb_Binary         = $0001;
  2570.   dcb_RtsDisable     = $0002;
  2571.   dcb_Parity         = $0004;
  2572.   dcb_OutxCtsFlow    = $0008;
  2573.   dcb_OutxDsrFlow    = $0010;
  2574.   dcb_DtrDisable     = $0080;
  2575.  
  2576. const
  2577.   dcb_OutX           = $0100;
  2578.   dcb_InX            = $0200;
  2579.   dcb_PeChar         = $0400;
  2580.   dcb_Null           = $0800;
  2581.   dcb_ChEvt          = $1000;
  2582.   dcb_Dtrflow        = $2000;
  2583.   dcb_Rtsflow        = $4000;
  2584.  
  2585. type
  2586.   PComStat = ^TComStat;
  2587.   TComStat = record
  2588.     Flags: Byte;
  2589. (*
  2590.     Byte fCtsHold: 1;    { Transmit is on CTS hold        }
  2591.     Byte fDsrHold: 1;    { Transmit is on DSR hold        }
  2592.     Byte fRlsdHold: 1;   { Transmit is on RLSD hold       }
  2593.     Byte fXoffHold: 1;   { Received handshake             }
  2594.     Byte fXoffSent: 1;   { Issued handshake               }
  2595.     Byte fEof: 1;        { End of file character found    }
  2596.     Byte fTxim: 1;       { Character being transmitted    }
  2597. *)
  2598.     cbInQue: Word;       { count of characters in Rx Queue}
  2599.     cbOutQue: Word;      { count of characters in Tx Queue}
  2600.   end;
  2601.  
  2602. const
  2603.   com_CtsHold    = $0001;
  2604.   com_DsrHold    = $0002;
  2605.   com_RlsdHold   = $0004;
  2606.   com_XoffHold   = $0008;
  2607.   com_XoffSent   = $0010;
  2608.   com_Eof        = $0020;
  2609.   com_Txim       = $0040;
  2610.  
  2611. type
  2612.   PMDICreateStruct = ^TMDICreateStruct;
  2613.   TMDICreateStruct = record
  2614.     szClass: PChar;
  2615.     szTitle: PChar;
  2616.     hOwner: THandle;
  2617.     x, y: Integer;
  2618.     cx, cy: Integer;
  2619.     style: LongInt;
  2620.     lParam: LongInt;        { app-defined stuff }
  2621.   end;
  2622.  
  2623. type
  2624.   PClientCreateStruct = ^TClientCreateStruct;
  2625.   TClientCreateStruct = record
  2626.     hWindowMenu: THandle;
  2627.     idFirstChild: Word;
  2628.   end;
  2629.  
  2630. { Help engine section }
  2631.  
  2632. { Commands to pass WinHelp }
  2633.  
  2634. const
  2635.   help_Context    = $0001;   { Display topic in ulTopic }
  2636.   help_Quit       = $0002;   { Terminate help }
  2637.   help_Index      = $0003;   { Display index }
  2638.   help_HelpOnHelp = $0004;   { Display help on using help }
  2639.   help_SetIndex   = $0005;   { Set the current Index for multi index help }
  2640.   help_Key        = $0101;   { Display topic for keyword in offabData }
  2641.   help_MultiKey   = $0201;
  2642.  
  2643. type
  2644.   TMultiKeyHelp = record
  2645.     mkSize: Word;
  2646.     mkKeyList: Byte;
  2647.     szKeyPhrase: array[0..0] of Byte;
  2648.   end;
  2649.  
  2650. { -------------------- Types from CUSTCTRL.H ------------------------ }
  2651.  
  2652. { general size definitions }
  2653.  
  2654. const
  2655.   ctlTypes = 12;        { number of control types }
  2656.   ctlDescr = 22;        { size of control menu name }
  2657.   ctlClass = 20;        { max size of class name }
  2658.   ctlTitle = 94;        { max size of control text }
  2659.  
  2660. { CONTROL STYLE DATA STRUCTURE
  2661.   
  2662.   This data structure is used by the class style dialog function
  2663.   to set and/or reset various control attributes. }
  2664.  
  2665. type
  2666.   PCtlStyle = ^TCtlStyle;
  2667.   TCtlStyle = record
  2668.     wX: Word;            { x origin of control }
  2669.     wY: Word;            { y origin of control }
  2670.     wCx: Word;            { width of control }
  2671.     wCy: Word;            { height of control }
  2672.     wId: Word;            { control child id }
  2673.     dwStyle: LongInt;        { control style }
  2674.     szClass: array[0..ctlClass-1] of Char;
  2675.                     { name of control class }
  2676.     szTitle: array[0..ctlTitle-1] of Char;
  2677.                     { control text }
  2678.   end;
  2679.  
  2680. {  CONTROL DATA STRUCTURE
  2681.  
  2682.    This data structure is returned by the control options function
  2683.    when enquiring about the capabilities of a particular control.
  2684.    Each control may contain various types (with predefined style
  2685.    bits) under one general class.
  2686.   
  2687.    The width and height fields are used to provide the host
  2688.    application with a suggested size.  The values in these fields
  2689.    could be either in pixels or in rc coordinates.  If it is in pixel,
  2690.    the most sigificant bit(MSB) is on.  If the MSB is off, it is in rc
  2691.    coordinates.
  2692.   
  2693.    The cursor and bitmap handles reference objects which can be
  2694.    used by the dialog editor in the placement and definition of
  2695.    new, user-defined control classes.  However, dialog editor in win30
  2696.    does not use these fields. }
  2697.   
  2698.   TCtlType = record
  2699.     wType: Word;        { type style }
  2700.     wWidth: Word;        { suggested width }
  2701.     wHeight: Word;        { suggested height }
  2702.     dwStyle: LongInt;        { default style }
  2703.     szDescr: array[0..CtlDescr-1] of Char;        
  2704.                 { menu name }
  2705.   end;
  2706.  
  2707.   PCtlInfo = ^TCtlInfo;
  2708.   TCtlInfo = record
  2709.     wVersion: Word;        { control version }
  2710.     wCtlTypes: Word;    { control types }
  2711.     szClass: array[0..ctlClass-1] of Char;        
  2712.                 { control class name }
  2713.     szTitle: array[0..ctlTitle-1] of Char;        
  2714.                 { control title }
  2715.     szReserved: array[0..9] of Char; 
  2716.                 { reserved for future use }
  2717.     ctType: array[0..ctlTypes-1] of TCtlType;        
  2718.                 { control type list }
  2719.   end;
  2720.  
  2721. { ---------------------- Types from DDE.H ------------------------- }
  2722.  
  2723. const
  2724.   wm_dde_First        = $03E0;
  2725.   wm_dde_Initiate   = wm_dde_First;
  2726.   wm_dde_Terminate  = wm_dde_First+1;
  2727.   wm_dde_Advise        = wm_dde_First+2;
  2728.   wm_dde_Unadvise   = wm_dde_First+3;
  2729.   wm_dde_Ack        = wm_dde_First+4;
  2730.   wm_dde_Data        = wm_dde_First+5;
  2731.   wm_dde_Request    = wm_dde_First+6;
  2732.   wm_dde_Poke        = wm_dde_First+7;
  2733.   wm_dde_Execute    = wm_dde_First+8;
  2734.   wm_dde_Last        = wm_dde_First+8;
  2735.  
  2736. { Constants used for a wm_dde_Ack message sent in responce to a wm_dde_Data
  2737.   wm_dde_Request, wm_dde_Poke, wm_dde_Advise, or wm_dde_Unadvise message.
  2738.   For example
  2739.     if lParam and dde_Ack <> 0 then ...
  2740. }
  2741.  
  2742. const
  2743.   dde_AppReturnCode = $00FF;
  2744.   dde_Busy        = $4000;
  2745.   dde_Ack        = $8000;
  2746.  
  2747. { Record for the  ww_dde_Advise Options parameter (LoWord(lParam)) }
  2748.  
  2749. type
  2750.   PDDEAdvise = ^TDDEAdvise;
  2751.   TDDEAdvise = record
  2752. (*
  2753.     unsigned reserved:14,
  2754.              fDeferUpd:1,
  2755.          fAckReq:1;
  2756. *)
  2757.     Flags: Word;
  2758.     cfFormat: Integer;
  2759.   end;
  2760.  
  2761. const
  2762.   dde_DeferUpd     = $4000;
  2763.   dde_AckReq       = $8000;
  2764.  
  2765. { Record for the hData parameter of a wm_dde_Data message (LoWord(lParam)).
  2766.   The actual size of this record depends on the size of the Value
  2767.   array. }
  2768.  
  2769. type
  2770.   PDDEData = ^TDDEData;
  2771.   TDDEData = record
  2772. (*    unsigned unused:12,
  2773.                  fResponse:1,
  2774.                  fRelease:1,
  2775.                  reserved:1,
  2776.                  fAckReq:1;
  2777. *)
  2778.         Flags: Word;
  2779.     cfFormat: Integer;
  2780.     Value: array[0..0] of Char;
  2781.   end;
  2782.  
  2783. const
  2784.   dde_Response = $1000;
  2785.   dde_Release  = $2000;
  2786.  
  2787. { Record for the hData parameter of the wm_dde_Poke record (LoWord(lParam)).
  2788.   The actual size of this record depends on the size of the Value array. }
  2789.  
  2790. type
  2791.   PDDEPoke = ^TDDEPoke;
  2792.   TDDEPoke = record
  2793. (*    unsigned unused:13,
  2794.          fRelease:1,
  2795.          fReserved:2;
  2796. *)
  2797.     Flags: Word;
  2798.     cfFormat: Byte;
  2799.     Value: array[0..0] of Byte;
  2800.   end;
  2801.  
  2802. type
  2803.   PDDEAck = ^TDDEAck;
  2804.   TDDEAck = record
  2805.     Flags: Word;
  2806.   end;
  2807.  
  2808. { ------------------------ Types from DRIVINIT.H ---------------------- }
  2809. { Header file for printer driver initialization using ExtDeviceMode()
  2810.   and DeviceCapabilities(). }
  2811.  
  2812. const
  2813.  
  2814.   { size of a device name string }
  2815.   cchDeviceName        = 32;
  2816.  
  2817.   { current version of specification }
  2818.   dm_SpecVersion    = $300;
  2819.  
  2820.   { field selection bits }
  2821.   dm_Orientation    = $0000001;
  2822.   dm_PaperSize        = $0000002;
  2823.   dm_PaperLength    = $0000004;
  2824.   dm_PaperWidth        = $0000008;
  2825.   dm_Scale        = $0000010;
  2826.   dm_Copies        = $0000100;
  2827.   dm_DefaultSource    = $0000200;
  2828.   dm_PrintQuality    = $0000400;
  2829.   dm_Color        = $0000800;
  2830.   dm_Duplex        = $0001000;
  2831.  
  2832.   { orientation selections }
  2833.   dmorient_Portrait    = 1;
  2834.   dmorient_Landscape    = 2;
  2835.  
  2836.   { paper selections }
  2837.   dmpaper_First        = 1;
  2838.   dmpaper_Letter    = 1;        { Letter 8 1/2 x 11 in }
  2839.   dmpaper_LetterSmall    = 2;        { Letter Small 8 1/2 x 11 in }
  2840.   dmpaper_Tabloid    = 3;        { Tabloid 11 x 17 in }
  2841.   dmpaper_Ledger    = 4;        { Ledger 17 x 11 in }
  2842.   dmpaper_Legal        = 5;        { Legal 8 1/2 x 14 in }
  2843.   dmpaper_Statement    = 6;        { Statement 5 1/2 x 8 1/2 in }
  2844.   dmpaper_Executive    = 7;        { Executive"7 1/2 x 10 in }
  2845.   dmpaper_A3        = 8;        { A3 297 x 420 mm }
  2846.   dmpaper_A4        = 9;        { A4 210 x 297 mm }
  2847.   dmpaper_A4Small    = 10;        { A4 Small 210 x 297 mm }
  2848.   dmpaper_A5        = 11;        { A5 148 x 210 mm }
  2849.   dmpaper_B4        = 12;        { B4 250 x 354 }
  2850.   dmpaper_B5        = 13;        { B5 182 x 257 mm }
  2851.   dmpaper_Folio        = 14;        { Folio 8 1/2 x 13 in }
  2852.   dmpaper_Quarto    = 15;        { Quarto 215 x 275 mm }
  2853.   dmpaper_10X14        = 16;        { 10x14 in }
  2854.   dmpaper_11X17        = 17;        { 11x17 in }
  2855.   dmpaper_Note        = 18;        { Note 8 1/2 x 11 in }
  2856.   dmpaper_Env_9        = 19;        { Envelope #9 3 7/8 x 8 7/8 }
  2857.   dmpaper_Env_10    = 20;        { Envelope #10 4 1/8 x 9 1/2 }
  2858.   dmpaper_Env_11    = 21;        { Envelope #11 4 1/2 x 10 3/8 }
  2859.   dmpaper_Env_12    = 22;        { Envelope #12 4 \276 x 11 }
  2860.   dmpaper_Env_14    = 23;        { Envelope #14 5 x 11 1/2 }
  2861.   dmpaper_CSheet    = 24;        { C size sheet }
  2862.   dmpaper_DSheet    = 25;        { D size sheet }
  2863.   dmpaper_ESheet    = 26;        { E size sheet }
  2864.   dmpaper_Last        = dmpaper_ESheet;
  2865.  
  2866.   dmpaper_User        = 256;
  2867.  
  2868.   { bin selections }
  2869.   dmbin_First        = 1;
  2870.   dmbin_Upper        = 1;
  2871.   dmbin_OnlyOne        = 1;
  2872.   dmbin_Lower        = 2;
  2873.   dmbin_Middle        = 3;
  2874.   dmbin_Manual        = 4;
  2875.   dmbin_Envelope    = 5;
  2876.   dmbin_EnvManual    = 6;
  2877.   dmbin_Auto        = 7;
  2878.   dmbin_Tractor        = 8;
  2879.   dmbin_SmallFmt    = 9;
  2880.   dmbin_LargeFmt    = 10;
  2881.   dmbin_LargeCapacity    = 11;
  2882.   dmbin_Cassette    = 14;
  2883.   dmbin_Last        = dmbin_Cassette;
  2884.  
  2885.   dmbin_User    = 256;    { device specific bins start here }
  2886.  
  2887.   { print qualities }
  2888.   dmres_Draft    = -1;
  2889.   dmres_Low    = -2;
  2890.   dmres_Medium    = -3;
  2891.   dmres_High    = -4;
  2892.  
  2893.   { color enable/disable for color printers }
  2894.   dmcolor_Monochrome    = 1;
  2895.   dmcolor_Color    = 2;
  2896.  
  2897.   { duplex enable }
  2898.   dmdup_Simplex    = 1;
  2899.   dmdup_Vertical    = 2;
  2900.   dmdup_Horizontal    = 3;
  2901.  
  2902. type
  2903.   PDevMode = ^TDevMode;
  2904.   TDevMode =  record
  2905.     dmDeviceName: array[0..cchDeviceName-1] of Char;
  2906.     dmSpecVersion: Word;
  2907.     dmDriverVersion: Word;
  2908.     dmSize: Word;
  2909.     dmDriverExtra: Word;
  2910.     dmFields: LongInt;
  2911.     dmOrientation: Integer;
  2912.     dmPaperSize: Integer;
  2913.     dmPaperLength: Integer;
  2914.     dmPaperWidth: Integer;
  2915.     dmScale: Integer;
  2916.     dmCopies: Integer;
  2917.     dmDefaultSource: Integer;
  2918.     dmPrintQuality: Integer;
  2919.     dmColor: Integer;
  2920.     dmDuplex: Integer;
  2921.   end;
  2922.  
  2923. const
  2924.  
  2925.   { mode selections for the device mode function }
  2926.   dm_Update    = 1;
  2927.   dm_Copy    = 2;
  2928.   dm_Prompt    = 4;
  2929.   dm_Modify    = 8;
  2930.  
  2931.   dm_In_Buffer        = dm_Modify;
  2932.   dm_In_Prompt        = dm_Prompt;
  2933.   dm_Out_Buffer        = dm_Copy;
  2934.   dm_Out_Default    = dm_Update;
  2935.  
  2936.   { device capabilities indices }
  2937.   dc_Fields    = 1;
  2938.   dc_Papers    = 2;
  2939.   dc_Papersize    = 3;
  2940.   dc_MinExtent    = 4;
  2941.   dc_MaxExtent    = 5;
  2942.   dc_Bins    = 6;
  2943.   dc_Duplex    = 7;
  2944.   dc_Size    = 8;
  2945.   dc_Extra    = 9;
  2946.   dc_Version    = 10;
  2947.   dc_Driver    = 11;
  2948.  
  2949.   { export ordinal definitions }
  2950.   proc_ExtDeviceMode       = MakeIntResource(90);
  2951.   proc_DeviceCapabilities = MakeIntResource(91);
  2952.   proc_OldDeviceMode       = MakeIntResource(13);
  2953.  
  2954. type
  2955.   TDeviceMode = procedure(Wnd: HWnd; Module: THandle;
  2956.     DeviceName, Output: PChar);
  2957.   TExtDeviceMode = function(Wnd: HWnd; Driver: THandle;
  2958.     var DevModeOutput: TDevMode; DeciveName, Port: PChar;
  2959.     var DevModeInput: TDevMode; Profile: PChar; Mode: Word): Integer;
  2960.   TDeviceCapabilities = function(DeviceName, Port: PChar;
  2961.     Index: Word; Output: PChar; var DevMode: TDevMode): Longint;
  2962.  
  2963. type
  2964.   PKeyboardState = ^TKeyboardState;
  2965.   TKeyboardState = array[0..255] of Char;
  2966.  
  2967. implementation
  2968.  
  2969. end.
  2970.