home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / tpw / doc / wintypes.pas < prev    next >
Pascal/Delphi Source File  |  1991-05-20  |  80KB  |  2,991 lines

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