home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 9 / 09.iso / l / l040 / 13.ddi / RTLWIN.ZIP / WIN31.PAS next >
Encoding:
Pascal/Delphi Source File  |  1992-10-28  |  43.7 KB  |  1,470 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {       Turbo Pascal for Windows Run-time Library       }
  5. {       Windows 3.1 API Interface Unit                  }
  6. {                                                       }
  7. {       Copyright (c) 1992 Borland International        }
  8. {                                                       }
  9. {*******************************************************}
  10.  
  11. unit Win31;
  12.  
  13. interface
  14.  
  15. uses WinTypes;
  16.  
  17. const
  18.   rt_Group_Cursor     = rt_Cursor + Difference;
  19.   rt_Group_Icon       = rt_Icon + Difference;
  20.  
  21. const
  22.   err_Warning   = $8000;
  23.   err_Param     = $4000;
  24.  
  25.   err_Size_Mask   = $3000;
  26.   err_Byte        = $1000;
  27.   err_Word        = $2000;
  28.   err_DWord       = $3000;
  29.  
  30. {***** LogParamError() values }
  31.  
  32. { Generic parameter values }
  33.   err_Bad_Value      = $6001;
  34.   err_Bad_Flags      = $6002;
  35.   err_Bad_Index      = $6003;
  36.   err_Bad_DValue     = $7004;
  37.   err_Bad_DFlags     = $7005;
  38.   err_Bad_DIndex     = $7006;
  39.   err_Bad_Ptr        = $7007;
  40.   err_Bad_Func_Ptr   = $7008;
  41.   err_Bad_Selector   = $6009;
  42.   err_Bad_String_ptr = $700a;
  43.   err_Bad_Handle     = $600b;
  44.  
  45. { KERNEL parameter errors }
  46.   err_Bad_HInstance       = $6020;
  47.   err_Bad_HModule         = $6021;
  48.   err_Bad_Global_Handle   = $6022;
  49.   err_Bad_Local_Handle    = $6023;
  50.   err_Bad_Atom            = $6024;
  51.   err_Bad_Hfile           = $6025;
  52.  
  53. { USER parameter errors }
  54.   err_Bad_HWnd            = $6040;
  55.   err_Bad_HMenu           = $6041;
  56.   err_Bad_HCursor         = $6042;
  57.   err_Bad_HIcon           = $6043;
  58.   err_Bad_HDWP            = $6044;
  59.   err_Bad_CID             = $6045;
  60.   err_Bad_HDrvr           = $6046;
  61.  
  62. { GDI parameter errors }
  63.   err_Bad_COORDS    = $7060;
  64.   err_Bad_GDI_OBJECT      = $6061;
  65.   err_Bad_HDC             = $6062;
  66.   err_Bad_HPEN            = $6063;
  67.   err_Bad_HFONT           = $6064;
  68.   err_Bad_HBRUSH          = $6065;
  69.   err_Bad_HBITMAP         = $6066;
  70.   err_Bad_HRGN            = $6067;
  71.   err_Bad_HPALETTE        = $6068;
  72.   err_Bad_HMETAFILE       = $6069;
  73.  
  74. {**** LogError() values }
  75.  
  76. { KERNEL errors }
  77.   err_GAlloc              = $0001;
  78.   err_GRealloc            = $0002;
  79.   err_GLock               = $0003;
  80.   err_LAlloc              = $0004;
  81.   err_LRealloc            = $0005;
  82.   err_LLock               = $0006;
  83.   err_ALlocres            = $0007;
  84.   err_LockRes             = $0008;
  85.   err_LoadModule          = $0009;
  86.  
  87. { USER errors }
  88.   err_CreateDlg           = $0040;
  89.   err_CreateDlg2          = $0041;
  90.   err_RegisterClass       = $0042;
  91.   err_DCBusy              = $0043;
  92.   err_CreateWnd           = $0044;
  93.   err_StrucExtra          = $0045;
  94.   err_LoadStr             = $0046;
  95.   err_LoadMenu            = $0047;
  96.   err_NestedBeginPaint    = $0048;
  97.   err_BadIndex            = $0049;
  98.   err_CreateMenu          = $004a;
  99.  
  100. { GDI errors }
  101.   err_CreateDC            = $0080;
  102.   err_CreateMeta          = $0081;
  103.   err_DelObjSelected      = $0082;
  104.   err_SelBitmap           = $0083;
  105.  
  106. const
  107. { WINDEBUGINFO flags values }
  108.   wdi_Options         = $0001;
  109.   wdi_Filter          = $0002;
  110.   wdi_AllocBreak      = $0004;
  111.  
  112. { dwOptions values }
  113.   dbo_CheckHeap       = $0001;
  114.   dbo_BufferFill      = $0004;
  115.   dbo_DisableGPTrapping = $0010;
  116.   dbo_CheckFree       = $0020;
  117.  
  118.   dbo_Silent          = $8000;
  119.  
  120.   dbo_TraceBreak      = $2000;
  121.   dbo_WarningBreak    = $1000;
  122.   dbo_NoErrorBreak    = $0800;
  123.   dbo_NofatalBreak    = $0400;
  124.   dbo_INT3Break       = $0100;
  125.  
  126. { DebugOutput flags values }
  127.   dbf_Trace           = $0000;
  128.   dbf_Warning         = $4000;
  129.   dbf_Error           = $8000;
  130.   dbf_Fatal           = $c000;
  131.  
  132. { dwFilter values }
  133.   dbf_Kernel          = $1000;
  134.   dbf_Krn_MemMan      = $0001;
  135.   dbf_Krn_LoadModule  = $0002;
  136.   dbf_Krn_SegmentLoad = $0004;
  137.   dbf_User            = $0800;
  138.   dbf_GDI             = $0400;
  139.   dbf_MMSystem        = $0040;
  140.   dbf_Penwin          = $0020;
  141.   dbf_Application     = $0008;
  142.   dbf_Driver          = $0010;
  143.  
  144. const
  145.   ew_RestartWindows   = $42;
  146.   ew_RebootSystem     = $43;
  147.  
  148. { SetErrorMode() constants }
  149.   sem_FailCriticalErrors  = $0001;
  150.   sem_NoGPFaultErrorBox   = $0002;
  151.   sem_NoOpenFileErrorBox  = $8000;
  152.  
  153. const
  154.   hInstance_Error = THandle(32);
  155.  
  156. const
  157.   of_Verify     = $0400;      { Used with OF_REOPEN }
  158.  
  159. { _llseek origin values }
  160. const
  161.   seek_set = 0;
  162.   seek_cur = 1;
  163.   seek_end = 2;
  164.  
  165. const
  166. { Errors }
  167.   wn_Success       = $0000;
  168.   wn_Not_Supported = $0001;
  169.   wn_Net_Error     = $0002;
  170.   wn_More_Data     = $0003;
  171.   wn_Bad_Pointer   = $0004;
  172.   wn_Bad_Value     = $0005;
  173.   wn_Bad_Password  = $0006;
  174.   wn_Access_Denied = $0007;
  175.   wn_Function_Busy = $0008;
  176.   wn_Windows_Error = $0009;
  177.   wn_Bad_User      = $000A;
  178.   wn_Out_Of_Memory = $000B;
  179.   wn_Cancel        = $000C;
  180.   wn_Continue      = $000D;
  181.  
  182. { Connection errors }
  183.   wn_Not_Connected     = $0030;
  184.   wn_Open_Files        = $0031;
  185.   wn_Bad_Netname       = $0032;
  186.   wn_Bad_Localname     = $0033;
  187.   wn_Already_Connected = $0034;
  188.   wn_Device_Error      = $0035;
  189.   wn_Connection_Closed = $0036;
  190.  
  191. const
  192.   cc_RoundRect        = $0100;
  193.   cp_Region           = $0002;
  194.  
  195. const
  196.   rc_GDI20_State      = $0020;
  197.   rc_SaveBitmap       = $0040;
  198.   rc_OP_DX_Output     = $4000;
  199.   rc_DevBits          = $8000;
  200.  
  201. const
  202.   Default_Charset     = 1;
  203.   Hangeul_Charset     = 129;
  204.   ChineseBig5_Charset = 136;
  205.  
  206. { OutPrecision values }
  207. const
  208.   out_TT_Precis   = 4;
  209.   out_Device_Precis = 5;
  210.   out_Raster_Precis = 6;
  211.   out_TT_Only_Precis  = 7;
  212.  
  213. { ClipPrecision values }
  214. const
  215.   clip_Mask   = $0F;
  216.   clip_LH_Angles    = $10;
  217.   clip_TT_Always    = $20;
  218.   clip_Embedded   = $80;
  219.  
  220. { tmPitchAndFamily values }
  221. const
  222.   tmpf_Fixed_Pitch    = $01;
  223.   tmpf_Vector     = $02;
  224.   tmpf_Device     = $08;
  225.   tmpf_Truetype     = $04;
  226.  
  227. { new StretchBlt() Modes (simpler names) }
  228. const
  229.   stretch_ANDScans        = 1;
  230.   stretch_ORScans         = 2;
  231.   stretch_DeleteScans     = 3;
  232.  
  233. { Metafile Functions }
  234. const
  235.   meta_StretchDIB        = $0f43;
  236.   meta_ExtFloodFill        = $0548;
  237.  
  238.   meta_ResetDC         = $014C;
  239.   meta_StartDoc        = $014D;
  240.   meta_StartPage         = $004F;
  241.   meta_EndPage         = $0050;
  242.   meta_AbortDoc        = $0052;
  243.   meta_EndDoc        = $005E;
  244.  
  245.   GetFaceName        = 513;
  246.  
  247. { wm_Size message wParam values }
  248.  
  249. const
  250.   size_Restored = 0;
  251.   size_Minimized = 1;
  252.   size_Maximized = 2;
  253.   size_MaxShow = 3;
  254.   size_MaxHide = 4;
  255.  
  256. { wm_KeyUp/Down/Char HiWord(lParam) flags }
  257.  
  258.   kf_Extended = $0100;
  259.   kf_DLGMode = $0800;
  260.   kf_MenuMode = $1000;
  261.   kf_AltDown = $2000;
  262.   kf_Repeat = $4000;
  263.   kf_Up = $8000;
  264.  
  265. { wm_Activate state values }
  266.  
  267.   wa_Inactive = 0;
  268.   wa_Active = 1;
  269.   wa_ClickActive = 2;
  270.  
  271. { Dialog window class }
  272.  
  273.   wc_Dialog = MakeIntAtom($8002);
  274.  
  275. { Get/SetWindowWord/Long offsets for use with wc_Dialog windows }
  276.  
  277.   dwl_MsgResult = 0;
  278.   dwl_DLGProc = 4;
  279.   dwl_User = 8;
  280.  
  281. { Redefined wm_NCHitTest return values }
  282.  
  283.   htMinButton = 8;
  284.   htMaxButton = 9;
  285.   htBorder = 18;
  286.  
  287. { Special HWND value for use with PostMessage() and SendMessage() }
  288. const
  289.   hWnd_Broadcast  = $FFFF;
  290.  
  291.   wh_MsgFilter = -1;
  292.  
  293.  
  294. { CallMsgFilter() and WH_SYS/MSGFILTER context codes }
  295. const
  296.   msgf_MainLoop            = 8;
  297.   msgf_User                = 4096;
  298.  
  299. {***** Power management ***************************************************}
  300. const
  301.   wm_Power      = $0048;
  302.  
  303. { wParam for WM_POWER window message and DRV_POWER driver notification }
  304.   pwr_Ok              = 1;
  305.   pwr_Fail            = -1;
  306.   pwr_SuspendRequest  = 1;
  307.   pwr_SuspendResume   = 2;
  308.   pwr_CriticalResume  = 3;
  309.  
  310. const
  311.   wm_SystemError = $0017;
  312.  
  313. const
  314.   gcw_Atom = -32;
  315.  
  316. { WM_SHOWWINDOW wParam codes }
  317. const
  318.   sw_OtherMaximized   = 2;
  319.   sw_OtherRestored    = 4;
  320.  
  321.  
  322. { Special value for CreateWindow, et al. }
  323. const
  324.   hWnd_Desktop = 0;
  325.  
  326. const
  327.   wf_Paging = $0800;
  328.   wf_WLO = $8000;
  329.  
  330.   obm_UpArrowI = 32737;
  331.   obm_DnArrowI = 32736;
  332.   obm_RgArrowI = 32735;
  333.   obm_LfArrowI = 32734;
  334.  
  335.   MouseTrails = 39;
  336.  
  337.   GetSetScreenParams = 800;
  338.  
  339.  
  340. { Network support }
  341.  
  342. function WNetAddConnection(lpszNetPath, lpszPassword,
  343.   lpszLocalName: PChar): Word;
  344. function WNetGetConnection(lpszLocalName, lpszRemoteName: PChar;
  345.   cbBufferSize: PWord): Word;
  346. function WNetCancelConnection(lpszName: PChar; tForce: Bool): Word;
  347.  
  348.  
  349. type
  350.   PNewTextMetric = ^TNewTextMetric;
  351.   TNewTextMetric = record
  352.     tmHeight: Integer;
  353.     tmAscent: Integer;
  354.     tmDescent: Integer;
  355.     tmInternalLeading: Integer;
  356.     tmExternalLeading: Integer;
  357.     tmAveCharWidth: Integer;
  358.     tmMaxCharWidth: Integer;
  359.     tmWeight: Integer;
  360.     tmItalic: Byte;
  361.     tmUnderlined: Byte;
  362.     tmStruckOut: Byte;
  363.     tmFirstChar: Byte;
  364.     tmLastChar: Byte;
  365.     tmDefaultChar: Byte;
  366.     tmBreakChar: Byte;
  367.     tmPitchAndFamily: Byte;
  368.     tmCharSet: Byte;
  369.     tmOverhang: Integer;
  370.     tmDigitizedAspectX: Integer;
  371.     tmDigitizedAspectY: Integer;
  372.     ntmFlags: Longint;            { various flags (fsSelection) }
  373.     ntmSizeEM: Word;            { size of EM }
  374.     ntmCellHeight: Word;         { height of font in notional units }
  375.     ntmAvgWidth: Word;      { average width in notional units }
  376.   end;
  377.  
  378. const
  379.   ntm_Regular = $00000040;    { possible ntmFlags bits }
  380.   ntm_Bold = $00000020;
  381.   ntm_Italic = $00000001;
  382.  
  383.   lf_FullFaceSize = 64;
  384.  
  385. type
  386.   PEnumLogFont = ^TEnumLogFont;
  387.   TEnumLogFont = record
  388.     elfLogFont: TLogFont;
  389.     elfFullName: array[0..LF_FULLFACESIZE-1] of Char;
  390.     elfStyle: array[0..LF_FACESIZE-1] of Char;
  391.   end;
  392.  
  393. const
  394.   dcx_Window = $00000001;
  395.   dcx_Cache = $00000002;
  396.   dcx_ClipChildren = $00000008;
  397.   dcx_ClipSiblings = $00000010;
  398.   dcx_ParentClip = $00000020;
  399.  
  400.   dcx_ExcludeRgn = $00000040;
  401.   dcx_IntersectRgn = $00000080;
  402.  
  403.   dcx_LockWindowUpdate = $00000400;
  404.  
  405.   dcx_UseStyle = $00010000;
  406.  
  407.   dcb_Reset = $0001;
  408.   dcb_Accumulate = $0002;
  409.   dcb_Dirty = dcb_Accumulate;
  410.   dcb_Set = dcb_Reset or dcb_Accumulate;
  411.   dcb_Enable = $0004;
  412.   dcb_Disable = $0008;
  413.  
  414.  
  415. const
  416. { GetGlyphOutline constants }
  417.   ggo_Metrics        = 0;
  418.   ggo_Bitmap         = 1;
  419.   ggo_Native         = 2;
  420.  
  421.   tt_Polygon_Type   = 24;
  422.  
  423.   tt_Prim_Line       = 1;
  424.   tt_Prim_QSPLine    = 2;
  425.  
  426.  
  427. type
  428.   PPanose = ^TPanose;
  429.   TPanose = record
  430.     bFamilyType: Byte;
  431.     bSerifStyle: Byte;
  432.     bWeight: Byte;
  433.     bProportion: Byte;
  434.     bContrast: Byte;
  435.     bStrokeVariation: Byte;
  436.     bArmStyle: Byte;
  437.     bLetterform: Byte;
  438.     bMidline: Byte;
  439.     bXHeight: Byte;
  440.   end;
  441.  
  442.   POutlineTextMetric = ^TOutlineTextMetric;
  443.   TOutlineTextMetric = record
  444.     otmSize: Word;          { I size of this structure             }
  445.     otmTextMetrics: TTextMetric;      { regular text metrics             }
  446.     otmFiller: Byte;          { want to be word aligned             }
  447.     otmPanoseNumber: TPanose;      { Panose number of font             }
  448.     otmfsSelection: Word;      { B Font selection flags (see #defines)   }
  449.     otmfsType: Word;          { B Type indicators    (see #defines)         }
  450.     otmsCharSlopeRise: Word;      { Slope angle Rise / Run   1 vertical     }
  451.     otmsCharSlopeRun: Word;      {                  0 vertical     }
  452.     otmEMSquare: Word;          { N size of EM                 }
  453.     otmAscent: Word;          { D ascent above baseline             }
  454.     otmDescent: Word;          { D descent below baseline             }
  455.     otmLineGap: Word;          { D                         }
  456.     otmCapEmHeight: Word;      { D height of upper case M             }
  457.     otmXHeight: Word;          { D height of lower case chars in font    }
  458.     otmrcFontBox: TRect;          { D Font bounding box             }
  459.     otmMacAscent: Word;          { D ascent above baseline for Mac         }
  460.     otmMacDescent: Word;       { D descent below baseline for Mac         }
  461.     otmMacLineGap: Word;       { D                         }
  462.     otmusMinimumPPEM: Word;      { D Minimum point ppem             }
  463.     otmptSubscriptSize: TPoint;      { D Size of subscript             }
  464.     otmptSubscriptOffset: TPoint;   { D Offset of subscript             }
  465.     otmptSuperscriptSize: TPoint;   { D Size of superscript             }
  466.     otmptSuperscriptOffset: TPoint; { D Offset of superscript             }
  467.     otmsStrikeoutSize: Word;      { D Strikeout size                 }
  468.     otmsStrikeoutPosition: Word;   { D Strikeout position             }
  469.     otmsUnderscoreSize: Word;      { D Underscore size                 }
  470.     otmsUnderscorePosition: Word;  { D Underscore position             }
  471.     otmpFamilyName: PChar;      { offset to family name             }
  472.     otmpFaceName: PChar;          { offset to face name             }
  473.     otmpStyleName: PChar;       { offset to Style string             }
  474.     otmpFullName: PChar;          { offset to full name             }
  475.   end;
  476.  
  477.   PFixed = ^TFixed;
  478.   TFixed = record
  479.     fract: Word;
  480.     value: Integer;
  481.   end;
  482.  
  483.   PMat2 = ^TMat2;
  484.   TMat2 = record
  485.      eM11: TFixed;
  486.      eM12: TFixed;
  487.      eM21: TFixed;
  488.      eM22: TFixed;
  489.   end;
  490.  
  491.   PGlyphMetrics = ^TGlyphMetrics;
  492.   TGlyphMetrics = record
  493.     gmBlackBoxX: Word;
  494.     gmBlackBoxY: Word;
  495.     gmptGlyphOrigin: TPoint;
  496.     gmCellIncX: Integer;
  497.     gmCellIncY: Integer;
  498.   end;
  499.  
  500.   PPointFX = ^TPointFX;
  501.   TPointFX = record
  502.     x: TFixed;
  503.     y: TFixed;
  504.   end;
  505.  
  506.   PTTPolyCurve = ^TTTPolyCurve;
  507.   TTTPolyCurve = record
  508.     wType: Word;
  509.     cpfx: Word;
  510.     apfx: array[0..0] of TPointFX;
  511.   end;
  512.  
  513.   PPolygonHeader = ^TPolygonHeader;
  514.   TPolygonHeader = record
  515.     cb: Longint;
  516.     dwType: Longint;
  517.     pfxStart: TPointFX;
  518.   end;
  519.  
  520.   PABC = ^TABC;
  521.   TABC = record
  522.     abcA: Integer;
  523.     abcB: Word;
  524.     abcC: Integer;
  525.   end;
  526.  
  527.   PRasterizer_Status = ^TRasterizer_Status;
  528.   TRasterizer_Status = record
  529.     nSize: Integer;
  530.     wFlags: Integer;
  531.     nLanguageID: Integer;
  532.   end;
  533.  
  534. { bits defined in wFlags of TRasterizer_Status }
  535. const
  536.   tt_Available = $0001;
  537.   tt_Enabled = $0002;
  538.  
  539. const
  540.   sb_LineLeft = 0;
  541.   sb_LineRight = 1;
  542.   sb_PageLeft = 2;
  543.   sb_PageRight = 3;
  544.   sb_Left = 6;
  545.   sb_Right = 7;
  546.  
  547.   esb_Enable_Both = $0000;
  548.   esb_Disable_Both = $0003;
  549.  
  550.   esb_Disable_Left = $0001;
  551.   esb_Disable_Right = $0002;
  552.  
  553.   esb_Disable_Up = $0001;
  554.   esb_Disable_Down = $0002;
  555.  
  556.   esb_Disable_LtUp = esb_Disable_Left;
  557.   esb_Disable_RtDn = esb_Disable_Right;
  558.  
  559.   vk_F17 = $80;
  560.   vk_F18 = $81;
  561.   vk_F19 = $82;
  562.   vk_F20 = $83;
  563.   vk_F21 = $84;
  564.   vk_F22 = $85;
  565.   vk_F23 = $86;
  566.   vk_F24 = $87;
  567.   vk_Scroll = $91;
  568.  
  569.   wm_CommNotify = $0044;
  570.  
  571.   wm_WindowPosChanging = $0046;
  572.   wm_WindowPosChanged = $0047;
  573.   wm_DropFiles = $0233;
  574.  
  575.   wm_PenWinFirst = $0380;
  576.   wm_PenWinLast = $038F;
  577.  
  578.   wm_Coalesce_First = $0390;
  579.   wm_Coalesce_Last = $039F;
  580.  
  581. type
  582.   { wm_WindowPosChanging/Changed record pointed to by lParam }
  583.   PWindowPos = ^TWindowPos;
  584.   TWindowPos = record
  585.     hWnd: HWnd;
  586.     hWndInsertAfter: HWnd;
  587.     x: Integer;
  588.     y: Integer;
  589.     cx: Integer;
  590.     cy: Integer;
  591.     flags: Word;
  592.   end;
  593.  
  594.   PNCCalcSize_Params = ^TNCCalcSize_Params;
  595.   TNCCalcSize_Params = record
  596.     rgrc: array[0..2] of TRect;
  597.     lppos: PWindowPos;
  598.   end;
  599.  
  600. const
  601.   { wm_NCCalcSize "window valid rect" return values }
  602.   wvr_AlignTop = $0010;
  603.   wvr_AlignLeft = $0020;
  604.   wvr_AlignBottom = $0040;
  605.   wvr_AlignRight = $0080;
  606.   wvr_HRedraw = $0100;
  607.   wvr_VRedraw = $0200;
  608.   wvr_Redraw = wvr_HRedraw or wvr_VRedraw;
  609.   wvr_ValidTRectS = $0400;
  610.  
  611.  
  612.   ma_NOActivateAndEat = 4;
  613.  
  614.   ws_ex_TopMost = $00000008;
  615.   ws_ex_AcceptFiles = $00000010;
  616.   ws_ex_Transparent = $00000020;
  617.  
  618.   cf_PenData = 10;
  619.   cf_RIFF = 11;
  620.   cf_Wave = 12;
  621.  
  622.   { Special HWnd values for SetWindowPos() hwndInsertAfter }
  623.   hwnd_Top = HWnd(0);
  624.   hwnd_Bottom = HWnd(1);
  625.   hwnd_TopMost = HWnd(-1);
  626.   hwnd_NoTopMost = HWnd(-2);
  627.  
  628.   { GetQueueStatus flags }
  629.   qs_Key = $0001;
  630.   qs_MouseMove = $0002;
  631.   qs_MouseButton = $0004;
  632.   qs_Mouse = qs_MouseMove or qs_MouseButton;
  633.   qs_PostMessage = $0008;
  634.   qs_Timer = $0010;
  635.   qs_Paint = $0020;
  636.   qs_SendMessage = $0040;
  637.   qs_AllInput = $007F;
  638.  
  639.   sm_CXDoubleClk = 36;
  640.   sm_CYDoubleClk = 37;
  641.   sm_CXIconSpacing = 38;
  642.   sm_CYIconSpacing = 39;
  643.   sm_MenuDropAlignment = 40;
  644.   sm_PenWindows = 41;
  645.   sm_DBCSEnabled = 42;
  646.  
  647.   sm_CMetrics = 43; { this overrides WINTYPES.PAS }
  648.  
  649.  
  650.   { Flags for TrackPopupMenu }
  651.   tpm_LeftButton = $0000;
  652.  
  653.   tpm_RightButton = $0002;
  654.   tpm_LeftAlign = $0000;
  655.   tpm_CenterAlign = $0004;
  656.   tpm_RightAlign = $0008;
  657.  
  658.   { RedrawWindow() flags }
  659.   rdw_Invalidate = $0001;
  660.   rdw_InternalPaint = $0002;
  661.   rdw_Erase = $0004;
  662.  
  663.   rdw_Validate = $0008;
  664.   rdw_NoInternalPaint = $0010;
  665.   rdw_NoErase = $0020;
  666.  
  667.   rdw_NoChildren = $0040;
  668.   rdw_AllChildren = $0080;
  669.  
  670.   rdw_UpdateNow = $0100;
  671.   rdw_EraseNow = $0200;
  672.   rdw_Frame = $0400;
  673.   rdw_NoFrame = $0800;
  674.  
  675.   sw_ScrollChildren = $0001;  { Scroll children within *lprcScroll. }
  676.   sw_Invalidate = $0002;  { Invalidate after scrolling }
  677.   sw_Erase = $0004;  { If sw_Invalidate, don't send wm_EraseBackground }
  678.  
  679.   color_InactiveCaptionText = 19;
  680.   color_BtnHighlight = 20;
  681.  
  682.  
  683. type
  684.   HHook = Longint;
  685.   THookProc = function (Code: Integer; wParam: Word; lParam: Longint): Longint;
  686.  
  687. const
  688.   wh_CBT = 5;
  689.   wh_SysMsgFilter = 6;
  690.   wh_Mouse = 7;
  691.   wh_Hardware = 8;
  692.   wh_Debug = 9;
  693.   wh_Shell = 10;
  694.  
  695.   hshell_WindowCreated = 1;
  696.   hshell_WindowDestroyed = 2;
  697.   hshell_ActivateShellWindow = 3;
  698.  
  699.   { CBT Hook Codes }
  700.   hcbt_MoveSize = 0;
  701.   hcbt_MinMax = 1;
  702.   hcbt_QS = 2;
  703.   hcbt_CreateWnd = 3;
  704.   hcbt_DestroyWnd = 4;
  705.   hcbt_Activate = 5;
  706.   hcbt_ClickSkipped = 6;
  707.   hcbt_KeySkipped = 7;
  708.   hcbt_SysCommAnd = 8;
  709.   hcbt_SetFocus = 9;
  710.  
  711. type
  712.   { hcbt_CreateWnd parameters pointed to by lParam }
  713.   PCBT_CreateWnd = ^TCBT_CreateWnd;
  714.   TCBT_CreateWnd = record
  715.     lpcs: PCreateStruct;
  716.     hWndInsertAfter: HWnd;
  717.   end;
  718.  
  719.   PMouseHookStruct = ^TMouseHookStruct;
  720.   TMouseHookStruct = record
  721.     pt: TPoint;
  722.     hWnd: HWnd;
  723.     wHitTestCode: Word;
  724.     dwExtraInfo: Longint;
  725.   end;
  726.  
  727.   PCBTActivateStruct = ^TCBTActivateStruct;
  728.   TCBTActivateStruct = record
  729.     fMouse: Bool;
  730.     hWndActive: HWnd;
  731.   end;
  732.  
  733.   PHardwareHookStruct = ^THardwareHookStruct;
  734.   THardwareHookStruct = record
  735.     hWnd: HWnd;
  736.     wMessage: Word;
  737.     wParam: Word;
  738.     lParam: Longint;
  739.   end;
  740.  
  741.   { Message Structure used in Journaling }
  742.   PEventMsg = TEventMsg;
  743.   TEventMsg = record
  744.     message: Word;
  745.     param: Word;
  746.     paramH: Word;
  747.     time: Longint;
  748.   end;
  749.  
  750. const
  751.   sc_ScreenSave = $F140;
  752.   sc_Hotkey = $F150;
  753.  
  754.   es_ReadOnly = $0800;
  755.   es_WantReturn = $1000;
  756.  
  757.   em_GetFirstVisibleLine = wm_User+30;
  758.   em_SetReadOnly = wm_User+31;
  759.   em_SetWordBreakProc = wm_User+32;
  760.   em_GetWordBreakProc = wm_User+33;
  761.   em_GetPasswordChar = wm_User+34;
  762.  
  763. type
  764.  TEditWordBreakProc = function(lpch: PChar; ichCurrent: Integer; cch: Integer;
  765.    Code: Integer): Integer;
  766.  
  767. { TEditWordBreakProc code values }
  768. const
  769.   wb_Left = 0;
  770.   wb_Right = 1;
  771.   wb_IsDelimiter = 2;
  772.  
  773. const
  774.   stm_SetIcon = wm_User+0;
  775.   stm_GetIcon = wm_User+1;
  776.  
  777.   { DlgDirList, DlgDirListComboBox flags values }
  778.   ddl_ReadWrite = $0001;
  779.   ddl_ReadOnly = $0002;
  780.   ddl_Hidden = $0004;
  781.   ddl_System = $0008;
  782.   ddl_Directory = $0010;
  783.   ddl_Archive = $0020;
  784.  
  785.   ddl_PostMsgs = $2000;
  786.   ddl_Drives = $4000;
  787.   ddl_Exclusive = $8000;
  788.  
  789.  
  790.   lb_SetCaretIndex = wm_User+31;
  791.   lb_GetCaretIndex = wm_User+32;
  792.  
  793.   lb_SetItemHeight = wm_User+33;
  794.   lb_GetItemHeight = wm_User+34;
  795.   lb_FindStringExact = wm_User+35;
  796.  
  797.   lbs_DisableNoScroll = $1000;
  798.  
  799.   cbn_Closeup = 8;
  800.   cbn_SelEndOk = 9;
  801.   cbn_SelEndCancel = 10;
  802.  
  803.   cbs_DisableNoScroll = $0800;
  804.  
  805.   cb_GetDroppedControlRect = wm_User+18;
  806.   cb_SetItemHeight = wm_User+19;
  807.   cb_GetItemHeight = wm_User+20;
  808.   cb_SetExtendedUI = wm_User+21;
  809.   cb_GetExtendedUI = wm_User+22;
  810.   cb_GetDroppedState = wm_User+23;
  811.   cb_FindStringExact = wm_User+24;
  812.  
  813.   ev_CTSS = $0400;    { CTS state                    }
  814.   ev_DSRS = $0800;    { DSR state                    }
  815.   ev_RLSDS = $1000;    { RLSD state                   }
  816.   ev_RingTe = $2000;    { Ring trailing edge indicator }
  817.  
  818.   GetMaxLPT = 8;    { Max supported LPT id        }
  819.   GetMaxCOM = 9;    { Max supported COM id        }
  820.   GetBaseIRQ = 10;    { Get port base & irq for a port }
  821.  
  822.   { Comm Baud Rate indices }
  823.   cbr_110 = $FF10;
  824.   cbr_300 = $FF11;
  825.   cbr_600 = $FF12;
  826.   cbr_1200 = $FF13;
  827.   cbr_2400 = $FF14;
  828.   cbr_4800 = $FF15;
  829.   cbr_9600 = $FF16;
  830.   cbr_14400 = $FF17;
  831.   cbr_19200 = $FF18;
  832.   cbr_38400 = $FF1B;
  833.   cbr_56000 = $FF1F;
  834.   cbr_128000 = $FF23;
  835.   cbr_256000 = $FF27;
  836.  
  837.   { notifications passed in low word of lParam on wm_CommNotify messages }
  838.   cn_Receive = $01;    { bytes are available in the input queue }
  839.   cn_Transmit = $02;    { fewer than wOutTrigger bytes still     }
  840.             { remain in the output queue waiting     }
  841.             { to be transmitted.             }
  842.   cn_Event = $0004;
  843.  
  844.   drv_Load = $0001;
  845.   drv_Enable = $0002;
  846.   drv_Open = $0003;
  847.   drv_Close = $0004;
  848.   drv_Disable = $0005;
  849.   drv_Free = $0006;
  850.   drv_Configure = $0007;
  851.   drv_QueryConfigure = $0008;
  852.   drv_Install = $0009;
  853.   drv_Remove = $000A;
  854.   drv_ExitSession = $000B;
  855.   drv_ExitApplication = $000C;
  856.   drv_Power = $000F;
  857.  
  858.   drv_Reserved = $0800;
  859.   drv_User = $4000;
  860.  
  861.   { Supported return values for drv_Configure message }
  862.   drvcnf_Cancel = $0000;
  863.   drvcnf_OK = $0001;
  864.   drvcnf_Restart = $0002;
  865.  
  866.   drvea_NormalExit = $0001;
  867.   drvea_AbnormalExit = $0002;
  868.  
  869.   { GetNextDriver flags }
  870.   gnd_Forward = $00000000;
  871.   gnd_FirstInstanceOnly = $00000001;
  872.   gnd_Reverse = $00000002;
  873.  
  874. type
  875.   PDriverInfoStruct = ^TDriverInfoStruct;
  876.   TDriverInfoStruct = record
  877.     length: Word;
  878.     hDriver: THandle;
  879.     hModule: THandle;
  880.     szAliasName: array[0..128] of Char;
  881.   end;
  882.  
  883. type
  884.   PDrvConfigInfo = ^TDrvConfigInfo;
  885.   TDrvConfigInfo = record
  886.     dwDCISize: Longint;
  887.     lpszDCISectionName: PChar;
  888.     lpszDCIAliasName: PChar;
  889.   end;
  890.  
  891.  
  892. const
  893.   { MDI client style bits }
  894.   mdis_AllChildStyles = $0001;
  895.  
  896.   { wParam Flags for wm_MDITILE and wm_MDICASCADE messages. }
  897.   mditile_Vertical = $0000;
  898.   mditile_Horizontal = $0001;
  899.   mditile_SkipDisabled = $0002;
  900.  
  901.   { Parameter for SystemParametersInfo() }
  902.   spi_GetBeep = 1;
  903.   spi_SetBeep = 2;
  904.   spi_GetMouse = 3;
  905.   spi_SetMouse = 4;
  906.   spi_GetBorder = 5;
  907.   spi_SetBorder = 6;
  908.   spi_GetKeyBoardSpeed = 10;
  909.   spi_SetKeyBoardSpeed = 11;
  910.   spi_LangDriver = 12;
  911.   spi_IconHorizontalSpacing = 13;
  912.   spi_GetScreenSaveTimeout = 14;
  913.   spi_SetScreenSaveTimeout = 15;
  914.   spi_GetScreenSaveActive = 16;
  915.   spi_SetScreenSaveActive = 17;
  916.   spi_GetGridGranularity = 18;
  917.   spi_SetGridGranularity = 19;
  918.   spi_SetDeskWallpaper = 20;
  919.   spi_SetDeskPattern = 21;
  920.   spi_GetKeyBoardDelay = 22;
  921.   spi_SetKeyBoardDelay = 23;
  922.   spi_IconVerticalSpacing = 24;
  923.   spi_GetIconTitleWrap = 25;
  924.   spi_SetIconTitleWrap = 26;
  925.   spi_GetMenuDropAlignment = 27;
  926.   spi_SetMenuDropAlignment = 28;
  927.   spi_SetDoubleClkWidth = 29;
  928.   spi_SetDoubleClkHeight = 30;
  929.   spi_GetIconTitleLogfont = 31;
  930.   spi_SetDoubleClickTime = 32;
  931.   spi_SetMouseButtonSwap = 33;
  932.   spi_SetIconTitleLogfont = 34;
  933.   spi_GetFastTaskSwitch = 35;
  934.   spi_SetFastTaskSwitch = 36;
  935.  
  936.  
  937.   { Flags }
  938.   spif_UpdateIniFile = $0001;
  939.   spif_SendWinIniChange = $0002;
  940.  
  941. type
  942.   PDocInfo = ^TDocInfo;
  943.   TDocInfo = record
  944.     cbSize: Integer;
  945.     lpszDocName: PChar;
  946.     lpszOutput: PChar;
  947.   end;
  948.  
  949. type
  950.   TAbortProc = function (DC: HDC; Error: Integer): Boolean;
  951.  
  952. type
  953.   TTask = Word;
  954.  
  955. type
  956.   PWinDebugInfo = ^TWinDebugInfo;
  957.   TWinDebugInfo = record
  958.     Flags: Word;
  959.     dwOptions: Longint;
  960.     dwFilter: Longint;
  961.     achAllocModule: array[0..7] of Char;
  962.     dwAllocBreak: Longint;
  963.     dwAllocCount: Longint;
  964.   end;
  965.  
  966. const
  967.   wpf_SetMinPosition      = $0001;
  968.   wpf_RestoreToMaximized  = $0002;
  969.  
  970.   swp_FrameChanged    = $0020;
  971.   swp_NoOwnerZOrder   = $0200;
  972.   swp_NoSendChanging  = $0400;
  973.   swp_DeferErase      = $2000;
  974.  
  975.  
  976. type
  977.   PWindowPlacement = ^TWindowPlacement;
  978.   TWindowPlacement = record
  979.     length: Word;
  980.     flags: Word;
  981.     showCmd: Word;
  982.     ptMinPosition: TPoint;
  983.     ptMaxPosition: TPoint;
  984.     rcNormalPosition: TRect;
  985.   end;
  986.  
  987. type
  988.   PSize = ^TSize;
  989.   TSize = record
  990.     cX: Integer;
  991.     cY: Integer;
  992.   end;
  993.  
  994. type
  995.   TOldFontEnumProc = TFarProc;
  996.   TFontEnumProc = TFarProc;
  997.  
  998. const
  999.   TrueType_FontType  = $0004;
  1000.  
  1001.  
  1002. type
  1003.   PKerningPair = ^TKerningPair;
  1004.   TKerningPair = record
  1005.     wFirst: Word;
  1006.     wSecond: Word;
  1007.     iKernAmount: Integer;
  1008.   end;
  1009.  
  1010. type
  1011.   PComStat = ^TComStat;
  1012.   TComStat = record
  1013.     status: Byte;
  1014.     cbInQue: Word;
  1015.     cbOutQue: Word;
  1016.   end;
  1017.  
  1018. const
  1019.   cstf_ctsHold    = $01;
  1020.   cstf_dsrHold    = $02;
  1021.   cstf_rlsdHold   = $04;
  1022.   cstf_xoffHold   = $08;
  1023.   cstf_xoffSent   = $10;
  1024.   cstf_Eof        = $20;
  1025.   cstf_txim       = $40;
  1026.  
  1027.  
  1028. type
  1029.   PDebugHookInfo = ^TDebugHookInfo;
  1030.   TDebugHookInfo = record
  1031.     hModuleHook: THandle;
  1032.     reserved: Longint;
  1033.     lParam: Longint;
  1034.     wParam: Word;
  1035.     code: Integer;
  1036.   end;
  1037.  
  1038. { Flags returned by GetSystemDebugState. }
  1039. const
  1040.   sds_Menu        = $0001;
  1041.   sds_SysModal    = $0002;
  1042.   sds_NoTaskQueue = $0004;
  1043.   sds_Dialog      = $0008;
  1044.   sds_TaskLocked  = $0010;
  1045.  
  1046. { Constants passed to WinHelp }
  1047. const
  1048.   help_Contents = $0003;
  1049.   help_SetContents = $0005;
  1050.   help_ContextPopup = $0008;
  1051.   help_ForceFile = $0009;
  1052.   help_Command = $0102;
  1053.   help_PartialKey = $0105;
  1054.   help_SetWinPos = $0203;
  1055.  
  1056. type
  1057.   PHelpWinInfo = ^THelpWinInfo;
  1058.   THelpWinInfo = record
  1059.     wStructSize: Integer;
  1060.     x: Integer;
  1061.     y: Integer;
  1062.     dx: Integer;
  1063.     dy: Integer;
  1064.     wMax: Integer;
  1065.     rgchMember: array[0..1] of Char;
  1066.   end;
  1067.  
  1068. { Struct pointed to by WM_GETMINMAXINFO lParam }
  1069. type
  1070.   PMinMaxInfo = ^TMinMaxInfo;
  1071.   TMinMaxInfo = record
  1072.     ptReserved: TPoint;
  1073.     ptMaxSize: TPoint;
  1074.     ptMaxPosition: TPoint;
  1075.     ptMinTrackSize: TPoint;
  1076.     ptMaxTrackSize: TPoint;
  1077.   end;
  1078.  
  1079. type
  1080.   PSegInfo = ^TSegInfo;
  1081.   TSegInfo = record
  1082.     offSegment: Word;
  1083.     cbSegment: Word;
  1084.     flags: Word;
  1085.     cbAlloc: Word;
  1086.     h: THandle;
  1087.     alignShift: Word;
  1088.     reserved: array[0..1] of Word;
  1089.   end;
  1090.  
  1091.  
  1092. const
  1093.   gfsr_SystemResources  = $0000;
  1094.   gfsr_GDIResources     = $0001;
  1095.   gfsr_UserResources    = $0002;
  1096.  
  1097.  
  1098. { function changed from Windows 3.0 to Windows 3.1 }
  1099. procedure AnsiToOem(AnsiStr, OemStr: PChar);
  1100. procedure AnsiToOemBuff(AnsiStr, OemStr: PChar; Length: Word);
  1101. function BringWindowToTop(Wnd: HWnd): Bool;
  1102. function EndDeferWindowPos(WinPosInfo: THandle): Bool;
  1103. function Escape(DC: HDC; Escape, Count: Integer; InData: PChar;
  1104.   OutData: Pointer): Integer;
  1105. function FrameRect(DC: HDC; var Rect: TRect; Brush: HBrush): Integer;
  1106. function GetMenuItemCount(Menu: HMenu): Integer;
  1107. function GetInstanceData(Instance: THandle; Data: PByte;
  1108.   Count: Integer): Integer;
  1109. procedure GlobalUnfix(Mem: THandle);
  1110. procedure OemToAnsi(OemStr, AnsiStr: PChar);
  1111. procedure OemToAnsiBuff(OemStr, AnsiStr: PChar; Length: Word);
  1112. function SetResourceHandler(Instance: THandle; ResType: PChar;
  1113.   LoadFunc: TFarProc): TFarProc;
  1114. procedure UnlockSegment(Segment: Word);
  1115. function CreateBitmap(Width, Height: Integer; Planes, BitCount: Word;
  1116.   Bits: Pointer): HBitmap;
  1117.  
  1118.  
  1119. { functions new to Windows 3.1 }
  1120. function GetTextExtentPoint(DC: HDC; Str: PChar; Count: Integer;
  1121.   var Size: Integer): Bool;
  1122. function GetSystemDebugState: Longint;
  1123. function LockInput(h1: THandle; hwndInput: HWnd; fLock: Bool): Bool;
  1124. function QuerySendMessage(h1, h2, h3: THandle; lpmsg: PMsg): Bool;
  1125. function EnumFonts(DC: HDC; lpszFace: PChar; fntenmprc: TOldFontEnumProc;
  1126.   lpszData: PChar): Integer;
  1127. function GetWinDebugInfo(DebugInfo: PWinDebugInfo; Flags: Word): Bool;
  1128. function SetWinDebugInfo(DebugInfo: PWinDebugInfo): Bool;
  1129. function IsBadReadPtr(lp: Pointer; cb: Word): Bool;
  1130. function IsBadWritePtr(lp: Pointer; cb: Word): Bool;
  1131. function IsBadHugeReadPtr(lp: Pointer; cb: Longint): Bool;
  1132. function IsBadHugeWritePtr(lp: Pointer; cb: Longint): Bool;
  1133. function IsBadCodePtr(lpfn: TFarProc): Bool;
  1134. function IsBadStringPtr(lpsz: PChar; cchMax: Word): Bool;
  1135. procedure DirectedYield(Task: TTask);
  1136. function PrestoChangoSelector(SourceSel, DestSel: Word): Word;
  1137. function GetSelectorBase(Selector: Word): Longint;
  1138. function SetSelectorBase(Selector: Word; Base: Longint): Word;
  1139. function GetSelectorLimit(Selector: Word): Longint;
  1140. function SetSelectorLimit(Selector: Word; Base: Longint): Word;
  1141.  
  1142. function GetDriverInfo(hDriver: THandle; lpdis: PDriverInfoStruct): Bool;
  1143. function GetWindowPlacement(Wnd: HWnd; Placement: PWindowPlacement): Bool;
  1144. function SetWindowPlacement(Wnd: HWnd; Placement: PWindowPlacement): Bool;
  1145. function DlgDirSelectEx(Dlg: HWnd; Path: PChar; cbPath: Integer;
  1146.   ListBox: Integer): Bool;
  1147. function DlgDirSelectComboBoxEx(Dlg: HWnd; Path: PChar; cbPath: Integer;
  1148.   ComboBox: Integer): Bool;
  1149. function GetTimerResolution: Longint;
  1150. function ExitWindowsExec(Exe: PChar; Params: PChar): Bool;
  1151.  
  1152. function SpoolFile(Printer, Port, Job, F: PChar): THandle;
  1153. function QueryAbort(DC: HDC; Reserved: Integer): Bool;
  1154. function SetWindowOrgEx(DC: HDC; nX, nY: Integer; Point: PPoint): Bool;
  1155. function GetWindowOrgEx(DC: HDC; Point: PPoint): Bool;
  1156. function SetWindowExtEx(DC: HDC; nX, nY: Integer; Size: PSize): Bool;
  1157. function GetWindowExtEx(DC: HDC; Size: PSize): Bool;
  1158. function OffsetWindowOrgEx(DC: HDC; nX, nY: Integer; Point: PPoint): Bool;
  1159. function ScaleWindowExtEx(DC: HDC; Xnum, Xdenom, Ynum, Ydenom: Integer;
  1160.   Size: PSize): Bool;
  1161. function SetViewportExtEx(DC: HDC; nX, nY: Integer; Size: PSize): Bool;
  1162. function GetViewportExtEx(DC: HDC; Size: PSize): Bool;
  1163. function SetViewportOrgEx(DC: HDC; nX, nY: Integer; Point: PPoint): Bool;
  1164. function GetViewportOrgEx(DC: HDC; Point: PPoint): Bool;
  1165. function OffsetViewportOrgEx(DC: HDC; nX, nY: Integer; Point: PPoint): Bool;
  1166. function ScaleViewportExtEx(DC: HDC; Xnum, Xdenom, Ynum, Ydenom: Integer;
  1167.   Size: PSize): Bool;
  1168. function GetBrushOrgEx(DC: HDC; Point: PPoint): Bool;
  1169. function MoveToEx(DC: HDC; nX, nY: Integer; Point: PPoint): Bool;
  1170. function GetCurrentPositionEx(DC: HDC; Point: PPoint): Bool;
  1171. function GetAspectRatioFilterEx(DC: HDC; Size: PSize): Bool;
  1172. function EnumFontFamilies(DC: HDC; Family: PChar;
  1173.   EnumProc: TFontEnumProc; Data: PChar): Integer;
  1174. function GetKerningPairs(DC: HDC; i: Integer; Pair: PKerningPair): Integer;
  1175. function SetBitmapDimensionEx(BM: HBitmap; nX, nY: Integer; Size: PSize): Bool;
  1176. function GetBitmapDimensionEx(BM: HBitmap; Size: PSize): Bool;
  1177. function SetMetaFileBitsBetter(mf: THandle): THandle;
  1178. function StartDoc(DC: HDC; var di: TDocInfo): Integer;
  1179. function StartPage(DC: HDC): Integer;
  1180. function EndPage(DC: HDC): Integer;
  1181. function EndDoc(DC: HDC): Integer;
  1182. function AbortDoc(DC: HDC): Integer;
  1183. function SetAbortProc(DC: HDC; AbortProc: TAbortProc): Integer;
  1184.  
  1185. function IsTask(Task: THandle): Bool;
  1186. function GetFreeSystemResources(SysResource: Word): Word;
  1187. function GlobalPtrHandle(P: Pointer): THandle;
  1188. function GlobalAllocPtr(Flags: Word; Bytes: Longint): Pointer;
  1189. function GlobalReAllocPtr(P: Pointer; Bytes: Longint; Flags: Word): Pointer;
  1190. function GlobalFreePtr(P: Pointer): THandle;
  1191. function GlobalLockPtr(P: Pointer): Pointer;
  1192. function GlobalUnlockPtr(P: Pointer): Bool;
  1193. function GetInstanceModule(Instance: THandle): THandle;
  1194. procedure LogError(Err: Word; Info: Pointer);
  1195. procedure LogParamError(Err: Word; fn: TFarProc; Param: Pointer);
  1196. function IsDBCSLeadByte(Ch: Byte): Bool;
  1197. function GetDCEx(Wnd: HWnd; Clip: HRgn; Flags: Longint): HDC;
  1198. function IsGDIObject(Obj: THandle): Bool;
  1199. function SetBoundsRect(DC: HDC; var Bounds: TRect; Flags: Word): Word;
  1200. function GetBoundsRect(DC: HDC; var Bounds: TRect; Flags: Word): Word;
  1201. function ConvertOutlineFontFile(A, B, C: PChar): Longint;
  1202. function GetFontData(hdc: HDC; dwTable, dwOffset: Longint; lpvBuffer: PChar;
  1203.   cbData: Longint): Longint;
  1204. function GetGlyphOutline(hdc: HDC; uChar, fuFormat: Word;
  1205.   var lpgm: TGlyphMetrics; cbBuffer: Longint; lpBuffer: PChar;
  1206.   var lpMat2: TMat2): Longint;
  1207. function CreateScalableFontResource(fHidden: Word; lpszResourceFile,
  1208.   lpszFontFile, lpszCurrentPath: PChar): Bool;
  1209. function GetCharABCWidths(hdc: HDC; uFirstChar, uLastChar: Word;
  1210.   var lpabc: TABC): Bool;
  1211. function GetRasterizerCaps(var lpRastStat: TRasterizer_Status;
  1212.   cbNumBytes: Integer): Bool;
  1213. function GetOutlineTextMetrics(hdc: HDC; cbData: Word;
  1214.   lpotm: POutlineTextMetric): Word;
  1215. function GetMessageExtraInfo: Longint;
  1216. function GetOpenClipboardWindow: HWnd;
  1217. function GetQueueStatus(Flags: Word): Longint;
  1218. function IsMenu(Menu: HMenu): Bool;
  1219. function RedrawWindow(Wnd: HWnd; UpdateRect: PRect; UpdateRgn: HRgn;
  1220.   Flags: Word): Bool;
  1221. function LockWindowUpdate(Wnd: HWnd): Bool;
  1222. function ScrollWindowEx(Wnd: HWnd; dx, dy: Integer; Scroll, Clip: PRect; UpdateRgn: HRgn;
  1223.   UpdateRect: PRect; Flags: Word): Integer;
  1224. function EnableScrollBar(hwnd: HWnd; fnSBFlags: Integer;
  1225.   fuArrowFlags: Word): Bool;
  1226. function CopyCursor(hInst: THandle; hCur: HCursor): HCursor;
  1227. function GetCursor: HCursor;
  1228. procedure GetClipCursor(var Rect: TRect);
  1229. function CopyIcon(hInst: THandle; Icon: HIcon): HIcon;
  1230. procedure MapWindowPoints(FromWnd, ToWnd: HWnd; var Point; Count: Word);
  1231. procedure MapWindowRect(FromWnd, ToWnd: HWnd; var Rect: TRect);
  1232. function SubtractRect(var Dest, Source1, Source2: TRect): Bool;
  1233. function SetWindowsHookEx(HookId: Integer; Hook: THookProc; Module, Task: THandle): HHook;
  1234. function UnhookWindowsHookEx(Hook: HHook): Bool;
  1235. function CallNextHookEx(Hook: HHook; Code: Integer; wParam: Word; lParam: Longint): Longint;
  1236. function EnableCommNotification(idComDev: Integer; hwnd: HWnd;
  1237.   cbWriteNotify, cbOutQueue: Integer): Bool;
  1238. function OpenDriver(DriverName, SectionName: PChar; lParam2: Longint): THandle;
  1239. function CloseDriver(Driver: THandle; lParam1, lParam2: Longint): Longint;
  1240. function GetDriverModuleHandle(Driver: THandle): THandle;
  1241. function SendDriverMessage(Driver: THandle; message: Word; lParam1,
  1242.   lParam2: Longint): Longint;
  1243. function GetNextDriver(Driver: THandle; lParam: Longint): THandle;
  1244.  
  1245. function lstrcpyn(String1, String2: PChar; i: Integer): PChar;
  1246. procedure hmemcpy(p1, p2: Pointer; L: Longint);
  1247.  
  1248.  
  1249. {  Not exported by any DLL but included in WINDOWS.H
  1250.   function SetDriverMessage(Driver: THandle; Message: Word; lParam1, lParam2: LongInt): LongInt; }
  1251.  
  1252. function DefDriverProc(DriverIdentifier: Longint; DriverId: THandle; Message: Word; lParam1, lParam2: Longint): Longint;
  1253. function SystemParametersInfo(Action, wParam: Word; lParam: Pointer;
  1254.   UpdateWinIni: Word): Bool;
  1255.  
  1256. { Provided for compatiblity only.  Should use the Pascal RTL functions
  1257.   Ptr, Off, and Seg instead. }
  1258.  
  1259. function MakeLP(Sel, Off: Word): Pointer;
  1260. inline(
  1261.   $5A/    { POP DX }
  1262.   $58);   { POP AX }
  1263.  
  1264. function SelectorOf(lp: Pointer): THandle;
  1265. inline(
  1266.   $5A/    { POP DX }
  1267.   $58);   { POP AX }
  1268.  
  1269. function OffsetOf(lp: Pointer): Word;
  1270. inline(
  1271.   $58/    { POP AX }
  1272.   $5A);   { POP DX }
  1273.  
  1274. implementation
  1275.  
  1276. uses WinProcs;
  1277.  
  1278. function GlobalPtrHandle(P: Pointer): THandle; assembler;
  1279. asm
  1280.     PUSH    P.Word[2]
  1281.     CALL    GlobalHandle
  1282. end;
  1283.  
  1284. function GlobalAllocPtr(Flags: Word; Bytes: Longint): Pointer; assembler;
  1285. asm
  1286.     PUSH    Flags
  1287.     PUSH    Bytes.Word[2]
  1288.     PUSH    Bytes.Word[0]
  1289.     CALL    GlobalAlloc
  1290.     PUSH    AX
  1291.     CALL    GlobalLock
  1292. end;
  1293.  
  1294. function GlobalReAllocPtr(P: Pointer; Bytes: Longint;
  1295.   Flags: Word): Pointer; assembler;
  1296. asm
  1297.     PUSH    P.Word[2]
  1298.     CALL    GlobalHandle
  1299.     PUSH    AX
  1300.     PUSH    AX
  1301.     CALL    GlobalUnlock
  1302.     PUSH    Bytes.Word[2]
  1303.     PUSH    Bytes.Word[0]
  1304.     PUSH    Flags
  1305.     CALL    GlobalReAlloc
  1306.     PUSH    AX
  1307.     CALL    GlobalLock
  1308. end;
  1309.  
  1310. function GlobalFreePtr(P: Pointer): THandle; assembler;
  1311. asm
  1312.     PUSH    P.Word[2]
  1313.     CALL    GlobalHandle
  1314.     PUSH    AX
  1315.     PUSH    AX
  1316.     CALL    GlobalUnlock
  1317.     CALL    GlobalFree
  1318. end;
  1319.  
  1320. function GlobalLockPtr(P: Pointer): Pointer; assembler;
  1321. asm
  1322.     PUSH    P.Word[2]
  1323.     CALL    GlobalHandle
  1324.     PUSH    AX
  1325.     CALL    GlobalLock
  1326. end;
  1327.  
  1328. function GlobalUnlockPtr(P: Pointer): Bool; assembler;
  1329. asm
  1330.     PUSH    P.Word[2]
  1331.     CALL    GlobalHandle
  1332.     PUSH    AX
  1333.     CALL    GlobalUnlock
  1334. end;
  1335.  
  1336. procedure MapWindowRect(FromWnd, ToWnd: HWnd; var Rect: TRect);
  1337. begin
  1338.   MapWindowPoints(FromWnd, ToWnd, Rect, 2);
  1339. end;
  1340.  
  1341. function GetInstanceModule(Instance: THandle): THandle;
  1342. begin
  1343.   GetInstanceModule := GetModuleHandle(Pointer(LongInt(Instance)));
  1344. end;
  1345.  
  1346. procedure AnsiToOem;                       external 'KEYBOARD' index 5;
  1347. procedure AnsiToOemBuff;                   external 'KEYBOARD' index 134;
  1348. function BringWindowToTop;                 external 'USER'     index 45;
  1349. function CreateBitmap;                     external 'GDI'      index 48;
  1350. function EndDeferWindowPos;                external 'USER'     index 261;
  1351. function Escape;                           external 'GDI'      index 38;
  1352. function FrameRect;                        external 'USER'     index 83;
  1353. function GetMenuItemCount;                 external 'USER'     index 263;
  1354. function GetInstanceData;                  external 'KERNEL'   index 54;
  1355. procedure GlobalUnfix;                     external 'KERNEL'   index 198;
  1356. procedure OemToAnsi;                       external 'KEYBOARD' index 6;
  1357. procedure OemToAnsiBuff;                   external 'KEYBOARD' index 135;
  1358. function SetResourceHandler;               external 'KERNEL'   index 67;
  1359. procedure UnlockSegment;                   external 'KERNEL'   index 24;
  1360.  
  1361. function IsTask;                           external 'KERNEL'   index 320;
  1362. function GetFreeSystemResources;           external 'USER'     index 284;
  1363. procedure LogError;                        external 'KERNEL'   index 324;
  1364. procedure LogParamError;                   external 'KERNEL'   index 325;
  1365. function IsDBCSLeadByte;                   external 'KERNEL'   index 207;
  1366. function GetDCEx;                          external 'USER'     index 359;
  1367. function IsGDIObject;                      external 'GDI'      index 462;
  1368. function SetBoundsRect;                    external 'GDI'      index 193;
  1369. function GetBoundsRect;                    external 'GDI'      index 194;
  1370. function ConvertOutlineFontFile;           external 'GDI'      index 312;
  1371. function GetFontData;                      external 'GDI'      index 311;
  1372. function GetGlyphOutline;                  external 'GDI'      index 309;
  1373. function CreateScalableFontResource;       external 'GDI'      index 310;
  1374. function GetCharABCWidths;                 external 'GDI'      index 307;
  1375. function GetRasterizerCaps;                external 'GDI'      index 313;
  1376. function GetOutlineTextMetrics;            external 'GDI'      index 308;
  1377. function GetMessageExtraInfo;              external 'USER'     index 288;
  1378. function GetOpenClipboardWindow;           external 'USER'     index 248;
  1379. function GetQueueStatus;                   external 'USER'     index 334;
  1380. function IsMenu;                           external 'USER'     index 358;
  1381. function RedrawWindow;                     external 'USER'     index 290;
  1382. function LockWindowUpdate;                 external 'USER'     index 294;
  1383. function ScrollWindowEx;                   external 'USER'     index 319;
  1384. function EnableScrollBar;                  external 'USER'     index 482;
  1385. function CopyCursor;                       external 'USER'     index 369;
  1386. function GetCursor;                        external 'USER'     index 247;
  1387. procedure GetClipCursor;                   external 'USER'     index 309;
  1388. function CopyIcon;                         external 'USER'     index 368;
  1389. procedure MapWindowPoints;                 external 'USER'     index 258;
  1390. function SetWindowsHookEx;                 external 'USER'     index 291;
  1391. function UnhookWindowsHookEx;              external 'USER'     index 292;
  1392. function CallNextHookEx;                   external 'USER'     index 293;
  1393. function EnableCommNotification;           external 'USER'     index 245;
  1394. function OpenDriver;                       external 'USER'     index 252;
  1395. function CloseDriver;                      external 'USER'     index 253;
  1396. function GetDriverModuleHandle;            external 'USER'     index 254;
  1397. function DefDriverProc;                    external 'USER'     index 255;
  1398. function GetNextDriver;                    external 'USER'     index 257;
  1399. function SubtractRect;                     external 'USER'     index 373;
  1400. function SystemParametersInfo;             external 'USER'     index 483;
  1401.  
  1402. function WNetAddConnection;                external 'USER'     index 517;
  1403. function WNetGetConnection;                external 'USER'     index 512;
  1404. function WNetCancelConnection;             external 'USER'     index 518;
  1405.  
  1406. function GetWinDebugInfo;                  external 'KERNEL'   index 355;
  1407. function SetWinDebugInfo;                  external 'KERNEL'   index 356;
  1408. function IsBadReadPtr;                     external 'KERNEL'   index 334;
  1409. function IsBadWritePtr;                    external 'KERNEL'   index 335;
  1410. function IsBadHugeReadPtr;                 external 'KERNEL'   index 346;
  1411. function IsBadHugeWritePtr;                external 'KERNEL'   index 347;
  1412. function IsBadCodePtr;                     external 'KERNEL'   index 336;
  1413. function IsBadStringPtr;                   external 'KERNEL'   index 337;
  1414. procedure DirectedYield;                   external 'KERNEL'   index 150;
  1415. function PrestoChangoSelector;             external 'KERNEL'   index 177;
  1416. function GetSelectorBase;                  external 'KERNEL'   index 186;
  1417. function SetSelectorBase;                  external 'KERNEL'   index 187;
  1418. function GetSelectorLimit;                 external 'KERNEL'   index 188;
  1419. function SetSelectorLimit;                 external 'KERNEL'   index 189;
  1420.  
  1421. function SendDriverMessage;                external 'USER'     index 251;
  1422. function GetDriverInfo;                    external 'USER'     index 256;
  1423. function GetWindowPlacement;               external 'USER'     index 370;
  1424. function SetWindowPlacement;               external 'USER'     index 371;
  1425. function DlgDirSelectEx;                   external 'USER'     index 422;
  1426. function DlgDirSelectComboBoxEx;           external 'USER'     index 423;
  1427. function GetTimerResolution;               external 'USER'     index 14;
  1428. function ExitWindowsExec;                  external 'USER'     index 246;
  1429. function GetSystemDebugState;              external 'USER'     index 231;
  1430. function QuerySendMessage;                 external 'USER'     index 184;
  1431. function LockInput;                        external 'USER'     index 226;
  1432.  
  1433. function GetTextExtentPoint;               external 'GDI'      index 471;
  1434. function SpoolFile;                        external 'GDI'      index 254;
  1435. function QueryAbort;                       external 'GDI'      index 155;
  1436. function SetWindowOrgEx;                   external 'GDI'      index 482;
  1437. function GetWindowOrgEx;                   external 'GDI'      index 475;
  1438. function SetWindowExtEx;                   external 'GDI'      index 481;
  1439. function GetWindowExtEx;                   external 'GDI'      index 474;
  1440. function OffsetWindowOrgEx;                external 'GDI'      index 477;
  1441. function ScaleWindowExtEx;                 external 'GDI'      index 485;
  1442. function SetViewportExtEx;                 external 'GDI'      index 479;
  1443. function GetViewportExtEx;                 external 'GDI'      index 472;
  1444. function SetViewportOrgEx;                 external 'GDI'      index 480;
  1445. function GetViewportOrgEx;                 external 'GDI'      index 473;
  1446. function OffsetViewportOrgEx;              external 'GDI'      index 476;
  1447. function ScaleViewportExtEx;               external 'GDI'      index 484;
  1448. function GetBrushOrgEx;                    external 'GDI'      index 469;
  1449. function MoveToEx;                         external 'GDI'      index 483;
  1450. function GetCurrentPositionEx;             external 'GDI'      index 470;
  1451. function GetAspectRatioFilterEx;           external 'GDI'      index 486;
  1452. function EnumFontFamilies;                 external 'GDI'      index 330;
  1453. function EnumFonts;                        external 'GDI'      index 70;
  1454. function GetKerningPairs;                  external 'GDI'      index 332;
  1455. function SetBitmapDimensionEx;             external 'GDI'      index 478;
  1456. function GetBitmapDimensionEx;             external 'GDI'      index 468;
  1457. function SetMetaFileBitsBetter;            external 'GDI'      index 196;
  1458. function StartDoc;                         external 'GDI'      index 377;
  1459. function StartPage;                        external 'GDI'      index 379;
  1460. function EndPage;                          external 'GDI'      index 380;
  1461. function EndDoc;                           external 'GDI'      index 378;
  1462. function AbortDoc;                         external 'GDI'      index 382;
  1463. function SetAbortProc;                     external 'GDI'      index 381;
  1464.  
  1465. function lstrcpyn;                         external 'KERNEL'   index 353;
  1466. procedure hmemcpy;                         external 'KERNEL'   index 348;
  1467.  
  1468.  
  1469. end.
  1470.