home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / vp21beta.zip / ARTLSRC.RAR / WINDOWS.PAS < prev   
Pascal/Delphi Source File  |  2000-08-15  |  590KB  |  16,801 lines

  1. //█▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█
  2. //█                                                      █
  3. //█     Virtual Pascal Runtime Library.  Version 2.1     █
  4. //█     Windows API interface unit including Open32      █
  5. //█     ─────────────────────────────────────────────────█
  6. //█     Copyright (C) 192000 vpascal.com                 █
  7. //█                                                      █
  8. //▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  9.  
  10. {$IFDEF Open32}
  11.   {&cdecl+}
  12. {$ELSE}
  13.   {&StdCall+}
  14. {$ENDIF Open32}
  15. {&AlignRec+,SmartLink+,OrgName+,X+,Z+,Delphi+,Use32-}
  16.  
  17. unit Windows;
  18.  
  19. interface
  20.  
  21. { Open32 compatibility layer }
  22.  
  23. {---[ Basic types]---}
  24.  
  25. type
  26.   Integer       = Longint;
  27.   Short         = SmallInt;
  28.   PShort        = ^Short;
  29.   LPShort       = ^Short;
  30.   Int           = Longint;
  31.   PInt          = ^Int;
  32.   LPInt         = ^Int;
  33.   Long          = Longint;
  34.   PLong         = ^Long;
  35.   LPLong        = ^Long;
  36.   UChar         = Byte;
  37.   PUChar        = ^UChar;
  38.   LPUChar       = ^UChar;
  39.   UShort        = SmallWord;
  40.   PUShort       = ^Short;
  41.   LPUShort      = ^Short;
  42.   UInt          = Longint;
  43.   PUInt         = ^UInt;
  44.   LPUInt        = ^UInt;
  45.   ULong         = Longint;
  46.   PULong        = ^ULong;
  47.   LPULong       = ^ULong;
  48.   PVoid         = Pointer;
  49.   LPVoid        = Pointer;
  50.   Float         = Single;
  51.   PFloat        = ^Float;
  52.   LPFloat       = ^Float;
  53.   PByte         = ^Byte;
  54.   LPByte        = ^Byte;
  55.   PWord         = ^SmallWord;
  56.   LPWord        = ^SmallWord;
  57.   DWord         = Longint;
  58.   PDWord        = ^DWord;
  59.   LPDWord       = ^DWord;
  60.   Bool          = LongBool;
  61.   PBool         = ^Bool;
  62.   LPBool        = ^Bool;
  63.   wParam        = Longint;
  64.   lParam        = Longint;
  65.   lResult       = Longint;
  66.   HResult       = Longint;
  67.   Handle        = Longint;
  68.   THandle       = Longint;
  69.   PHandle       = ^THandle;
  70.   LPHandle      = ^THandle;
  71.   SPHandle      = ^THandle;
  72.   wchar_t       = SmallWord;
  73.   WideChar      = char;
  74.   WChar         = SmallWord;
  75.   PWChar        = ^WChar;
  76.   PWCh          = ^WChar;
  77.   LPWCh         = ^WChar;
  78.   PCWCh         = ^WChar;
  79.   LPCWCh        = ^WChar;
  80.   NWPSTR        = ^WChar;
  81.   LPWSTR        = ^WChar;
  82.   PWSTR         = ^WChar;
  83.   LPCWSTR       = ^WChar;
  84.   PCWSTR        = ^WChar;
  85.   PSz           = PChar;
  86.   LPSz          = PChar;
  87.   PCSz          = PChar;
  88.   LPCSz         = PChar;
  89.   LPChar        = PChar;
  90.   LPCH          = PChar;
  91.   PCH           = PChar;
  92.   LPCCH         = PChar;
  93.   PCCH          = PChar;
  94.   NPSTR         = PChar;
  95.   LPSTR         = PChar;
  96.   PSTR          = PChar;
  97.   LPTCH         = PChar;
  98.   LPCSTR        = PChar;
  99.   PCSTR         = PChar;
  100.   PTCH          = PChar;
  101.   PTSTR         = PChar;
  102.   LPTSTR        = PChar;
  103.   LPCTSTR       = PChar;
  104.   TChar         = Char;
  105.   PTCHAR        = PChar;
  106.   TByte         = Byte;
  107.   PTByte        = ^Byte;
  108.   PInteger      = ^Integer;
  109.   PLongint      = ^Longint;
  110.   PSingle       = ^Single;
  111.  
  112.   TAtom         = SmallWord;
  113.   Atom          = SmallWord;
  114.   TColorRef     = Longint;
  115.   HAccel        = THandle;
  116.   HBitmap       = THandle;
  117.   HBrush        = THandle;
  118.   HCursor       = THandle;
  119.   HDC           = THandle;
  120.   HDWP          = THandle;
  121.   HEnhMetafile  = THandle;
  122.   HFile         = THandle;
  123.   HFont         = THandle;
  124.   HGDIObj       = THandle;
  125.   PHGDIObj      = PHandle;
  126.   HGlobal       = THandle;
  127.   HHook         = THandle;
  128.   HIcon         = THandle;
  129.   hInst         = THandle;
  130.   HKey          = DWord;
  131.   PHKey         = ^DWord;
  132.   HLocal        = THandle;
  133.   hMenu         = THandle;
  134.   HMetafile     = THandle;
  135.   hModule       = THandle;
  136.   HPalette      = THandle;
  137.   HPen          = THandle;
  138.   HRgn          = THandle;
  139.   HrSrc         = THandle;
  140.   HStr          = THandle;
  141.   hWnd          = THandle;
  142.   TGlobalHandle = THandle;
  143.   TLocalHandle  = THandle;
  144.   MMResult      = Longint;
  145.   TFarProc      = Pointer;
  146.   FarProc       = Pointer;
  147.   LoByte        = Byte;
  148.   LoWord        = SmallWord;
  149.   MakeIntResource = PChar;
  150.   MakeIntAtom   = PChar;
  151.  
  152.   TFNWndProc            = TFarProc;
  153.   TFNDlgProc            = TFarProc;
  154.   TFNThreadStartRoutine = TFarProc;
  155.   TFNWndEnumProc        = TFarProc;
  156.   TFNEnhMFEnumProc      = TFarProc;
  157.   TFNFontEnumProc       = TFarProc;
  158.   TFNMFEnumProc         = TFarProc;
  159.   TFNGObjEnumProc       = TFarProc;
  160.   TFNPropEnumProc       = TFarProc;
  161.   TFNPropEnumProcEx     = TFarProc;
  162.   TFNLineDDAProc        = TFarProc;
  163.   TFNTimerProc          = TFarProc;
  164.   TFNHookProc           = function (Code: Integer; WP: wParam; LP: lParam): lResult;
  165.  
  166.   TFNMain               = function(Inst,PrevInst: hInst; CmdLine: PChar; CmdShow: Integer): Integer;
  167.   TWndProc              = function(Wnd: hWnd; Msg: UInt; WP: wParam; LP: lParam): lResult;
  168.   TOFNHookProc          = function(Wnd: hWnd; Msg: UInt; WP: wParam; LP: lParam): Longint;
  169.   TDlgProc              = function(Wnd: hWnd; Msg: UInt; WP: wParam; LP: lParam): Bool;
  170.   TTimerProc            = procedure(Wnd: hWnd; Msg: UInt; WP: wParam; LP: lParam);
  171.   TFNAbortProc          = function(DC: HDC; Code: Integer): Bool;
  172.   TPrintHookProc        = function(Wnd: hWnd; Msg: UInt; WP: wParam; LP: lParam): UInt;
  173.   TSetupHookProc        = function(Wnd: hWnd; Msg: UInt; WP: wParam; LP: lParam): UInt;
  174.   TThreadStartRoutine   = function(lpThreadParameter: Pointer): Integer;
  175.   TGObjEnumProc         = function(LogObject: Pointer; Data: lParam): Integer;
  176.   TLineDDAProc          = procedure(X,Y: Integer; Data: lParam);
  177.   TWndEnumProc          = function(Wnd: hWnd; LP: lParam): Bool;
  178.   TPropEnumProc         = function(Wnd: hWnd; Str: PChar; hData: THandle): Bool;
  179.   TFRHookProc           = function(Wnd: hWnd; Msg: UInt; WP: wParam; LP: lParam): UInt;
  180.   TGrayStringProc       = function(DC: HDC; Data: lParam; cchData: Integer): Bool;
  181.   TCCHookProc           = function(Wnd: hWnd; Msg: UInt; WP: wParam; LP: lParam): UInt;
  182.   TCFHookProc           = function(Wnd: hWnd; Msg: UInt; WP: wParam; LP: lParam): UInt;
  183.   TPropEnumProcEx       = function(Wnd: hWnd; Str: PChar; hData: THandle; Data: DWord): Bool;
  184.  
  185. {---[ Types and constants ]---}
  186.  
  187. const
  188.   MinChar                       = $80;
  189.   MaxChar                       = $7F;
  190.   MinShort                      = $8000;
  191.   MaxShort                      = $7FFF;
  192.   MinLong                       = $80000000;
  193.   MaxLong                       = $7FFFFFFF;
  194.   MaxByte                       = $FF;
  195.   MaxWord                       = $FFFF;
  196.   MaxDWord                      = $FFFFFFFF;
  197.   Thread_Priority_Error_Return  = MaxLong;
  198.  
  199.   invalid_Handle_Value          = Handle(-1);
  200.   hfile_Error                   = Handle(-1);
  201.   hwnd_Desktop                  = hWnd(0);
  202.   hwnd_Broadcast                = hWnd($FFFF);
  203.   std_Input_Handle              = DWord(-10);
  204.   std_Output_Handle             = DWord(-11);
  205.   std_Error_Handle              = DWord(-12);
  206.  
  207. { wm_Size Types }
  208.  
  209.   size_Restored                 = 0;
  210.   size_Minimized                = 1;
  211.   size_Maximized                = 2;
  212.   size_MaxShow                  = 3;
  213.   size_MaxHide                  = 4;
  214.   sizeFullScreen                = size_Maximized;
  215.   sizeIconic                    = size_Minimized;
  216.   sizeNormal                    = size_Restored;
  217.   sizeZoomHide                  = size_MaxHide;
  218.   sizeZoomShow                  = size_MaxShow;
  219.  
  220. { Window Styles }
  221.  
  222.   ws_Overlapped         = $00000000;
  223.   ws_Popup              = $80000000;
  224.   ws_Child              = $40000000;
  225.   ws_Minimize           = $20000000;
  226.   ws_Visible            = $10000000;
  227.   ws_Disabled           = $08000000;
  228.   ws_ClipSiblings       = $04000000;
  229.   ws_ClipChildren       = $02000000;
  230.   ws_Maximize           = $01000000;
  231.   ws_Border             = $00800000;
  232.   ws_DlgFrame           = $00400000;
  233.   ws_VScroll            = $00200000;
  234.   ws_HScroll            = $00100000;
  235.   ws_SysMenu            = $00080000;
  236.   ws_ThickFrame         = $00040000;
  237.   ws_Group              = $00020000;
  238.   ws_TabStop            = $00010000;
  239.   ws_MinimizeBox        = $00020000;
  240.   ws_MaximizeBox        = $00010000;
  241.   ws_ChildWindow        = ws_Child;
  242.   ws_Iconic             = ws_Minimize;
  243.   ws_SizeBox            = ws_ThickFrame;
  244.   ws_Tiled              = ws_Overlapped;
  245.   ws_Caption            = ws_Border or ws_DlgFrame;
  246.   ws_OverlappedWindow   = ws_Overlapped or ws_Caption or ws_SysMenu
  247.                           or ws_ThickFrame or ws_MinimizeBox or ws_MaximizeBox;
  248.   ws_TiledWindow        = ws_OverlappedWindow;
  249.   ws_PopupWindow        = ws_Popup or ws_Border or ws_SysMenu;
  250.   ws_Ex_TopMost         = $00000008;
  251.   ws_Ex_AcceptFiles     = $00000010;
  252.   cw_UseDefault         = $80000000;
  253.  
  254. { Class Styles }
  255.  
  256.   cs_VRedraw                    = $0001;
  257.   cs_HRedraw                    = $0002;
  258.   cs_KeyCvtWindow               = $0004;
  259.   cs_DblClks                    = $0008;
  260.   cs_OwnDC                      = $0020;
  261.   cs_ClassDC                    = $0040;
  262.   cs_ParentDC                   = $0080;
  263.   cs_NoKeyCvt                   = $0100;
  264.   cs_NoClose                    = $0200;
  265.   cs_SaveBits                   = $0800;
  266.   cs_ByteAlignClient            = $1000;
  267.   cs_ByteAlignWindow            = $2000;
  268.   cs_GlobalClass                = $4000;
  269.  
  270.  
  271. { Window bytes needed for private dialogs }
  272.  
  273.   dlgWindowExtra                = 30;
  274.  
  275. { MessageBox Flags }
  276.  
  277.   mb_Ok                         = $00000000;
  278.   mb_OkCancel                   = $00000001;
  279.   mb_AbortRetryIgnore           = $00000002;
  280.   mb_YesNoCancel                = $00000003;
  281.   mb_YesNo                      = $00000004;
  282.   mb_RetryCancel                = $00000005;
  283.   mb_IconHand                   = $00000010;
  284.   mb_IconQuestion               = $00000020;
  285.   mb_IconExclamation            = $00000030;
  286.   mb_IconAsterisk               = $00000040;
  287.   mb_IconInformation            = mb_IconAsterisk;
  288.   mb_IconStop                   = mb_IconHand;
  289.   mb_DefButton1                 = $00000000;
  290.   mb_DefButton2                 = $00000100;
  291.   mb_DefButton3                 = $00000200;
  292.   mb_ApplModal                  = $00000000;
  293.   mb_SystemModal                = $00001000;
  294.   mb_NoFocus                    = $00008000;
  295.   mb_SetForeground              = $00010000;
  296.   mb_Service_Notification       = $00040000;
  297.   mb_TypeMask                   = $0000000F;
  298.   mb_IconMask                   = $000000F0;
  299.   mb_DefMask                    = $00000F00;
  300.   mb_ModeMask                   = $00003000;
  301.   mb_MiscMask                   = $0000C000;
  302.  
  303. { Predefined Resource Types }
  304.  
  305.   rt_Cursor                     = MakeIntResource(1);
  306.   rt_Bitmap                     = MakeIntResource(2);
  307.   rt_Icon                       = MakeIntResource(3);
  308.   rt_Menu                       = MakeIntResource(4);
  309.   rt_Dialog                     = MakeIntResource(5);
  310.   rt_String                     = MakeIntResource(6);
  311.   rt_FontDir                    = MakeIntResource(7);
  312.   rt_Font                       = MakeIntResource(8);
  313.   rt_Accelerator                = MakeIntResource(9);
  314.   rt_RcData                     = MakeIntResource(10);
  315.   rt_MessageTable               = MakeIntResource(11);
  316.   rt_DlgInclude                 = MakeIntResource(17);
  317.  
  318. { System Icons }
  319.  
  320.   idi_Application               = MakeIntResource(32512);
  321.   idi_Hand                      = MakeIntResource(32513);
  322.   idi_Question                  = MakeIntResource(32514);
  323.   idi_Exclamation               = MakeIntResource(32515);
  324.   idi_Asterisk                  = MakeIntResource(32516);
  325.  
  326. { System cursors }
  327.  
  328.   idc_Arrow                     = MakeIntResource(32512);
  329.   idc_Ibeam                     = MakeIntResource(32513);
  330.   idc_Wait                      = MakeIntResource(32514);
  331.   idc_Cross                     = MakeIntResource(32515);
  332.   idc_UpArrow                   = MakeIntResource(32516);
  333.   idc_Size                      = MakeIntResource(32640);
  334.   idc_Icon                      = MakeIntResource(32641);
  335.   idc_SizeNwse                  = MakeIntResource(32642);
  336.   idc_SizeNesw                  = MakeIntResource(32643);
  337.   idc_SizeWe                    = MakeIntResource(32644);
  338.   idc_SizeNs                    = MakeIntResource(32645);
  339.   idc_SizeAll                   = MakeIntResource(32646);
  340.   idc_No                        = MakeIntResource(32648);
  341.   idc_AppStarting               = MakeIntResource(32650);
  342.  
  343. { System Bitmaps }
  344.  
  345.   obm_Close                     = 32754;
  346.   obm_Uparrow                   = 32753;
  347.   obm_Dnarrow                   = 32752;
  348.   obm_Rgarrow                   = 32751;
  349.   obm_Lfarrow                   = 32750;
  350.   obm_Reduce                    = 32749;
  351.   obm_Zoom                      = 32748;
  352.   obm_Restore                   = 32747;
  353.   obm_Reduced                   = 32746;
  354.   obm_ZoomD                     = 32745;
  355.   obm_RestoreD                  = 32744;
  356.   obm_UpArrowD                  = 32743;
  357.   obm_DnArrowD                  = 32742;
  358.   obm_RgArrowD                  = 32741;
  359.   obm_LfArrowD                  = 32740;
  360.   obm_MnArrow                   = 32739;
  361.   obm_Combo                     = 32738;
  362.   obm_UpArrowI                  = 32737;
  363.   obm_DnArrowI                  = 32736;
  364.   obm_RgArrowI                  = 32735;
  365.   obm_LfArrowI                  = 32734;
  366.   obm_Old_Close                 = 32767;
  367.   obm_Size                      = 32766;
  368.   obm_Old_UpArrow               = 32765;
  369.   obm_Old_DnArrow               = 32764;
  370.   obm_Old_RgArrow               = 32763;
  371.   obm_Old_LfArrow               = 32762;
  372.   obm_BtSize                    = 32761;
  373.   obm_Check                     = 32760;
  374.   obm_CheckBoxes                = 32759;
  375.   obm_BtnCorners                = 32758;
  376.   obm_Old_Reduce                = 32757;
  377.   obm_Old_Zoom                  = 32756;
  378.   obm_Old_Restore               = 32755;
  379.  
  380. { Device Capabilities Indices }
  381.  
  382.   DriverVersion                 = 0;
  383.   Technology                    = 2;
  384.   HorzSize                      = 4;
  385.   VertSize                      = 6;
  386.   HorzRes                       = 8;
  387.   VertRes                       = 10;
  388.   BitsPixel                     = 12;
  389.   Planes                        = 14;
  390.   NumFonts                      = 22;
  391.   NumColors                     = 24;
  392.   PDeviceSize                   = 26;
  393.   CurveCaps                     = 28;
  394.   LineCaps                      = 30;
  395.   PolygonalCaps                 = 32;
  396.   TextCaps                      = 34;
  397.   ClipCaps                      = 36;
  398.   RasterCaps                    = 38;
  399.   AspectX                       = 40;
  400.   AspectY                       = 42;
  401.   AspectXY                      = 44;
  402.   LogPixelsX                    = 88;
  403.   LogPixelsY                    = 90;
  404.   SizePalette                   = 104;
  405.   NumReserved                   = 106;
  406.   ColorRes                      = 108;
  407.   PhysicalWidth                 = 110;
  408.   PhysicalHeight                = 111;
  409.   PhysicalOffsetX               = 112;
  410.   PhysicalOffsetY               = 113;
  411.   ScalingFactorX                = 114;
  412.   ScalingFactorY                = 115;
  413.  
  414. { Device Technologies }
  415.  
  416.   dt_Plotter                    = 0;
  417.   dt_RasDisplay                 = 1;
  418.   dt_RasPrinter                 = 2;
  419.   dt_RasCamera                  = 3;
  420.   dt_Metafile                   = 5;
  421.  
  422. { Raster Capabilities }
  423.  
  424.   rc_BitBlt                     = $0001;
  425.   rc_Banding                    = $0002;
  426.   rc_Scaling                    = $0004;
  427.   rc_Bitmap64                   = $0008;
  428.   rc_Di_Bitmap                  = $0080;
  429.   rc_Palette                    = $0100;
  430.   rc_DibToDev                   = $0200;
  431.   rc_StretchBlt                 = $0800;
  432.   rc_FloodFill                  = $1000;
  433.   rc_StretchDib                 = $2000;
  434.  
  435.   cc_None                       = 0;
  436.   cc_Circles                    = 1;
  437.   cc_Pie                        = 2;
  438.   cc_Chord                      = 4;
  439.   cc_Ellipses                   = 8;
  440.   cc_Wide                       = 16;
  441.   cc_Styled                     = 32;
  442.   cc_WideStyled                 = 64;
  443.   cc_Interiors                  = 128;
  444.   cc_RoundRect                  = 256;
  445.  
  446.   lc_None                       = 0;
  447.   lc_PolyLine                   = 2;
  448.   lc_Marker                     = 4;
  449.   lc_PolyMarker                 = 8;
  450.   lc_Wide                       = 16;
  451.   lc_Styled                     = 32;
  452.   lc_WideStyled                 = 64;
  453.   lc_Interiors                  = 128;
  454.  
  455.   pc_None                       = 0;
  456.   pc_Polygon                    = 1;
  457.   pc_Rectangle                  = 2;
  458.   pc_Windpolygon                = 4;
  459.   pc_Trapezoid                  = 4;
  460.   pc_Scanline                   = 8;
  461.   pc_Wide                       = 16;
  462.   pc_Styled                     = 32;
  463.   pc_Widestyled                 = 64;
  464.   pc_Interiors                  = 128;
  465.  
  466.   tc_Cr_90                      = $00000008;
  467.   tc_Cr_Any                     = $00000010;
  468.   tc_Sf_X_YIndep                = $00000020;
  469.   tc_Sa_Integer                 = $00000080;
  470.   tc_Sa_Contin                  = $00000100;
  471.   tc_Ia_Able                    = $00000400;
  472.   tc_Ua_Able                    = $00000800;
  473.   tc_So_Able                    = $00001000;
  474.   tc_Ra_Able                    = $00002000;
  475.   tc_Va_Able                    = $00004000;
  476.   tc_Reserved                   = $00008000;
  477.   tc_ScrollBlt                  = $00010000;
  478.  
  479.  
  480. { GetWindow Constants }
  481.  
  482.   gw_HWndFirst                  = 0;
  483.   gw_HWndLast                   = 1;
  484.   gw_HWndNext                   = 2;
  485.   gw_HWndPrev                   = 3;
  486.   gw_Owner                      = 4;
  487.   gw_Child                      = 5;
  488.   gw_Max                        = 5;
  489.  
  490. { ShowWindow() Constants }
  491.  
  492.   sw_Hide                       = 0;
  493.   sw_Normal                     = 1;
  494.   sw_ShowNormal                 = 1;
  495.   sw_ShowMinimized              = 2;
  496.   sw_Maximize                   = 3;
  497.   sw_ShowMaximized              = 3;
  498.   sw_ShowNoActivate             = 4;
  499.   sw_Show                       = 5;
  500.   sw_Minimize                   = 6;
  501.   sw_ShowMinNoActive            = 7;
  502.   sw_ShowNa                     = 8;
  503.   sw_Restore                    = 9;
  504.   sw_Max                        = 10;
  505.   sw_ShowDefault                = 10;
  506.  
  507.   hide_Window                   = 0;
  508.   show_OpenWindow               = 1;
  509.   show_IconWindow               = 2;
  510.   show_FullScreen               = 3;
  511.   show_OpenNoActivate           = 4;
  512.  
  513.   wa_Inactive                   = 0;
  514.   wa_Active                     = 1;
  515.   wa_ClickActive                = 2;
  516.  
  517. { SetWindowPos() Constants }
  518.  
  519.   swp_NoSize                    = $0001;
  520.   swp_NoMove                    = $0002;
  521.   swp_NoZOrder                  = $0004;
  522.   swp_NoRedraw                  = $0008;
  523.   swp_NoActivate                = $0010;
  524.   swp_FrameChanged              = $0020;
  525.   swp_ShowWindow                = $0040;
  526.   swp_HideWindow                = $0080;
  527.   swp_NoCopyBits                = $0100;
  528.   swp_NoOwnerZOrder             = $0200;
  529.  
  530.   swp_DrawFrame                 = swp_FrameChanged;
  531.   swp_NoReposition              = swp_NoOwnerZOrder;
  532.  
  533. { TWindowPos structure sent with wm_WindowPosChanging }
  534.  
  535. type
  536.   PWindowPos = ^TWindowPos;
  537.   TWindowPos = packed record
  538.     hWnd:            hWnd;
  539.     hwndInsertAfter: hWnd;
  540.     x:               Integer;
  541.     y:               Integer;
  542.     cx:              Integer;
  543.     cy:              Integer;
  544.     flags:           UInt;
  545.   end;
  546.  
  547. const
  548.   hwnd_Top                      = hWnd(0);
  549.   hwnd_Bottom                   = hWnd(1);
  550.   hwnd_Topmost                  = hWnd(-1);
  551.   hwnd_NoTopmost                = hWnd(-2);
  552.  
  553. { Menu flags for Add/Check/EnableMenuItem }
  554.  
  555.   mf_ByCommand                  = $00000000;
  556.   mf_Enabled                    = $00000000;
  557.   mf_Insert                     = $00000000;
  558.   mf_String                     = $00000000;
  559.   mf_Unchecked                  = $00000000;
  560.   mf_Unhilite                   = $00000000;
  561.   mf_Grayed                     = $00000001;
  562.   mf_Disabled                   = $00000002;
  563.   mf_Bitmap                     = $00000004;
  564.   mf_Checked                    = $00000008;
  565.   mf_Popup                      = $00000010;
  566.   mf_MenubarBreak               = $00000020;
  567.   mf_MenuBreak                  = $00000040;
  568.   mf_Change                     = $00000080;
  569.   mf_End                        = $00000080;
  570.   mf_Hilite                     = $00000080;
  571.   mf_Append                     = $00000100;
  572.   mf_OwnerDraw                  = $00000100;
  573.   mf_Delete                     = $00000200;
  574.   mf_UseCheckBitmaps            = $00000200;
  575.   mf_ByPosition                 = $00000400;
  576.   mf_Separator                  = $00000800;
  577.   mf_Remove                     = $00001000;
  578.   mf_SysMenu                    = $00002000;
  579.   mf_Help                       = $00004000;
  580.   mf_MouseSelect                = $00008000;
  581.  
  582. { Get/SetWindowLong Offsets }
  583.  
  584.   gwl_WndProc                   = -4;
  585.   gwl_HInstance                 = -6;
  586.   gwl_HWndParent                = -8;
  587.   gwl_Id                        = -12;
  588.   gwl_Style                     = -16;
  589.   gwl_ExStyle                   = -20;
  590.   gwl_UserData                  = -21;
  591.  
  592. { Get/SetWindowWord Offsets }
  593.  
  594.   gww_HInstance                 = -6;
  595.   gww_HWndParent                = -8;
  596.   gww_Id                        = -12;
  597.  
  598. { Get/SetClassLong Offsets }
  599.  
  600.   gcl_MenuName                  = -8;
  601.   gcl_HbrBackground             = -10;
  602.   gcl_HCursor                   = -12;
  603.   gcl_HIcon                     = -14;
  604.   gcl_hModule                   = -16;
  605.   gcl_CbWndExtra                = -18;
  606.   gcl_CbClsExtra                = -20;
  607.   gcl_WndProc                   = -24;
  608.   gcl_Style                     = -26;
  609.   gcw_Atom                      = -32;
  610.  
  611. { Get/SetClassWord Offsets }
  612.  
  613.   gcw_HbrBackground             = -10;
  614.   gcw_HCursor                   = -12;
  615.   gcw_HIcon                     = -13;
  616.   gcw_hModule                   = -14;
  617.   gcw_CbWndExtra                = -18;
  618.   gcw_CbClsExtra                = -20;
  619.   gcw_Style                     = -26;
  620.  
  621. { Get/SetWindowLong Offsets for Dialog Windows }
  622.  
  623.   dwl_MsgResult                 = 0;
  624.   dwl_DlgProc                   = 4;
  625.   dwl_User                      = 8;
  626.  
  627. { MDI client style bits }
  628.  
  629.   mdis_AllChildStyles           = $0001;
  630.  
  631. { wParam Flags for wm_MdiTile and wm_MdiCascade messages. }
  632.  
  633.   mditile_Vertical              = $0000;
  634.   mditile_Horizontal            = $0001;
  635.   mditile_SkipDisabled          = $0002;
  636.  
  637. { wm_MouseActivate Return Codes }
  638.  
  639.   ma_Activate                   = 1;
  640.   ma_ActivateAndEat             = 2;
  641.   ma_NoActivate                 = 3;
  642.   ma_NoActivateAndEat           = 4;
  643.  
  644. { Dialog and Message Box IDs }
  645.  
  646.   idOk                          = 1;  id_Ok     = idOk;
  647.   idCancel                      = 2;  id_Cancel = idCancel;
  648.   idAbort                       = 3;  id_Abort  = idAbort;
  649.   idRetry                       = 4;  id_Retry  = idRetry;
  650.   idIgnore                      = 5;  id_Ignore = idIgnore;
  651.   idYes                         = 6;  id_Yes    = idYes;
  652.   idNo                          = 7;  id_No     = idNo;
  653.   idClose                       = 8;  id_Close  = idClose;
  654.   idHelp                        = 9;  id_Help   = idHelp;
  655.  
  656. { Font Families }
  657.  
  658.   ff_DontCare                   = $0000;
  659.   ff_Roman                      = $0010;
  660.   ff_Swiss                      = $0020;
  661.   ff_Modern                     = $0030;
  662.   ff_Script                     = $0040;
  663.   ff_Decorative                 = $0050;
  664.  
  665. { Font Bold Weight Values }
  666.  
  667.   fw_DontCare                   = 0;
  668.   fw_Thin                       = 100;
  669.   fw_ExtraLight                 = 200;
  670.   fw_Light                      = 300;
  671.   fw_Normal                     = 400;
  672.   fw_Medium                     = 500;
  673.   fw_SemiBold                   = 600;
  674.   fw_Bold                       = 700;
  675.   fw_ExtraBold                  = 800;
  676.   fw_Heavy                      = 900;
  677.  
  678.   fw_Black                      = fw_Heavy;
  679.   fw_DemiBold                   = fw_SemiBold;
  680.   fw_Regular                    = fw_Normal;
  681.   fw_UltraBold                  = fw_ExtraBold;
  682.   fw_UltraLight                 = fw_ExtraLight;
  683.  
  684. { Character sets }
  685.  
  686.   Ansi_CharSet                  = 0;
  687.   Symbol_CharSet                = 2;
  688.   Oem_CharSet                   = 255;
  689.  
  690. { Output precision }
  691.  
  692.   out_Default_Precis            = 0;
  693.   out_String_Precis             = 1;
  694.   out_Character_Precis          = 2;
  695.   out_Stroke_Precis             = 3;
  696.  
  697. { Clip precision }
  698.  
  699.   clip_Default_Precis           = 0;
  700.   clip_Character_Precis         = 1;
  701.   clip_Stroke_Precis            = 2;
  702.  
  703. { Font quality }
  704.  
  705.   Default_Quality               = 0;
  706.   Draft_Quality                 = 1;
  707.   Proof_Quality                 = 2;
  708.  
  709. { Font pitch }
  710.  
  711.   Default_Pitch                 = 0;
  712.   Fixed_Pitch                   = 1;
  713.   Variable_Pitch                = 2;
  714.  
  715. { GDI Escapes }
  716.  
  717.   NewFrame                      = 1;
  718.   _AbortDoc                     = 2; // Renamed
  719.   NextBand                      = 3;
  720.   SetColorTable                 = 4;
  721.   GetColorTable                 = 5;
  722.   FlushOutput                   = 6;
  723.   DraftMode                     = 7;
  724.   QueryEscSupport               = 8;
  725.   _SetAbortProc                 = 9;  // Renamed
  726.   _StartDoc                     = 10; // Renamed
  727.   _EndDoc                       = 11; // Renamed
  728.   GetPhysPageSize               = 12;
  729.   GetPrintingOffset             = 13;
  730.   GetScalingFactor              = 14;
  731.   MfComment                     = 15;
  732.   GetPenWidth                   = 16;
  733.   SetCopyCount                  = 17;
  734.   SelectPaperSource             = 18;
  735.   DeviceData                    = 19;
  736.   PassThrough                   = 19;
  737.   GetTechnolgy                  = 20;
  738.   GetTechnology                 = 20;
  739.   SetLineCap                    = 21;
  740.   SetLineJoin                   = 22;
  741.   _SetMiterLimit                = 23; // Renamed
  742.   BandInfo                      = 24;
  743.   DrawPatternRect               = 25;
  744.   GetVectorPenSize              = 26;
  745.   GetVectorBrushSize            = 27;
  746.   EnableDuplex                  = 28;
  747.   GetSetPaperBins               = 29;
  748.   GetSetPrintOrient             = 30;
  749.   EnumPaperBins                 = 31;
  750.   SetDibScaling                 = 32;
  751.   EpsPrinting                   = 33;
  752.   EnumPaperMetrics              = 34;
  753.   GetSetPaperMetrics            = 35;
  754.   PostScript_Data               = 37;
  755.   PostScript_Ignore             = 38;
  756.   MouseTrails                   = 39;
  757.   GetDeviceUnits                = 42;
  758.  
  759.   GetExtendedTextMetrics        = 256;
  760.   GetExtentTable                = 257;
  761.   GetPairKernTable              = 258;
  762.   GetTrackKernTable             = 259;
  763.   _ExtTextOut                   = 512; // Renamed
  764.   GetFaceName                   = 513;
  765.   DownloadFace                  = 514;
  766.   EnableRelativeWidths          = 768;
  767.   EnablePairKerning             = 769;
  768.   SetKernTrack                  = 770;
  769.   SetAllJustValues              = 771;
  770.   SetCharSet                    = 772;
  771.   _StretchBlt                   = 2048; // Renamed
  772.   GetSetScreenParams            = 3072;
  773.   QueryDibSupport               = 3073;
  774.   Begin_Path                    = 4096;
  775.   Clip_To_Path                  = 4097;
  776.   End_Path                      = 4098;
  777.   Ext_Device_Caps               = 4099;
  778.   Restore_Ctm                   = 4100;
  779.   Save_Ctm                      = 4101;
  780.   Set_Arc_Direction             = 4102;
  781.   Set_Background_Color          = 4103;
  782.   Set_Poly_Mode                 = 4104;
  783.   Set_Screen_Angle              = 4105;
  784.   Set_Spread                    = 4106;
  785.   Transform_Ctm                 = 4107;
  786.   Set_Clip_Box                  = 4108;
  787.   Set_Bounds                    = 4109;
  788.   Set_Mirror_Mode               = 4110;
  789.   OpenChannel                   = 4110;
  790.   DownloadHeader                = 4111;
  791.   CloseChannel                  = 4112;
  792.   Postscript_Passthrough        = 4115;
  793.   Encapsulated_Postscript       = 4116;
  794.   Ds_AbsAlign                   = $001;
  795.   Ds_SysModal                   = $002;
  796.   Ds_LocalEdit                  = $020;
  797.   Ds_SetFont                    = $040;
  798.   Ds_ModalFrame                 = $080;
  799.   Ds_NoIdleMsg                  = $100;
  800.   Ds_SetForeground              = $200;
  801.   Dc_HasDefId                   = $534B;
  802.   Dlgc_WantArrows               = $0001;
  803.   Dlgc_WantTab                  = $0002;
  804.   Dlgc_WantAllKeys              = $0004;
  805.   Dlgc_WantMessage              = $0004;
  806.   Dlgc_HasSetSel                = $0008;
  807.   Dlgc_DefPushButton            = $0010;
  808.   Dlgc_UndefPushButton          = $0020;
  809.   Dlgc_RadioButton              = $0040;
  810.   Dlgc_WantChars                = $0080;
  811.   Dlgc_Static                   = $0100;
  812.   Dlgc_Button                   = $2000;
  813.  
  814. { OpenFile mode flags }
  815.  
  816.   of_Read                       = $00000000;
  817.   of_Write                      = $00000001;
  818.   of_ReadWrite                  = $00000002;
  819.   of_Share_Compat               = $00000000;
  820.   of_Share_Exclusive            = $00000010;
  821.   of_Share_Deny_Write           = $00000020;
  822.   of_Share_Deny_Read            = $00000030;
  823.   of_Share_Deny_None            = $00000040;
  824.   of_Parse                      = $00000100;
  825.   of_Delete                     = $00000200;
  826.   of_Verify                     = $00000400;
  827.   of_Cancel                     = $00000800;
  828.   of_Create                     = $00001000;
  829.   of_Prompt                     = $00002000;
  830.   of_Exist                      = $00004000;
  831.   of_ReOpen                     = $00008000;
  832.  
  833. { Generic access flags for CreateFile }
  834.  
  835.   Generic_Read                  = $80000000;
  836.   Generic_Write                 = $40000000;
  837.   Generic_Execute               = $20000000;
  838.   Generic_All                   = $10000000;
  839.  
  840. { Share & Attribute flags for CreateFile }
  841.  
  842.   file_Share_Read               = $00000001;
  843.   file_Share_Write              = $00000002;
  844.   file_Attribute_Readonly       = $00000001;
  845.   file_Attribute_Hidden         = $00000002;
  846.   file_Attribute_System         = $00000004;
  847.   file_Attribute_Directory      = $00000010;
  848.   file_Attribute_Archive        = $00000020;
  849.   file_Attribute_Normal         = $00000080;
  850.   file_Attribute_Temporary      = $00000100;
  851.   file_Attribute_Atomic_Write   = $00000200;
  852.   file_Attribute_Xaction_Write  = $00000400;
  853.   file_Attribute_Compressed     = $00000800;
  854.   file_Attribute_Has_Embedding  = $00001000;
  855.  
  856. { Create option for CreateFile }
  857.  
  858.   Create_New                    = 1;
  859.   Create_Always                 = 2;
  860.   Open_Existing                 = 3;
  861.   Open_Always                   = 4;
  862.   Truncate_Existing             = 5;
  863.  
  864. { Access file flags }
  865.  
  866.   file_Flag_Write_Through       = $80000000;
  867.   file_Flag_Overlapped          = $40000000;
  868.   file_Flag_No_Buffering        = $20000000;
  869.   file_Flag_Random_Access       = $10000000;
  870.   file_Flag_Sequential_Scan     = $08000000;
  871.   file_Flag_Delete_On_Close     = $04000000;
  872.   file_Flag_Backup_Semantics    = $02000000;
  873.   file_Flag_Posix_Semantics     = $01000000;
  874.  
  875. { SetFilePointer Flags }
  876.  
  877.   file_Begin                    = 0;
  878.   file_Current                  = 1;
  879.   file_End                      = 2;
  880.  
  881. { GetFileType Flags }
  882.  
  883.   file_Type_Unknown             = $00000000;
  884.   file_Type_Disk                = $00000000;
  885.   file_Type_Char                = $00000001;
  886.   file_Type_Pipe                = $00000002;
  887.   file_Type_Remote              = $00008000;
  888.  
  889. { DllEntryPoint flags }
  890.  
  891.   dll_Process_Detach            = 0;
  892.   dll_Process_Attach            = 1;
  893.  
  894. { GetQueueStatus Flags }
  895.  
  896.   qs_Key                        = $01;
  897.   qs_MouseMove                  = $02;
  898.   qs_MouseButton                = $04;
  899.   qs_PostMessage                = $08;
  900.   qs_Timer                      = $10;
  901.   qs_Paint                      = $20;
  902.   qs_SendMessage                = $40;
  903.   qs_HotKey                     = $80;
  904.   qs_Mouse                      = qs_MouseMove or qs_MouseButton;
  905.   qs_Input                      = qs_Mouse or qs_Key;
  906.   qs_AllEvents                  = qs_Input or qs_PostMessage or qs_Timer or qs_Paint or qs_HotKey;
  907.   qs_AllInput                   = qs_SendMessage or qs_Paint or qs_Timer or
  908.                                   qs_PostMessage or qs_MouseButton or qs_MouseMove or
  909.                                   qs_HotKey or qs_Key;
  910. { Maximum path length }
  911.  
  912.   Max_Path = 260;
  913.  
  914. { PeekMessage Options }
  915.  
  916.   pm_NoRemove                   = $0000;
  917.   pm_ReMove                     = $0001;
  918.   pm_NoYield                    = $0002;
  919.  
  920. { Edit Control Styles }
  921.  
  922.   es_Left                       = $0000;
  923.   es_Center                     = $0001;
  924.   es_Right                      = $0002;
  925.   es_MultiLine                  = $0004;
  926.   es_UpperCase                  = $0008;
  927.   es_LowerCase                  = $0010;
  928.   es_Password                   = $0020;
  929.   es_AutoVScroll                = $0040;
  930.   es_AutoHScroll                = $0080;
  931.   es_NoHideSel                  = $0100;
  932.   es_OemConvert                 = $0400;
  933.   es_ReadOnly                   = $0800;
  934.   es_WantReturn                 = $1000;
  935.  
  936. { Edit Control Notification Codes }
  937.  
  938.   en_SetFocus                   = $0100;
  939.   en_KillFocus                  = $0200;
  940.   en_Change                     = $0300;
  941.   en_Update                     = $0400;
  942.   en_ErrSpace                   = $0500;
  943.   en_MaxText                    = $0501;
  944.   en_HScroll                    = $0601;
  945.   en_VScroll                    = $0602;
  946.  
  947. { Listbox Styles }
  948.  
  949.   lbs_Notify                    = $0001;
  950.   lbs_Sort                      = $0002;
  951.   lbs_NoRedraw                  = $0004;
  952.   lbs_MultipleSel               = $0008;
  953.   lbs_OwnerDrawFixed            = $0010;
  954.   lbs_OwnerDrawVariable         = $0020;
  955.   lbs_HasStrings                = $0040;
  956.   lbs_UseTabStops               = $0080;
  957.   lbs_NoIntegralHeight          = $0100;
  958.   lbs_MultiColumn               = $0200;
  959.   lbs_WantKeyboardInput         = $0400;
  960.   lbs_ExtendedSel               = $0800;
  961.   lbs_DisableNoScroll           = $1000;
  962.   lbs_NoData                    = $2000;
  963.   lbs_Standard                  = lbs_Notify or lbs_Sort or ws_VScroll or ws_Border;
  964.  
  965. { Listbox Return Values }
  966.  
  967.   lb_ErrSpace                   = -2;
  968.   lb_Err                        = -1;
  969.   lb_OKay                       = 0;
  970.  
  971. { Listbox Notification Codes }
  972.  
  973.   lbn_ErrSpace                  = -2;
  974.   lbn_SelChange                 = 1;
  975.   lbn_DblClk                    = 2;
  976.   lbn_SelCancel                 = 3;
  977.   lbn_SetFocus                  = 4;
  978.   lbn_KillFocus                 = 5;
  979.  
  980. { DlgDirList, DlgDirListComboBox flags values }
  981.  
  982.   ddl_ReadWrite                 = $0000;
  983.   ddl_ReadOnly                  = $0001;
  984.   ddl_Hidden                    = $0002;
  985.   ddl_System                    = $0004;
  986.   ddl_Directory                 = $0010;
  987.   ddl_Archive                   = $0020;
  988.   ddl_PostMsgs                  = $2000;
  989.   ddl_Drives                    = $4000;
  990.   ddl_Exclusive                 = $8000;
  991.  
  992. { Combo Box return Values }
  993.  
  994.   cb_ErrSpace                   = -2;
  995.   cb_Err                        = -1;
  996.   cb_OKay                       = 0;
  997.  
  998. { Combo Box Notification Codes }
  999.  
  1000.   cbn_ErrSpace                  = -1;
  1001.   cbn_SelChange                 = 1;
  1002.   cbn_DblClk                    = 2;
  1003.   cbn_SetFocus                  = 3;
  1004.   cbn_KillFocus                 = 4;
  1005.   cbn_EditChange                = 5;
  1006.   cbn_EditUpdate                = 6;
  1007.   cbn_DropDown                  = 7;
  1008.   cbn_CloseUp                   = 8;
  1009.   cbn_SelendOk                  = 9;
  1010.   cbn_SelendCancel              = 10;
  1011.  
  1012. { Combo Box styles }
  1013.  
  1014.   cbs_Simple                    = $0001;
  1015.   cbs_DropDown                  = $0002;
  1016.   cbs_DropDownList              = $0003;
  1017.   cbs_OwnerDrawFixed            = $0010;
  1018.   cbs_OwnerDrawVariable         = $0020;
  1019.   cbs_AutoHScroll               = $0040;
  1020.   cbs_OemConvert                = $0080;
  1021.   cbs_Sort                      = $0100;
  1022.   cbs_HasStrings                = $0200;
  1023.   cbs_NoIntegralHeight          = $0400;
  1024.   cbs_DisableNoScroll           = $0800;
  1025.  
  1026. { Scroll Bar Constants }
  1027.  
  1028.   sb_Horz                       = 0;
  1029.   sb_Vert                       = 1;
  1030.   sb_Ctl                        = 2;
  1031.   sb_Both                       = 3;
  1032.  
  1033.   esb_Enable_Both               = 0;
  1034.   esb_Disable_Ltup              = 1;
  1035.   esb_Disable_Rtdn              = 2;
  1036.   esb_Disable_Both              = 3;
  1037.  
  1038. { Scroll Bar Commands }
  1039.  
  1040.   sb_LineUp                     = 0;
  1041.   sb_LineLeft                   = 0;
  1042.   sb_LineDown                   = 1;
  1043.   sb_LineRight                  = 1;
  1044.   sb_PageUp                     = 2;
  1045.   sb_PageLeft                   = 2;
  1046.   sb_PageDown                   = 3;
  1047.   sb_PageRight                  = 3;
  1048.   sb_ThumbPosition              = 4;
  1049.   sb_ThumbTrack                 = 5;
  1050.   sb_Top                        = 6;
  1051.   sb_Left                       = 6;
  1052.   sb_Bottom                     = 7;
  1053.   sb_Right                      = 7;
  1054.   sb_EndScroll                  = 8;
  1055.  
  1056. { Scroll Bar Styles }
  1057.  
  1058.   sbs_Horz                      = $0000;
  1059.   sbs_Vert                      = $0001;
  1060.   sbs_TopAlign                  = $0002;
  1061.   sbs_LeftAlign                 = $0002;
  1062.   sbs_BottomAlign               = $0004;
  1063.   sbs_RightAlign                = $0004;
  1064.   sbs_SizeBoxTopLeftAlign       = $0002;
  1065.   sbs_SizeBoxBottomRightAlign   = $0004;
  1066.   sbs_SizeBox                   = $0008;
  1067.  
  1068. { Static Control Constants }
  1069.  
  1070.   ss_Left                       = $00;
  1071.   ss_Center                     = $01;
  1072.   ss_Right                      = $02;
  1073.   ss_Icon                       = $03;
  1074.   ss_BlackRect                  = $04;
  1075.   ss_GrayRect                   = $05;
  1076.   ss_WhiteRect                  = $06;
  1077.   ss_BlackFrame                 = $07;
  1078.   ss_GrayFrame                  = $08;
  1079.   ss_WhiteFrame                 = $09;
  1080.   ss_UserItem                   = $0A;
  1081.   ss_Simple                     = $0B;
  1082.   ss_LeftNowordWrap             = $0C;
  1083.   ss_NoPrefix                   = $80;
  1084.  
  1085. { Button Control Styles }
  1086.  
  1087.   bs_PushButton                 = $00;
  1088.   bs_DefPushButton              = $01;
  1089.   bs_CheckBox                   = $02;
  1090.   bs_AutoCheckBox               = $03;
  1091.   bs_RadioButton                = $04;
  1092.   bs_3State                     = $05;
  1093.   bs_Auto3State                 = $06;
  1094.   bs_GroupBox                   = $07;
  1095.   bs_UserButton                 = $08;
  1096.   bs_AutoRadioButton            = $09;
  1097.   bs_OwnerDraw                  = $0B;
  1098.   bs_LeftText                   = $20;
  1099.  
  1100. { User Button Notification Codes }
  1101.  
  1102.   bn_Clicked                    = 0;
  1103.   bn_Paint                      = 1;
  1104.   bn_Hilite                     = 2;
  1105.   bn_Unhilite                   = 3;
  1106.   bn_Disable                    = 4;
  1107.   bn_DoubleClicked              = 5;
  1108.  
  1109. { Button Control Messages }
  1110.  
  1111.   bm_GetCheck                   = $00F0;
  1112.   bm_SetCheck                   = $00F1;
  1113.   bm_GetState                   = $00F2;
  1114.   bm_SetState                   = $00F3;
  1115.   bm_SetStyle                   = $00F4;
  1116.  
  1117. { Owner draw control types }
  1118.  
  1119.   odt_Menu                      = 1;
  1120.   odt_Listbox                   = 2;
  1121.   odt_Combobox                  = 3;
  1122.   odt_Button                    = 4;
  1123.   odt_Static                    = 5;
  1124.  
  1125. { Owner draw actions }
  1126.  
  1127.   oda_DrawEntire                = $0001;
  1128.   oda_Select                    = $0002;
  1129.   oda_Focus                     = $0004;
  1130.  
  1131. { Owner draw state }
  1132.  
  1133.   ods_Selected                  = $0001;
  1134.   ods_Grayed                    = $0002;
  1135.   ods_Disabled                  = $0004;
  1136.   ods_Checked                   = $0008;
  1137.   ods_Focus                     = $0010;
  1138.   ods_Default                   = $0020;
  1139.   ods_ComboBoxEdit              = $1000;
  1140.  
  1141. { Stock Logical Objects }
  1142.  
  1143.   White_Brush                   = 0;
  1144.   LtGray_Brush                  = 1;
  1145.   Gray_Brush                    = 2;
  1146.   DkGray_Brush                  = 3;
  1147.   Black_Brush                   = 4;
  1148.   Null_Brush                    = 5;
  1149.   White_Pen                     = 6;
  1150.   Black_Pen                     = 7;
  1151.   Null_Pen                      = 8;
  1152.   Oem_Fixed_Font                = 10;
  1153.   Ansi_Fixed_Font               = 11;
  1154.   Ansi_Var_Font                 = 12;
  1155.   System_Font                   = 13;
  1156.   Device_Default_Font           = 14;
  1157.   Default_Palette               = 15;
  1158.   System_Fixed_Font             = 16;
  1159.   Stock_Last                    = 16;
  1160.   Hollow_Brush                  = Null_Brush;
  1161.  
  1162. { Brush Styles }
  1163.  
  1164.   bs_Solid                      = 0;
  1165.   bs_Null                       = 1;
  1166.   bs_Hatched                    = 2;
  1167.   bs_Pattern                    = 3;
  1168.   bs_Indexed                    = 4;
  1169.   bs_DibPattern                 = 5;
  1170.   bs_DibPatternPt               = 6;
  1171.   bs_Pattern8x8                 = 7;
  1172.   bs_DibPattern8x8              = 8;
  1173.   bs_Hollow                     = bs_Null;
  1174.  
  1175. { Hatch Styles }
  1176.  
  1177.   hs_Horizontal                 = 0;
  1178.   hs_Vertical                   = 1;
  1179.   hs_FDiagonal                  = 2;
  1180.   hs_BDiagonal                  = 3;
  1181.   hs_Cross                      = 4;
  1182.   hs_DiagCross                  = 5;
  1183.   hs_SolidClr                   = 6;
  1184.   hs_DitheredClr                = 7;
  1185.   hs_SolidTextClr               = 8;
  1186.   hs_DitheredTextClr            = 9;
  1187.   hs_SolidBkClr                 = 10;
  1188.   hs_DitheredBkClr              = 11;
  1189.   hs_Api_Max                    = 12;
  1190.  
  1191. { Pen Styles }
  1192.  
  1193.   ps_Solid                      = 0;
  1194.   ps_Dash                       = 1;
  1195.   ps_Dot                        = 2;
  1196.   ps_DashDot                    = 3;
  1197.   ps_DashDotDot                 = 4;
  1198.   ps_Null                       = 5;
  1199.   ps_InsideFrame                = 6;
  1200.   ps_UserStyle                  = 7;
  1201.   ps_Alternate                  = 8;
  1202.   ps_Style_Mask                 = $0000000F;
  1203.   ps_Cosmetic                   = $00000000;
  1204.   ps_Endcap_Round               = $00000000;
  1205.   ps_Join_Round                 = $00000000;
  1206.   ps_Endcap_Square              = $00000100;
  1207.   ps_Endcap_Flat                = $00000200;
  1208.   ps_Endcap_Mask                = $00000F00;
  1209.   ps_Join_Bevel                 = $00001000;
  1210.   ps_Join_Miter                 = $00002000;
  1211.   ps_Join_Mask                  = $0000F000;
  1212.   ps_Geometric                  = $00010000;
  1213.   ps_Type_Mask                  = $000F0000;
  1214.  
  1215. { Region Flags }
  1216.  
  1217.   Error                         = 0;
  1218.   NullRegion                    = 1;
  1219.   SimpleRegion                  = 2;
  1220.   ComplexRegion                 = 3;
  1221.   Rgn_Error                     = Error;
  1222.   Gdi_Error                     = $FFFFFFFF;
  1223.   Clr_Invalid                   = $FFFFFFFF;
  1224.  
  1225. { CombineRgn Styles }
  1226.  
  1227.   rgn_And                       = 1;
  1228.   rgn_Or                        = 2;
  1229.   rgn_Xor                       = 3;
  1230.   rgn_Diff                      = 4;
  1231.   rgn_Copy                      = 5;
  1232.   rgn_Min                       = rgn_And;
  1233.   rgn_Max                       = rgn_Copy;
  1234.  
  1235. { PolyFill Modes }
  1236.  
  1237.   Alternate                     = 1;
  1238.   Winding                       = 2;
  1239.  
  1240. { Binary Raster Operations }
  1241.  
  1242.   r2_Black                      = 1;
  1243.   r2_NotMergePen                = 2;
  1244.   r2_MaskNotPen                 = 3;
  1245.   r2_NotCopyPen                 = 4;
  1246.   r2_MaskPenNot                 = 5;
  1247.   r2_Not                        = 6;
  1248.   r2_XorPen                     = 7;
  1249.   r2_NotMaskPen                 = 8;
  1250.   r2_MaskPen                    = 9;
  1251.   r2_NotXorPen                  = 10;
  1252.   r2_Nop                        = 11;
  1253.   r2_MergeNotPen                = 12;
  1254.   r2_CopyPen                    = 13;
  1255.   r2_MergePenNot                = 14;
  1256.   r2_MergePen                   = 15;
  1257.   r2_White                      = 16;
  1258.   r2_Last                       = 16;
  1259.  
  1260. { Ternary raster operations }
  1261.  
  1262.   SrcCopy                       = $00CC0020;
  1263.   SrcPaint                      = $00EE0086;
  1264.   SrcAnd                        = $008800C6;
  1265.   SrcInvert                     = $00660046;
  1266.   SrcErase                      = $00440328;
  1267.   NotSrcCopy                    = $00330008;
  1268.   NotSrcErase                   = $001100A6;
  1269.   MergeCopy                     = $00C000CA;
  1270.   MergePaint                    = $00BB0226;
  1271.   PatCopy                       = $00F00021;
  1272.   PatPaint                      = $00FB0A09;
  1273.   PatInvert                     = $005A0049;
  1274.   DstInvert                     = $00550009;
  1275.   Blackness                     = $00000042;
  1276.   Whiteness                     = $00FF0062;
  1277.  
  1278.  
  1279. { Spooler Error Codes }
  1280.  
  1281.   sp_OutOfMemory                = -5;
  1282.   sp_OutOfDisk                  = -4;
  1283.   sp_UserAbort                  = -3;
  1284.   sp_AppAbort                   = -2;
  1285.   sp_Error                      = -1;
  1286.   sp_NotReported                = $4000;
  1287.  
  1288. { Predefined Clipboard Formats }
  1289.  
  1290.   cf_Text                       = 1;
  1291.   cf_Bitmap                     = 2;
  1292.   cf_MetafilePict               = 3;
  1293.   cf_Sylk                       = 4;
  1294.   cf_Dif                        = 5;
  1295.   cf_Tiff                       = 6;
  1296.   cf_OemText                    = 7;
  1297.   cf_Dib                        = 8;
  1298.   cf_Palette                    = 9;
  1299.   cf_PenData                    = 10;
  1300.   cf_Riff                       = 11;
  1301.   cf_Wave                       = 12;
  1302.   cf_UnicodeText                = 13;
  1303.   cf_EnhMetafile                = 14;
  1304.  
  1305.   cf_OwnerDisplay               = $0080;
  1306.   cf_DspText                    = $0081;
  1307.   cf_DspBitmap                  = $0082;
  1308.   cf_DspMetafilePict            = $0083;
  1309.   cf_DspEnhMetafile             = $008E;
  1310.   cf_PrivateFirst               = $0200;
  1311.   cf_PrivateLast                = $02FF;
  1312.   cf_GdiObjFirst                = $0300;
  1313.   cf_GdiObjLast                 = $03FF;
  1314.  
  1315. { GetSystemMetrics() codes }
  1316.  
  1317.   sm_CxScreen                   = 0;
  1318.   sm_CyScreen                   = 1;
  1319.   sm_CxVScroll                  = 2;
  1320.   sm_CyHScroll                  = 3;
  1321.   sm_CyCaption                  = 4;
  1322.   sm_CxBorder                   = 5;
  1323.   sm_CyBorder                   = 6;
  1324.   sm_CxDlgFrame                 = 7;
  1325.   sm_CyDlgFrame                 = 8;
  1326.   sm_CyVThumb                   = 9;
  1327.   sm_CxHThumb                   = 10;
  1328.   sm_CxIcon                     = 11;
  1329.   sm_CyIcon                     = 12;
  1330.   sm_CxCursor                   = 13;
  1331.   sm_CyCursor                   = 14;
  1332.   sm_CyMenu                     = 15;
  1333.   sm_CxFullScreen               = 16;
  1334.   sm_CyFullScreen               = 17;
  1335.   sm_CyKanjiWindow              = 18;
  1336.   sm_MousePresent               = 19;
  1337.   sm_CyVScroll                  = 20;
  1338.   sm_CxHScroll                  = 21;
  1339.   sm_Debug                      = 22;
  1340.   sm_SwapButton                 = 23;
  1341.   sm_Reserved1                  = 24;
  1342.   sm_Reserved2                  = 25;
  1343.   sm_Reserved3                  = 26;
  1344.   sm_Reserved4                  = 27;
  1345.   sm_CxMin                      = 28;
  1346.   sm_CyMin                      = 29;
  1347.   sm_CxSize                     = 30;
  1348.   sm_CySize                     = 31;
  1349.   sm_CxFrame                    = 32;
  1350.   sm_CyFrame                    = 33;
  1351.   sm_CxMinTrack                 = 34;
  1352.   sm_CyMinTrack                 = 35;
  1353.   sm_CxDoubleClk                = 36;
  1354.   sm_CyDoubleClk                = 37;
  1355.   sm_MenuDropAlignment          = 40;
  1356.   sm_CMouseButtons              = 43;
  1357.   sm_CMetrics                   = 44;
  1358.  
  1359. { Flags for TrackPopupMenu }
  1360.  
  1361.   tpm_LeftAlign                 = $0000;
  1362.   tpm_LeftButton                = $0000;
  1363.   tpm_RightButton               = $0002;
  1364.   tpm_CenterAlign               = $0004;
  1365.   tpm_RightAlign                = $0008;
  1366.  
  1367. { SetWindowsHook codes }
  1368.  
  1369.   wh_Min                        = -1;
  1370.   wh_MsgFilter                  = -1;
  1371.   wh_JournalRecord              = 0;
  1372.   wh_JournalPlayback            = 1;
  1373.   wh_Keyboard                   = 2;
  1374.   wh_GetMessage                 = 3;
  1375.   wh_CallWndProc                = 4;
  1376.   wh_Cbt                        = 5;
  1377.   wh_SysMsgFilter               = 6;
  1378.   wh_Mouse                      = 7;
  1379.   wh_Hardware                   = 8;
  1380.   wh_Debug                      = 9;
  1381.   wh_Shell                      = 10;
  1382.   wh_ForegroundIdle             = 11;
  1383.   wh_Max                        = 11;
  1384.  
  1385. { Hook Codes }
  1386.  
  1387.   hc_Action                     = 0;
  1388.   hc_GetNext                    = 1;
  1389.   hc_Skip                       = 2;
  1390.   hc_NoRemove                   = 3;
  1391.   hc_SysModalOn                 = 4;
  1392.   hc_SysModalOff                = 5;
  1393.   hc_NoRem                      = hc_NoRemove;
  1394.  
  1395.   drive_Unknown                 = 0;
  1396.   drive_No_Root_Dir             = 1;
  1397.   drive_Removable               = 2;
  1398.   drive_Fixed                   = 3;
  1399.   drive_Remote                  = 4;
  1400.   drive_Cdrom                   = 5;
  1401.   drive_RamDisk                 = 6;
  1402.  
  1403. { Color Types }
  1404.  
  1405.   ctlcolor_MsgBox               = 0;
  1406.   ctlcolor_Edit                 = 1;
  1407.   ctlcolor_ListBox              = 2;
  1408.   ctlcolor_Btn                  = 3;
  1409.   ctlcolor_Dlg                  = 4;
  1410.   ctlcolor_ScrollBar            = 5;
  1411.   ctlcolor_Static               = 6;
  1412.   ctlcolor_Max                  = 8;
  1413.  
  1414.   color_ScrollBar               = 0;
  1415.   color_Background              = 1;
  1416.   color_ActiveCaption           = 2;
  1417.   color_InactiveCaption         = 3;
  1418.   color_Menu                    = 4;
  1419.   color_Window                  = 5;
  1420.   color_WindowFrame             = 6;
  1421.   color_MenuText                = 7;
  1422.   color_WindowText              = 8;
  1423.   color_CaptionText             = 9;
  1424.   color_ActiveBorder            = 10;
  1425.   color_InactiveBorder          = 11;
  1426.   color_AppWorkSpace            = 12;
  1427.   color_Highlight               = 13;
  1428.   color_HighlightText           = 14;
  1429.   color_BtnFace                 = 15;
  1430.   color_BtnShadow               = 16;
  1431.   color_GrayText                = 17;
  1432.   color_BtnText                 = 18;
  1433.   color_InactiveCaptionText     = 19;
  1434.   color_BtnHighlight            = 20;
  1435.   color_3dDkShadow              = 21;
  1436.   color_3dLight                 = 22;
  1437.   color_InfoText                = 23;
  1438.   color_InfoBk                  = 24;
  1439.   color_Max                     = 24;
  1440.  
  1441. { Draw Text flags }
  1442.  
  1443.   dt_Top                        = $00000000;
  1444.   dt_Left                       = $00000000;
  1445.   dt_Center                     = $00000001;
  1446.   dt_Right                      = $00000002;
  1447.   dt_VCenter                    = $00000004;
  1448.   dt_Bottom                     = $00000008;
  1449.   dt_WordBreak                  = $00000010;
  1450.   dt_SingleLine                 = $00000020;
  1451.   dt_ExpandTabs                 = $00000040;
  1452.   dt_TabStop                    = $00000080;
  1453.   dt_NoClip                     = $00000100;
  1454.   dt_ExternAlleading            = $00000200;
  1455.   dt_CalcRect                   = $00000400;
  1456.   dt_NoPrefix                   = $00000800;
  1457.   dt_ValidFlags                 = $00000FFF;
  1458.  
  1459. { Text Alignment Options }
  1460.  
  1461.   ta_Left                       = 0;
  1462.   ta_NoUpdateCp                 = 0;
  1463.   ta_Top                        = 0;
  1464.   ta_UpdateCp                   = 1;
  1465.   ta_Right                      = 2;
  1466.   ta_Center                     = 6;
  1467.   ta_Bottom                     = 8;
  1468.   ta_BaseLine                   = 24;
  1469.   ta_Mask                       = ta_BaseLine + ta_Center + ta_UpdateCp;
  1470.  
  1471.   vta_BaseLine                  = ta_BaseLine;
  1472.   vta_Left                      = ta_Bottom;
  1473.   vta_Right                     = ta_Top;
  1474.   vta_Center                    = ta_Center;
  1475.   vta_Bottom                    = ta_Right;
  1476.   vta_Top                       = ta_Left;
  1477.  
  1478. { Memory APIs }
  1479.  
  1480.   page_NoAccess                 = $00000001;
  1481.   page_ReadOnly                 = $00000002;
  1482.   page_ReadWrite                = $00000004;
  1483.   page_WriteCopy                = $00000008;
  1484.   page_Execute                  = $00000010;
  1485.   page_Execute_Read             = $00000020;
  1486.   page_Execute_ReadWrite        = $00000040;
  1487.   page_Execute_WriteCopy        = $00000080;
  1488.   page_Guard                    = $00000100;
  1489.   page_NoCache                  = $00000200;
  1490.   mem_Commit                    = $00001000;
  1491.   mem_Reserve                   = $00002000;
  1492.   mem_Decommit                  = $00004000;
  1493.   mem_Release                   = $00008000;
  1494.   mem_Free                      = $00010000;
  1495.   mem_Private                   = $00020000;
  1496.   mem_Mapped                    = $00040000;
  1497.   mem_Top_Down                  = $00100000;
  1498.   sec_File                      = $00800000;
  1499.   sec_Image                     = $01000000;
  1500.   sec_Reserve                   = $04000000;
  1501.   sec_Commit                    = $08000000;
  1502.   sec_NoCache                   = $10000000;
  1503.   mem_Image                     = sec_Image;
  1504.  
  1505. { Global Memory Flags }
  1506.  
  1507.   gmem_Fixed                    = $0000;
  1508.   gmem_Moveable                 = $0002;
  1509.   gmem_NoCompact                = $0010;
  1510.   gmem_NoDiscard                = $0020;
  1511.   gmem_ZeroInit                 = $0040;
  1512.   gmem_Modify                   = $0080;
  1513.   gmem_LockCount                = $00FF;
  1514.   gmem_Discardable              = $0100;
  1515.   gmem_Not_Banked               = $1000;
  1516.   gmem_Share                    = $2000;
  1517.   gmem_DdeShare                 = $2000;
  1518.   gmem_Notify                   = $4000;
  1519.   gmem_Discarded                = $4000;
  1520.   gmem_Invalid_Handle           = $8000;
  1521.   gmem_Lower                    = gmem_Not_Banked;
  1522.   GHnd                          = gmem_Moveable or gmem_ZeroInit;
  1523.   GPtr                          = gmem_Fixed or gmem_ZeroInit;
  1524.  
  1525. { Local Memory Flags }
  1526.  
  1527.   lmem_Fixed                    = $0000;
  1528.   lmem_Moveable                 = $0002;
  1529.   lmem_NoCompact                = $0010;
  1530.   lmem_NoDiscard                = $0020;
  1531.   lmem_ZeroInit                 = $0040;
  1532.   lmem_Modify                   = $0080;
  1533.   lmem_LockCount                = $00FF;
  1534.   lmem_Discardable              = $0F00;
  1535.   lmem_Valid_Flags              = $0F72;
  1536.   lmem_Discarded                = $4000;
  1537.   lmem_Invalid_Handle           = $8000;
  1538.   LHnd                          = lmem_Moveable or lmem_ZeroInit;
  1539.   LPtr                          = lmem_Fixed or lmem_ZeroInit;
  1540.   NonZeroLHnd                   = lmem_Moveable;
  1541.   NonZeroLPtr                   = lmem_Fixed;
  1542.  
  1543. { constants for HeapAlloc() flags }
  1544.  
  1545.   heap_No_Serialize             = $00000001;
  1546.   heap_Growable                 = $00000002;
  1547.   heap_Generate_Exceptions      = $00000004;
  1548.   heap_Zero_Memory              = $00000008;
  1549.   heap_Realloc_In_Place_Only    = $00000010;
  1550.   heap_Tail_Checking_Enabled    = $00000020;
  1551.   heap_Free_Checking_Enabled    = $00000040;
  1552.   heap_Disable_Coalesce_On_Free = $00000080;
  1553.  
  1554. { System API Flags }
  1555.  
  1556.   Infinite                      = DWord(-1);
  1557.  
  1558.   _Delete                       = $00010000; // Renamed
  1559.   Read_Control                  = $00020000;
  1560.   Write_Dac                     = $00040000;
  1561.   Write_Owner                   = $00080000;
  1562.   Synchronize                   = $00100000;
  1563.  
  1564.   Specific_Rights_All           = $0000FFFF;
  1565.   Standard_Rights_Read          = Read_Control;
  1566.   Standard_Rights_Write         = Read_Control;
  1567.   Standard_Rights_Execute       = Read_Control;
  1568.   Standard_Rights_Required      = $000F0000;
  1569.   Standard_Rights_All           = $001F0000;
  1570.  
  1571. { Thread Creation Flags }
  1572.  
  1573.   debug_Process                 = $00000001;
  1574.   debug_Only_This_Process       = $00000002;
  1575.   create_Suspended              = $00000004;
  1576.   detached_Process              = $00000008;
  1577.   create_New_Console            = $00000010;
  1578.   normal_Priority_Class         = $00000020;
  1579.   idle_Priority_Class           = $00000040;
  1580.   high_Priority_Class           = $00000080;
  1581.   realtime_Priority_Class       = $00000100;
  1582.   create_New_Process_Group      = $00000200;
  1583.   create_Unicode_Environment    = $00000400;
  1584.   create_Separate_Wow_Vdm       = $00000800;
  1585.   create_Share_Wow_Vdm          = $00001000;
  1586.   create_Default_Error_Mode     = $04000000;
  1587.   create_No_Window              = $08000000;
  1588.   process_Terminate             = $00000001;
  1589.   process_Create_Thread         = $00000002;
  1590.   process_Vm_Operation          = $00000008;
  1591.   process_Vm_Read               = $00000010;
  1592.   process_Vm_Write              = $00000020;
  1593.   process_Dup_Handle            = $00000040;
  1594.   process_Create_Process        = $00000080;
  1595.   process_Set_Quota             = $00000100;
  1596.   process_Set_Information       = $00000200;
  1597.   process_Query_Information     = $00000400;
  1598.   process_All_Access            = Standard_Rights_Required or Synchronize or $FFF;
  1599.  
  1600.   thread_Terminate              = $00000001;
  1601.   thread_Suspend_Resume         = $00000002;
  1602.   thread_Get_Context            = $00000008;
  1603.   thread_Set_Context            = $00000010;
  1604.   thread_Set_Information        = $00000020;
  1605.   thread_Query_Information      = $00000040;
  1606.   thread_Set_Thread_Token       = $00000080;
  1607.   thread_Impersonate            = $00000100;
  1608.   thread_Direct_Impersonation   = $00000200;
  1609.   thread_All_Access             = Standard_Rights_Required or Synchronize or $3FF;
  1610.  
  1611.   tls_Minimum_Available         = 64;
  1612.  
  1613.   still_Active                  = $00000103;
  1614.  
  1615.   thread_Base_Priority_Idle     = -15;
  1616.   thread_Base_Priority_Min      = -2;
  1617.   thread_Base_Priority_Max      = 2;
  1618.   thread_Base_Priority_Lowrt    = 15;
  1619.  
  1620.   thread_Priority_Idle          = -15;
  1621.   thread_Priority_Lowest        = -2;
  1622.   thread_Priority_Below_Normal  = -1;
  1623.   thread_Priority_Normal        = 0;
  1624.   thread_Priority_Above_Normal  = 1;
  1625.   thread_Priority_Highest       = 2;
  1626.   thread_Priority_Time_Critical = 15;
  1627.  
  1628. { Synchronization APIs }
  1629.  
  1630. {$IFDEF Open32}
  1631.   maximum_Wait_Objects          = 128;
  1632. {$ELSE}
  1633.   maximum_Wait_Objects          = 64;
  1634. {$ENDIF Open32}
  1635.   status_Abandoned_Wait_0       = $00000080;
  1636.   status_Timeout                = $00000102;
  1637.   status_Wait_0                 = $00000000;
  1638.   wait_Abandoned                = status_Abandoned_Wait_0;
  1639.   wait_Abandoned_0              = status_Abandoned_Wait_0;
  1640.   wait_Failed                   = DWord($FFFFFFFF);
  1641.   wait_Object_0                 = status_Wait_0;
  1642.   wait_Timeout                  = status_Timeout;
  1643.  
  1644.   event_Modify_State            = $00000002;
  1645.   event_All_Access              = Standard_Rights_Required or Synchronize or event_Modify_State;
  1646.  
  1647.   mutex_All_Access              = Standard_Rights_Required or Synchronize;
  1648.  
  1649.   semaphore_Modify_State        = $00000002;
  1650.   semaphore_All_Access          = Standard_Rights_Required or Synchronize or semaphore_Modify_State;
  1651.  
  1652. { File IO APIs }
  1653.  
  1654.   file_Read_Data                = $00000001;
  1655.   file_List_Directory           = $00000001;
  1656.   file_Write_Data               = $00000002;
  1657.   file_Add_File                 = $00000002;
  1658.   file_Append_Data              = $00000004;
  1659.   file_Add_Subdirectory         = $00000004;
  1660.   file_Create_Pipe_Instance     = $00000004;
  1661.   file_Read_Ea                  = $00000008;
  1662.   file_Read_Properties          = $00000008;
  1663.   file_Write_Ea                 = $00000010;
  1664.   file_Write_Properties         = $00000010;
  1665.   file_Execute                  = $00000020;
  1666.   file_Traverse                 = $00000020;
  1667.   file_Delete_Child             = $00000040;
  1668.   file_Read_Attributes          = $00000080;
  1669.   file_Write_Attributes         = $00000100;
  1670.   file_All_Access               = Standard_Rights_Required or Synchronize or $1FF;
  1671.   file_Generic_Read             = Standard_Rights_Read or file_Read_Data or
  1672.                                   file_Read_Attributes or file_Read_Ea   or
  1673.                                   Synchronize;
  1674.  
  1675.   file_Generic_Write            = Standard_Rights_Write or file_Write_Data or
  1676.                                   file_Write_Attributes or file_Write_Ea   or
  1677.                                   file_Append_Data      or Synchronize;
  1678.   file_Generic_Execute          = Standard_Rights_Execute or file_Read_Attributes or
  1679.                                   file_Execute            or Synchronize;
  1680.  
  1681.   file_Notify_Change_File_Name  = $00000001;
  1682.   file_Notify_Change_Dir_Name   = $00000002;
  1683.   file_Notify_Change_Attributes = $00000004;
  1684.   file_Notify_Change_Size       = $00000008;
  1685.   file_Notify_Change_Last_Write = $00000010;
  1686.   file_Notify_Change_Security   = $00000100;
  1687.   file_Case_Sensitive_Search    = $00000001;
  1688.   file_Case_Preserved_Names     = $00000002;
  1689.   file_Unicode_On_Disk          = $00000004;
  1690.   file_Persistent_Acls          = $00000008;
  1691.   file_File_Compression         = $00000010;
  1692.   file_Volume_Is_Compressed     = $00008000;
  1693.   io_Completion_Modify_State    = $00000002;
  1694.   io_Completion_All_Access      = Standard_Rights_Required or Synchronize or $3;
  1695.   duplicate_Close_Source        = $00000001;
  1696.   duplicate_Same_Access         = $00000002;
  1697.  
  1698. { GetVolumeInformation Flags }
  1699.  
  1700.   fs_Case_Is_Preserved          = file_Case_Preserved_Names;
  1701.   fs_Case_Sensitive             = file_Case_Sensitive_Search;
  1702.   fs_Unicode_Stored_On_Disk     = file_Unicode_On_Disk;
  1703.  
  1704. { Exceptions }
  1705.  
  1706.   status_No_Memory              = $C0000017;
  1707.   status_Access_Violation       = $C0000005;
  1708.  
  1709. { Virtual Keys, Standard Set }
  1710.  
  1711.   vk_LButton                    = $01;
  1712.   vk_RButton                    = $02;
  1713.   vk_Cancel                     = $03;
  1714.   vk_MButton                    = $04;
  1715.   vk_Back                       = $08;
  1716.   vk_Tab                        = $09;
  1717.   vk_Clear                      = $0C;
  1718.   vk_Return                     = $0D;
  1719.   vk_Shift                      = $10;
  1720.   vk_Control                    = $11;
  1721.   vk_Menu                       = $12;
  1722.   vk_Pause                      = $13;
  1723.   vk_Capital                    = $14;
  1724.   vk_Escape                     = $1B;
  1725.   vk_Space                      = $20;
  1726.   vk_Prior                      = $21;
  1727.   vk_Next                       = $22;
  1728.   vk_End                        = $23;
  1729.   vk_Home                       = $24;
  1730.   vk_Left                       = $25;
  1731.   vk_Up                         = $26;
  1732.   vk_Right                      = $27;
  1733.   vk_Down                       = $28;
  1734.   vk_Select                     = $29;
  1735.   vk_Print                      = $2A;
  1736.   vk_Execute                    = $2B;
  1737.   vk_SnapShot                   = $2C;
  1738.   vk_Insert                     = $2D;
  1739.   vk_Delete                     = $2E;
  1740.   vk_Help                       = $2F;
  1741.   vk_Lwin                       = $5B;
  1742.   vk_Rwin                       = $5C;
  1743.   vk_Apps                       = $5D;
  1744.   vk_Numpad0                    = $60;
  1745.   vk_Numpad1                    = $61;
  1746.   vk_Numpad2                    = $62;
  1747.   vk_Numpad3                    = $63;
  1748.   vk_Numpad4                    = $64;
  1749.   vk_Numpad5                    = $65;
  1750.   vk_Numpad6                    = $66;
  1751.   vk_Numpad7                    = $67;
  1752.   vk_Numpad8                    = $68;
  1753.   vk_Numpad9                    = $69;
  1754.   vk_Multiply                   = $6A;
  1755.   vk_Add                        = $6B;
  1756.   vk_Separator                  = $6C;
  1757.   vk_Subtract                   = $6D;
  1758.   vk_Decimal                    = $6E;
  1759.   vk_Divide                     = $6F;
  1760.   vk_F1                         = $70;
  1761.   vk_F2                         = $71;
  1762.   vk_F3                         = $72;
  1763.   vk_F4                         = $73;
  1764.   vk_F5                         = $74;
  1765.   vk_F6                         = $75;
  1766.   vk_F7                         = $76;
  1767.   vk_F8                         = $77;
  1768.   vk_F9                         = $78;
  1769.   vk_F10                        = $79;
  1770.   vk_F11                        = $7A;
  1771.   vk_F12                        = $7B;
  1772.   vk_F13                        = $7C;
  1773.   vk_F14                        = $7D;
  1774.   vk_F15                        = $7E;
  1775.   vk_F16                        = $7F;
  1776.   vk_F17                        = $80;
  1777.   vk_F18                        = $81;
  1778.   vk_F19                        = $82;
  1779.   vk_F20                        = $83;
  1780.   vk_F21                        = $84;
  1781.   vk_F22                        = $85;
  1782.   vk_F23                        = $86;
  1783.   vk_F24                        = $87;
  1784.   vk_NumLock                    = $90;
  1785.   vk_Scroll                     = $91;
  1786.   vk_LShift                     = $A0;
  1787.   vk_RShift                     = $A1;
  1788.   vk_LControl                   = $A2;
  1789.   vk_RControl                   = $A3;
  1790.   vk_LMenu                      = $A4;
  1791.   vk_RMenu                      = $A5;
  1792.   vk_Attn                       = $F6;
  1793.   vk_CrSel                      = $F7;
  1794.   vk_ExSel                      = $F8;
  1795.   vk_ErEof                      = $F9;
  1796.   vk_Play                       = $FA;
  1797.   vk_Zoom                       = $FB;
  1798.   vk_NoName                     = $FC;
  1799.   vk_Pa1                        = $FD;
  1800.   vk_Oem_Clear                  = $FE;
  1801.  
  1802. { constants for Get/SetSystemPaletteUse() }
  1803.  
  1804.   syspal_Error                  = 0;
  1805.   syspal_Static                 = 1;
  1806.   syspal_NoStatic               = 2;
  1807.  
  1808. { RedrawWindow() flags }
  1809.  
  1810.   rdw_Invalidate                = $0001;
  1811.   rdw_InternalPaint             = $0002;
  1812.   rdw_Erase                     = $0004;
  1813.   rdw_Validate                  = $0008;
  1814.   rdw_NoInternalPaint           = $0010;
  1815.   rdw_NoErase                   = $0020;
  1816.   rdw_NoChildren                = $0040;
  1817.   rdw_AllChildren               = $0080;
  1818.   rdw_UpdateNow                 = $0100;
  1819.   rdw_EraseNow                  = $0200;
  1820.   rdw_Frame                     = $0400;
  1821.   rdw_NoFrame                   = $0800;
  1822.  
  1823. { Bounds Accumulation APIs }
  1824.  
  1825.   dcb_Reset                     = $0001;
  1826.   dcb_Accumulate                = $0002;
  1827.   dcb_Enable                    = $0004;
  1828.   dcb_Disable                   = $0008;
  1829.   dcb_Dirty                     = dcb_Accumulate;
  1830.   dcb_Set                       = dcb_Reset or dcb_Accumulate;
  1831.  
  1832. { SetErrorMode() flags }
  1833.  
  1834.   sem_FailCriticalErrors        = $0001;
  1835.   sem_NoGpFaultErrorBox         = $0002;
  1836.   sem_NoAlignmentFaultExcept    = $0004;
  1837.   sem_NoOpenFileErrorBox        = $8000;
  1838.  
  1839. { Parameter for SystemParametersInfo() }
  1840.  
  1841.   spi_GetBeep                   = 1;
  1842.   spi_SetBeep                   = 2;
  1843.   spi_GetMouse                  = 3;
  1844.   spi_SetMouse                  = 4;
  1845.   spi_GetBorder                 = 5;
  1846.   spi_SetBorder                 = 6;
  1847.   spi_GetKeyboardSpeed          = 10;
  1848.   spi_SetKeyboardSpeed          = 11;
  1849.   spi_LangDriver                = 12;
  1850.   spi_IconHorizontalSpacing     = 13;
  1851.   spi_GetScreenSaveTimeout      = 14;
  1852.   spi_SetScreenSaveTimeout      = 15;
  1853.   spi_GetScreenSaveActive       = 16;
  1854.   spi_SetScreenSaveActive       = 17;
  1855.   spi_GetGridGranularity        = 18;
  1856.   spi_SetGridGranularity        = 19;
  1857.   spi_Setdeskwallpaper          = 20;
  1858.   spi_SetDeskPattern            = 21;
  1859.   spi_GetKeyboardDelay          = 22;
  1860.   spi_SetKeyboardDelay          = 23;
  1861.   spi_IconVerticalSpacing       = 24;
  1862.   spi_GetIconTitleWrap          = 25;
  1863.   spi_SetIconTitleWrap          = 26;
  1864.   spi_GetMenuDropAlignment      = 27;
  1865.   spi_SetMenuDropAlignment      = 28;
  1866.   spi_SetDoubleClkWidth         = 29;
  1867.   spi_SetDoubleClkHeight        = 30;
  1868.   spi_GetIconTitleLogfont       = 31;
  1869.   spi_SetDoubleClickTime        = 32;
  1870.   spi_SetMouseButtonSwap        = 33;
  1871.   spi_SetIconTitleLogfont       = 34;
  1872.   spi_GetFastTaskSwitch         = 35;
  1873.   spi_SetFastTaskSwitch         = 36;
  1874.   spi_SetDragFullWindows        = 37;
  1875.   spi_GetDragFullWindows        = 38;
  1876.   spi_GetKeyboardLayout         = 39;
  1877.   spi_SetKeyboardLayout         = 40;
  1878.   spi_GetNonClientMetrics       = 41;
  1879.   spi_SetNonClientMetrics       = 42;
  1880.   spi_GetMinimizedMetrics       = 43;
  1881.   spi_SetMinimizedMetrics       = 44;
  1882.   spi_GetIconMetrics            = 45;
  1883.   spi_SetIconMetrics            = 46;
  1884.   spi_GetWorkArea               = 48;
  1885.   spi_SetPenWindows             = 49;
  1886.   spi_GetHighContrast           = 66;
  1887.   spi_SetHighContrast           = 67;
  1888.   spi_GetKeyBoardPref           = 68;
  1889.   spi_SetKeyboardPref           = 69;
  1890.   spi_GetScreenReader           = 70;
  1891.   spi_SetScreenReader           = 71;
  1892.   spi_GetAnimation              = 72;
  1893.   spi_SetAnimation              = 73;
  1894.   spi_GetFontSmoothing          = 74;
  1895.   spi_SetFontSmoothing          = 75;
  1896.   spi_SetDragWidth              = 76;
  1897.   spi_SetDragHeight             = 77;
  1898.   spi_SetHandHeld               = 78;
  1899.   spi_GetLowPowerTimeout        = 79;
  1900.   spi_GetPowerOffTimeout        = 80;
  1901.   spi_SetLowPowerTimeout        = 81;
  1902.   spi_SetPowerOffTimeout        = 82;
  1903.   spi_GetLowPowerActive         = 83;
  1904.   spi_GetPowerOffActive         = 84;
  1905.   spi_SetLowPowerActive         = 85;
  1906.   spi_SetPowerOffActive         = 86;
  1907.   spi_SetCursors                = 87;
  1908.   spi_SetIcons                  = 88;
  1909.   spi_GetDefaultInputLang       = 89;
  1910.   spi_SetDefaultInputLang       = 90;
  1911.   spi_Setlangtoggle             = 91;
  1912.   spi_GetWindowsExtension       = 92;
  1913.   spi_SetMouseTrails            = 93;
  1914.   spi_GetMouseTrails            = 94;
  1915.   spi_GetFilterKeys             = 50;
  1916.   spi_SetFilterKeys             = 51;
  1917.   spi_GetToggleKeys             = 52;
  1918.   spi_SetToggleKeys             = 53;
  1919.   spi_GetMouseKeys              = 54;
  1920.   spi_SetMouseKeys              = 55;
  1921.   spi_GetShowSounds             = 56;
  1922.   spi_SetShowSounds             = 57;
  1923.   spi_GetStickyKeys             = 58;
  1924.   spi_SetStickyKeys             = 59;
  1925.   spi_GetAccessTimeout          = 60;
  1926.   spi_SetAccessTimeout          = 61;
  1927.   spi_GetSerialKeys             = 62;
  1928.   spi_SetSerialKeys             = 63;
  1929.   spi_GetSoundsEntry            = 64;
  1930.   spi_SetSoundsEntry            = 65;
  1931.  
  1932. { Flags }
  1933.  
  1934.   spif_UpdateIniFile            = $0001;
  1935.   spif_SendWinIniChange         = $0002;
  1936.   spif_SendChange               = spif_SendWinIniChange;
  1937.  
  1938.   dm_Update                     = 1;
  1939.   dm_Copy                       = 2;
  1940.   dm_Prompt                     = 4;
  1941.   dm_Modify                     = 8;
  1942.  
  1943.   dm_In_Buffer                  = dm_Modify;
  1944.   dm_In_Prompt                  = dm_Prompt;
  1945.   dm_Out_Buffer                 = dm_Copy;
  1946.   dm_Out_Default                = dm_Update;
  1947.  
  1948. { device capabilities indices }
  1949.  
  1950.   dc_Fields                     = 1;
  1951.   dc_Papers                     = 2;
  1952.   dc_PaperSize                  = 3;
  1953.   dc_MinExtent                  = 4;
  1954.   dc_MaxExtent                  = 5;
  1955.   dc_Bins                       = 6;
  1956.   dc_Duplex                     = 7;
  1957.   dc_Size                       = 8;
  1958.   dc_Extra                      = 9;
  1959.   dc_Version                    = 10;
  1960.   dc_Driver                     = 11;
  1961.   dc_BinNames                   = 12;
  1962.   dc_EnumResolutions            = 13;
  1963.   dc_FileDependencies           = 14;
  1964.   dc_TrueType                   = 15;
  1965.   dc_PaperNames                 = 16;
  1966.   dc_Orientation                = 17;
  1967.   dc_Copies                     = 18;
  1968.   dc_BinAdjust                  = 19;
  1969.   dc_Emf_Compliant              = 20;
  1970.   dc_DataType_Produced          = 21;
  1971.  
  1972. { ExtFloodFill style flags }
  1973.  
  1974.   FloodFillBorder               = 0;
  1975.   FloodFillSurface              = 1;
  1976.  
  1977. { StretchBlt Modes }
  1978.  
  1979.   Stretch_AndScans              = 1;
  1980.   Stretch_OrScans               = 2;
  1981.   Stretch_DeleteScans           = 3;
  1982.   Stretch_HalfTone              = 4;
  1983.   MaxStretchBltMode             = 4;
  1984.  
  1985.   BlackOnWhite                  = Stretch_AndScans;
  1986.   WhiteOnBlack                  = Stretch_OrScans;
  1987.   ColorOnColor                  = Stretch_DeleteScans;
  1988.   HalfTone                      = Stretch_HalfTone;
  1989.  
  1990. { PolyDraw and GetPath point types }
  1991.  
  1992.   pt_CloseFigure                = $01;
  1993.   pt_LineTo                     = $02;
  1994.   pt_BezierTo                   = $04;
  1995.   pt_MoveTo                     = $06;
  1996.  
  1997. { color usage }
  1998.  
  1999.   dib_Rgb_Colors                = 0;
  2000.   dib_Pal_Colors                = 1;
  2001.  
  2002. { GDI object types }
  2003.  
  2004.   obj_Pen                       = 1;
  2005.   obj_Brush                     = 2;
  2006.   obj_Dc                        = 3;
  2007.   obj_MetaDc                    = 4;
  2008.   obj_Pal                       = 5;
  2009.   obj_Font                      = 6;
  2010.   obj_Bitmap                    = 7;
  2011.   obj_Region                    = 8;
  2012.   obj_MetaFile                  = 9;
  2013.   obj_MemDc                     = 10;
  2014.   obj_ExtPen                    = 11;
  2015.   obj_EnhMetaDc                 = 12;
  2016.   obj_EnhMetaFile               = 13;
  2017.  
  2018. { ScrollWindowEx() scroll flags }
  2019.  
  2020.   sw_ScrollChildren             = $0001;
  2021.   sw_Invalidate                 = $0002;
  2022.   sw_Erase                      = $0004;
  2023.  
  2024. { Enhanced Metafile structures }
  2025.  
  2026.   enhmeta_Signature             = $464D4520;
  2027.   enhmeta_Stock_Object          = $80000000;
  2028.  
  2029.   emr_Header                    = 1;
  2030.   emr_PolyBezier                = 2;
  2031.   emr_Polygon                   = 3;
  2032.   emr_PolyLine                  = 4;
  2033.   emr_PolybezierTo              = 5;
  2034.   emr_PolyLineTo                = 6;
  2035.   emr_PolyPolyLine              = 7;
  2036.   emr_PolyPolygon               = 8;
  2037.   emr_SetWindowExtEx            = 9;
  2038.   emr_SetWindowOrgEx            = 10;
  2039.   emr_SetViewPortExtEx          = 11;
  2040.   emr_SetViewPortOrgEx          = 12;
  2041.   emr_SetBrushOrgEx             = 13;
  2042.   emr_Eof                       = 14;
  2043.   emr_SetPixelV                 = 15;
  2044.   emr_SetMapperFlags            = 16;
  2045.   emr_SetMapMode                = 17;
  2046.   emr_SetBkMode                 = 18;
  2047.   emr_SetPolyFillMode           = 19;
  2048.   emr_SetRop2                   = 20;
  2049.   emr_SetStretchBltMode         = 21;
  2050.   emr_SetTextAlign              = 22;
  2051.   emr_SetColorAdjustment        = 23;
  2052.   emr_SetTextColor              = 24;
  2053.   emr_SetBkColor                = 25;
  2054.   emr_OffsetClipRgn             = 26;
  2055.   emr_MoveToEx                  = 27;
  2056.   emr_SetMetaRgn                = 28;
  2057.   emr_ExcludeClipRect           = 29;
  2058.   emr_IntersectClipRect         = 30;
  2059.   emr_ScaleViewPortExtEx        = 31;
  2060.   emr_ScaleWindowExtEx          = 32;
  2061.   emr_SaveDC                    = 33;
  2062.   emr_RestoreDC                 = 34;
  2063.   emr_SetWorldTransform         = 35;
  2064.   emr_ModifyWorldTransform      = 36;
  2065.   emr_SelectObject              = 37;
  2066.   emr_CreatePen                 = 38;
  2067.   emr_CreateBrushIndirect       = 39;
  2068.   emr_DeleteObject              = 40;
  2069.   emr_AngleArc                  = 41;
  2070.   emr_Ellipse                   = 42;
  2071.   emr_Rectangle                 = 43;
  2072.   emr_RoundRect                 = 44;
  2073.   emr_Arc                       = 45;
  2074.   emr_Chord                     = 46;
  2075.   emr_Pie                       = 47;
  2076.   emr_SelectPalette             = 48;
  2077.   emr_CreatePalette             = 49;
  2078.   emr_SetPaletteEntries         = 50;
  2079.   emr_ResizePalette             = 51;
  2080.   emr_RealizePalette            = 52;
  2081.   emr_ExtFloodFill              = 53;
  2082.   emr_LineTo                    = 54;
  2083.   emr_ArcTo                     = 55;
  2084.   emr_PolyDraw                  = 56;
  2085.   emr_SetArcDirection           = 57;
  2086.   emr_SetMiterLimit             = 58;
  2087.   emr_BeginPath                 = 59;
  2088.   emr_EndPath                   = 60;
  2089.   emr_CloseFigure               = 61;
  2090.   emr_FillPath                  = 62;
  2091.   emr_StrokeAndFillPath         = 63;
  2092.   emr_StrokePath                = 64;
  2093.   emr_FlattenPath               = 65;
  2094.   emr_WidenPath                 = 66;
  2095.   emr_SelectClipPath            = 67;
  2096.   emr_AbortPath                 = 68;
  2097.   emr_GdiComment                = 70;
  2098.   emr_FillRgn                   = 71;
  2099.   emr_FrameRgn                  = 72;
  2100.   emr_InvertRgn                 = 73;
  2101.   emr_PaintRgn                  = 74;
  2102.   emr_ExtSelectClipRgn          = 75;
  2103.   emr_BitBlt                    = 76;
  2104.   emr_StretchBlt                = 77;
  2105.   emr_MaskBlt                   = 78;
  2106.   emr_PlgBlt                    = 79;
  2107.   emr_SetDibitsToDevice         = 80;
  2108.   emr_StretchDiBits             = 81;
  2109.   emr_ExtCreateFontIndirectW    = 82;
  2110.   emr_ExtTextOutA               = 83;
  2111.   emr_ExtTextOutW               = 84;
  2112.   emr_PolyBezier16              = 85;
  2113.   emr_Polygon16                 = 86;
  2114.   emr_PolyLine16                = 87;
  2115.   emr_PolyBezierTo16            = 88;
  2116.   emr_PolyLineTo16              = 89;
  2117.   emr_PolyPolyLine16            = 90;
  2118.   emr_PolyPolyGon16             = 91;
  2119.   emr_Polydraw16                = 92;
  2120.   emr_CreateMonoBrush           = 93;
  2121.   emr_CreateDibPatternBrushPt   = 94;
  2122.   emr_ExtCreatePen              = 95;
  2123.   emr_PolyTextOutA              = 96;
  2124.   emr_PolyTextOutW              = 97;
  2125.   emr_SetIcmMode                = 98;
  2126.   emr_CreateColorSpace          = 99;
  2127.   emr_SetColorSpace             = 100;
  2128.   emr_DeleteColorSpace          = 101;
  2129.  
  2130.   emr_Min                       = 1;
  2131.   emr_Max                       = 101;
  2132.  
  2133. { Forward Declaration }
  2134.  
  2135.   lf_FaceSize                   = 32;
  2136.  
  2137. type
  2138.   PLogFont = ^TLogFont;
  2139.   PLogFontA = ^TLogFontA;
  2140.   PLogFontW = ^TLogFontW;
  2141.   TLogFont = packed record
  2142.     lfHeight:           Long;
  2143.     lfWidth:            Long;
  2144.     lfEscapement:       Long;
  2145.     lfOrientation:      Long;
  2146.     lfWeight:           Long;
  2147.     lfItalic:           Byte;
  2148.     lfUnderline:        Byte;
  2149.     lfStrikeOut:        Byte;
  2150.     lfCharSet:          Byte;
  2151.     lfOutPrecision:     Byte;
  2152.     lfClipPrecision:    Byte;
  2153.     lfQuality:          Byte;
  2154.     lfPitchAndFamily:   Byte;
  2155.     lfFaceName: array[0..lf_FaceSize-1] of Char;
  2156.   end;
  2157.   TLogFontW = packed record
  2158.     lfHeight: Longint;
  2159.     lfWidth: Longint;
  2160.     lfEscapement: Longint;
  2161.     lfOrientation: Longint;
  2162.     lfWeight: Longint;
  2163.     lfItalic: Byte;
  2164.     lfUnderline: Byte;
  2165.     lfStrikeOut: Byte;
  2166.     lfCharSet: Byte;
  2167.     lfOutPrecision: Byte;
  2168.     lfClipPrecision: Byte;
  2169.     lfQuality: Byte;
  2170.     lfPitchAndFamily: Byte;
  2171.     lfFaceName: array[0..LF_FACESIZE - 1] of WideChar;
  2172.   end;
  2173.   tLogFontA = tLogFont;
  2174.  
  2175.   PTextMetric = ^TTextMetric;
  2176.   PTextMetricA = ^TTextMetricA;
  2177.   PTextMetricW = ^TTextMetricW;
  2178.   TTextMetric = record
  2179.     tmHeight:           Long;
  2180.     tmAscent:           Long;
  2181.     tmDescent:          Long;
  2182.     tmInternalLeading:  Long;
  2183.     tmExternalLeading:  Long;
  2184.     tmAveCharWidth:     Long;
  2185.     tmMaxCharWidth:     Long;
  2186.     tmWeight:           Long;
  2187.     tmOverhang:         Long;
  2188.     tmDigitizedAspectX: Long;
  2189.     tmDigitizedAspectY: Long;
  2190.     tmFirstChar:        Char;
  2191.     tmLastChar:         Char;
  2192.     tmDefaultChar:      Char;
  2193.     tmBreakChar:        Char;
  2194.     tmItalic:           Byte;
  2195.     tmUnderlined:       Byte;
  2196.     tmStruckOut:        Byte;
  2197.     tmPitchAndFamily:   Byte;
  2198.     tmCharSet:          Byte;
  2199.   end;
  2200.   TTextMetricW = packed record
  2201.     tmHeight: Longint;
  2202.     tmAscent: Longint;
  2203.     tmDescent: Longint;
  2204.     tmInternalLeading: Longint;
  2205.     tmExternalLeading: Longint;
  2206.     tmAveCharWidth: Longint;
  2207.     tmMaxCharWidth: Longint;
  2208.     tmWeight: Longint;
  2209.     tmOverhang: Longint;
  2210.     tmDigitizedAspectX: Longint;
  2211.     tmDigitizedAspectY: Longint;
  2212.     tmFirstChar: WideChar;
  2213.     tmLastChar: WideChar;
  2214.     tmDefaultChar: WideChar;
  2215.     tmBreakChar: WideChar;
  2216.     tmItalic: Byte;
  2217.     tmUnderlined: Byte;
  2218.     tmStruckOut: Byte;
  2219.     tmPitchAndFamily: Byte;
  2220.     tmCharSet: Byte;
  2221.   end;
  2222.   TTextMetricA = TTextMetric;
  2223.  
  2224. { Structure }
  2225.  
  2226. type
  2227.   PPoint = ^TPoint;
  2228.   TPoint = record
  2229.     X: Long;
  2230.     Y: Long;
  2231.   end;
  2232.  
  2233.   PMsg = ^TMsg;
  2234.   TMsg = packed record
  2235.     hWnd:    hWnd;
  2236.     message: UInt;
  2237.     wParam:  wParam;
  2238.     lParam:  lParam;
  2239.     time:    DWord;
  2240.     pt:      TPoint;
  2241.   end;
  2242.  
  2243.   PRect = ^TRect;
  2244.   TRect = record
  2245.     case Integer of
  2246.       0: (Left, Top, Right, Bottom: Integer);
  2247.       1: (TopLeft, BottomRight: TPoint);
  2248.   end;
  2249.  
  2250.   PWndClass = ^TWndClass;
  2251.   TWndClass = record
  2252.     style:         UInt;
  2253.     lpfnWndProc:   TFNWndProc;
  2254.     cbClsExtra:    Integer;
  2255.     cbWndExtra:    Integer;
  2256.     hInstance:     hInst;
  2257.     HIcon:         HIcon;
  2258.     HCursor:       HCursor;
  2259.     hbrBackground: HBrush;
  2260.     lpszMenuName:  PChar;
  2261.     lpszClassName: PChar;
  2262.   end;
  2263.  
  2264. const
  2265.   ofs_MaxPathName               = 128;
  2266.  
  2267. type
  2268.   POfStruct = ^TOfStruct;
  2269.   TOfStruct = record
  2270.     cBytes:     Byte;
  2271.     fFixedDisk: Byte;
  2272.     nErrCode:   SmallWord;
  2273.     Reserved1:  SmallWord;
  2274.     Reserved2:  SmallWord;
  2275.     szPathName: array[0..ofs_MaxPathName-1] of Char;
  2276.   end;
  2277.  
  2278. const
  2279.   cchDeviceName = 32;
  2280.   cchFormName   = 32;     // size of a form name string
  2281.  
  2282. type
  2283.   PDeviceMode = ^TDeviceMode;
  2284.   PDeviceModeA = ^TDeviceModeA;
  2285.   PDeviceModeW = ^TDeviceModeW;
  2286.   TDeviceMode = packed record
  2287.     dmDeviceName:       array[0..cchDeviceName-1] of Char;
  2288.     dmSpecVersion:      SmallWord;
  2289.     dmDriverVersion:    SmallWord;
  2290.     dmSize:             SmallWord;
  2291.     dmDriverExtra:      SmallWord;
  2292.     dmFields:           DWord;
  2293.     dmOrientation:      Short;
  2294.     dmPaperSize:        Short;
  2295.     dmPaperLength:      Short;
  2296.     dmPaperWidth:       Short;
  2297.     dmScale:            Short;
  2298.     dmCopies:           Short;
  2299.     dmDefaultSource:    Short;
  2300.     dmPrintQuality:     Short;
  2301.     dmColor:            Short;
  2302.     dmDuplex:           Short;
  2303.     dmYResolution:      Short;
  2304.     dmTTOption:         Short;
  2305.     dmCollate:          Short;
  2306.     dmFormName:         array[0..32-1] of Byte;
  2307.     dmLogPixels:        SmallWord;
  2308.     dmBitsPerPel:       DWord;
  2309.     dmPelsWidth:        DWord;
  2310.     dmPelsHeight:       DWord;
  2311.     dmDisplayFlags:     DWord;
  2312.     dmDisplayFrequency: DWord;
  2313.   end;
  2314.   TDeviceModeW = packed record
  2315.     dmDeviceName: array[0..CCHDEVICENAME - 1] of WideChar;
  2316.     dmSpecVersion: Word;
  2317.     dmDriverVersion: Word;
  2318.     dmSize: Word;
  2319.     dmDriverExtra: Word;
  2320.     dmFields: DWord;
  2321.     dmOrientation: Short;
  2322.     dmPaperSize: Short;
  2323.     dmPaperLength: Short;
  2324.     dmPaperWidth: Short;
  2325.     dmScale: Short;
  2326.     dmCopies: Short;
  2327.     dmDefaultSource: Short;
  2328.     dmPrintQuality: Short;
  2329.     dmColor: Short;
  2330.     dmDuplex: Short;
  2331.     dmYResolution: Short;
  2332.     dmTTOption: Short;
  2333.     dmCollate: Short;
  2334.     dmFormName: array[0..CCHFORMNAME - 1] of WideChar;
  2335.     dmLogPixels: Word;
  2336.     dmBitsPerPel: DWord;
  2337.     dmPelsWidth: DWord;
  2338.     dmPelsHeight: DWord;
  2339.     dmDisplayFlags: DWord;
  2340.     dmDisplayFrequency: DWord;
  2341.     dmICMMethod: DWord;
  2342.     dmICMIntent: DWord;
  2343.     dmMediaType: DWord;
  2344.     dmDitherType: DWord;
  2345.     dmReserved1: DWord;
  2346.     dmReserved2: DWord;
  2347.   end;
  2348.   tDeviceModeA = tDeviceMode;
  2349.  
  2350.   PDevMode = PDeviceMode;
  2351.   TDevMode = TDeviceMode;
  2352.  
  2353.   TFNDevMode = function(Wnd: hWnd; Driver: hModule; var DevModeOutput: TDeviceMode; DeciveName,Port: PChar; var DevModeInput: TDeviceMode; P7: PChar; P8: Longint): Longint;
  2354.  
  2355. const
  2356.   dm_SpecVersion                = $0320;
  2357.   dm_Orientation                = $00000001;
  2358.   dm_PaperSize                  = $00000002;
  2359.   dm_PaperLength                = $00000004;
  2360.   dm_PaperWidth                 = $00000008;
  2361.   dm_Scale                      = $00000010;
  2362.   dm_Copies                     = $00000100;
  2363.   dm_DefaultSource              = $00000200;
  2364.   dm_PrintQuality               = $00000400;
  2365.   dm_Color                      = $00000800;
  2366.   dm_Duplex                     = $00001000;
  2367.   dm_YResolution                = $00002000;
  2368.   dm_TTOption                   = $00004000;
  2369.   dm_Collate                    = $00008000;
  2370.   dm_FormName                   = $00010000;
  2371.  
  2372.   dmOrient_Portrait             = 1;
  2373.   dmOrient_Landscape            = 2;
  2374.  
  2375.   dmpaper_Letter                = 1;
  2376.   dmpaper_First                 = dmpaper_Letter;
  2377.   dmpaper_LetterSmall           = 2;
  2378.   dmpaper_TabLoid               = 3;
  2379.   dmpaper_Ledger                = 4;
  2380.   dmpaper_Legal                 = 5;
  2381.   dmpaper_Statement             = 6;
  2382.   dmpaper_Executive             = 7;
  2383.   dmpaper_A3                    = 8;
  2384.   dmpaper_A4                    = 9;
  2385.   dmpaper_A4Small               = 10;
  2386.   dmpaper_A5                    = 11;
  2387.   dmpaper_B4                    = 12;
  2388.   dmpaper_B5                    = 13;
  2389.   dmpaper_Folio                 = 14;
  2390.   dmpaper_QuarTo                = 15;
  2391.   dmpaper_10x14                 = 16;
  2392.   dmpaper_11x17                 = 17;
  2393.   dmpaper_Note                  = 18;
  2394.   dmpaper_Env_9                 = 19;
  2395.   dmpaper_Env_10                = 20;
  2396.   dmpaper_Env_11                = 21;
  2397.   dmpaper_Env_12                = 22;
  2398.   dmpaper_Env_14                = 23;
  2399.   dmpaper_CSheet                = 24;
  2400.   dmpaper_DSheet                = 25;
  2401.   dmpaper_ESheet                = 26;
  2402.   dmpaper_Env_Dl                = 27;
  2403.   dmpaper_Env_C5                = 28;
  2404.   dmpaper_Env_C3                = 29;
  2405.   dmpaper_Env_C4                = 30;
  2406.   dmpaper_Env_C6                = 31;
  2407.   dmpaper_Env_C65               = 32;
  2408.   dmpaper_Env_B4                = 33;
  2409.   dmpaper_Env_B5                = 34;
  2410.   dmpaper_Env_b6                = 35;
  2411.   dmpaper_Env_Italy             = 36;
  2412.   dmpaper_Env_Monarch           = 37;
  2413.   dmpaper_Env_Personal          = 38;
  2414.   dmpaper_FanFold_Us            = 39;
  2415.   dmpaper_FanFold_Std_German    = 40;
  2416.   dmpaper_FanFold_Lgl_German    = 41;
  2417.   dmpaper_Last                  = dmpaper_FanFold_Lgl_German;
  2418.   dmpaper_user                  = 256;
  2419.  
  2420.   dmbin_Upper                   = 1;
  2421.   dmbin_First                   = dmbin_Upper;
  2422.   dmbin_OnlyOne                 = 1;
  2423.   dmbin_Lower                   = 2;
  2424.   dmbin_Middle                  = 3;
  2425.   dmbin_Manual                  = 4;
  2426.   dmbin_Envelope                = 5;
  2427.   dmbin_EnvManual               = 6;
  2428.   dmbin_Auto                    = 7;
  2429.   dmbin_Tractor                 = 8;
  2430.   dmbin_SmallFmt                = 9;
  2431.   dmbin_LargeFmt                = 10;
  2432.   dmbin_LargeCapacity           = 11;
  2433.   dmbin_Cassette                = 14;
  2434.   dmbin_FormSource              = 15;
  2435.   dmbin_Last                    = dmbin_FormSource;
  2436.  
  2437.   dmbin_user                    = 256;
  2438.  
  2439.   dmres_Draft                   = -1;
  2440.   dmres_Low                     = -2;
  2441.   dmres_Medium                  = -3;
  2442.   dmres_High                    = -4;
  2443.  
  2444.   dmcolor_Monochrome            = 1;
  2445.   dmcolor_Color                 = 2;
  2446.  
  2447.   dmdup_Simplex                 = 1;
  2448.   dmdup_Vertical                = 2;
  2449.   dmdup_Horizontal              = 3;
  2450.  
  2451.   dmtt_Bitmap                   = 1;
  2452.   dmtt_DownLoad                 = 2;
  2453.   dmtt_SubDev                   = 3;
  2454.  
  2455.   dmcollate_False               = 0;
  2456.   dmcollate_True                = 1;
  2457.  
  2458.   dm_GrayScale                  = $00000001;
  2459.   dm_Interlaced                 = $00000002;
  2460.  
  2461. type
  2462.   PSize = ^TSize;
  2463.   TSize = record
  2464.     cx: Longint;
  2465.     cy: Longint;
  2466.   end;
  2467.  
  2468.   PSmallPoint = ^TSmallPoint;
  2469.   TSmallPoint = record
  2470.     x: SmallInt;
  2471.     y: SmallInt;
  2472.   end;
  2473.  
  2474.   PCreateStruct = ^TCreateStruct;
  2475.   TCreateStruct = packed record
  2476.     lpCreateParams: Pointer;
  2477.     hInstance:      THandle;
  2478.     hMenu:          hMenu;
  2479.     hwndParent:     hWnd;
  2480.     cy:             Longint;
  2481.     cx:             Longint;
  2482.     y:              Longint;
  2483.     x:              Longint;
  2484.     style:          Longint;
  2485.     lpszName:       PChar;
  2486.     lpszClass:      PChar;
  2487.     dwExStyle:      Longint;
  2488.   end;
  2489.  
  2490.   PClientCreateStruct = ^TClientCreateStruct;
  2491.   TClientCreateStruct = packed record
  2492.     hWindowMenu:  THandle;
  2493.     idFirstChild: Longint;
  2494.   end;
  2495.  
  2496.   PMDICreateStruct = ^TMDICreateStruct;
  2497.   TMDICreateStruct = packed record
  2498.     szClass: PChar;
  2499.     szTitle: PChar;
  2500.     hOwner:  THandle;
  2501.     x:       Longint;
  2502.     y:       Longint;
  2503.     cx:      Longint;
  2504.     cy:      Longint;
  2505.     style:   Longint;
  2506.     lParam:  lParam;
  2507.   end;
  2508.  
  2509.   PSecurityAttributes = ^TSecurityAttributes;
  2510.   TSecurityAttributes = record
  2511.     nLength: Longint;
  2512.     lpSecurityDescriptor: Pointer;
  2513.     bInheritHandle: Bool;
  2514.   end;
  2515.  
  2516.   PSecurityDescriptor = Pointer;
  2517.  
  2518.   PPaintStruct = ^TPaintStruct;
  2519.   TPaintStruct = packed record
  2520.     hdc:         HDC;
  2521.     fErase:      Bool;
  2522.     rcPaint:     TRect;
  2523.     fRestore:    Bool;
  2524.     fIncUpdate:  Bool;
  2525.     rgbReserved: array[0..31] of Byte;
  2526.   end;
  2527.  
  2528. { Palette Entry Flags }
  2529. const
  2530.   pc_Reserved                   = $01;
  2531.   pc_Explicit                   = $02;
  2532.   pc_NoCollapse                 = $04;
  2533.  
  2534. type
  2535.   PPaletteEntry = ^TPaletteEntry;
  2536.   TPaletteEntry = packed record
  2537.     peRed:   Byte;
  2538.     peGreen: Byte;
  2539.     peBlue:  Byte;
  2540.     peFlags: Byte;
  2541.   end;
  2542.  
  2543.   PLogPalette = ^TLogPalette;
  2544.   TLogPalette = packed record
  2545.     palVersion:    SmallWord;
  2546.     palNumEntries: SmallWord;
  2547.     palPalEntry:   array[0..1] of TPaletteEntry;
  2548.   end;
  2549.  
  2550.   PXForm = ^TXForm;
  2551.   TXForm = packed record
  2552.     eM11: Single;
  2553.     eM12: Single;
  2554.     eM21: Single;
  2555.     eM22: Single;
  2556.     eDx:  Single;
  2557.     eDy:  Single;
  2558.   end;
  2559.  
  2560.   PBitmapCoreHeader = ^TBitmapCoreHeader;
  2561.   TBitmapCoreHeader = packed record
  2562.     bcSize:     Longint;
  2563.     bcWidth:    SmallWord;
  2564.     bcHeight:   SmallWord;
  2565.     bcPlanes:   SmallWord;
  2566.     bcBitCount: SmallWord;
  2567.   end;
  2568.  
  2569.   PBitmapInfoHeader = ^TBitmapInfoHeader;
  2570.   TBitmapInfoHeader = packed record
  2571.     biSize:          Longint;
  2572.     biWidth:         Longint;
  2573.     biHeight:        Longint;
  2574.     biPlanes:        SmallWord;
  2575.     biBitCount:      SmallWord;
  2576.     biCompression:   Longint;
  2577.     biSizeImage:     Longint;
  2578.     biXPelsPerMeter: Longint;
  2579.     biYPelsPerMeter: Longint;
  2580.     biClrUsed:       Longint;
  2581.     biClrImportant:  Longint;
  2582.   end;
  2583.  
  2584.   PBitmapFileHeader = ^TBitmapFileHeader;
  2585.   TBitmapFileHeader = packed record
  2586.     bfType:      SmallWord;
  2587.     bfSize:      Longint;
  2588.     bfReserved1: SmallWord;
  2589.     bfReserved2: SmallWord;
  2590.     bfOffBits:   Longint;
  2591.   end;
  2592.  
  2593. { biCompression Field Constants }
  2594. const
  2595.   bi_Rgb                        = 0;
  2596.   bi_Rle8                       = 1;
  2597.   bi_Rle4                       = 2;
  2598.   bi_BitFields                  = 3;
  2599.  
  2600. type
  2601.   PRGBTriple = ^TRGBTriple;
  2602.   TRGBTriple = packed record
  2603.     rgbtBlue:  Byte;
  2604.     rgbtGreen: Byte;
  2605.     rgbtRed:   Byte;
  2606.   end;
  2607.  
  2608.   PBitmapCoreInfo = ^TBitmapCoreInfo;
  2609.   TBitmapCoreInfo = record
  2610.     bmciHeader: TBitmapCoreHeader;
  2611.     bmciColors: array[0..0] of TRGBTriple;
  2612.   end;
  2613.  
  2614.   PRGBQuad = ^TRGBQuad;
  2615.   TRGBQuad = packed record
  2616.     rgbBlue:     Byte;
  2617.     rgbGreen:    Byte;
  2618.     rgbRed:      Byte;
  2619.     rgbReserved: Byte;
  2620.   end;
  2621.  
  2622.   PBitmapInfo = ^TBitmapInfo;
  2623.   TBitmapInfo = packed record
  2624.     bmiHeader: TBitmapInfoHeader;
  2625.     bmiColors: array[0..0] of TRGBQuad;
  2626.   end;
  2627.  
  2628. { Xform FLAGS }
  2629. const
  2630.   mwt_Identity                  = 1;
  2631.   mwt_LeftMultiply              = 2;
  2632.   mwt_RightMultiply             = 3;
  2633.  
  2634. { Mapping Modes }
  2635.   mm_Text                       = 1;
  2636.   mm_LoMetric                   = 2;
  2637.   mm_HiMetric                   = 3;
  2638.   mm_LoEnglish                  = 4;
  2639.   mm_HiEnglish                  = 5;
  2640.   mm_TWips                      = 6;
  2641.   mm_IsoTropic                  = 7;
  2642.   mm_AnisoTropic                = 8;
  2643.  
  2644. type
  2645.   PDocInfo = ^TDocInfo;
  2646.   TDocInfo = packed record
  2647.     cbSize:      Longint;
  2648.     lpszDocName: PChar;
  2649.     lpszOutput:  PChar;
  2650.   end;
  2651.  
  2652. { Logical Brush (or Pattern) }
  2653.  
  2654. type
  2655.   PLogBrush = ^TLogBrush;
  2656.   TLogBrush = packed record
  2657.     lbStyle: Longint;
  2658.     lbColor: TColorRef;
  2659.     lbHatch: Longint;
  2660.   end;
  2661.  
  2662. { Logical Pen }
  2663.  
  2664.   PLogPen = ^TLogPen;
  2665.   TLogPen = packed record
  2666.     lopnStyle: Longint;
  2667.     lopnWidth: TPoint;
  2668.     lopnColor: TColorRef;
  2669.   end;
  2670.  
  2671.   PExtLogPen = ^TLogPen;
  2672.   TExtLogPen = packed record
  2673.     elpPenStyle:   Longint;
  2674.     elpWidth:      Longint;
  2675.     elpBrushStyle: Longint;
  2676.     elpColor:      TColorRef;
  2677.     elpHatch:      Longint;
  2678.     elpNumEntries: Longint;
  2679.     elpStyleEntry: array[0..0] of Longint;
  2680.   end;
  2681.  
  2682. { constants for CreateDIBitmap }
  2683. const
  2684.   cbm_CreateDib                 = $02; { create DIB bitmap }
  2685.   cbm_Init                      = $04; { initialize bitmap }
  2686.  
  2687. { ExtTexOut options }
  2688.   eto_Grayed                    = 1;
  2689.   eto_Opaque                    = 2;
  2690.   eto_Clipped                   = 4;
  2691.  
  2692. { Background Modes }
  2693.   Transparent                   = 1;
  2694.   Opaque                        = 2;
  2695.   BkMode_Last                   = 2;
  2696.  
  2697. { Bitmap Header Definition }
  2698. type
  2699.   PBitmap = ^TBitmap;
  2700.   TBitmap = packed record
  2701.     bmType:       Longint;
  2702.     bmWidth:      Longint;
  2703.     bmHeight:     Longint;
  2704.     bmWidthBytes: Longint;
  2705.     bmPlanes:     SmallWord;
  2706.     bmBitsPixel:  SmallWord;
  2707.     bmBits:       Pointer;
  2708.   end;
  2709.  
  2710.   PGlyphMetrics = ^TGlyphMetrics;
  2711.   TGlyphMetrics = packed record
  2712.     gmBlackBoxX:     Longint;
  2713.     gmBlackBoxY:     Longint;
  2714.     gmptGlyphOrigin: TPoint;
  2715.     gmCellIncX:      SmallInt;
  2716.     gmCellIncY:      SmallInt;
  2717.   end;
  2718.  
  2719. { GetGlyphOutline constants }
  2720. const
  2721.   ggo_Metrics                   = 0;
  2722.   ggo_Bitmap                    = 1;
  2723.   ggo_Native                    = 2;
  2724.  
  2725. type
  2726.   TFixed = packed record
  2727.     fract: SmallWord;
  2728.     value: SmallInt;
  2729.   end;
  2730.  
  2731.   PMat2 = ^TMat2;
  2732.   TMat2 = packed record
  2733.     eM11: TFixed;
  2734.     eM12: TFixed;
  2735.     eM21: TFixed;
  2736.     eM22: TFixed;
  2737.   end;
  2738.  
  2739. { Clipboard Metafile Picture Structure }
  2740.  
  2741.   PHandleTable = ^THandleTable;
  2742.   THandleTable = packed record
  2743.     objectHandle: array[0..0] of HGDIObj;
  2744.   end;
  2745.  
  2746.   PMetaRecord = ^TMetaRecord;
  2747.   TMetaRecord = record
  2748.     rdSize:     Longint;
  2749.     rdFunction: SmallWord;
  2750.     rdParm:     array[0..0] of SmallWord;
  2751.   end;
  2752.  
  2753. { Dialog Template & Item Structures }
  2754.  
  2755.   PDlgTemplate = ^TDlgTemplate;
  2756.   TDlgTemplate = record
  2757.     style:           Longint;
  2758.     dwExtendedStyle: Longint;
  2759.     cdit:            SmallWord;
  2760.     x:               SmallWord;
  2761.     y:               SmallWord;
  2762.     cx:              SmallWord;
  2763.     cy:              SmallWord;
  2764.   end;
  2765.  
  2766.   PDlgItemTemplate = ^TDlgItemTemplate;
  2767.   TDlgItemTemplate = record
  2768.     style:           Longint;
  2769.     dwExtendedStyle: Longint;
  2770.     x:               SmallWord;
  2771.     y:               SmallWord;
  2772.     cx:              SmallWord;
  2773.     cy:              SmallWord;
  2774.     id:              SmallWord;
  2775.   end;
  2776.  
  2777. { Window Placement Structure }
  2778.  
  2779.   PWindowPlacement = ^TWindowPlacement;
  2780.   TWindowPlacement = record
  2781.     length:           Longint;
  2782.     flags:            Longint;
  2783.     showCmd:          Longint;
  2784.     ptMinPosition:    TPoint;
  2785.     ptMaxPosition:    TPoint;
  2786.     rcNormalPosition: TRect;
  2787.   end;
  2788.  
  2789. { Filetime Structure }
  2790.  
  2791.   PFileTime = ^TFileTime;
  2792.   TFileTime = record
  2793.     dwLowDateTime:  Longint;
  2794.     dwHighDateTime: Longint;
  2795.   end;
  2796.  
  2797. { Systemtime Structure }
  2798.  
  2799.   PSystemTime = ^TSystemTime;
  2800.   TSystemTime = record
  2801.     wYear:         SmallWord;
  2802.     wMonth:        SmallWord;
  2803.     wDayOfWeek:    SmallWord;
  2804.     wDay:          SmallWord;
  2805.     wHour:         SmallWord;
  2806.     wMinute:       SmallWord;
  2807.     wSecond:       SmallWord;
  2808.     wMilliseconds: SmallWord;
  2809.   end;
  2810.  
  2811. { Access Mask }
  2812.  
  2813.   Access_Mask   = Longint;
  2814.   PAccess_Mask  = ^Access_Mask;
  2815.   RegSam        = Access_Mask;
  2816.  
  2817. { METAFILEPICT Structure }
  2818.  
  2819.   PMetafilePict = ^TMetafilePict;
  2820.   TMetafilePict = packed record
  2821.     mm:   Longint;
  2822.     xExt: Longint;
  2823.     yExt: Longint;
  2824.     hMF:  HMetafile;
  2825.   end;
  2826.  
  2827.   PMetaHeader = ^TMetaHeader;
  2828.   TMetaHeader = packed record
  2829.     mtType:         SmallWord;
  2830.     mtHeaderSize:   SmallWord;
  2831.     mtVersion:      SmallWord;
  2832.     mtSize:         Longint;
  2833.     mtNoObjects:    SmallWord;
  2834.     mtMaxRecord:    Longint;
  2835.     mtNoParameters: SmallWord;
  2836.   end;
  2837.  
  2838.   POverlapped = ^TOverlapped;
  2839.   TOverlapped = record
  2840.     Internal:     Longint;
  2841.     InternalHigh: Longint;
  2842.     Offset:       Longint;
  2843.     OffsetHigh:   Longint;
  2844.     hEvent:       THandle;
  2845.   end;
  2846.  
  2847.   PMemoryStatus = ^TMemoryStatus;
  2848.   TMemoryStatus = record
  2849.     dwLength:        Longint;
  2850.     dwMemoryLoad:    Longint;
  2851.     dwTotalPhys:     Longint;
  2852.     dwAvailPhys:     Longint;
  2853.     dwTotalPageFile: Longint;
  2854.     dwAvailPageFile: Longint;
  2855.     dwTotalVirtual:  Longint;
  2856.     dwAvailVirtual:  Longint;
  2857.   end;
  2858.  
  2859. const
  2860.   Default_Charset               = 1;
  2861.   Shiftjis_Charset              = 128;
  2862.   Hangeul_Charset               = 129;
  2863.   Gb2312_Charset                = 134;
  2864.   Chinesebig5_Charset           = 136;
  2865.   Johab_Charset                 = 130;
  2866.   Hebrew_Charset                = 177;
  2867.   Arabic_Charset                = 178;
  2868.   Greek_Charset                 = 161;
  2869.   Turkish_Charset               = 162;
  2870.   Thai_Charset                  = 222;
  2871.   Easteurope_Charset            = 238;
  2872.   Russian_Charset               = 204;
  2873.  
  2874. { EnumFonts Masks }
  2875.  
  2876.   Raster_FontType               = $0001;
  2877.   Device_FontType               = $0002;
  2878.   TrueType_FontType             = $0004;
  2879.  
  2880.   out_Tt_Precis                 = 4;
  2881.   out_Device_Precis             = 5;
  2882.   out_Raster_Precis             = 6;
  2883.   out_Tt_Only_Precis            = 7;
  2884.   out_Outline_Precis            = 8;
  2885.  
  2886.   clip_Mask                     = $000F;
  2887.   clip_Lh_Angles                = $0010;
  2888.   clip_Tt_Always                = $0020;
  2889.   clip_Embedded                 = $0080;
  2890.  
  2891. { MEASUREITEMSTRUCT for ownerdraw }
  2892. type
  2893.   PMeasureItemStruct = ^TMeasureItemStruct;
  2894.   TMeasureItemStruct = packed record
  2895.     CtlType:    Longint;
  2896.     CtlID:      Longint;
  2897.     itemID:     Longint;
  2898.     itemWidth:  Longint;
  2899.     itemHeight: Longint;
  2900.     itemData:   Longint;
  2901.   end;
  2902.  
  2903. { DRAWITEMSTRUCT for ownerdraw }
  2904.  
  2905.   PDrawItemStruct = ^TDrawItemStruct;
  2906.   TDrawItemStruct = packed record
  2907.     CtlType:    Longint;
  2908.     CtlID:      Longint;
  2909.     itemID:     Longint;
  2910.     itemAction: Longint;
  2911.     itemState:  Longint;
  2912.     hwndItem:   hWnd;
  2913.     hDC:        HDC;
  2914.     rcItem:     TRect;
  2915.     itemData:   Longint;
  2916.   end;
  2917.  
  2918. { DELETEITEMSTRUCT for ownerdraw }
  2919.  
  2920.   PDeleteItemStruct = ^TDeleteItemStruct;
  2921.   TDeleteItemStruct = packed record
  2922.     CtlType:  Longint;
  2923.     CtlID:    Longint;
  2924.     itemID:   Longint;
  2925.     hwndItem: hWnd;
  2926.     itemData: Longint;
  2927.   end;
  2928.  
  2929. { COMPAREITEMSTUCT for ownerdraw sorting }
  2930.  
  2931.   PCompareItemStruct = ^TCompareItemStruct;
  2932.   TCompareItemStruct = packed record
  2933.     CtlType:   Longint;
  2934.     CtlID:     Longint;
  2935.     hwndItem:  hWnd;
  2936.     itemID1:   Longint;
  2937.     itemData1: Longint;
  2938.     itemID2:   Longint;
  2939.     itemData2: Longint;
  2940.   end;
  2941.  
  2942. { Registry Definitions }
  2943. const
  2944.   regh_Sysinfo                  = $FFFFFFFD;
  2945.   regh_WinOs2Ini                = $FFFFFFFE;
  2946.   regh_IniMapping               = $FFFFFFFF;
  2947.  
  2948.   key_Query_Value               = $0001;
  2949.   key_Set_Value                 = $0002;
  2950.   key_Create_Sub_Key            = $0004;
  2951.   key_Enumerate_Sub_Keys        = $0008;
  2952.   key_Notify                    = $0010;
  2953.   key_Create_Link               = $0020;
  2954.   reg_Option_Non_Volatile       = $00000000;
  2955.   reg_Option_Volatile           = $00000001;
  2956.   reg_Created_New_Key           = $00000001;
  2957.   reg_Opened_Existing_Key       = $00000002;
  2958.  
  2959.   key_Read                      = Read_Control or key_Query_Value or key_Enumerate_Sub_Keys or key_Notify;
  2960.   key_Write                     = Read_Control or key_Set_Value or key_Create_Sub_Key;
  2961.   key_Execute                   = key_Read;
  2962.  
  2963.   key_All_Access                = Standard_Rights_All or key_Query_Value or
  2964.                                 key_Set_Value or key_Create_Sub_Key or
  2965.                                 key_Enumerate_Sub_Keys or key_Notify or
  2966.                                 key_Create_Link;
  2967.   reg_None                      = 0;
  2968.   reg_Sz                        = 1;
  2969.   reg_Expand_Sz                 = 2;
  2970.   reg_Binary                    = 3;
  2971.   reg_DWord                     = 4;
  2972.   reg_DWord_Little_Endian       = 4;
  2973.   reg_DWord_Big_Endian          = 5;
  2974.   reg_Link                      = 6;
  2975.   reg_Multi_Sz                  = 7;
  2976.   reg_Resource_List             = 8;
  2977.  
  2978.   ewx_LogOff                    = 0;
  2979.   ewx_ShutDown                  = 1;
  2980.   ewx_Reboot                    = 2;
  2981.   ewx_Force                     = 4;
  2982.   ewx_PowerOff                  = 8;
  2983.  
  2984. type
  2985.   PABC = ^TABC;
  2986.   TABC = packed record
  2987.     abcA: Longint;
  2988.     abcB: Longint;
  2989.     abcC: Longint;
  2990.   end;
  2991.  
  2992.   PEnhMetaHeader = ^TEnhMetaHeader;
  2993.   TEnhMetaHeader = packed record
  2994.     iType:          Longint;
  2995.     nSize:          Longint;
  2996.     rclBounds:      TRect;
  2997.     rclFrame:       TRect;
  2998.     dSignature:     Longint;
  2999.     nVersion:       Longint;
  3000.     nBytes:         Longint;
  3001.     nRecords:       Longint;
  3002.     nHandles:       SmallWord;
  3003.     sReserved:      SmallWord;
  3004.     nDescription:   Longint;
  3005.     offDescription: Longint;
  3006.     nPalEntries:    Longint;
  3007.     szlDevice:      TSize;
  3008.     szlMillimeters: TSize;
  3009.   end;
  3010.  
  3011.   PKerningPair = ^TKerningPair;
  3012.   TKerningPair = packed record
  3013.     wFirst:      SmallWord;
  3014.     wSecond:     SmallWord;
  3015.     iKernAmount: Longint;
  3016.   end;
  3017.  
  3018.   PPanose = ^TPanose;
  3019.   TPanose = packed record
  3020.     bFamilyType:      Byte;
  3021.     bSerifStyle:      Byte;
  3022.     bWeight:          Byte;
  3023.     bProportion:      Byte;
  3024.     bContrast:        Byte;
  3025.     bStrokeVariation: Byte;
  3026.     bArmStyle:        Byte;
  3027.     bLetterform:      Byte;
  3028.     bMidline:         Byte;
  3029.     bXHeight:         Byte;
  3030.   end;
  3031.  
  3032.   POutlineTextmetric = ^TOutlineTextmetric;
  3033.   TOutlineTextmetric = record
  3034.     otmSize:                Longint;
  3035.     otmTextMetrics:         TTextMetric;
  3036.     otmFiller:              Byte;
  3037.     otmPanoseNumber:        TPanose;
  3038.     otmfsSelection:         Longint;
  3039.     otmfsType:              Longint;
  3040.     otmsCharSlopeRise:      Longint;
  3041.     otmsCharSlopeRun:       Longint;
  3042.     otmItalicAngle:         Longint;
  3043.     otmEMSquare:            Longint;
  3044.     otmAscent:              Longint;
  3045.     otmDescent:             Longint;
  3046.     otmLineGap:             Longint;
  3047.     otmsCapEmHeight:        Longint;
  3048.     otmsXHeight:            Longint;
  3049.     otmrcFontBox:           TRect;
  3050.     otmMacAscent:           Longint;
  3051.     otmMacDescent:          Longint;
  3052.     otmMacLineGap:          Longint;
  3053.     otmusMinimumPPEM:       Longint;
  3054.     otmptSubscriptSize:     TPoint;
  3055.     otmptSubscriptOffset:   TPoint;
  3056.     otmptSuperscriptSize:   TPoint;
  3057.     otmptSuperscriptOffset: TPoint;
  3058.     otmsStrikeoutSize:      Longint;
  3059.     otmsStrikeoutPosition:  Longint;
  3060.     otmsUnderscoreSize:     Longint;
  3061.     otmsUnderscorePosition: Longint;
  3062.     otmpFamilyName:         PChar;
  3063.     otmpFaceName:           PChar;
  3064.     otmpStyleName:          PChar;
  3065.     otmpFullName:           PChar;
  3066.   end;
  3067.  
  3068.   PRasterizerStatus = ^TRasterizerStatus;
  3069.   TRasterizerStatus = packed record
  3070.     nSize:       SmallInt;
  3071.     wFlags:      SmallInt;
  3072.     nLanguageID: SmallInt;
  3073.   end;
  3074.  
  3075. { bits defined in wFlags of RASTERIZER_STATUS }
  3076. const
  3077.   tt_Available                  = $0001;
  3078.   tt_Enabled                    = $0002;
  3079.  
  3080.   tt_Polygon_Type               = 24;
  3081.   tt_Prim_Line                  = 1;
  3082.   tt_Prim_QSpline               = 2;
  3083.  
  3084. type
  3085.   PPointfx = ^TPointfx;
  3086.   TPointfx = packed record
  3087.     x: TFixed;
  3088.     y: TFixed;
  3089.   end;
  3090.  
  3091.   PTTPolyCurve = ^TTTPolyCurve;
  3092.   TTTPolyCurve = packed record
  3093.     wType: SmallWord;
  3094.     cpfx:  SmallWord;
  3095.     apfx:  array[0..0] of TPointFX;
  3096.   end;
  3097.  
  3098.   PTTPolygonHeader = ^TTTPolygonHeader;
  3099.   TTTPolygonHeader = packed record
  3100.     cb: Longint;
  3101.     dwType: Longint;
  3102.     pfxStart: TPointFX;
  3103.   end;
  3104.  
  3105. const
  3106.   wpf_SetMinPosition            = $0001;
  3107.   wpf_RestoreToMaximized        = $0002;
  3108.  
  3109. type
  3110.   PWin32FindData = ^TWin32FindData;
  3111.   TWin32FindData = record
  3112.     dwFileAttributes:   Longint;
  3113.     ftCreationTime:     TFileTime;
  3114.     ftLastAccessTime:   TFileTime;
  3115.     ftLastWriteTime:    TFileTime;
  3116.     nFileSizeHigh:      Longint;
  3117.     nFileSizeLow:       Longint;
  3118.     dwReserved0:        Longint;
  3119.     dwReserved1:        Longint;
  3120.     cFileName:          array[0..Max_Path-1] of Char;
  3121.     cAlternateFileName: array[0..13] of Char;
  3122.   end;
  3123.  
  3124. { Menu item resource format }
  3125.  
  3126.   PMenuItemTemplateHeader = ^TMenuItemTemplateHeader;
  3127.   TMenuItemTemplateHeader = packed record
  3128.     versionNumber: SmallWord;
  3129.     offset:        SmallWord;
  3130.   end;
  3131.  
  3132.   PMenuItemTemplate = ^TMenuItemTemplate;
  3133.   TMenuItemTemplate = packed record
  3134.     mtOption: SmallWord;
  3135.     mtID:     SmallWord;
  3136.     mtString: array[0..0] of WChar;
  3137.   end;
  3138.  
  3139. const
  3140.   startf_UseShowWindow          = $00000001;
  3141.   startf_UsePosition            = $00000002;
  3142.   startf_UseSize                = $00000004;
  3143.  
  3144. type
  3145.   PStartupInfo = ^TStartupInfo;
  3146.   TStartupInfo = record
  3147.     cb:              Longint;
  3148.     lpReserved:      PChar;
  3149.     lpDesktop:       PChar;
  3150.     lpTitle:         PChar;
  3151.     dwX:             Longint;
  3152.     dwY:             Longint;
  3153.     dwXSize:         Longint;
  3154.     dwYSize:         Longint;
  3155.     dwXCountChars:   Longint;
  3156.     dwYCountChars:   Longint;
  3157.     dwFillAttribute: Longint;
  3158.     dwFlags:         Longint;
  3159.     wShowWindow:     SmallWord;
  3160.     cbReserved2:     SmallWord;
  3161.     lpReserved2:     PByte;
  3162.     hStdInput:       THandle;
  3163.     hStdOutput:      THandle;
  3164.     hStdError:       THandle;
  3165.   end;
  3166.  
  3167.   PProcessInformation = ^TProcessInformation;
  3168.   TProcessInformation = record
  3169.     hProcess:    THandle;
  3170.     hThread:     THandle;
  3171.     dwProcessId: Longint;
  3172.     dwThreadId:  Longint;
  3173.   end;
  3174.  
  3175.   PListEntry = ^TListEntry;
  3176.   TListEntry = record
  3177.     Flink: PListEntry;
  3178.     Blink: PListEntry;
  3179.   end;
  3180.  
  3181.   PRTLCriticalSection = ^TRTLCriticalSection;
  3182.   PRTLCriticalSectionDebug = ^TRTLCriticalSectionDebug;
  3183.   TRTLCriticalSectionDebug = record
  3184.     _Type:                 SmallWord;
  3185.     CreatorBackTraceIndex: SmallWord;
  3186.     CriticalSection:       PRTLCriticalSection;
  3187.     ProcessLocksList:      TListEntry;
  3188.     EntryCount:            DWord;
  3189.     ContentionCount:       DWord;
  3190.     Spare: array [0..1] of DWord;
  3191.   end;
  3192.  
  3193.   TRTLCriticalSection = record
  3194. {$IFDEF Open32}
  3195.     ulReserved: array[0..7] of Longint;
  3196. {$ELSE}
  3197.     DebugInfo:      PRTLCriticalSectionDebug;
  3198.     LockCount:      Longint;
  3199.     RecursionCount: Longint;
  3200.     OwningThread:   THandle;
  3201.     LockSemaphore:  THandle;
  3202.     Reserved:       DWord;
  3203. {$ENDIF Open32}
  3204.   end;
  3205.  
  3206.   PByHandleFileInformation = ^TByHandleFileInformation;
  3207.   TByHandleFileInformation = record
  3208.     dwFileAttributes:     Longint;
  3209.     ftCreationTime:       TFileTime;
  3210.     ftLastAccessTime:     TFileTime;
  3211.     ftLastWriteTime:      TFileTime;
  3212.     dwVolumeSerialNumber: Longint;
  3213.     nFileSizeHigh:        Longint;
  3214.     nFileSizeLow:         Longint;
  3215.     nNumberOfLinks:       Longint;
  3216.     nFileIndexHigh:       Longint;
  3217.     nFileIndexLow:        Longint;
  3218.   end;
  3219.  
  3220.   PAccel = ^TAccel;
  3221.   TAccel = packed record
  3222.     fVirt: Byte;
  3223.     key:   SmallWord;
  3224.     cmd:   SmallWord;
  3225.   end;
  3226.  
  3227.   PEMR = ^TEMR;
  3228.   TEMR = packed record
  3229.     iType: Longint;
  3230.     nSize: Longint;
  3231.   end;
  3232.  
  3233.   PEMRText = ^TEMRText;
  3234.   TEMRText = packed record
  3235.     ptlReference: TPoint;
  3236.     nChars:       Longint;
  3237.     offString:    Longint;
  3238.     fOptions:     Longint;
  3239.     rcl:          TRect;
  3240.     offDx:        Longint;
  3241.   end;
  3242.  
  3243.   PAbortPath = ^TAbortPath;
  3244.   TAbortPath = packed record
  3245.     emr: TEMR;
  3246.   end;
  3247.  
  3248.   PEMRSelectclippath = ^TEMRSelectClipPath;
  3249.   TEMRSelectClipPath = packed record
  3250.     emr: TEMR;
  3251.     iMode: Longint;
  3252.   end;
  3253.  
  3254.   PEMRSetMiterLimit = ^TEMRSetMiterLimit;
  3255.   TEMRSetMiterLimit = packed record
  3256.     emr:         TEMR;
  3257.     eMiterLimit: Single;
  3258.   end;
  3259.  
  3260.   PEMRRestoreDC = ^TEMRRestoreDC;
  3261.   TEMRRestoreDC = packed record
  3262.     emr:       TEMR;
  3263.     iRelative: Longint;
  3264.   end;
  3265.  
  3266.   PEMRSetArcDirection = ^TEMRSetArcDirection;
  3267.   TEMRSetArcDirection = packed record
  3268.     emr:           TEMR;
  3269.     iArcDirection: Longint;
  3270.   end;
  3271.  
  3272.   PEMRSetMapperFlags = ^TEMRSetMapperFlags;
  3273.   TEMRSetMapperFlags = packed record
  3274.     emr:     TEMR;
  3275.     dwFlags: Longint;
  3276.   end;
  3277.  
  3278.   PEMRSetTextColor = ^TEMRSetTextColor;
  3279.   TEMRSetTextColor = packed record
  3280.     emr:     TEMR;
  3281.     crColor: TColorRef;
  3282.   end;
  3283.   TEMRSetBkColor = TEMRSetTextColor;
  3284.   PEMRSetBkColor = PEMRSetTextColor;
  3285.  
  3286.   PEMRSelectObject = ^TEMRSelectObject;
  3287.   TEMRSelectObject = packed record
  3288.     emr:      TEMR;
  3289.     ihObject: Longint;
  3290.   end;
  3291.   EMRDeleteObject = TEMRSelectObject;
  3292.   PEMRDeleteObject = PEMRSelectObject;
  3293.  
  3294.   PEMRSelectColorSpace = ^TEMRSelectColorSpace;
  3295.   TEMRSelectColorSpace = packed record
  3296.     emr:  TEMR;
  3297.     ihCS: Longint;
  3298.   end;
  3299.   EMRDeleteColorSpace = TEMRSelectColorSpace;
  3300.   PEMRDeleteColorSpace = PEMRSelectColorSpace;
  3301.  
  3302.   PEMRSelectPalette = ^TEMRSelectPalette;
  3303.   TEMRSelectPalette = packed record
  3304.     emr:   TEMR;
  3305.     ihPal: Longint;
  3306.   end;
  3307.  
  3308.   PEMRResizePalette = ^TEMRResizePalette;
  3309.   TEMRResizePalette = packed record
  3310.     emr:      TEMR;
  3311.     ihPal:    Longint;
  3312.     cEntries: Longint;
  3313.   end;
  3314.  
  3315.   PEMRSetPaletteEntries = ^TEMRSetPaletteEntries;
  3316.   TEMRSetPaletteEntries = packed record
  3317.     emr:         TEMR;
  3318.     ihPal:       Longint;
  3319.     iStart:      Longint;
  3320.     cEntries:    Longint;
  3321.     aPalEntries: array[0..0] of TPaletteEntry;
  3322.   end;
  3323.  
  3324.   PColorAdjustment = ^TColorAdjustment;
  3325.   TColorAdjustment = packed record
  3326.     caSize:            SmallWord;
  3327.     caFlags:           SmallWord;
  3328.     caIlluminantIndex: SmallWord;
  3329.     caRedGamma:        SmallWord;
  3330.     caGreenGamma:      SmallWord;
  3331.     caBlueGamma:       SmallWord;
  3332.     caReferenceBlack:  SmallWord;
  3333.     caReferenceWhite:  SmallWord;
  3334.     caContrast:        SmallInt;
  3335.     caBrightness:      SmallInt;
  3336.     caColorfulness:    SmallInt;
  3337.     caRedGreenTint:    SmallInt;
  3338.   end;
  3339.  
  3340.   PEMRSetColorAdjustment = ^TEMRSetColorAdjustment;
  3341.   TEMRSetColorAdjustment = packed record
  3342.     emr:             TEMR;
  3343.     ColorAdjustment: TColorAdjustment;
  3344.   end;
  3345.  
  3346.   PEMRGDIComment = ^TEMRGDIComment;
  3347.   TEMRGDIComment = record
  3348.     emr:    TEMR;
  3349.     cbData: Longint;
  3350.     Data:   array[0..0] of Byte;
  3351.   end;
  3352.  
  3353.   PEMREOF = ^TEMREOF;
  3354.   TEMREOF = packed record
  3355.     emr:           TEMR;
  3356.     nPalEntries:   Longint;
  3357.     offPalEntries: Longint;
  3358.     nSizeLast:     Longint;
  3359.   end;
  3360.  
  3361.   PEMRLineTo = ^TEMRLineTo;
  3362.   TEMRLineTo = packed record
  3363.     emr: TEMR;
  3364.     ptl: TPoint;
  3365.   end;
  3366.   EMRMoveToEx = TEMRLineTo;
  3367.   PEMRMoveToEx = PEMRLineTo;
  3368.  
  3369.   PEMROffsetClipRgn = ^TEMROffsetClipRgn;
  3370.   TEMROffsetClipRgn = packed record
  3371.     emr:       TEMR;
  3372.     ptlOffset: TPoint;
  3373.   end;
  3374.  
  3375.   PEMRFillPath = ^TEMRFillPath;
  3376.   TEMRFillPath = packed record
  3377.     emr:       TEMR;
  3378.     rclBounds: TRect;
  3379.   end;
  3380.   EMRStrokeAndFillPath = TEMRFillPath;
  3381.   PEMRStrokeAndFillPath = PEMRFillPath;
  3382.   EMRStrokePath = TEMRFillPath;
  3383.   PEMRStrokePath = PEMRFillPath;
  3384.  
  3385.   PEMRExcludeClipRect = ^TEMRExcludeClipRect;
  3386.   TEMRExcludeClipRect = packed record
  3387.     emr:     TEMR;
  3388.     rclClip: TRect;
  3389.   end;
  3390.   EMRIntersectClipRect = TEMRExcludeClipRect;
  3391.   PEMRIntersectClipRect = PEMRExcludeClipRect;
  3392.  
  3393.   PEMRSetViewportOrgEx = ^TEMRSetViewportOrgEx;
  3394.   TEMRSetViewportOrgEx = packed record
  3395.     emr:       TEMR;
  3396.     ptlOrigin: TPoint;
  3397.   end;
  3398.   EMRSetWindowOrgEx = TEMRSetViewportOrgEx;
  3399.   PEMRSetWindowOrgEx = PEMRSetViewportOrgEx;
  3400.   EMRSetBrushOrgEx = TEMRSetViewportOrgEx;
  3401.   PEMRSetBrushOrgEx = PEMRSetViewportOrgEx;
  3402.  
  3403.   PEMRSetViewportExtEx = ^TEMRSetViewportExtEx;
  3404.   TEMRSetViewportExtEx = packed record
  3405.     emr:       TEMR;
  3406.     szlExtent: TSize;
  3407.   end;
  3408.   EMRSetWindowExtEx = TEMRSetViewportExtEx;
  3409.   PEMRSetWindowExtEx = PEMRSetViewportExtEx;
  3410.  
  3411.   PEMRScaleViewportExtEx = ^TEMRScaleViewportExtEx;
  3412.   TEMRScaleViewportExtEx = packed record
  3413.     emr:    TEMR;
  3414.     xNum:   Longint;
  3415.     xDenom: Longint;
  3416.     yNum:   Longint;
  3417.     yDenom: Longint;
  3418.   end;
  3419.   EMRScaleWindowExtEx = TEMRScaleViewportExtEx;
  3420.   PEMRScaleWindowExtEx = PEMRScaleViewportExtEx;
  3421.  
  3422.   PEMRSetWorldTransform = ^TEMRSetWorldTransform;
  3423.   TEMRSetWorldTransform = packed record
  3424.     emr:   TEMR;
  3425.     xform: TXForm;
  3426.   end;
  3427.  
  3428.   PEMRModifyWorldTransform = ^TEMRModifyWorldTransform;
  3429.   TEMRModifyWorldTransform = packed record
  3430.     emr:   TEMR;
  3431.     xform: TXForm;
  3432.     iMode: Longint;
  3433.   end;
  3434.  
  3435.   PEMRSetPixelV = ^TEMRSetPixelV;
  3436.   TEMRSetPixelV = packed record
  3437.     emr:      TEMR;
  3438.     ptlPixel: TPoint;
  3439.     crColor:  TColorRef;
  3440.   end;
  3441.  
  3442.   PEMRExtFloodFill = ^TEMRExtFloodFill;
  3443.   TEMRExtFloodFill = packed record
  3444.     emr:      TEMR;
  3445.     ptlStart: TPoint;
  3446.     crColor:  TColorRef;
  3447.     iMode:    Longint;
  3448.   end;
  3449.  
  3450.  
  3451.   PEMREllipse = ^TEMREllipse;
  3452.   TEMREllipse = packed record
  3453.     emr:    TEMR;
  3454.     rclBox: TRect;
  3455.   end;
  3456.  
  3457.   PEMRRoundRect = ^TEMRRoundRect;
  3458.   TEMRRoundRect = packed record
  3459.     emr:       TEMR;
  3460.     rclBox:    TRect;
  3461.     szlCorner: TSize;
  3462.   end;
  3463.  
  3464.   PEMRArc = ^TEMRArc;
  3465.   TEMRArc = packed record
  3466.     emr:      TEMR;
  3467.     rclBox:   TRect;
  3468.     ptlStart: TPoint;
  3469.     ptlEnd:   TPoint;
  3470.   end;
  3471.  
  3472.   PEMRAngleArc = ^TEMRAngleArc;
  3473.   TEMRAngleArc = packed record
  3474.     emr:         TEMR;
  3475.     ptlCenter:   TPoint;
  3476.     nRadius:     Longint;
  3477.     eStartAngle: Single;
  3478.     eSweepAngle: Single;
  3479.   end;
  3480.  
  3481.   PEMRPolyline = ^TEMRPolyline;
  3482.   TEMRPolyline = packed record
  3483.     emr: TEMR;
  3484.     rclBounds: TRect;
  3485.     cptl:      Longint;
  3486.     aptl:      array[0..0] of TPoint;
  3487.   end;
  3488.   EMRPolyBezier = TEMRPolyLine;
  3489.   PEMRPolyBezier = PEMRPolyLine;
  3490.   EMRPolyGON = TEMRPolyLine;
  3491.   PEMRPolyGON = PEMRPolyLine;
  3492.   EMRPolyBezierTo = TEMRPolyLine;
  3493.   PEMRPolyBezierTo = PEMRPolyLine;
  3494.   EMRPolyLineTo = TEMRPolyLine;
  3495.   PEMRPolyLineTo = PEMRPolyLine;
  3496.  
  3497.   PEMRPolyline16 = ^TEMRPolyline16;
  3498.   TEMRPolyline16 = packed record
  3499.     emr: TEMR;
  3500.     rclBounds: TRect;
  3501.     cpts:      Longint;
  3502.     apts:      array[0..0] of TPoint;
  3503.   end;
  3504.   EMRPolyBezier16 = TEMRPolyLine16;
  3505.   PEMRPolyBezier16 = PEMRPolyLine16;
  3506.   EMRPolygon16 = TEMRPolyLine16;
  3507.   PEMRPolygon16 = PEMRPolyLine16;
  3508.   EMRPolyBezierTo16 = TEMRPolyLine16;
  3509.   PEMRPolyBezierTo16 = PEMRPolyLine16;
  3510.   EMRPolyLineTo16 = TEMRPolyLine16;
  3511.   PEMRPolyLineTo16 = PEMRPolyLine16;
  3512.  
  3513.   PEMRPolyDraw = ^TEMRPolyDraw;
  3514.   TEMRPolyDraw = record
  3515.     emr:       TEMR;
  3516.     rclBounds: TRect;
  3517.     cptl:      Longint;
  3518.     aptl:      array[0..0] of TPoint;
  3519.     abTypes:   array[0..0] of Byte;
  3520.   end;
  3521.  
  3522.   PEMRPolyDraw16 = ^TEMRPolyDraw16;
  3523.   TEMRPolyDraw16 = record
  3524.     emr:        TEMR;
  3525.     rclBounds:  TRect;
  3526.     cpts:       Longint;
  3527.     apts:       array[0..0] of TPoint;
  3528.     abTypes:    array[0..0] of Byte;
  3529.   end;
  3530.  
  3531.   PEMRPolyPolyline = ^TEMRPolyPolyline;
  3532.   TEMRPolyPolyline = packed record
  3533.     emr:         TEMR;
  3534.     rclBounds:   TRect;
  3535.     nPolys:      Longint;
  3536.     cptl:        Longint;
  3537.     aPolyCounts: array[0..0] of Longint;
  3538.     aptl:        array[0..0] of TPoint;
  3539.   end;
  3540.   EMRPolyPolygon = TEMRPolyPolyline;
  3541.   PEMRPolyPolygon = PEMRPolyPolyline;
  3542.  
  3543.   PEMRPolyPolyline16 = ^TEMRPolyPolyline16;
  3544.   TEMRPolyPolyline16 = packed record
  3545.     emr:         TEMR;
  3546.     rclBounds:   TRect;
  3547.     nPolys:      Longint;
  3548.     cpts:        Longint;
  3549.     aPolyCounts: array[0..0] of Longint;
  3550.     apts:        array[0..0] of TPoint;
  3551.   end;
  3552.   EMRPolyPolygon16 = TEMRPolyPolyline16;
  3553.   PEMRPolyPolygon16 = PEMRPolyPolyline16;
  3554.  
  3555.   PEMRInvertRgn = ^TEMRInvertRgn;
  3556.   TEMRInvertRgn = record
  3557.     emr:       TEMR;
  3558.     rclBounds: TRect;
  3559.     cbRgnData: Longint;
  3560.     RgnData:   array[0..0] of Byte;
  3561.   end;
  3562.   EMRPaintRgn = TEMRInvertRgn;
  3563.   PEMRPaintRgn = PEMRInvertRgn;
  3564.  
  3565.   PEMRFillRgn = ^TEMRFillRgn;
  3566.   TEMRFillRgn = record
  3567.     emr:       TEMR;
  3568.     rclBounds: TRect;
  3569.     cbRgnData: Longint;
  3570.     ihBrush:   Longint;
  3571.     RgnData:   array[0..0] of Byte;
  3572.   end;
  3573.  
  3574.   PEMRFrameRgn = ^TEMRFrameRgn;
  3575.   TEMRFrameRgn = record
  3576.     emr:       TEMR;
  3577.     rclBounds: TRect;
  3578.     cbRgnData: Longint;
  3579.     ihBrush:   Longint;
  3580.     szlStroke: TSize;
  3581.     RgnData:   array[0..0] of Byte;
  3582.   end;
  3583.  
  3584.  
  3585.   PEMRExtSelectClipRgn = ^TEMRExtSelectClipRgn;
  3586.   TEMRExtSelectClipRgn = record
  3587.     emr:       TEMR;
  3588.     cbRgnData: Longint;
  3589.     iMode:     Longint;
  3590.     RgnData:   array[0..0] of Byte;
  3591.   end;
  3592.  
  3593.   PEMRExtTextOut = ^TEMRExtTextOut;
  3594.   TEMRExtTextOut = packed record
  3595.     emr: TEMR;
  3596.     rclBounds:     TRect;
  3597.     iGraphicsMode: Longint;
  3598.     exScale:       Single;
  3599.     eyScale:       Single;
  3600.     emrtext:       TEMRText;
  3601.   end;
  3602.  
  3603.   PEMRPolyTextOut = ^TEMRPolyTextOut;
  3604.   TEMRPolyTextOut = packed record
  3605.     emr:           TEMR;
  3606.     rclBounds:     TRect;
  3607.     iGraphicsMode: Longint;
  3608.     exScale:       Single;
  3609.     eyScale:       Single;
  3610.     cStrings:      Longint;
  3611.     aemrtext:      array[0..0] of TEMRText;
  3612.   end;
  3613.  
  3614.   PEMRBitBlt = ^TEMRBitBlt;
  3615.   TEMRBitBlt = packed record
  3616.     emr:          TEMR;
  3617.     rclBounds:    TRect;
  3618.     xDest:        Longint;
  3619.     yDest:        Longint;
  3620.     cxDest:       Longint;
  3621.     cyDest:       Longint;
  3622.     dwRop:        Longint;
  3623.     xSrc:         Longint;
  3624.     ySrc:         Longint;
  3625.     xformSrc:     TXForm;
  3626.     crBkColorSrc: TColorRef;
  3627.     iUsageSrc:    Longint;
  3628.     offBmiSrc:    Longint;
  3629.     cbBmiSrc:     Longint;
  3630.     offBitsSrc:   Longint;
  3631.     cbBitsSrc:    Longint;
  3632.   end;
  3633.  
  3634.   PEMRStretchBlt = ^TEMRStretchBlt;
  3635.   TEMRStretchBlt = packed record
  3636.     emr:          TEMR;
  3637.     rclBounds:    TRect;
  3638.     xDest:        Longint;
  3639.     yDest:        Longint;
  3640.     cxDest:       Longint;
  3641.     cyDest:       Longint;
  3642.     dwRop:        Longint;
  3643.     xSrc:         Longint;
  3644.     ySrc:         Longint;
  3645.     xformSrc:     TXForm;
  3646.     crBkColorSrc: TColorRef;
  3647.     iUsageSrc:    Longint;
  3648.     offBmiSrc:    Longint;
  3649.     cbBmiSrc:     Longint;
  3650.     offBitsSrc:   Longint;
  3651.     cbBitsSrc:    Longint;
  3652.     cxSrc:        Longint;
  3653.     cySrc:        Longint;
  3654.   end;
  3655.  
  3656.   PEMRMaskBlt = ^TEMRMaskBlt;
  3657.   TEMRMaskBlt = packed record
  3658.     emr:          TEMR;
  3659.     rclBounds:    TRect;
  3660.     xDest:        Longint;
  3661.     yDest:        Longint;
  3662.     cxDest:       Longint;
  3663.     cyDest:       Longint;
  3664.     dwRop:        Longint;
  3665.     xSrc:         Longint;
  3666.     ySrc:         Longint;
  3667.     xformSrc:     TXForm;
  3668.     crBkColorSrc: TColorRef;
  3669.     iUsageSrc:    Longint;
  3670.     offBmiSrc:    Longint;
  3671.     cbBmiSrc:     Longint;
  3672.     offBitsSrc:   Longint;
  3673.     cbBitsSrc:    Longint;
  3674.     xMask:        Longint;
  3675.     yMask:        Longint;
  3676.     iUsageMask:   Longint;
  3677.     offBmiMask:   Longint;
  3678.     cbBmiMask:    Longint;
  3679.     offBitsMask:  Longint;
  3680.     cbBitsMask:   Longint;
  3681.   end;
  3682.  
  3683.   PEMRPLGBlt = ^TEMRPLGBlt;
  3684.   TEMRPLGBlt = packed record
  3685.     emr:          TEMR;
  3686.     rclBounds:    TRect;
  3687.     aptlDest:     array[0..2] of TPoint;
  3688.     xSrc:         Longint;
  3689.     ySrc:         Longint;
  3690.     cxSrc:        Longint;
  3691.     cySrc:        Longint;
  3692.     xformSrc:     TXForm;
  3693.     crBkColorSrc: TColorRef;
  3694.     iUsageSrc:    Longint;
  3695.     offBmiSrc:    Longint;
  3696.     cbBmiSrc:     Longint;
  3697.     offBitsSrc:   Longint;
  3698.     cbBitsSrc:    Longint;
  3699.     xMask:        Longint;
  3700.     yMask:        Longint;
  3701.     iUsageMask:   Longint;
  3702.     offBmiMask:   Longint;
  3703.     cbBmiMask:    Longint;
  3704.     offBitsMask:  Longint;
  3705.     cbBitsMask:   Longint;
  3706.   end;
  3707.  
  3708.   PEMRSetDIBitsToDevice = ^TEMRSetDIBitsToDevice;
  3709.   TEMRSetDIBitsToDevice = packed record
  3710.     emr:        TEMR;
  3711.     rclBounds:  TRect;
  3712.     xDest:      Longint;
  3713.     yDest:      Longint;
  3714.     xSrc:       Longint;
  3715.     ySrc:       Longint;
  3716.     cxSrc:      Longint;
  3717.     cySrc:      Longint;
  3718.     offBmiSrc:  Longint;
  3719.     cbBmiSrc:   Longint;
  3720.     offBitsSrc: Longint;
  3721.     cbBitsSrc:  Longint;
  3722.     iUsageSrc:  Longint;
  3723.     iStartScan: Longint;
  3724.     cScans:     Longint;
  3725.   end;
  3726.  
  3727.   PEMRStretchDIBits = ^TEMRStretchDIBits;
  3728.   TEMRStretchDIBits = packed record
  3729.     emr:        TEMR;
  3730.     rclBounds:  TRect;
  3731.     xDest:      Longint;
  3732.     yDest:      Longint;
  3733.     xSrc:       Longint;
  3734.     ySrc:       Longint;
  3735.     cxSrc:      Longint;
  3736.     cySrc:      Longint;
  3737.     offBmiSrc:  Longint;
  3738.     cbBmiSrc:   Longint;
  3739.     offBitsSrc: Longint;
  3740.     cbBitsSrc:  Longint;
  3741.     iUsageSrc:  Longint;
  3742.     dwRop:      Longint;
  3743.     cxDest:     Longint;
  3744.     cyDest:     Longint;
  3745.   end;
  3746.  
  3747.   PEMRCreatePalette = ^TEMRCreatePalette;
  3748.   TEMRCreatePalette = packed record
  3749.     emr:   TEMR;
  3750.     ihPal: Longint;
  3751.     lgpl:  TLogPalette;
  3752.   end;
  3753.  
  3754.   PEMRCreatePen = ^TEMRCreatePen;
  3755.   TEMRCreatePen = packed record
  3756.     emr:   TEMR;
  3757.     ihPen: Longint;
  3758.     lopn:  TLogPen;
  3759.   end;
  3760.  
  3761.  
  3762.   PEMRExtCreatePen = ^TEMRExtCreatePen;
  3763.   TEMRExtCreatePen = packed record
  3764.     emr:     TEMR;
  3765.     ihPen:   Longint;
  3766.     offBmi:  Longint;
  3767.     cbBmi:   Longint;
  3768.     offBits: Longint;
  3769.     cbBits:  Longint;
  3770.     elp:     TExtLogPen;
  3771.   end;
  3772.  
  3773.   PEMRCreateBrushIndirect = ^TEMRCreateBrushIndirect;
  3774.   TEMRCreateBrushIndirect = packed record
  3775.     emr:     TEMR;
  3776.     ihBrush: Longint;
  3777.     lb:      TLogBrush;
  3778.   end;
  3779.  
  3780.   PEMRCreateMonoBrush = ^TEMRCreateMonoBrush;
  3781.   TEMRCreateMonoBrush = packed record
  3782.     emr:     TEMR;
  3783.     ihBrush: Longint;
  3784.     iUsage:  Longint;
  3785.     offBmi:  Longint;
  3786.     cbBmi:   Longint;
  3787.     offBits: Longint;
  3788.     cbBits:  Longint;
  3789.   end;
  3790.  
  3791.   PEMRCreateDIBPatternBrushPt = ^TEMRCreateDIBPatternBrushPt;
  3792.   TEMRCreateDIBPatternBrushPt = packed record
  3793.     emr:     TEMR;
  3794.     ihBrush: Longint;
  3795.     iUsage:  Longint;
  3796.     offBmi:  Longint;
  3797.     cbBmi:   Longint;
  3798.     offBits: Longint;
  3799.     cbBits:  Longint;
  3800.   end;
  3801.  
  3802.   PEMRFormat = ^TEMRFormat;
  3803.   TEMRFormat = packed record
  3804.     dSignature: Longint;
  3805.     nVersion:   Longint;
  3806.     cbData:     Longint;
  3807.     offData:    Longint;
  3808.   end;
  3809.  
  3810. const
  3811.   gdiComment_Identifier         = $43494447;
  3812.   gdiComment_Windows_Metafile   = $80000001;
  3813.   gdiComment_BeginGroup         = $00000002;
  3814.   gdiComment_EndGroup           = $00000003;
  3815.   gdiComment_MultiFormats       = $40000004;
  3816.   eps_Signature                 = $46535045;
  3817.  
  3818. type
  3819.   PEnhMetaRecord = ^TEnhMetaRecord;
  3820.   TEnhMetaRecord = packed record
  3821.     iType: Longint;
  3822.     nSize: Longint;
  3823.     dParm: array[0..0] of Longint;
  3824.   end;
  3825.  
  3826.   TFontEnumProc  = function(Font: PLogFont; TextMetric: PTextMetric; dwType: DWord; Data: lParam): Integer;
  3827.   TMFEnumProc    = function(DC: HDC; Table: PHandleTable; MR: PMetaRecord; P4: Longint; Data: lParam): Integer;
  3828.   TEnhMfEnumProc = function(DC: HDC; Table: PHandleTable; EMR: PEnhMetaRecord; P4: Longint; Data: lParam): Integer;
  3829.  
  3830. const
  3831.   rdh_Rectangles                = 1;
  3832.  
  3833. type
  3834.   PRgnDataHeader = ^TRgnDataHeader;
  3835.   TRgnDataHeader = packed record
  3836.     dwSize:   Longint;
  3837.     iType:    Longint;
  3838.     nCount:   Longint;
  3839.     nRgnSize: Longint;
  3840.     rcBound:  TRect;
  3841.   end;
  3842.  
  3843.   PRgnData = ^TRgnData;
  3844.   TRgnData = record
  3845.     rdh:    TRgnDataHeader;
  3846.     Buffer: array[0..0] of Char;
  3847.   end;
  3848.  
  3849.   PIconInfo = ^TIconInfo;
  3850.   TIconInfo = packed record
  3851.     fIcon:    Bool;
  3852.     xHotspot: Longint;
  3853.     yHotspot: Longint;
  3854.     hbmMask:  HBitmap;
  3855.     hbmColor: HBitmap;
  3856.   end;
  3857.  
  3858. { Arc direction }
  3859. const
  3860.   ad_CounterClockwise           = 1;
  3861.   ad_Clockwise                  = 2;
  3862.  
  3863. { Types for wType field in MMTIME struct }
  3864.  
  3865.   time_Ms                       = $0001;
  3866.   time_Samples                  = $0002;
  3867.   time_Bytes                    = $0004;
  3868.   time_Smpte                    = $0008;
  3869.   time_Midi                     = $0010;
  3870.   time_Ticks                    = $0020;
  3871.  
  3872. type
  3873.   PTimeZoneInformation = ^TTimeZoneInformation;
  3874.   TTimeZoneInformation = record
  3875.     Bias:         Longint;
  3876.     StandardName: array[0..31] of WChar;
  3877.     StandardDate: TSystemTime;
  3878.     StandardBias: Longint;
  3879.     DaylightName: array[0..31] of WChar;
  3880.     DaylightDate: TSystemTime;
  3881.     DaylightBias: Longint;
  3882.   end;
  3883.  
  3884. const
  3885.   time_Zone_Id_Unknown          = 0;
  3886.   time_Zone_Id_Standard         = 1;
  3887.   time_Zone_Id_Daylight         = 2;
  3888.  
  3889.   hInstance_Error               = 32;
  3890.  
  3891. { LoadModule structure }
  3892. type
  3893.   PLoadParms32 = ^TLoadParms32;
  3894.   TLoadParms32 = record
  3895.     lpEnvAddress: PChar;
  3896.     lpCmdLine:    PChar;
  3897.     lpCmdShow:    PChar;
  3898.     dwReserved:   Longint;
  3899.   end;
  3900.  
  3901. { DC Graphics Mode }
  3902. const
  3903.   gm_Compatible                 = 1;
  3904.   gm_Advanced                   = 2;
  3905.  
  3906.   dcx_Window                    = $00000001;
  3907.   dcx_Cache                     = $00000002;
  3908.   dcx_NoResetAttrs              = $00000004;
  3909.   dcx_ClipChildren              = $00000008;
  3910.   dcx_ClipSiblings              = $00000010;
  3911.   dcx_ParentClip                = $00000020;
  3912.   dcx_ExcludeRgn                = $00000040;
  3913.   dcx_IntersectRgn              = $00000080;
  3914.   dcx_ExcludeUpdate             = $00000100;
  3915.   dcx_IntersectUpdate           = $00000200;
  3916.   dcx_LockWindowUpdate          = $00000400;
  3917.   dcx_Validate                  = $00200000;
  3918.  
  3919. { Defines for the fVirt field of the Accelerator table structure (ACCEL). }
  3920.  
  3921.   fVirtKey                      = $01;
  3922.   fNoInvert                     = $02;
  3923.   fShift                        = $04;
  3924.   fControl                      = $08;
  3925.   fAlt                          = $10;
  3926.  
  3927.  
  3928. { Default codepage }
  3929.  
  3930.   cp_WinAnsi                    = 1004;
  3931.  
  3932.   sc_Size                       = $F000;
  3933.   sc_Move                       = $F010;
  3934.   sc_Minimize                   = $F020;
  3935.   sc_Maximize                   = $F030;
  3936.   sc_NextWindow                 = $F040;
  3937.   sc_PrevWindow                 = $F050;
  3938.   sc_Close                      = $F060;
  3939.   sc_VScroll                    = $F070;
  3940.   sc_HScroll                    = $F080;
  3941.   sc_MouseMenu                  = $F090;
  3942.   sc_KeyMenu                    = $F100;
  3943.   sc_Arrange                    = $F110;
  3944.   sc_Restore                    = $F120;
  3945.   sc_TaskList                   = $F130;
  3946.   sc_ScreenSave                 = $F140;
  3947.   sc_HotKey                     = $F150;
  3948.   sc_Icon                       = sc_Minimize;
  3949.   sc_Zoom                       = sc_Maximize;
  3950.  
  3951.   meta_SetBkColor               = $0201;
  3952.   meta_SetBkMode                = $0102;
  3953.   meta_SetMapMode               = $0103;
  3954.   meta_SetRop2                  = $0104;
  3955.   meta_SetRelAbs                = $0105;
  3956.   meta_SetPolyFillMode          = $0106;
  3957.   meta_SetStretchBltMode        = $0107;
  3958.   meta_SetTextCharExtra         = $0108;
  3959.   meta_SetTextColor             = $0209;
  3960.   meta_SetTextJustification     = $020A;
  3961.   meta_SetWindowOrg             = $020B;
  3962.   meta_SetWindowExt             = $020C;
  3963.   meta_SetViewportOrg           = $020D;
  3964.   meta_SetViewporText           = $020E;
  3965.   meta_OffsetWindowOrg          = $020F;
  3966.   meta_ScaleWindowExt           = $0410;
  3967.   meta_OffsetViewPortOrg        = $0211;
  3968.   meta_ScaleViewPortExt         = $0412;
  3969.   meta_LineTo                   = $0213;
  3970.   meta_MoveTo                   = $0214;
  3971.   meta_ExcludeClipRect          = $0415;
  3972.   meta_IntersectClipRect        = $0416;
  3973.   meta_Arc                      = $0817;
  3974.   meta_Ellipse                  = $0418;
  3975.   meta_FloodFill                = $0419;
  3976.   meta_Pie                      = $081A;
  3977.   meta_Rectangle                = $041B;
  3978.   meta_RoundRect                = $061C;
  3979.   meta_PatBlt                   = $061D;
  3980.   meta_SaveDC                   = $001E;
  3981.   meta_SetPixel                 = $041F;
  3982.   meta_OffsetClipRgn            = $0220;
  3983.   meta_TextOut                  = $0521;
  3984.   meta_BitBlt                   = $0922;
  3985.   meta_StretchBlt               = $0B23;
  3986.   meta_Polygon                  = $0324;
  3987.   meta_PolyLine                 = $0325;
  3988.   meta_Escape                   = $0626;
  3989.   meta_RestoreDC                = $0127;
  3990.   meta_FillRegion               = $0228;
  3991.   meta_FrameRegion              = $0429;
  3992.   meta_InvertRegion             = $012A;
  3993.   meta_PaintRegion              = $012B;
  3994.   meta_SelectClipRegion         = $012C;
  3995.   meta_SelectObject             = $012D;
  3996.   meta_SetTextAlign             = $012E;
  3997.   meta_Chord                    = $0830;
  3998.   meta_SetMapperFlags           = $0231;
  3999.   meta_ExtTextOut               = $0a32;
  4000.   meta_SetDibToDev              = $0d33;
  4001.   meta_SelectPalette            = $0234;
  4002.   meta_RealizePalette           = $0035;
  4003.   meta_AnimatePalette           = $0436;
  4004.   meta_SetPalEntries            = $0037;
  4005.   meta_PolyPolygon              = $0538;
  4006.   meta_ResizePalette            = $0139;
  4007.   meta_DibBitblt                = $0940;
  4008.   meta_DibStretchBlt            = $0b41;
  4009.   meta_DibCreatePatternBrush    = $0142;
  4010.   meta_StretchDib               = $0f43;
  4011.   meta_ExtFloodFill             = $0548;
  4012.   meta_DeleteObject             = $01f0;
  4013.   meta_CreatePalette            = $00f7;
  4014.   meta_CreatePatternBrush       = $01F9;
  4015.   meta_CreatePenIndirect        = $02FA;
  4016.   meta_CreateFontIndirect       = $02FB;
  4017.   meta_CreateBrushIndirect      = $02FC;
  4018.   meta_CreateRegion             = $06FF;
  4019.  
  4020. type
  4021.   PMinMaxInfo = ^TMinMaxInfo;
  4022.   TMinMaxInfo = packed record
  4023.     ptReserved:     TPoint;
  4024.     ptMaxSize:      TPoint;
  4025.     ptMaxPosition:  TPoint;
  4026.     ptMinTrackSize: TPoint;
  4027.     ptMaxTrackSize: TPoint;
  4028.   end;
  4029.  
  4030. const
  4031.   msgf_DialogBox                = 0;
  4032.   msgf_MessageBox               = 1;
  4033.   msgf_Menu                     = 2;
  4034.   msgf_Move                     = 3;
  4035.   msgf_Size                     = 4;
  4036.   msgf_ScrollBar                = 5;
  4037.   msgf_NextWindow               = 6;
  4038.   msgf_MainLoop                 = 8;
  4039.   msgf_Max                      = 8;
  4040.   msgf_User                     = 4096;
  4041.  
  4042.   help_Context                  = $0001;
  4043.   help_Quit                     = $0002;
  4044.   help_Index                    = $0003;
  4045.   help_Contents                 = $0003;
  4046.   help_HelpOnHelp               = $0004;
  4047.   help_SetIndex                 = $0005;
  4048.   help_SetContents              = $0005;
  4049.   help_ContextPopup             = $0008;
  4050.   help_ForceFile                = $0009;
  4051.   help_Key                      = $0101;
  4052.   help_Command                  = $0102;
  4053.   help_PartialKey               = $0105;
  4054.   help_MultiKey                 = $0201;
  4055.   help_SetWinPos                = $0203;
  4056.  
  4057.   mk_LButton                    = $0001;
  4058.   mk_RButton                    = $0002;
  4059.   mk_Shift                      = $0004;
  4060.   mk_Control                    = $0008;
  4061.   mk_MButton                    = $0010;
  4062.  
  4063.   st_BeginSwp                   = 0;
  4064.   st_EndSwp                     = 1;
  4065.  
  4066.   htError                       = -2;
  4067.   htTransparent                 = -1;
  4068.   htNoWhere                     = 0;
  4069.   htClient                      = 1;
  4070.   htCaption                     = 2;
  4071.   htSysMenu                     = 3;
  4072.   htGrowBox                     = 4;
  4073.   htSize                        = htGrowBox;
  4074.   htMenu                        = 5;
  4075.   htHScroll                     = 6;
  4076.   htVScroll                     = 7;
  4077.   htMinButton                   = 8;
  4078.   htMaxButton                   = 9;
  4079.   htLeft                        = 10;
  4080.   htRight                       = 11;
  4081.   htTop                         = 12;
  4082.   htTopLeft                     = 13;
  4083.   htTopRight                    = 14;
  4084.   htBottom                      = 15;
  4085.   htBottomLeft                  = 16;
  4086.   htBottomRight                 = 17;
  4087.   htBorder                      = 18;
  4088.   htReduce                      = htMinButton;
  4089.   htZoom                        = htMaxButton;
  4090.   htSizeFirst                   = htLeft;
  4091.   htSizeLast                    = htBottomRight;
  4092.  
  4093.   smto_Normal                   = $0000;
  4094.   smto_Block                    = $0001;
  4095.   smto_AbortIfHung              = $0002;
  4096.  
  4097. { Hook Related structures ... }
  4098. type
  4099.   PCWPStruct = ^TCWPStruct;
  4100.   TCWPStruct = packed record
  4101.     lParam:  lParam;
  4102.     wParam:  wParam;
  4103.     message: Longint;
  4104.     hWnd:    hWnd;
  4105.   end;
  4106.  
  4107.   PDebugHookInfo = ^TDebugHookInfo;
  4108.   TDebugHookInfo = packed record
  4109.     idThread: Longint;
  4110.     reserved: lParam;
  4111.     lParam:   lParam;
  4112.     wParam:   wParam;
  4113.     code:     Longint;
  4114.   end;
  4115.  
  4116.   PEventMsg = ^TEventMsg;
  4117.   TEventMsg = packed record
  4118.     message: Longint;
  4119.     paramL:  Longint;
  4120.     paramH:  Longint;
  4121.     time:    Longint;
  4122.     hWnd:    hWnd;
  4123.   end;
  4124.  
  4125.   PMouseHookStruct = ^TMouseHookStruct;
  4126.   TMouseHookStruct = packed record
  4127.     pt:           TPoint;
  4128.     hWnd:         hWnd;
  4129.     wHitTestCode: Longint;
  4130.     dwExtraInfo:  Longint;
  4131.   end;
  4132.  
  4133.   TWOHandleArray = array[0..maximum_Wait_Objects-1] of THandle;
  4134.   PWOHandleArray = ^TWOHandleArray;
  4135.  
  4136. {----- WinSpool -----}
  4137.  
  4138. const
  4139.   PRINTER_ENUM_DEFAULT     = $00000001;
  4140.   PRINTER_ENUM_LOCAL       = $00000002;
  4141.   PRINTER_ENUM_CONNECTIONS = $00000004;
  4142.   PRINTER_ENUM_FAVORITE    = $00000004;
  4143.   PRINTER_ENUM_NAME        = $00000008;
  4144.   PRINTER_ENUM_REMOTE      = $00000010;
  4145.   PRINTER_ENUM_SHARED      = $00000020;
  4146.   PRINTER_ENUM_NETWORK     = $00000040;
  4147.  
  4148.   PRINTER_ENUM_EXPAND      = $00004000;
  4149.   PRINTER_ENUM_CONTAINER   = $00008000;
  4150.  
  4151.   PRINTER_ENUM_ICONMASK    = $00ff0000;
  4152.   PRINTER_ENUM_ICON1       = $00010000;
  4153.   PRINTER_ENUM_ICON2       = $00020000;
  4154.   PRINTER_ENUM_ICON3       = $00040000;
  4155.   PRINTER_ENUM_ICON4       = $00080000;
  4156.   PRINTER_ENUM_ICON5       = $00100000;
  4157.   PRINTER_ENUM_ICON6       = $00200000;
  4158.   PRINTER_ENUM_ICON7       = $00400000;
  4159.   PRINTER_ENUM_ICON8       = $00800000;
  4160.  
  4161. type
  4162.   PPrinterDefaults = ^TPrinterDefaults;
  4163.   TPrinterDefaults = record
  4164.     pDatatype: PChar;
  4165.     pDevMode: PDeviceMode;
  4166.     DesiredAccess: Access_Mask;
  4167.   end;
  4168.   PPrinterInfo4 = ^TPrinterInfo4;
  4169.   TPrinterInfo4 = record
  4170.     pPrinterName: PChar;
  4171.     pServerName: PChar;
  4172.     Attributes: Dword;
  4173.   end;
  4174.   PPrinterInfo5 = ^TPrinterInfo5;
  4175.   TPrinterInfo5 = record
  4176.     pPrinterName: PChar;
  4177.     pPortName: PChar;
  4178.     Attributes: Dword;
  4179.     DeviceNotSelectedTimeout: Dword;
  4180.     TransmissionRetryTimeout: DWord;
  4181.   end;
  4182.  
  4183. {---------------[ Error codes ]----------------------------------------------}
  4184. const
  4185.   facility_Null                 = 0;
  4186.   facility_Rpc                  = 1;
  4187.   facility_Dispatch             = 2;
  4188.   facility_Storage              = 3;
  4189.   facility_Itf                  = 4;
  4190.   facility_Win32                = 7;
  4191.   facility_Windows              = 8;
  4192.   facility_Control              = 10;
  4193.  
  4194.   no_Error                      = 0;
  4195.   error_Success                 = 0;
  4196.   error_Invalid_Function        = 1;
  4197.   error_File_Not_Found          = 2;
  4198.   error_Path_Not_Found          = 3;
  4199.   error_Too_Many_Open_Files     = 4;
  4200.   error_Access_Denied           = 5;
  4201.   error_Invalid_Handle          = 6;
  4202.   error_Arena_Trashed           = 7;
  4203.   error_Not_Enough_Memory       = 8;
  4204.   error_Invalid_Block           = 9;
  4205.   error_Bad_Environment         = 10;
  4206.   error_Bad_Format              = 11;
  4207.   error_Invalid_Access          = 12;
  4208.   error_Invalid_Data            = 13;
  4209.   error_OutOfMemory             = 14;
  4210.   error_Invalid_Drive           = 15;
  4211.   error_Current_Directory       = 16;
  4212.   error_Not_Same_Device         = 17;
  4213.   error_No_More_Files           = 18;
  4214.   error_Write_Protect           = 19;
  4215.   error_Bad_Unit                = 20;
  4216.   error_Not_Ready               = 21;
  4217.   error_Bad_Command             = 22;
  4218.   error_Crc                     = 23;
  4219.   error_Bad_Length              = 24;
  4220.   error_Seek                    = 25;
  4221.   error_Not_Dos_Disk            = 26;
  4222.   error_Sector_Not_Found        = 27;
  4223.   error_Out_Of_Paper            = 28;
  4224.   error_Write_Fault             = 29;
  4225.   error_Read_Fault              = 30;
  4226.   error_Gen_Failure             = 31;
  4227.   error_Sharing_Violation       = 32;
  4228.   error_Lock_Violation          = 33;
  4229.   error_Wrong_Disk              = 34;
  4230.   error_Sharing_Buffer_Exceeded = 36;
  4231.   error_Handle_Eof              = 38;
  4232.   error_Handle_Disk_Full        = 39;
  4233.   error_Not_Supported           = 50;
  4234.   error_Rem_Not_List            = 51;
  4235.   error_Dup_Name                = 52;
  4236.   error_Bad_NetPath             = 53;
  4237.   error_Network_Busy            = 54;
  4238.   error_Dev_Not_Exist           = 55;
  4239.   error_Too_Many_Cmds           = 56;
  4240.   error_Adap_Hdw_Err            = 57;
  4241.   error_Bad_Net_Resp            = 58;
  4242.   error_Unexp_Net_Err           = 59;
  4243.   error_Bad_Rem_Adap            = 60;
  4244.   error_Printq_Full             = 61;
  4245.   error_No_Spool_Space          = 62;
  4246.   error_Print_Cancelled         = 63;
  4247.   error_Netname_Deleted         = 64;
  4248.   error_Network_Access_Denied   = 65;
  4249.   error_Bad_Dev_Type            = 66;
  4250.   error_Bad_Net_Name            = 67;
  4251.   error_Too_Many_Names          = 68;
  4252.   error_Too_Many_Sess           = 69;
  4253.   error_Sharing_Paused          = 70;
  4254.   error_Req_Not_Accep           = 71;
  4255.   error_Redir_Paused            = 72;
  4256.   error_File_Exists             = 80;
  4257.   error_Cannot_Make             = 82;
  4258.   error_Fail_I24                = 83;
  4259.   error_Out_Of_Structures       = 84;
  4260.   error_Already_Assigned        = 85;
  4261.   error_Invalid_Password        = 86;
  4262.   error_Invalid_Parameter       = 87;
  4263.   error_Net_Write_Fault         = 88;
  4264.   error_No_Proc_Slots           = 89;
  4265.   error_Too_Many_Semaphores     = 100;
  4266.   error_Excl_Sem_Already_Owned  = 101;
  4267.   error_Sem_Is_Set              = 102;
  4268.   error_Too_Many_Sem_Requests   = 103;
  4269.   error_Invalid_At_Interrupt_Time=104;
  4270.   error_Sem_Owner_Died          = 105;
  4271.   error_Sem_User_Limit          = 106;
  4272.   error_Disk_Change             = 107;
  4273.   error_Drive_Locked            = 108;
  4274.   error_Broken_Pipe             = 109;
  4275.   error_Open_Failed             = 110;
  4276.   error_Buffer_Overflow         = 111;
  4277.   error_Disk_Full               = 112;
  4278.   error_No_More_Search_Handles  = 113;
  4279.   error_Invalid_Target_Handle   = 114;
  4280.   error_Invalid_Category        = 117;
  4281.   error_Invalid_Verify_Switch   = 118;
  4282.   error_Bad_Driver_Level        = 119;
  4283.   error_Call_Not_Implemented    = 120;
  4284.   error_Sem_Timeout             = 121;
  4285.   error_Insufficient_Buffer     = 122;
  4286.   error_Invalid_Name            = 123;
  4287.   error_Invalid_Level           = 124;
  4288.   error_No_Volume_Label         = 125;
  4289.   error_Mod_Not_Found           = 126;
  4290.   error_Proc_Not_Found          = 127;
  4291.   error_Wait_No_Children        = 128;
  4292.   error_Child_Not_Complete      = 129;
  4293.   error_Direct_Access_Handle    = 130;
  4294.   error_Negative_Seek           = 131;
  4295.   error_Seek_On_Device          = 132;
  4296.   error_Is_Join_Target          = 133;
  4297.   error_Is_Joined               = 134;
  4298.   error_Is_Substed              = 135;
  4299.   error_Not_Joined              = 136;
  4300.   error_Not_Substed             = 137;
  4301.   error_Join_To_Join            = 138;
  4302.   error_Subst_To_Subst          = 139;
  4303.   error_Join_To_Subst           = 140;
  4304.   error_Subst_To_Join           = 141;
  4305.   error_Busy_Drive              = 142;
  4306.   error_Same_Drive              = 143;
  4307.   error_Dir_Not_Root            = 144;
  4308.   error_Dir_Not_Empty           = 145;
  4309.   error_Is_Subst_Path           = 146;
  4310.   error_Is_Join_Path            = 147;
  4311.   error_Path_Busy               = 148;
  4312.   error_Is_Subst_Target         = 149;
  4313.   error_System_Trace            = 150;
  4314.   error_Invalid_Event_Count     = 151;
  4315.   error_Too_Many_Muxwaiters     = 152;
  4316.   error_Invalid_List_Format     = 153;
  4317.   error_Label_Too_Long          = 154;
  4318.   error_Too_Many_Tcbs           = 155;
  4319.   error_Signal_Refused          = 156;
  4320.   error_Discarded               = 157;
  4321.   error_Not_Locked              = 158;
  4322.   error_Bad_ThreadId_Addr       = 159;
  4323.   error_Bad_Arguments           = 160;
  4324.   error_Bad_Pathname            = 161;
  4325.   error_Signal_Pending          = 162;
  4326.   error_Max_Thrds_Reached       = 164;
  4327.   error_Lock_Failed             = 167;
  4328.   error_Busy                    = 170;
  4329.   error_Cancel_Violation        = 173;
  4330.   error_Atomic_Locks_Not_Supported=174;
  4331.   error_Invalid_Segment_Number  = 180;
  4332.   error_Invalid_Ordinal         = 182;
  4333.   error_Already_Exists          = 183;
  4334.   error_Invalid_Flag_Number     = 186;
  4335.   error_Sem_Not_Found           = 187;
  4336.   error_Invalid_Starting_Codeseg= 188;
  4337.   error_Invalid_Stackseg        = 189;
  4338.   error_Invalid_Moduletype      = 190;
  4339.   error_Invalid_Exe_Signature   = 191;
  4340.   error_Exe_Marked_Invalid      = 192;
  4341.   error_Bad_Exe_Format          = 193;
  4342.   error_Iterated_Data_Exceeds_64k=194;
  4343.   error_Invalid_MinAllocSize    = 195;
  4344.   error_Dynlink_From_Invalid_Ring=196;
  4345.   error_Iopl_Not_Enabled        = 197;
  4346.   error_Invalid_Segdpl          = 198;
  4347.   error_AutoDataSeg_Exceeds_64k = 199;
  4348.   error_Ring2seg_Must_Be_Movable= 200;
  4349.   error_Reloc_Chain_Xeeds_Seglim= 201;
  4350.   error_Infloop_In_Reloc_Chain  = 202;
  4351.   error_Envvar_Not_Found        = 203;
  4352.   error_No_Signal_Sent          = 205;
  4353.   error_Filename_Exced_Range    = 206;
  4354.   error_Ring2_Stack_In_Use      = 207;
  4355.   error_Meta_Expansion_Too_Long = 208;
  4356.   error_Invalid_Signal_Number   = 209;
  4357.   error_Thread_1_inactive       = 210;
  4358.   error_Locked                  = 212;
  4359.   error_Too_Many_Modules        = 214;
  4360.   error_Nesting_Not_Allowed     = 215;
  4361.   error_Bad_Pipe                = 230;
  4362.   error_Pipe_Busy               = 231;
  4363.   error_No_Data                 = 232;
  4364.   error_Pipe_Not_Connected      = 233;
  4365.   error_More_Data               = 234;
  4366.   error_Vc_Disconnected         = 240;
  4367.   error_Invalid_Ea_Name         = 254;
  4368.   error_Ea_List_Inconsistent    = 255;
  4369.   error_No_More_Items           = 259;
  4370.   error_Cannot_Copy             = 266;
  4371.   error_Directory               = 267;
  4372.   error_Eas_Didnt_Fit           = 275;
  4373.   error_Ea_File_Corrupt         = 276;
  4374.   error_Ea_Table_Full           = 277;
  4375.   error_Invalid_Ea_Handle       = 278;
  4376.   error_Eas_Not_Supported       = 282;
  4377.   error_Not_Owner               = 288;
  4378.   error_Too_Many_Posts          = 298;
  4379.   error_Partial_Copy            = 299;
  4380.   error_Mr_Mid_Not_Found        = 317;
  4381.   error_Invalid_Address         = 487;
  4382.   error_Arithmetic_Overflow     = 534;
  4383.   error_Pipe_Connected          = 535;
  4384.   error_Pipe_Listening          = 536;
  4385.   error_Ea_Access_Denied        = 994;
  4386.   error_Operation_Aborted       = 995;
  4387.   error_Io_Incomplete           = 996;
  4388.   error_Io_Pending              = 997;
  4389.   error_Noaccess                = 998;
  4390.   error_Swaperror               = 999;
  4391.   error_Stack_Overflow          = 1001;
  4392.   error_Invalid_Message         = 1002;
  4393.   error_Can_Not_Complete        = 1003;
  4394.   error_Invalid_Flags           = 1004;
  4395.   error_Unrecognized_Volume     = 1005;
  4396.   error_File_Invalid            = 1006;
  4397.   error_Fullscreen_Mode         = 1007;
  4398.   error_No_Token                = 1008;
  4399.   error_Baddb                   = 1009;
  4400.   error_Badkey                  = 1010;
  4401.   error_Cantopen                = 1011;
  4402.   error_Cantread                = 1012;
  4403.   error_Cantwrite               = 1013;
  4404.   error_Registry_Recovered      = 1014;
  4405.   error_Registry_Corrupt        = 1015;
  4406.   error_Registry_Io_Failed      = 1016;
  4407.   error_Not_Registry_File       = 1017;
  4408.   error_Key_Deleted             = 1018;
  4409.   error_No_Log_Space            = 1019;
  4410.   error_Key_Has_Children        = 1020;
  4411.   error_Child_Must_Be_Volatile  = 1021;
  4412.   error_Notify_Enum_Dir         = 1022;
  4413.   error_Dependent_Services_Running=1051;
  4414.   error_Invalid_Service_Control = 1052;
  4415.   error_Service_Request_Timeout = 1053;
  4416.   error_Service_No_Thread       = 1054;
  4417.   error_Service_Database_Locked = 1055;
  4418.   error_Service_Already_Running = 1056;
  4419.   error_Invalid_Service_Account = 1057;
  4420.   error_Service_Disabled        = 1058;
  4421.   error_Circular_Dependency     = 1059;
  4422.   error_Service_Does_Not_Exist  = 1060;
  4423.   error_Service_Cannot_Accept_Ctrl=1061;
  4424.   error_Service_Not_Active      = 1062;
  4425.   error_Failed_Service_Controller_Connect=1063;
  4426.   error_Exception_In_Service    = 1064;
  4427.   error_Database_Does_Not_Exist = 1065;
  4428.   error_Service_Specific_Error  = 1066;
  4429.   error_Process_Aborted         = 1067;
  4430.   error_Service_Dependency_Fail = 1068;
  4431.   error_Service_Logon_Failed    = 1069;
  4432.   error_Service_Start_Hang      = 1070;
  4433.   error_Invalid_Service_Lock    = 1071;
  4434.   error_Service_Marked_For_Delete=1072;
  4435.   error_Service_Exists          = 1073;
  4436.   error_Already_Running_Lkg     = 1074;
  4437.   error_Service_Dependency_Deleted=1075;
  4438.   error_Boot_Already_Accepted   = 1076;
  4439.   error_Service_Never_Started   = 1077;
  4440.   error_Duplicate_Service_Name  = 1078;
  4441.   error_End_Of_Media            = 1100;
  4442.   error_Filemark_Detected       = 1101;
  4443.   error_Beginning_Of_Media      = 1102;
  4444.   error_Setmark_Detected        = 1103;
  4445.   error_No_Data_Detected        = 1104;
  4446.   error_Partition_Failure       = 1105;
  4447.   error_Invalid_Block_Length    = 1106;
  4448.   error_Device_Not_Partitioned  = 1107;
  4449.   error_Unable_To_Lock_Media    = 1108;
  4450.   error_Unable_To_Unload_Media  = 1109;
  4451.   error_Media_Changed           = 1110;
  4452.   error_Bus_Reset               = 1111;
  4453.   error_No_Media_In_Drive       = 1112;
  4454.   error_No_Unicode_Translation  = 1113;
  4455.   error_Dll_Init_Failed         = 1114;
  4456.   error_Shutdown_In_Progress    = 1115;
  4457.   error_No_Shutdown_In_Progress = 1116;
  4458.   error_Io_Device               = 1117;
  4459.   error_Serial_No_Device        = 1118;
  4460.   error_Irq_Busy                = 1119;
  4461.   error_More_Writes             = 1120;
  4462.   error_Counter_Timeout         = 1121;
  4463.   error_Floppy_Id_Mark_Not_Found= 1122;
  4464.   error_Floppy_Wrong_Cylinder   = 1123;
  4465.   error_Floppy_Unknown_Error    = 1124;
  4466.   error_Floppy_Bad_Registers    = 1125;
  4467.   error_Disk_Recalibrate_Failed = 1126;
  4468.   error_Disk_Operation_Failed   = 1127;
  4469.   error_Disk_Reset_Failed       = 1128;
  4470.   error_Eom_Overflow            = 1129;
  4471.   error_Not_Enough_Server_Memory= 1130;
  4472.   error_Possible_Deadlock       = 1131;
  4473.   error_Mapped_Alignment        = 1132;
  4474.   error_Bad_Username            = 2202;
  4475.   error_Not_Connected           = 2250;
  4476.   error_Open_Files              = 2401;
  4477.   error_Active_Connections      = 2402;
  4478.   error_Device_In_Use           = 2404;
  4479.   error_Bad_Device              = 1200;
  4480.   error_Connection_Unavail      = 1201;
  4481.   error_Device_Already_Remembered=1202;
  4482.   error_No_Net_Or_Bad_Path      = 1203;
  4483.   error_Bad_Provider            = 1204;
  4484.   error_Cannot_Open_Profile     = 1205;
  4485.   error_Bad_Profile             = 1206;
  4486.   error_Not_Container           = 1207;
  4487.   error_Extended_Error          = 1208;
  4488.   error_Invalid_Groupname       = 1209;
  4489.   error_Invalid_Computername    = 1210;
  4490.   error_Invalid_Eventname       = 1211;
  4491.   error_Invalid_Domainname      = 1212;
  4492.   error_Invalid_Servicename     = 1213;
  4493.   error_Invalid_Netname         = 1214;
  4494.   error_Invalid_Sharename       = 1215;
  4495.   error_Invalid_Passwordname    = 1216;
  4496.   error_Invalid_Messagename     = 1217;
  4497.   error_Invalid_Messagedest     = 1218;
  4498.   error_Session_Credential_Conflict= 1219;
  4499.   error_Remote_Session_Limit_Exceeded=1220;
  4500.   error_Dup_Domainname          = 1221;
  4501.   error_No_Network              = 1222;
  4502.   error_Cancelled               = 1223;
  4503.   error_User_Mapped_File        = 1224;
  4504.   error_Connection_Refused      = 1225;
  4505.   error_Graceful_Disconnect     = 1226;
  4506.   error_Address_Already_Associated=1227;
  4507.   error_Address_Not_Associated  = 1228;
  4508.   error_Connection_Invalid      = 1229;
  4509.   error_Connection_Active       = 1230;
  4510.   error_Network_Unreachable     = 1231;
  4511.   error_Host_Unreachable        = 1232;
  4512.   error_Protocol_Unreachable    = 1233;
  4513.   error_Port_Unreachable        = 1234;
  4514.   error_Request_Aborted         = 1235;
  4515.   error_Connection_Aborted      = 1236;
  4516.   error_Retry                   = 1237;
  4517.   error_Connection_Count_Limit  = 1238;
  4518.   error_Login_Time_Restriction  = 1239;
  4519.   error_Login_Wksta_Restriction = 1240;
  4520.   error_Incorrect_Address       = 1241;
  4521.   error_Already_Registered      = 1242;
  4522.   error_Service_Not_Found       = 1243;
  4523.   error_Not_All_Assigned        = 1300;
  4524.   error_Some_Not_Mapped         = 1301;
  4525.   error_No_Quotas_For_Account   = 1302;
  4526.   error_Local_User_Session_Key  = 1303;
  4527.   error_Null_Lm_Password        = 1304;
  4528.   error_Unknown_Revision        = 1305;
  4529.   error_Revision_Mismatch       = 1306;
  4530.   error_Invalid_Owner           = 1307;
  4531.   error_Invalid_Primary_Group   = 1308;
  4532.   error_No_Impersonation_Token  = 1309;
  4533.   error_Cant_Disable_Mandatory  = 1310;
  4534.   error_No_Logon_Servers        = 1311;
  4535.   error_No_Such_Logon_Session   = 1312;
  4536.   error_No_Such_Privilege       = 1313;
  4537.   error_Privilege_Not_Held      = 1314;
  4538.   error_Invalid_Account_Name    = 1315;
  4539.   error_User_Exists             = 1316;
  4540.   error_No_Such_User            = 1317;
  4541.   error_Group_Exists            = 1318;
  4542.   error_No_Such_Group           = 1319;
  4543.   error_Member_In_Group         = 1320;
  4544.   error_Member_Not_In_Group     = 1321;
  4545.   error_Last_Admin              = 1322;
  4546.   error_Wrong_Password          = 1323;
  4547.   error_Ill_Formed_Password     = 1324;
  4548.   error_Password_Restriction    = 1325;
  4549.   error_Logon_Failure           = 1326;
  4550.   error_Account_Restriction     = 1327;
  4551.   error_Invalid_Logon_Hours     = 1328;
  4552.   error_Invalid_Workstation     = 1329;
  4553.   error_Password_Expired        = 1330;
  4554.   error_Account_Disabled        = 1331;
  4555.   error_None_Mapped             = 1332;
  4556.   error_Too_Many_Luids_Requested= 1333;
  4557.   error_Luids_Exhausted         = 1334;
  4558.   error_Invalid_Sub_Authority   = 1335;
  4559.   error_Invalid_Acl             = 1336;
  4560.   error_Invalid_Sid             = 1337;
  4561.   error_Invalid_Security_Descr  = 1338;
  4562.   error_Bad_Inheritance_Acl     = 1340;
  4563.   error_Server_Disabled         = 1341;
  4564.   error_Server_Not_Disabled     = 1342;
  4565.   error_Invalid_Id_Authority    = 1343;
  4566.   error_Allotted_Space_Exceeded = 1344;
  4567.   error_Invalid_Group_Attributes= 1345;
  4568.   error_Bad_Impersonation_Level = 1346;
  4569.   error_Cant_Open_Anonymous     = 1347;
  4570.   error_Bad_Validation_Class    = 1348;
  4571.   error_Bad_Token_Type          = 1349;
  4572.   error_No_Security_On_Object   = 1350;
  4573.   error_Cant_Access_Domain_Info = 1351;
  4574.   error_Invalid_Server_State    = 1352;
  4575.   error_Invalid_Domain_State    = 1353;
  4576.   error_Invalid_Domain_Role     = 1354;
  4577.   error_No_Such_Domain          = 1355;
  4578.   error_Domain_Exists           = 1356;
  4579.   error_Domain_Limit_Exceeded   = 1357;
  4580.   error_Internal_Db_Corruption  = 1358;
  4581.   error_Internal_Error          = 1359;
  4582.   error_Generic_Not_Mapped      = 1360;
  4583.   error_Bad_Descriptor_Format   = 1361;
  4584.   error_Not_Logon_Process       = 1362;
  4585.   error_Logon_Session_Exists    = 1363;
  4586.   error_No_Such_Package         = 1364;
  4587.   error_Bad_Logon_Session_State = 1365;
  4588.   error_Logon_Session_Collision = 1366;
  4589.   error_Invalid_Logon_Type      = 1367;
  4590.   error_Cannot_Impersonate      = 1368;
  4591.   error_Rxact_Invalid_State     = 1369;
  4592.   error_Rxact_Commit_Failure    = 1370;
  4593.   error_Special_Account         = 1371;
  4594.   error_Special_Group           = 1372;
  4595.   error_Special_User            = 1373;
  4596.   error_Members_Primary_Group   = 1374;
  4597.   error_Token_Already_In_Use    = 1375;
  4598.   error_No_Such_Alias           = 1376;
  4599.   error_Member_Not_In_Alias     = 1377;
  4600.   error_Member_In_Alias         = 1378;
  4601.   error_Alias_Exists            = 1379;
  4602.   error_Logon_Not_Granted       = 1380;
  4603.   error_Too_Many_Secrets        = 1381;
  4604.   error_Secret_Too_Long         = 1382;
  4605.   error_Internal_Db_Error       = 1383;
  4606.   error_Too_Many_Context_Ids    = 1384;
  4607.   error_Logon_Type_Not_Granted  = 1385;
  4608.   error_Nt_Cross_Encryption_Required= 1386;
  4609.   error_No_Such_Member          = 1387;
  4610.   error_Invalid_Member          = 1388;
  4611.   error_Too_Many_Sids           = 1389;
  4612.   error_Lm_Cross_Encryption_Required= 1390;
  4613.   error_No_Inheritance          = 1391;
  4614.   error_File_Corrupt            = 1392;
  4615.   error_Disk_Corrupt            = 1393;
  4616.   error_No_User_Session_Key     = 1394;
  4617.   error_Invalid_Window_Handle   = 1400;
  4618.   error_Invalid_Menu_Handle     = 1401;
  4619.   error_Invalid_Cursor_Handle   = 1402;
  4620.   error_Invalid_Accel_Handle    = 1403;
  4621.   error_Invalid_Hook_Handle     = 1404;
  4622.   error_Invalid_Dwp_Handle      = 1405;
  4623.   error_Tlw_With_Wschild        = 1406;
  4624.   error_Cannot_Find_Wnd_Class   = 1407;
  4625.   error_Window_Of_Other_Thread  = 1408;
  4626.   error_Hotkey_Already_Registered=1409;
  4627.   error_Class_Already_Exists    = 1410;
  4628.   error_Class_Does_Not_Exist    = 1411;
  4629.   error_Class_Has_Windows       = 1412;
  4630.   error_Invalid_Index           = 1413;
  4631.   error_Invalid_Icon_Handle     = 1414;
  4632.   error_Private_Dialog_Index    = 1415;
  4633.   error_Listbox_Id_Not_Found    = 1416;
  4634.   error_No_Wildcard_Characters  = 1417;
  4635.   error_Clipboard_Not_Open      = 1418;
  4636.   error_Hotkey_Not_Registered   = 1419;
  4637.   error_Window_Not_Dialog       = 1420;
  4638.   error_Control_Id_Not_Found    = 1421;
  4639.   error_Invalid_Combobox_Message= 1422;
  4640.   error_Window_Not_Combobox     = 1423;
  4641.   error_Invalid_Edit_Height     = 1424;
  4642.   error_Dc_Not_Found            = 1425;
  4643.   error_Invalid_Hook_Filter     = 1426;
  4644.   error_Invalid_Filter_Proc     = 1427;
  4645.   error_Hook_Needs_Hmod         = 1428;
  4646.   error_Global_Only_Hook        = 1429;
  4647.   error_Journal_Hook_Set        = 1430;
  4648.   error_Hook_Not_Installed      = 1431;
  4649.   error_Invalid_Lb_Message      = 1432;
  4650.   error_Setcount_On_Bad_Lb      = 1433;
  4651.   error_Lb_Without_Tabstops     = 1434;
  4652.   error_Destroy_Object_Of_Other_Thread=1435;
  4653.   error_Child_Window_Menu       = 1436;
  4654.   error_No_System_Menu          = 1437;
  4655.   error_Invalid_Msgbox_Style    = 1438;
  4656.   error_Invalid_Spi_Value       = 1439;
  4657.   error_Screen_Already_Locked   = 1440;
  4658.   error_Hwnds_Have_Diff_Parent  = 1441;
  4659.   error_Not_Child_Window        = 1442;
  4660.   error_Invalid_Gw_Command      = 1443;
  4661.   error_Invalid_Thread_Id       = 1444;
  4662.   error_Non_Mdichild_Window     = 1445;
  4663.   error_Popup_Already_Active    = 1446;
  4664.   error_No_Scrollbars           = 1447;
  4665.   error_Invalid_Scrollbar_Range = 1448;
  4666.   error_Invalid_Showwin_Command = 1449;
  4667.   error_Eventlog_File_Corrupt   = 1500;
  4668.   error_Eventlog_Cant_Start     = 1501;
  4669.   error_Log_File_Full           = 1502;
  4670.   error_Eventlog_File_Changed   = 1503;
  4671.  
  4672.   error_Invalid_User_Buffer     = 1784;
  4673.   error_Unrecognized_Media      = 1785;
  4674.   error_No_Trust_Lsa_Secret     = 1786;
  4675.   error_No_Trust_Sam_Account    = 1787;
  4676.   error_Trusted_Domain_Failure  = 1788;
  4677.   error_Trusted_Relationship_Failure=1789;
  4678.   error_Trust_Failure           = 1790;
  4679.  
  4680.   error_Netlogon_Not_Started    = 1792;
  4681.   error_Account_Expired         = 1793;
  4682.   error_Redirector_Has_Open_Handles=1794;
  4683.   error_Printer_Driver_Already_Installed=1795;
  4684.   error_Unknown_Port            = 1796;
  4685.   error_Unknown_Printer_Driver  = 1797;
  4686.   error_Unknown_Printprocessor  = 1798;
  4687.   error_Invalid_Separator_File  = 1799;
  4688.   error_Invalid_Priority        = 1800;
  4689.   error_Invalid_Printer_Name    = 1801;
  4690.   error_Printer_Already_Exists  = 1802;
  4691.   error_Invalid_Printer_Command = 1803;
  4692.   error_Invalid_Datatype        = 1804;
  4693.   error_Invalid_Environment     = 1805;
  4694.  
  4695.   error_Nologon_Interdomain_Trust_Account=1807;
  4696.   error_Nologon_Workstation_Trust_Account=1808;
  4697.   error_Nologon_Server_Trust_Account=1809;
  4698.   error_Domain_Trust_Inconsistent=1810;
  4699.   error_Server_Has_Open_Handles = 1811;
  4700.   error_Resource_Data_Not_Found = 1812;
  4701.   error_Resource_Type_Not_Found = 1813;
  4702.   error_Resource_Name_Not_Found = 1814;
  4703.   error_Resource_Lang_Not_Found = 1815;
  4704.   error_Not_Enough_Quota        = 1816;
  4705.   error_Invalid_Time            = 1901;
  4706.   error_Invalid_Form_Name       = 1902;
  4707.   error_Invalid_Form_Size       = 1903;
  4708.   error_Already_Waiting         = 1904;
  4709.   error_Printer_Deleted         = 1905;
  4710.   error_Invalid_Printer_State   = 1906;
  4711.   error_Password_Must_Change    = 1907;
  4712.   error_Domain_Controller_Not_Found=1908;
  4713.   error_Account_Locked_Out      = 1909;
  4714.   error_Invalid_Pixel_Format    = 2000;
  4715.   error_Bad_Driver              = 2001;
  4716.   error_Invalid_Window_Style    = 2002;
  4717.   error_Metafile_Not_Supported  = 2003;
  4718.   error_Transform_Not_Supported = 2004;
  4719.   error_Clipping_Not_Supported  = 2005;
  4720.   error_Unknown_Print_Monitor   = 3000;
  4721.   error_Printer_Driver_In_Use   = 3001;
  4722.   error_Spool_File_Not_Found    = 3002;
  4723.   error_Spl_No_StartDoc         = 3003;
  4724.   error_Spl_No_AddJob           = 3004;
  4725.   error_Print_Processor_Already_Installed=3005;
  4726.   error_Print_Monitor_Already_Installed=3006;
  4727.   error_Wins_Internal           = 4000;
  4728.   error_Can_Not_Del_Local_Wins  = 4001;
  4729.   error_Static_Init             = 4002;
  4730.   error_Inc_Backup              = 4003;
  4731.   error_Full_Backup             = 4004;
  4732.   error_Rec_Non_Existent        = 4005;
  4733.   error_Rpl_Not_Allowed         = 4006;
  4734.  
  4735. {---------------[ API Prototypes ]-------------------------------------------}
  4736.  
  4737. function AnsiToOem(Src,Dest: PChar): Bool;
  4738. function OemToAnsi(Src,Dest: PChar): Bool;
  4739. function AnsiToOemBuff(Src,Dest: PChar; DestLen: DWord): Bool;
  4740. function OemToAnsiBuff(Src,Dest: PChar; DestLen: DWord): Bool;
  4741. function AnsiUpper(Str: PChar): PChar;
  4742. function AnsiUpperBuff(Str: PChar; StrLen: DWord): DWord;
  4743. function AnsiLower(Str: PChar): PChar;
  4744. function AnsiLowerBuff(Str: PChar; StrLen: DWord): DWord;
  4745. function AnsiNext(Str: PChar): PChar;
  4746. function AnsiPrev(Start,Current: PChar): PChar;
  4747.  
  4748. function WinMain(hInst,HPrevInst: hInst; CmdLine: PChar; CmdShow: UInt): UInt;
  4749. function AbortDoc(DC: HDC): Integer;
  4750. function AbortPath(DC: HDC): Bool;
  4751. function AddAtom(Str: PChar): TAtom;
  4752. function AddFontResource(FileName: PChar): Integer;
  4753. function AdjustWindowRect(var Rect: TRect; Style: DWord; Menu: Bool): Bool;
  4754. function AdjustWindowRectEx(var Rect: TRect; Style: DWord; Menu: Bool; ExStyle: DWord): Bool;
  4755. function AngleArc(DC: HDC; X,Y: Integer; Radius: DWord; StartAngle,SweepAngle: Single): Bool;
  4756. function AnimatePalette(Pal: HPalette; StartEntry,cEntries: UInt; ppe: PPaletteEntry): Bool;
  4757. function AppendMenu(Menu: hMenu; Flags,IDNewItems: UInt; NewItem: PChar): Bool;
  4758. function Arc(DC: HDC; Left,Top,Right,Bottom,StartX,StartY,EndX,EndY: Integer): Bool;
  4759. function ArcTo(DC: HDC; RLeft,RTop,RRight,RBottom,xRad1,yRad1,xRad2,yRad2: Integer): Bool;
  4760. function ArrangeIconicWindows(Wnd: hWnd): UInt;
  4761. function Beep(Freq,Durat: UInt): Bool;
  4762. function BeginDeferWindowPos(NumWindows: Integer): HDWP;
  4763. function BeginPaint(Wnd: hWnd; var Paint: TPaintStruct): HDC;
  4764. function BeginPath(DC: HDC): Bool;
  4765. function BitBlt(DestDC: HDC; X,Y,Width,Height: Integer; SrcDC: HDC; XSrc,YSrc: Integer; Rop: DWord): Bool;
  4766. function BringWindowToTop(Wnd: hWnd): Bool;
  4767. function CallMsgFilter(var Msg: TMsg; Code: Integer): Bool;
  4768. function CallNextHookEx(Hook: HHook; Code: Integer; WP: wParam; LP: lParam): lResult;
  4769. function CallWindowProc(PrevWndFunc: TFNWndProc; Wnd: hWnd; Msg: UInt; WP: wParam; LP: lParam): lResult;
  4770. function ChangeClipboardChain(WndRemove,WndNewNext: hWnd): Bool;
  4771. function CharLower(Str: PChar): PChar;
  4772. function CharLowerBuff(Str: PChar; StrLen: DWord): DWord;
  4773. function CharUpper(Str: PChar): PChar;
  4774. function CharUpperBuff(Str: PChar; StrLen: DWord): DWord;
  4775. function CheckDlgButton(Dlg: hWnd; IDButton: Integer; Check: UInt): Bool;
  4776. function CheckMenuItem(Menu: hMenu; IDCheckItem,Check: UInt): DWord;
  4777. function CheckRadioButton(Wnd: hWnd; IDFirstButton,IDLastButton,IDCheckButton: Integer): Bool;
  4778. function ChildWindowFromPoint(WndParent: hWnd; Point: TPoint): hWnd;
  4779. function Chord(DC: HDC; X1,Y1,X2,Y2,xRadial1,yRadial1,xRadial2,yRadial2: Integer): Bool;
  4780. function ClientToScreen(Wnd: hWnd; var Point: TPoint): Bool;
  4781. function ClipCursor(Rect: PRect): Bool;
  4782. function CloseClipboard: Bool;
  4783. function CloseEnhMetaFile(DC: HDC): HEnhMetafile;
  4784. function CloseFigure(DC: HDC): Bool;
  4785. function CloseHandle(Handle: THandle): Bool;
  4786. function CloseMetaFile(DC: HDC): HMetafile;
  4787. function ClosePrinter(hPrinter: THandle): Boolean;
  4788. function CloseWindow(Wnd: hWnd): Bool;
  4789. function CombineRgn(Dest,Src1,Src2: HRgn; CombineMode: Integer): Integer;
  4790. function CompareFileTime(const FileTime1,FileTime2: TFileTime): Longint;
  4791. function CopyCursor(Cursor: HCursor): HCursor;
  4792. function CopyEnhMetaFile(Src: HEnhMetafile; FileName: PChar): HEnhMetafile;
  4793. function CopyFile(ExistingFileName,NewFileName: PChar; FailIfExists: Bool): Bool;
  4794. function CopyIcon(Icon: HIcon): HIcon;
  4795. function CopyMetaFile(MetaFile: HMetafile; FileName: PChar): HMetafile;
  4796. function CopyRect(var Dest: TRect; const Src: TRect): Bool;
  4797. function CountClipboardFormats: Integer;
  4798. function CreateAcceleratorTable(var Accel; Count: Integer): HAccel;
  4799. function CreateBitmap(Width,Height: Integer; Planes,BitCount: Longint; Bits: Pointer): HBitmap;
  4800. function CreateBitmapIndirect(const Bitmap: TBitMap): HBitmap;
  4801. function CreateBrushIndirect(const Brush: TLogBrush): HBrush;
  4802. function CreateCaret(Wnd: hWnd; Bitmap: HBitmap; Width,Height: Integer): Bool;
  4803. function CreateCompatibleBitmap(DC: HDC; Width,Height: Integer): HBitmap;
  4804. function CreateCompatibleDC(DC: HDC): HDC;
  4805. function CreateCursor(Inst: hInst; XHotSpot,YHotSpot,Width,Height: Integer; ANDPlane,XORPlane: Pointer): HCursor;
  4806. function CreateDC(Driver,Device,Output: PChar; Init: PDeviceMode): HDC;
  4807. function CreateDIBPatternBrushPt(const PackedDIB: Pointer; Usage: UInt): HBrush;
  4808. function CreateDIBitmap(DC: HDC; var InfoHeader: TBitmapInfoHeader; Usage: DWord; InitBits: PChar; var InitInfo: TBitmapInfo; wUsage: UInt): HBitmap;
  4809. function CreateDialog(Instance: hInst; TemplateName: PChar; WndParent: hWnd; DialogFunc: TFNDlgProc): hWnd;
  4810. function CreateDialogParam(Instance: hInst; TemplateName: PChar; WndParent: hWnd; DialogFunc: TFNDlgProc; Param: lParam): hWnd;
  4811. function CreateDialogIndirect(Instance: hInst; const Template: TDlgTemplate; WndParent: hWnd; DialogFunc: TFNDlgProc): hWnd;
  4812. function CreateDialogIndirectParam(Instance: hInst; const Template: TDlgTemplate; WndParent: hWnd; DialogFunc: TFNDlgProc; Param: lParam): hWnd;
  4813. function CreateDirectory(PathName: PChar; SecurityAttributes: PSecurityAttributes): Bool;
  4814. function CreateEllipticRgn(X1,Y1,X2,Y2: Integer): HRgn;
  4815. function CreateEllipticRgnIndirect(const Rect: TRect): HRgn;
  4816. function CreateEnhMetaFile(DC: HDC; FileName: PChar; Rect: PRect; Description: PChar): HEnhMetafile;
  4817. function CreateEvent(EventAttributes: PSecurityAttributes; ManualReset,InitialState: Bool; Name: PChar): THandle;
  4818. function CreateFile(FileName: PChar; DesiredAccess,ShareMode: Integer; SecurityAttributes: PSecurityAttributes; CreationDisposition,FlagsAndAttributes: DWord; TemplateFile: THandle): THandle;
  4819. function CreateFont(Height,Width,Escapement,Orientaion,Weight: Integer; Italic,Underline,StrikeOut,CharSet,OutputPrecision,ClipPrecision,Quality,PitchAndFamily: DWord; FaceName: PChar): HFont;
  4820. function CreateFontIndirect(const Font: TLogFont): HFont;
  4821. function CreateHalftonePalette(dc: Hdc): hPalette;
  4822. function CreateHatchBrush(Style: Longint; Color: TColorRef): HBrush;
  4823. function CreateIC(Driver,Device,Output: PChar; Init: PDeviceMode): HDC;
  4824. function CreateIcon(Instance: hInst; Width,Height: Integer; Planes,BitsPixel: Byte; ANDbits,XORBits: Pointer): HIcon;
  4825. function CreateIconFromResource(PresBits: PByte; ResSize: DWord; Icon: Bool; Ver: DWord): HIcon;
  4826. function CreateIconIndirect(var IconInfo: TIconInfo): HIcon;
  4827. function CreateMenu: hMenu;
  4828. function CreateMetaFile(Name: PChar): HDC;
  4829. function CreateMDIWindow(ClassName,WindowName: PChar; Style: DWord; X,Y,Width,Height: Integer; WndParent: hWnd; Instance: hInst; Param: lParam): hWnd;
  4830. function CreateMutex(MutexAttributes: PSecurityAttributes; InitialOwner: Bool; Name: PChar): THandle;
  4831. function CreatePalette(const Pal: TLogPalette): HPalette;
  4832. function CreatePatternBrush(Bitmap: HBitmap): HBrush;
  4833. function CreatePen(Style,Width: Integer; Color: TColorRef): HPen;
  4834. function CreatePenIndirect(const Pen: TLogPen): HPen;
  4835. function CreatePolyPolygonRgn(const PtStructs,pIntArray; Count,PolyFillMode: Integer): HRgn;
  4836. function CreatePolygonRgn(const Points; Count,FillMode: Integer): HRgn;
  4837. function CreatePopupMenu: hMenu;
  4838. function CreateProcess(AppName,CmdLine: PChar; ProcessAttrs,ThreadAttrs: PSecurityAttributes; InheritHandles: Bool; CreationFlags: DWord; Env: Pointer; CurDir: PChar; const SI: TStartupInfo; var PI: TProcessInformation): Bool;
  4839. function CreateRectRgn(X1,Y1,X2,Y2: Integer): HRgn;
  4840. function CreateRectRgnIndirect(const Rect: TRect): HRgn;
  4841. function CreateRoundRectRgn(X1,Y1,X2,Y2,Width,Height: Integer): HRgn;
  4842. function CreateSemaphore(SemAttr: PSecurityAttributes; InitCount,MaxCount: Longint; Name: PChar): THandle;
  4843. function CreateSolidBrush(Color: TColorRef): HBrush;
  4844. function CreateThread(hreadAttributes: Pointer; StackSize: DWord; StartAddress: TFNThreadStartRoutine; Parameter: Pointer; CreationFlags: DWord; var ThreadId: DWord): THandle;
  4845. function CreateWindowEx(ExStyle: DWord; ClassName,WindowName: PChar; Style: DWord; X,Y,Width,Height: Integer; WndParent: hWnd; Menu: hMenu; Instance: hInst; Param: Pointer): hWnd;
  4846. function DPtoLP(DC: HDC; var Points; Count: Integer): Bool;
  4847. function DefDlgProc(Dlg: hWnd; Msg: UInt; WP: wParam; LP: lParam): lResult;
  4848. function DeferWindowPos(WinPosInfo: HDWP; Wnd,WndInsertAfter: hWnd; X,Y,CX,CY: Integer; Flags: UInt): HDWP;
  4849. function DefFrameProc(Wnd,WndMDIClient: hWnd; Msg: UInt; WP: wParam; LP: lParam): lResult;
  4850. function DefMDIChildProc(Wnd: hWnd; Msg: UInt; WP: wParam; LP: lParam): lResult;
  4851. function DefWindowProc(Wnd: hWnd; Msg: UInt; WP: wParam; LP: lParam): lResult;
  4852. function DeleteAtom(Atom: TAtom): TAtom;
  4853. procedure DeleteCriticalSection(var CriticalSection: TRTLCriticalSection);
  4854. function DeleteDC(DC: HDC): Bool;
  4855. function DeleteEnhMetaFile(Metafile: HEnhMetafile): Bool;
  4856. function DeleteFile(FileName: PChar): Bool;
  4857. function DeleteMenu(Menu: hMenu; Position,Flags: UInt): Bool;
  4858. function DeleteMetaFile(Metafile: HMetafile): Bool;
  4859. function DeleteObject(GDIObject: THandle): Bool;
  4860. function DestroyAcceleratorTable(Accel: HAccel): Bool;
  4861. function DestroyCaret: Bool;
  4862. function DestroyCursor(Cursor: HCursor): Bool;
  4863. function DestroyIcon(Icon: HIcon): Bool;
  4864. function DestroyMenu(Menu: hMenu): Bool;
  4865. function DestroyWindow(Wnd: hWnd): Bool;
  4866. function DeviceCapabilities(Device,Port: PChar; Capability: SmallWord; Output: PChar; DevMode: PDeviceMode): Integer;
  4867. function DialogBox(Instance: hInst; Template: PChar; WndParent: hWnd; DialogFunc: TFNDlgProc): Integer;
  4868. function DialogBoxParam(Instance: hInst; Template: PChar; WndParent: hWnd; DialogFunc: TFNDlgProc; Param: lParam): Integer;
  4869. function DialogBoxIndirect(Instance: hInst; const DlgTemplate: TDlgTemplate; WndParent: hWnd; DialogFunc: TFNDlgProc): Integer;
  4870. function DialogBoxIndirectParam(Instance: hInst; const DlgTemplate: TDlgTemplate; WndParent: hWnd; DialogFunc: TFNDlgProc; Param: lParam): Integer;
  4871. function DispatchMessage(const Msg: TMsg): Longint;
  4872. function DlgDirList(Dlg: hWnd; PathSpec: PChar; IDListBox,IDStaticPath: Integer; FileType: UInt): Integer;
  4873. function DlgDirListComboBox(Dlg: hWnd; PathSpec: PChar; IDComboBox,IDStaticPath: Integer; FileType: UInt): Integer;
  4874. function DlgDirSelectEx(Dlg: hWnd; Str: PChar; Count,IDListBox: Integer): Bool;
  4875. function DlgDirSelectComboBoxEx(Dlg: hWnd; Str: PChar; Count,IDComboBox: Integer): Bool;
  4876. function DllEntryPoint(Instance: hInst; Reason: DWord; Reserved: Pointer): Bool;
  4877. function DocumentProperties(Wnd: hWnd; hPrinter: THandle; pDeviceName: PChar;
  4878.   const pDevModeOutput: TDeviceMode; var pDevModeInput: TDeviceMode;
  4879.   fMode: DWord): Longint;
  4880. function DosDateTimeToFileTime(FatDate,FatTime: SmallWord; var FileTime: TFileTime): Bool;
  4881. function DrawFocusRect(DC: HDC; const Rect: TRect): Bool;
  4882. function DrawIcon(DC: HDC; X,Y: Integer; Icon: HIcon): Bool;
  4883. function DrawMenuBar(Wnd: hWnd): Bool;
  4884. function DrawText(DC: HDC; Str: PChar; Count: Integer; var Rect: TRect; Format: UInt): Integer;
  4885. function DuplicateHandle(SourceProcessHandle,SourceHandle,TargetProcessHandle: THandle; TargetHandle: PHandle; DesiredAccess: DWord; InheritHandle: Bool; Options: DWord): Bool;
  4886. function Ellipse(DC: HDC; X1,Y1,X2,Y2: Integer): Bool;
  4887. function EmptyClipboard: Bool;
  4888. function EnableMenuItem(Menu: hMenu; IDEnableItem,Enable: UInt): Bool;
  4889. function EnableScrollBar(Wnd: hWnd; SBflags,Arrows: UInt): Bool;
  4890. function EnableWindow(Wnd: hWnd; Enable: Bool): Bool;
  4891. function EndDeferWindowPos(WinPosInfo: HDWP): Bool;
  4892. function EndDialog(Wnd: hWnd; Result: Integer): Bool;
  4893. function EndDoc(DC: HDC): Longint;
  4894. function EndPage(DC: HDC): Longint;
  4895. function EndPath(DC: HDC): Bool;
  4896. function EndPaint(Wnd: hWnd; const Paint: TPaintStruct): Bool;
  4897. procedure EnterCriticalSection(var CriticalSection: TRTLCriticalSection);
  4898. function EnumChildWindows(Wnd: hWnd; EnumFunc: TFNWndEnumProc; Param: lParam): Bool;
  4899. function EnumClipboardFormats(Format: Longint): Integer;
  4900. function EnumEnhMetaFile(DC: HDC; MetaFile: HEnhMetafile; EnumProc: TFNEnhMFEnumProc; Data: Pointer; const Rect: TRect): Bool;
  4901. function EnumFonts(DC: HDC; Face: PChar; EnumProc: TFNFontEnumProc; Data: PChar): Integer;
  4902. function EnumFontFamilies(DC: HDC; Family: PChar; EnumProc: TFNFontEnumProc; Param: lParam): Integer;
  4903. function EnumMetaFile(DC: HDC; Metafile: HMetafile; EnumProc: TFNMFEnumProc; Param: lParam): Bool;
  4904. function EnumObjects(DC: HDC; ObjectType: Integer; ObjectFunc: TFNGObjEnumProc; Param: lParam): Integer;
  4905. function EnumPrinters(Flags: DWord; Name: PChar; Level: DWord;
  4906.   pPrinterEnum: Pointer; cbBuf: DWord; var pcbNeeded, pcReturned: DWord): Boolean;
  4907. function EnumProps(Wnd: hWnd; EnumFunc: TFNPropEnumProc): Integer;
  4908. function EnumPropsEx(Wnd: hWnd; EnumFunc: TFNPropEnumProcEx; Param: lParam): Integer;
  4909. function EnumThreadWindows(ThreadId: DWord; EnumProc: TFNWndEnumProc; Param: lParam): Bool;
  4910. function EnumWindows(EnumProc: TFNWndEnumProc; Param: lParam): Bool;
  4911. function EqualRect(const R1,R2: TRect): Bool;
  4912. function EqualRgn(Rgn1,Rgn2: HRgn): Bool;
  4913. function Escape(DC: HDC; Escape,cbInput: Integer; InData: PChar; OutData: Pointer): Integer;
  4914. function ExcludeClipRect(DC: HDC; X1,Y1,X2,Y2: Integer): Integer;
  4915. function ExcludeUpdateRgn(DC: HDC; Wnd: hWnd): Bool;
  4916. procedure ExitProcess(ExitCode: UInt);
  4917. procedure ExitThread(ExitCode: DWord);
  4918. function ExitWindows(Reserved: DWord; Code: UInt): Bool;
  4919. function ExitWindowsEx(Flags: DWord; Rserved: UInt): Bool;
  4920. function ExtCreatePen(PenStyle,Width: DWord; const Brush: TLogBrush; StyleCount: DWord; Style: Pointer): HPen;
  4921. function ExtCreateRegion(XForm: PXForm; Ciount: DWord; const RgnData: TRgnData): HRgn;
  4922. function ExtFloodFill(DC: HDC; X,Y: Longint; Color: TColorRef; FillType: UInt): Bool;
  4923. function ExtSelectClipRgn(DC: HDC; Rgn: HRgn; Mode: Integer): Integer;
  4924. function ExtTextOut(DC: HDC; X,Y: Integer; Options: UInt; Rect: PRect; Str: PChar; Count: UInt; DX: PInteger): Bool;
  4925. procedure FatalAppExit(Action: UInt; MessageText: PChar);
  4926. procedure FatalExit(ExitCode: Integer);
  4927. function FileTimeToDosDateTime(const FileTime: TFileTime; var FatDate,FatTime: SmallWord): Bool;
  4928. function FileTimeToLocalFileTime(const FileTime: TFileTime; var LocalFileTime: TFileTime): Bool;
  4929. function FileTimeToSystemTime(const FileTime: TFileTime; var SystemTime: TSystemTime): Bool;
  4930. function FillPath(DC: HDC): Bool;
  4931. function FillRect(DC: HDC; const Rect: TRect; Brush: HBrush): Integer;
  4932. function FillRgn(DC: HDC; Rgn: HRgn; Brush: HBrush): Bool;
  4933. function FindAtom(Str: PChar): TAtom;
  4934. function FindClose(FindFile: THandle): Bool;
  4935. function FindFirstFile(FileName: PChar; var FindFileData: TWIN32FindData): THandle;
  4936. function FindNextFile(FindFile: THandle; var FindFileData: TWIN32FindData): Bool;
  4937. function FindResource(Instance: hInst; ResName,ResType: PChar): HRSRC;
  4938. function FindWindow(ClassName,WindowName: PChar): hWnd;
  4939. function FlashWindow(Wnd: hWnd; Invert: Bool): Bool;
  4940. function FlattenPath(DC: HDC): Bool;
  4941. function FlushFileBuffers(FileHandle: THandle): Bool;
  4942. function FrameRect(DC: HDC; const Rect: TRect; Brush: HBrush): Integer;
  4943. function FrameRgn(DC: HDC; Rgn: HRgn; Brush: HBrush; Width,Height: Integer): Bool;
  4944. function FreeDDElParam(Msg: UInt; Param: Longint): Bool;
  4945. function FreeLibrary(Instance: hInst): Bool;
  4946. function GdiFlush: Boolean;
  4947. function GetACP: UInt;
  4948. function GetActiveWindow: hWnd;
  4949. function GetArcDirection(DC: HDC): Integer;
  4950. function GetAspectRatioFilterEx(DC: HDC; var AspectRation: TSize): Bool;
  4951. function GetAtomName(Atom: TAtom; Buffer: PChar; Size: Integer): UInt;
  4952. function GetBitmapBits(Bitmap: HBitmap; Count: Longint; Bits: Pointer): Longint;
  4953. function GetBitmapDimensionEx(Bitmap: HBitmap; var Dimension: TSize): Bool;
  4954. function GetBkColor(DC: HDC): TColorRef;
  4955. function GetBkMode(DC: HDC): Longint;
  4956. function GetBoundsRect(DC: HDC; var Rect: TRect; Flags: UInt): UInt;
  4957. function GetBrushOrgEx(DC: HDC; var Point: TPoint): Bool;
  4958. function GetCapture: hWnd;
  4959. function GetCaretBlinkTime: UInt;
  4960. function GetCaretPos(var Point: TPoint): Bool;
  4961. function GetCharABCWidths(DC: HDC; FirstChar,LastChar: UInt; const ABC): Bool;
  4962. function GetCharWidth(DC: HDC; FirstChar,LastChar: UInt; const Buffer): Bool;
  4963. function GetClassInfo(hInst: hInst; ClassName: PChar; var WndClass: TWndClass): Bool;
  4964. function GetClassLong(Wnd: hWnd; Index: Integer): DWord;
  4965. function GetClassName(Wnd: hWnd; ClassName: PChar; MaxCount: Integer): Integer;
  4966. function GetClassWord(Wnd: hWnd; Index: Integer): SmallWord;
  4967. function GetClientRect(Wnd: hWnd; var Rect: TRect): Bool;
  4968. function GetClipboardData(Format: UInt): THandle;
  4969. function GetClipboardFormatName(Format: UInt; FormatName: PChar; MaxCount: Integer): Integer;
  4970. function GetClipboardOwner: hWnd;
  4971. function GetClipboardViewer: hWnd;
  4972. function GetClipBox(DC: HDC; var Rect: TRect): Integer;
  4973. function GetClipCursor(var Rect: TRect): Bool;
  4974. function GetClipRgn(DC: HDC; Rgn: HRgn): Integer;
  4975. function GetCommandLine: PChar;
  4976. function GetCurrentDirectory(BufferLength: DWord; Buffer: PChar): DWord;
  4977. function GetCurrentObject(DC: HDC; ObjectType: UInt): HGDIObj;
  4978. function GetCurrentPositionEx(DC: HDC; Point: PPoint): Bool;
  4979. function GetCurrentProcess: THandle;
  4980. function GetCurrentProcessId: DWord;
  4981. function GetCurrentThread: THandle;
  4982. function GetCurrentThreadId: DWord;
  4983. function GetCurrentTime: Longint;
  4984. function GetCursor: HCursor;
  4985. function GetCursorPos(var Point: TPoint): Bool;
  4986. function GetDC(Wnd: hWnd): HDC;
  4987. function GetDCEx(Wnd: hWnd; Rgn: HRgn; Flags: DWord): HDC;
  4988. function GetDCOrgEx(DC: HDC; var Point: TPoint): Bool;
  4989. function GetDIBits(DC: HDC; Bitmap: HBitmap; StartScan,NumScans: UInt; Bits: Pointer; var BitInfo: TBitmapInfo; Usage: UInt): Integer;
  4990. function GetDeviceCaps(DC: HDC; Index: Integer): Integer;
  4991. function GetDialogBaseUnits: Longint;
  4992. function GetDiskFreeSpace(RootPathName: PChar; var SectorsPerCluster,BytesPerSector,NumberOfFreeClusters,TotalNumberOfClusters: DWord): Bool;
  4993. function GetDlgCtrlID(Wnd: hWnd): Integer;
  4994. function GetDlgItem(Dlg: hWnd; IDDlgItem: Integer): hWnd;
  4995. function GetDlgItemInt(Dlg: hWnd; IDDlgItem: Integer; var Translated: Bool; Signed: Bool): UInt;
  4996. function GetDlgItemText(Dlg: hWnd; IDDlgItem: Integer; Str: PChar; MaxCount: Integer): UInt;
  4997. function GetDoubleClickTime: UInt;
  4998. function GetDriveType(RootPathName: PChar): UInt;
  4999. function GetEnhMetaFile(Metafile: PChar): HEnhMetafile;
  5000. function GetEnhMetaFileBits(Metafile: HEnhMetafile; BufSize: UInt; Buffer: PByte): UInt;
  5001. function GetEnhMetaFileHeader(metafile: HEnhMetafile; BufSize: UInt; Buffer: PEnhMetaHeader): UInt;
  5002. function GetEnhMetaFilePaletteEntries(Metafile: HEnhMetafile; cEntries: UInt; ppe: Pointer): UInt;
  5003. function GetEnvironmentStrings: PChar;
  5004. function GetEnvironmentVariable(Name,Buffer: PChar; Size: DWord): DWord;
  5005. function GetExitCodeProcess(Process: THandle; var ExitCode: DWord): Bool;
  5006. function GetExitCodeThread(Thread: THandle; var ExitCode: DWord): Bool;
  5007. function GetFileAttributes(FileName: PChar): DWord;
  5008. function GetFileInformationByHandle(FileHandle: THandle; var FileInformation: TByHandleFileInformation): Bool;
  5009. function GetFileSize(Filehandle: THandle; FileSizeHigh: Pointer): DWord;
  5010. function GetFileTime(FileHandle: THandle; CreationTime,LastAccessTime,LastWriteTime: PFileTime): Bool;
  5011. function GetFileType(Filehandle: THandle): DWord;
  5012. function GetFocus: hWnd;
  5013. function GetForegroundWindow: hWnd;
  5014. function GetFullPathName(FileName: PChar; BufferLength: DWord; Buffer: PChar; var FilePart: PChar): DWord;
  5015. function GetGraphicsMode(DC: HDC): Integer;
  5016. function GetIconInfo(Icon: HIcon; var IconInfo: TIconInfo): Bool;
  5017. function GetKerningPairs(DC: HDC; Count: DWord; var KerningPairs): DWord;
  5018. function GetKeyboardType(TypeFlag: Integer): Integer;
  5019. function GetKeyNameText(Param: Longint; Str: PChar; Size: Integer): Integer;
  5020. function GetKeyState(VirtKey: Integer): SmallInt;
  5021. function GetLastActivePopup(Wnd: hWnd): hWnd;
  5022. function GetLastError: DWord;
  5023. procedure GetLocalTime(var SystemTime: TSystemTime);
  5024. function GetLogicalDriveStrings(BufferLength: DWord; Buffer: PChar): DWord;
  5025. function GetLogicalDrives: DWord;
  5026. function GetMapMode(DC: HDC): DWord;
  5027. function GetMenu(Wnd: hWnd): hMenu;
  5028. function GetMenuCheckMarkDimensions: Longint;
  5029. function GetMenuItemCount(Menu: hMenu): Integer;
  5030. function GetMenuItemID(Menu: hMenu; Pos: Integer): UInt;
  5031. function GetMenuState(Menu: hMenu; Id,Flags: UInt): UInt;
  5032. function GetMenuString(Menu: hMenu; IDItem: UInt; Str: PChar; MaxCount: Integer; Flags: UInt): Integer;
  5033. function GetMessage(var Msg: TMsg; Wnd: hWnd; MsgFilterMin,MsgFilterMax: UInt): Bool;
  5034. function GetMessageExtraInfo: Longint;
  5035. function GetMessagePos: DWord;
  5036. function GetMessageTime: Longint;
  5037. function GetMetaFile(MetaFile: PChar): HMetafile;
  5038. function GetMetaFileBitsEx(Metafile: HMetafile; Size: UInt; Data: Pointer): UInt;
  5039. function GetMiterLimit(DC: HDC; var Limit: Single): Bool;
  5040. function GetModuleFileName(Instance: hInst; FileName: PChar; Size: DWord): DWord;
  5041. function GetModuleHandle(ModuleName: PChar): hModule;
  5042. function GetNearestColor(DC: HDC; Color: TColorRef): TColorRef;
  5043. function GetNearestPaletteIndex(Pal: HPalette; Color: TColorRef): UInt;
  5044. function GetNextDlgGroupItem(Dlg,Ctl: hWnd; Previous: Bool): hWnd;
  5045. function GetNextDlgTabItem(Dlg,Ctl: hWnd; Previous: Bool): hWnd;
  5046. function GetNextWindow(Wnd: hWnd; Cmd: UInt): hWnd;
  5047. function GetOEMCP: UInt;
  5048. function GetObject(GDIObj: HGDIObj; BufSize: Integer; pObject: Pointer): Integer;
  5049. function GetObjectType(GDIObj: HGDIObj): Longint;
  5050. function GetOpenClipboardWindow: hWnd;
  5051. function GetOutlineTextMetrics(DC: HDC; DataSize: UInt; OTM: Pointer): UInt;
  5052. function GetOverlappedResult(Filehandle: THandle; const Overlapped: TOverlapped; var NumberOfBytesTransferred: DWord; Wait: Bool): Bool;
  5053. function GetPaletteEntries(Palette: HPalette; StartIndex,NumEntries: UInt; var PaletteEntries): UInt;
  5054. function GetParent(Wnd: hWnd): hWnd;
  5055. function GetPath(DC: HDC; var Points,Types,Size: Integer): Integer;
  5056. function GetPixel(DC: HDC; X,Y: Integer): TColorRef;
  5057. function GetPolyFillMode(DC: HDC): Integer;
  5058. function GetPriorityClass(Process: THandle): DWord;
  5059. function GetPriorityClipboardFormat(var FormatPriorityList; cFormats: Integer): Integer;
  5060. function GetPrivateProfileInt(AppName,KeyName: PChar; Default: Integer; FileName: PChar): UInt;
  5061. function GetPrivateProfileString(AppName,KeyName,Default,ReturnedString: PChar; Size: DWord; FileName: PChar): DWord;
  5062. function GetProcAddress(Module: hModule; ProcName: PChar): TFarProc;
  5063. function GetProfileInt(AppName,KeyName: PChar; Default: Integer): UInt;
  5064. function GetProfileString(AppName,KeyName,Default,ReturnedString: PChar; Size: DWord): DWord;
  5065. function GetProp(Wnd: hWnd; Str: PChar): THandle;
  5066. function GetQueueStatus(Flags: UInt): DWord;
  5067. function GetROP2(DC: HDC): Integer;
  5068. function GetRasterizerCaps(var Status: TRasterizerStatus; Size: UInt): Bool;
  5069. function GetRgnBox(Rgn: HRgn; var Rect: TRect): Integer;
  5070. function GetRegionData(Rgn: HRgn; Count: DWord; RgnData: PRgnData): DWord;
  5071. function GetScrollPos(Wnd: hWnd; Bar: Integer): Integer;
  5072. function GetScrollRange(Wnd: hWnd; Bar: Integer; var MinPos,MaxPos: Integer): Bool;
  5073. function GetStdHandle(StdHandle: DWord): THandle;
  5074. function GetStockObject(Index: Integer): HGDIObj;
  5075. function GetStretchBltMode(DC: HDC): Integer;
  5076. function GetSubMenu(Wnd: hWnd; Pos: Integer): hMenu;
  5077. function GetSysColor(Index: Integer): DWord;
  5078. function GetSystemDirectory(Buffer: PChar; Size: UInt): UInt;
  5079. function GetSystemMenu(Wnd: hWnd; Revert: Bool): hMenu;
  5080. function GetSystemMetrics(Index: Integer): Integer;
  5081. function GetSystemPaletteEntries(DC: HDC; StartIndex,NumEntries: UInt; var PaletteEntries): UInt;
  5082. procedure GetSystemTime(var SystemTime: TSystemTime);
  5083. function GetTabbedTextExtent(DC: HDC; Str: PChar; Count,TabPositions: Integer; var TabStopPositions): DWord;
  5084. function GetTempFileName(PathName,PrefixString: PChar; Unique: UInt; TempFileName: PChar): UInt;
  5085. function GetTempPath(BufferLength: DWord; Buffer: PChar): DWord;
  5086. function GetTextAlign(DC: HDC): UInt;
  5087. function GetTextCharacterExtra(DC: HDC): Integer;
  5088. function GetTextColor(DC: HDC): TColorRef;
  5089. function GetTextExtentPoint(DC: HDC; Str: PChar; Count: Integer; var Size: TSize): Bool;
  5090. function GetTextExtentPoint32(DC: HDC; Str: PChar; Count: Integer; var Size: TSize): Bool;
  5091. function GetTextFace(DC: HDC; Count: Integer; Buffer: PChar): Integer;
  5092. function GetTextMetrics(DC: HDC; var TM: TTextMetric): Bool;
  5093. function GetThreadPriority(Thread: THandle): Integer;
  5094. function GetTickCount: DWord;
  5095. function GetTimeZoneInformation(var TimeZoneInformation: TTimeZoneInformation): DWord;
  5096. function GetTopWindow(Wnd: hWnd): hWnd;
  5097. function GetUpdateRect(Wnd: hWnd; var Rect: TRect; Erase: Bool): Bool;
  5098. function GetUpdateRgn(Wnd: hWnd; Rgn: HRgn; Erase: Bool): Integer;
  5099. function GetViewportExtEx(DC: HDC; var Size: TSize): Bool;
  5100. function GetViewportOrgEx(DC: HDC; Point: PPoint): Bool;
  5101. function GetVolumeInformation(RootPathName,VolumeNameBuffer: PChar; VolumeNameSize: DWord; VolumeSerialNumber: PDWord; var MaximumComponentLength,FileSystemFlags: DWord; FileSystemNameBuffer: PChar; FileSystemNameSize: DWord): Bool;
  5102. function GetWinMetaFileBits(Metafile: HEnhMetafile; BufSize: UInt; Buffer: PByte; MapMode: Integer; RefDC: HDC): UInt;
  5103. function GetWindow(Wnd: hWnd; Cmd: UInt): hWnd;
  5104. function GetWindowDC(Wnd: hWnd): HDC;
  5105. function GetWindowExtEx(DC: HDC; var Size: TSize): Bool;
  5106. function GetWindowLong(Wnd: hWnd; Index: Integer): Longint;
  5107. function GetWindowOrgEx(DC: HDC; var Point: TPoint): Bool;
  5108. function GetWindowPlacement(Wnd: hWnd; WindowPlacement: PWindowPlacement): Bool;
  5109. function GetWindowRect(Wnd: hWnd; var Rect: TRect): Bool;
  5110. function GetWindowsDirectory(Buffer: PChar; Size: UInt): UInt;
  5111. function GetWindowText(Wnd: hWnd; Str: PChar; MaxCount: Integer): Integer;
  5112. function GetWindowTextLength(Wnd: hWnd): Integer;
  5113. function GetWindowThreadProcessId(Wnd: hWnd; ProcessId: Pointer): DWord;
  5114. function GetWindowWord(Wnd: hWnd; Index: Integer): SmallWord;
  5115. function GetWorldTransform(DC: HDC; var XForm: TXForm): Bool;
  5116. function GlobalAddAtom(Str: PChar): TAtom;
  5117. function GlobalAlloc(Flags: UInt; Bytes: DWord): HGlobal;
  5118. function GlobalDeleteAtom(Atom: TAtom): TAtom;
  5119. function GlobalDiscard(Handle: HGlobal): HGlobal;
  5120. function GlobalFindAtom(Str: PChar): TAtom;
  5121. function GlobalFlags(Mem: HGlobal): UInt;
  5122. function GlobalFree(Mem: HGlobal): HGlobal;
  5123. function GlobalGetAtomName(Atom: TAtom; Buffer: PChar; Size: Integer): UInt;
  5124. function GlobalHandle(Mem: Pointer): HGlobal;
  5125. function GlobalLock(Mem: HGlobal): Pointer;
  5126. procedure GlobalMemoryStatus(var MemoryStatus: TMemoryStatus);
  5127. function GlobalReAlloc(Mem: HGlobal; Bytes: DWord; Flags: UInt): HGlobal;
  5128. function GlobalSize(Mem: HGlobal): DWord;
  5129. function GlobalUnlock(Mem: HGlobal): Bool;
  5130. function HeapAlloc(Heap: THandle; Flags,Bytes: DWord): Pointer;
  5131. function HeapCreate(Options,InitialSize,MaxSize: DWord): THandle;
  5132. function HeapDestroy(Heap: THandle): Bool;
  5133. function HeapFree(Heap: THandle; Flags: DWord; Mem: Pointer): Bool;
  5134. function HeapReAlloc(Heap: THandle; Flags: DWord; Mem: Pointer; Bytes: DWord): Pointer;
  5135. function HeapSize(Heap: THandle; Flags: DWord; Mem: Pointer): DWord;
  5136. function HideCaret(Wnd: hWnd): Bool;
  5137. function HiliteMenuItem(Wnd: hWnd; Menu: hMenu; IDHiliteItem,Hilite: UInt): Bool;
  5138. function InflateRect(var Rect: TRect; DX,DY: Integer): Bool;
  5139. function InSendMessage: Bool;
  5140. function InitAtomTable(Size: DWord): Bool;
  5141. procedure InitializeCriticalSection(CriticalSection: TRTLCriticalSection);
  5142. function InsertMenu(Menu: hMenu; Position,Flags,IDNewItem: UInt; NewItem: PChar): Bool;
  5143. function InterlockedDecrement(var Addend: Integer): Integer;
  5144. function InterlockedExchange(var Target: Integer; Value: Integer): Integer;
  5145. function InterlockedIncrement(var Addend: Integer): Integer;
  5146. function IntersectClipRect(DC: HDC; X1,Y1,X2,Y2: Integer): Integer;
  5147. function IntersectRect(var Dest: TRect; const Src1,Src2: TRect): Bool;
  5148. function InvalidateRect(Wnd: hWnd; Rect: PRect; Erase: Bool): Bool;
  5149. function InvalidateRgn(Wnd: hWnd; Rgn: HRgn; Erase: Bool): Bool;
  5150. function InvertRect(DC: HDC; const Rect: TRect): Bool;
  5151. function InvertRgn(DC: HDC; Rgn: HRgn): Bool;
  5152. function IsBadCodePtr(Code: TFarProc): Bool;
  5153. function IsBadReadPtr(Data: Pointer; Size: UInt): Bool;
  5154. function IsBadStringPtr(Str: PChar; MaxCount: UInt): Bool;
  5155. function IsBadWritePtr(Mem: Pointer; Size: UInt): Bool;
  5156. function IsChild(WndParent,Wnd: hWnd): Bool;
  5157. function IsClipboardFormatAvailable(Format: UInt): Bool;
  5158. function IsDBCSLeadByte(TestChar: Byte): Bool;
  5159. function IsDialogMessage(Wnd: hWnd; var Msg: TMsg): Bool;
  5160. function IsDlgButtonChecked(Dlg: hWnd; IDButton: Integer): UInt;
  5161. function IsIconic(Wnd: hWnd): Bool;
  5162. function IsMenu(Menu: hMenu): Bool;
  5163. function IsRectEmpty(const Rect: TRect): Bool;
  5164. function IsWindow(Wnd: hWnd): Bool;
  5165. function IsWindowEnabled(Wnd: hWnd): Bool;
  5166. function IsWindowVisible(Wnd: hWnd): Bool;
  5167. function IsZoomed(Wnd: hWnd): Bool;
  5168. function KillTimer(Wnd: hWnd; IDEvent: UInt): Bool;
  5169. function LPtoDP(DC: HDC; var Points; Count: Integer): Bool;
  5170. procedure LeaveCriticalSection(var CriticalSection: TRTLCriticalSection);
  5171. function LineDDA(X1,Y1,X2,Y2: Integer; LineFunc: TFNLineDDAProc; Data: lParam): Bool;
  5172. function LineTo(DC: HDC; X,Y: Integer): Bool;
  5173. function LoadAccelerators(Instance: hInst; TableName: PChar): HAccel;
  5174. function LoadBitmap(Instance: hInst; BitmapName: PChar): HBitmap;
  5175. function LoadCursor(Instance: hInst; CursorName: PChar): HCursor;
  5176. function LoadIcon(Instance: hInst; IconName: PChar): HIcon;
  5177. function LoadLibrary(LibFileName: PChar): hInst;
  5178. function LoadMenu(Instance: hInst; MenuName: PChar): hMenu;
  5179. function LoadMenuIndirect(MenuTemplate: Pointer): hMenu;
  5180. function LoadModule(ModuleName: PChar; ParameterBlock: Pointer): DWord;
  5181. function LoadResource(Instance: hInst; ResInfo: HRSRC): HGlobal;
  5182. function FreeResource(hResData: HGLOBAL): Bool;
  5183. function LockResource(ResData: HGlobal): Pointer;
  5184. function UnlockResource(hResData: THandle): Bool;
  5185. function LoadString(Instance: hInst; ID: UInt; Buffer: PChar; BufferMax: Integer): Integer;
  5186. function LocalAlloc(Flags,Bytes: UInt): HLocal;
  5187. function LocalDiscard(Mem: HLocal): HLocal;
  5188. function LocalFlags(Mem: HLocal): UInt;
  5189. function LocalFileTimeToFileTime(const LocalFileTime: TFileTime; var FileTime: TFileTime): Bool;
  5190. function LocalFree(Mem: HLocal): HLocal;
  5191. function LocalHandle(Mem: Pointer): HLocal;
  5192. function LocalUnlock(Mem: HLocal): Bool;
  5193. function LocalReAlloc(Mem: HLocal; Bytes,Flags: UInt): HLocal;
  5194. function LocalSize(Mem: HLocal): UInt;
  5195. function LocalLock(Mem: HLocal): Pointer;
  5196. function LockFile(FileHandle: THandle; FileOffsetLow,FileOffsetHigh,NumberOfBytesToLockLow,NumberOfBytesToLockHigh: DWord): Bool;
  5197. function LockWindowUpdate(Wnd: hWnd): Bool;
  5198. function MapDialogRect(Wnd: hWnd; var Rect: TRect): Bool;
  5199. function MapVirtualKey(Code,MapType: UInt): UInt;
  5200. function MapWindowPoints(WndFrom,WndTo: hWnd; var Points; cPoints: UInt): Integer;
  5201. function MaskBlt(DestDC: HDC; X,Y,Width,Hight: Integer; SrcDC: HDC; XSrc,YSrc: Integer; Mask: HBitmap; XMask,YMask: Integer; Rop: DWord): Bool;
  5202. function MessageBox(Wnd: hWnd; Text,Caption: PChar; uType: UInt): Integer;
  5203. function MessageBeep(uType: UInt): Bool;
  5204. function MsgWaitForMultipleObjects(Count: DWord; var Handles; WaitAll: Bool; Milliseconds,WakeMask: DWord): DWord;
  5205. function ModifyMenu(Menu: hMenu; Pos,Flags,IDNewItem: UInt; NewItem: PChar): Bool;
  5206. function ModifyWorldTransform(DC: HDC; const XForm: TXForm; Mode: DWord): Bool;
  5207. function MoveFile(ExistingFileName,NewFileName: PChar): Bool;
  5208. function MoveToEx(DC: HDC; X,Y: Integer; OldPos: PPoint): Bool;
  5209. function MoveWindow(Wnd: hWnd; X,Y,Width,Height: Integer; Repaint: Bool): Bool;
  5210. function MulDiv(Number,Numerator,Denominator: Integer): Integer;
  5211. function OffsetClipRgn(DC: HDC; DX,DY: Integer): Integer;
  5212. function OffsetRect(var Rect: TRect; DX,DY: Integer): Bool;
  5213. function OffsetRgn(Rgn: HRgn; DX,DY: Integer): Integer;
  5214. function OffsetViewportOrgEx(DC: HDC; X,Y: Integer; var Points): Bool;
  5215. function OffsetWindowOrgEx(DC: HDC; X,Y: Integer; var Points): Bool;
  5216. function OpenClipboard(Wnd: hWnd): Bool;
  5217. function OpenEvent(DesiredAccess: DWord; InheritHandle: Bool; Name: PChar): THandle;
  5218. function OpenFile(FileName: PChar; var ReOpenBuff: TOFStruct; Style: UInt): HFile;
  5219. function OpenMutex(DesiredAccess: DWord; InheritHandle: Bool; Name: PChar): THandle;
  5220. function OpenPrinter(pPrinterName: PChar; var phPrinter: THandle; pDefault: PPrinterDefaults): Boolean;
  5221. function OpenProcess(DesiredAccess: DWord; InheritHandle: Bool; ProcessId: DWord): THandle;
  5222. function OpenSemaphore(DesiredAccess: DWord; InheritHandle: Bool; Name: PChar): THandle;
  5223. procedure OutputDebugString(OutputString: PChar);
  5224. function PackDDElParam(Msg,Lo,Hi: UInt): Longint;
  5225. function PaintRgn(DC: HDC; Rgn: HRgn): Bool;
  5226. function PatBlt(DC: HDC; X,Y,Width,Height: Integer; Rop: DWord): Bool;
  5227. function PathToRegion(DC: HDC): HRgn;
  5228. function PeekMessage(var Msg: TMsg; Wnd: hWnd; MsgFilterMin,MsgFilterMax,RemoveMsg: UInt): Bool;
  5229. function Pie(DC: HDC; X1,Y2,X2,Y2,X3,Y3,X4,Y4: Integer): Bool;
  5230. function PlayEnhMetaFile(DC: HDC; Metafile: HEnhMetafile; const Rect: TRect): Bool;
  5231. function PlayMetaFile(DC: HDC; Metafile: HMetafile): Bool;
  5232. function PlayMetaFileRecord(DC: HDC; const HandleTable: THandleTable; const MetaRecord: TMetaRecord; cHandles: UInt): Bool;
  5233. function PolyBezier(DC: HDC; const Points; Count: DWord): Bool;
  5234. function PolyBezierTo(DC: HDC; const Points; Count: DWord): Bool;
  5235. function PolyDraw(DC: HDC; const Points,Types; cCount: Integer): Bool;
  5236. function Polygon(DC: HDC; var Points; Count: Integer): Bool;
  5237. function Polyline(DC: HDC; var Points; Count: Integer): Bool;
  5238. function PolylineTo(DC: HDC; const Points; Count: DWord): Bool;
  5239. function PolyPolygon(DC: HDC; var Points,nPoints; nCount: Integer): Bool;
  5240. function PolyPolyline(DC: HDC; const PointStructs,Points; cCount: DWord): Bool;
  5241. procedure PostQuitMessage(ExitCode: Integer);
  5242. function PostMessage(Wnd: hWnd; Msg: UInt; WP: wParam; LP: lParam): Bool;
  5243. function PostThreadMessage(Thread: DWord; Msg: UInt; WP: wParam; LP: lParam): Bool;
  5244. function PtInRect(const Rect: TRect; Point: TPoint): Bool;
  5245. function PtInRegion(Rgn: HRgn; X,Y: Integer): Bool;
  5246. function PtVisible(DC: HDC; X,Y: Integer): Bool;
  5247. function PulseEvent(Event: THandle): Bool;
  5248. function ReadFile(FileHandle: THandle; var Buffer; NumberOfBytesToRead: DWord; var NumberOfBytesRead: DWord; Overlapped: POverlapped): Bool;
  5249. function RealizePalette(DC: HDC): UInt;
  5250. function RectInRegion(Rgn: HRgn; const Rect: TRect): Bool;
  5251. function RectVisible(DC: HDC; const Rect: TRect): Bool;
  5252. function Rectangle(DC: HDC; X1,Y1,X2,Y2: Integer): Bool;
  5253. function RedrawWindow(Wnd: hWnd; UpdateRect: PRect; UpdateRgn: HRgn; Flags: UInt): Bool;
  5254. function RegCloseKey(Key: HKey): Longint;
  5255. function RegCreateKey(Key: HKey; Subkey: PChar; var Result: HKey): Longint;
  5256. function RegCreateKeyEx(Key: HKey; Subkey: PChar; Reserved: DWord; kClass: PChar; Options: DWord; Desired: REGSAM; SecurityAttributes: PSecurityAttributes; var Result: HKey; Disposition: PDWord): Longint;
  5257. function RegDeleteKey(Key: HKey; SubKey: PChar): Longint;
  5258. function RegDeleteValue(Key: HKey; ValueName: PChar): Longint;
  5259. function RegEnumKey(Key: HKey; Index: DWord; Name: PChar; cbName: DWord): Longint;
  5260. function RegEnumKeyEx(Key: HKey; Index: DWord; Name: PChar; var cbName: DWord; Reserved: Pointer; kClass: PChar; cbClass: PDWord; LastWriteTime: PFileTime): Longint;
  5261. function RegEnumValue(Key: HKey; Index: DWord; ValueName: PChar; var ValueName: DWord; Reserved: Pointer; lpType: PDWord; Data: PByte; cbData: PDWord): Longint;
  5262. function RegOpenKey(Key: HKey; Subkey: PChar; var Result: HKey): Longint;
  5263. function RegOpenKeyEx(Key: HKey; Subkey: PChar; Options: DWord; Desired: REGSAM; var Result: HKey): Longint;
  5264. function RegQueryInfoKey(Key: HKey; kClass: PChar; pcbClass: PDWord; Reserved: Pointer; ubKeys,MaxSubKeyLen,MaxClassLen,Values,MaxValueNameLen,MaxValueLen,SecurityDescriptor: PDWord; LastWriteTime: PFileTime): Longint;
  5265. function RegQueryValue(Key: HKey; SubKey,Value: PChar; var cbValue: Longint): Longint;
  5266. function RegQueryValueEx(Key: HKey; ValueName: PChar; Reserved: Pointer; lpType: PDWord; Data: PByte; cbData: PDWord): Longint;
  5267. function RegSetValue(Key: HKey; SubKey: PChar; dwType: DWord; Data: PChar; cbData: DWord): Longint;
  5268. function RegSetValueEx(Key: HKey; SubKey: PChar; Reserved,dwType: DWord; Data: Pointer; cbData: DWord): Longint;
  5269. function RegisterClass(const WndClass: TWndClass): TAtom;
  5270. function RegisterClipboardFormat(Format: PChar): UInt;
  5271. function RegisterWindowMessage(Str: PChar): UInt;
  5272. function ReleaseCapture: Bool;
  5273. function ReleaseDC(Wnd: hWnd; DC: HDC): Integer;
  5274. function ReleaseMutex(Mutex: THandle): Bool;
  5275. function ReleaseSemaphore(Semaphore: THandle; ReleaseCount: Longint; PreviousCount: Pointer): Bool;
  5276. function RemoveDirectory(PathName: PChar): Bool;
  5277. function RemoveFontResource(FileName: PChar): Bool;
  5278. function RemoveMenu(Menu: hMenu; Pos,Flags: UInt): Bool;
  5279. function RemoveProp(Wnd: hWnd; Str: PChar): THandle;
  5280. function ReplyMessage(Result: lResult): Bool;
  5281. function ResetDC(DC: HDC; const InitData: TDeviceMode): Bool;
  5282. function ResetEvent(Event: THandle): Bool;
  5283. function ResizePalette(Pal: HPalette; Entries: UInt): Bool;
  5284. function RestoreDC(DC: HDC; SavedDC: Integer): Bool;
  5285. function ResumeThread(Thread: THandle): DWord;
  5286. function ReuseDDElParam(Param: Longint; msgIn,msgOut,Lo,Hi: UInt): Longint;
  5287. function RoundRect(DC: HDC; X1,Y1,X2,Y2,X3,Y3: Integer): Bool;
  5288. function SaveDC(DC: HDC): Integer;
  5289. function ScaleViewportExtEx(DC: HDC; XM,XD,YM,YD: Integer; Size: PSize): Bool;
  5290. function ScaleWindowExtEx(DC: HDC; XM,XD,YM,YD: Integer; Size: PSize): Bool;
  5291. function ScreenToClient(Wnd: hWnd; var Point: TPoint): Bool;
  5292. function ScrollDC(DC: HDC; DX,DY: Integer; var Scroll,Clip: TRect; Rgn: HRgn; Update: PRect): Bool;
  5293. function ScrollWindow(Wnd: hWnd; X,Y: Integer; Scroll,Clip: PRect): Bool;
  5294. function ScrollWindowEx(Wnd: hWnd; X,Y: Integer; Scroll,Clip: PRect; UpdateRgn: HRgn; UpdateRect: PRect; Flags: UInt): Bool;
  5295. function SearchPath(Path,FileName,Extension: PChar; BufferLength: DWord; Buffer: PChar; const FilePart: PChar): DWord;
  5296. function SelectClipRgn(DC: HDC; Rgn: HRgn): Integer;
  5297. function SelectObject(DC: HDC; GDIObj: HGDIObj): HGDIObj;
  5298. function SelectPalette(DC: HDC; Pal: HPalette; ForceBackground: Bool): HPalette;
  5299. function SendDlgItemMessage(Wnd: hWnd; IDDlgItem: Integer; Msg: UInt; WP: wParam; LP: lParam): Longint;
  5300. function SendMessage(hWnd: hWnd; Msg: UInt; WP: wParam; LP: lParam): lResult;
  5301. function SetActiveWindow(Wnd: hWnd): hWnd;
  5302. function SetArcDirection(DC: HDC; Direction: Integer): Integer;
  5303. function SetBitmapBits(Bitmap: HBitmap; cBytes: DWord; Bits: Pointer): Longint;
  5304. function SetBitmapDimensionEx(Bitmap: HBitmap; Width,Height: Integer; Size: PSize): Bool;
  5305. function SetBkColor(DC: HDC; Color: TColorRef): TColorRef;
  5306. function SetBkMode(DC: HDC; BkMode: Integer): Integer;
  5307. function SetBoundsRect(DC: HDC; Bounds: PRect; Flags: UInt): UInt;
  5308. function SetBrushOrgEx(DC: HDC; X,Y: Integer; var Points): Bool;
  5309. function SetCapture(Wnd: hWnd): hWnd;
  5310. function SetCaretBlinkTime(MSeconds: UInt): Bool;
  5311. function SetCaretPos(X,Y: Integer): Bool;
  5312. function SetClassLong(Wnd: hWnd; Index: Integer; NewLong: Longint): DWord;
  5313. function SetClassWord(Wnd: hWnd; Index: Integer; NewWord: SmallWord): SmallWord;
  5314. function SetClipboardData(Format: UInt; Mem: THandle): THandle;
  5315. function SetClipboardViewer(Wnd: hWnd): hWnd;
  5316. function SetCurrentDirectory(PathName: PChar): Bool;
  5317. function SetCursor(Cursor: HCursor): HCursor;
  5318. function SetCursorPos(X,Y: Integer): Bool;
  5319. function SetDIBits(DC: HDC; Bitmap: HBitmap; StartScan,NumScans: UInt; Bits: Pointer; var BitsInfo: TBitmapInfo; Usage: UInt): Integer;
  5320. function SetDIBitsToDevice(DC: HDC; X,Y,Width,Height: DWord; XSrc,YSrc: Integer; StartScan,NumScans: UInt; Bits: Pointer; var BitsInfo: TBitmapInfo; Usage: UInt): Integer;
  5321. function SetDlgItemInt(Wnd: hWnd; IDDlgItem: Integer; Value: UInt; Signed: Bool): Bool;
  5322. function SetDlgItemText(Wnd: hWnd; DDlgItem: Integer; Str: PChar): Bool;
  5323. function SetDoubleClickTime(Interval: UInt): Bool;
  5324. function SetEndOfFile(FileHandle: THandle): Bool;
  5325. function SetEnhMetaFileBits(BufSize: UInt; Buffer: PChar): HEnhMetafile;
  5326. function SetEnvironmentVariable(Name,Value: PChar): Bool;
  5327. function SetEvent(Event: THandle): Bool;
  5328. function SetFileAttributes(FileName: PChar; FileAttributes: DWord): Bool;
  5329. function SetFilePointer(FileHandle: THandle; DistanceToMove: Longint; DistanceToMoveHigh: Pointer; MoveMethod: DWord): DWord;
  5330. function SetFileTime(FileHandle: THandle; CreationTime,LastAccessTime,LastWriteTime: PFileTime): Bool;
  5331. function SetFocus(Wnd: hWnd): hWnd;
  5332. function SetForegroundWindow(Wnd: hWnd): Bool;
  5333. function SetGraphicsMode(DC: HDC; Mode: Integer): Integer;
  5334. function SetHandleCount(Number: UInt): UInt;
  5335. procedure SetLastError(ErrCode: DWord);
  5336. function SetLocalTime(const SystemTime: TSystemTime): Bool;
  5337. function SetMapMode(DC: HDC; MapMode: Integer): Integer;
  5338. function SetMapperFlags(DC: HDC; Flag: DWord): DWord;
  5339. function SetMenu(Wnd: hWnd; Menu: hMenu): Bool;
  5340. function SetMenuItemBitmaps(Menu: hMenu; Position,Flags: UInt; BitmapUnchecked,BitmapChecked: HBitmap): Bool;
  5341. function SetMetaFileBitsEx(Size: UInt; const Data: PChar): HMetafile;
  5342. function SetMiterLimit(DC: HDC; NewLimit: Single; OldLimit: PSingle): Bool;
  5343. function SetPaletteEntries(Pal: HPalette; StartIndex,NumEntries: UInt; var PaletteEntries): UInt;
  5344. function SetParent(WndChild,WndNewParent: hWnd): hWnd;
  5345. function SetPixel(DC: HDC; X,Y: Integer; Color: TColorRef): TColorRef;
  5346. function SetPolyFillMode(DC: HDC; PolyFillMode: Integer): Integer;
  5347. function SetPriorityClass(Process: THandle; PriorityClass: DWord): Bool;
  5348. function SetProp(Wnd: hWnd; Str: PChar; Data: THandle): Bool;
  5349. function SetRect(var Rect: TRect; X1,Y1,X2,Y2: Integer): Bool;
  5350. function SetRectEmpty(var Rect: TRect): Bool;
  5351. function SetRectRgn(Rgn: HRgn; X1,Y1,X2,Y2: Integer): Bool;
  5352. function SetROP2(DC: HDC; DrawMode: Integer): Integer;
  5353. function SetScrollPos(Wnd: hWnd; Bar,Pos: Integer; Redraw: Bool): Integer;
  5354. function SetScrollRange(Wnd: hWnd; Bar,MinPos,MaxPos: Integer; Redraw: Bool): Bool;
  5355. function SetStdHandle(StdHandle: DWord; Handle: THandle): Bool;
  5356. function SetStretchBltMode(DC: HDC; StretchMode: Integer): Integer;
  5357. function SetSysColors(cElements: Integer; const lpaElements,lpaRgbValues): Bool;
  5358. function SetSystemTime(SystemTime: TSystemTime): Bool;
  5359. function SetTimeZoneInformation(const TimeZoneInformation: TTimeZoneInformation): Bool;
  5360. function SetTextAlign(DC: HDC; Flags: UInt): UInt;
  5361. function SetTextCharacterExtra(DC: HDC; CharExtra: Integer): Integer;
  5362. function SetTextColor(DC: HDC; Color: TColorRef): TColorRef;
  5363. function SetTextJustification(DC: HDC; BreakExtra,BreakCount: Integer): Bool;
  5364. function SetThreadPriority(Thread: THandle; Priority: Integer): Bool;
  5365. function SetTimer(Wnd: hWnd; IDEvent,Elapse: UInt; TimerFunc: TFNTimerProc): UInt;
  5366. function SetViewportExtEx(DC: HDC; XExt,YExt: Integer; Size: PSize): Bool;
  5367. function SetViewportOrgEx(DC: HDC; X,Y: Integer; Point: PPoint): Bool;
  5368. function SetVolumeLabel(RootPathName,VolumeName: PChar): Bool;
  5369. function SetWindowExtEx(DC: HDC; XExt,YExt: Integer; Size: PSize): Bool;
  5370. function SetWindowLong(Wnd: hWnd; Index: Integer; NewLong: Longint): Longint;
  5371. function SetWindowOrgEx(DC: HDC; X,Y: Integer; Point: PPoint): Bool;
  5372. function SetWindowPlacement(Wnd: hWnd; WindowPlacement: PWindowPlacement): Bool;
  5373. function SetWindowPos(Wnd,WndInsertAfter: hWnd; X,Y,CX,CY: Integer; Flags: UInt): Bool;
  5374. function SetWindowsHookEx(Hook: Longint; HookFunc: TFNHookProc; Module: hInst; ThreadId: DWord): HHook;
  5375. function SetWindowText(Wnd: hWnd; Str: PChar): Bool;
  5376. function SetWindowWord(Wnd: hWnd; Index: Integer; NewWord: SmallWord): SmallWord;
  5377. function SetWinMetaFileBits(BufSize: UInt; Buffer: PChar; RefDC: HDC; const MetaFilePict: TMetaFilePict): HEnhMetafile;
  5378. function SetWorldTransform(DC: HDC; const XForm: TXForm): Bool;
  5379. function ShowCaret(Wnd: hWnd): Bool;
  5380. function ShowCursor(Show: Bool): Integer;
  5381. function ShowOwnedPopups(Wnd: hWnd; Show: Bool): Bool;
  5382. function ShowScrollBar(Wnd: hWnd; Bar: Integer; Show: Bool): Bool;
  5383. function ShowWindow(Wnd: hWnd; CmdShow: Integer): Bool;
  5384. function SizeofResource(Instance: hInst; ResInfo: HRSRC): Longint;
  5385. procedure Sleep(Milliseconds: DWord);
  5386. function StartDoc(DC: HDC; const DocInfo: TDocInfo): Integer;
  5387. function StartPage(DC: HDC): Integer;
  5388. function StretchDIBits(DestDC: HDC; X,Y,Width,Height,XSrc,YSrc,WidthSrc,HeightSrc: Integer; Bits: Pointer; var BitsInfo: TBitmapInfo; Usage: UInt; Rop: DWord): Integer;
  5389. function StretchBlt(DestDC: HDC; X,Y,Width,Height: Integer; SrcDC: HDC; XSrc,YSrc,SrcWidth,SrcHeight: Integer; Rop: DWord): Bool;
  5390. function StrokeAndFillPath(DC: HDC): Bool;
  5391. function StrokePath(DC: HDC): Bool;
  5392. function SubtractRect(var Dest: TRect; const Src1,Src2: TRect): Bool;
  5393. function SuspendThread(Thread: THandle): Longint;
  5394. function SwapMouseButton(Swap: Bool): Bool;
  5395. function SystemParametersInfo(Action,Param: UInt; Param: Pointer; WinIni: UInt): Bool;
  5396. function SystemTimeToFileTime(const SystemTime: TSystemTime; var FileTime: TFileTime): Bool;
  5397. function SystemTimeToTzSpecificLocalTime(TimeZoneInformation: PTimeZoneInformation; var UniversalTime,LocalTime: TSystemTime): Bool;
  5398. function TabbedTextOut(DC: HDC; X,Y: Integer; Str: PChar; Count,TabPositions: Integer; TabStopPositions: Pointer; TabOrigin: Integer): Longint;
  5399. function TerminateProcess(Process: THandle; ExitCode: UInt): Bool;
  5400. function TerminateThread(Thread: THandle; ExitCode: DWord): Bool;
  5401. function TextOut(DC: HDC; X,Y: Integer; Str: PChar; Count: Integer): Bool;
  5402. function TlsAlloc: DWord;
  5403. function TlsFree(TlsIndex: DWord): Bool;
  5404. function TlsGetValue(TlsIndex: DWord): Pointer;
  5405. function TlsSetValue(TlsIndex: DWord; TlsValue: Pointer): Bool;
  5406. function TrackPopupMenu(Menu: hMenu; Flags: UInt; X,Y,Reserved: Integer; Wnd: hWnd; Rect: PRect): Bool;
  5407. function TranslateAccelerator(Wnd: hWnd; AccTable: HAccel; var Msg: TMsg): Integer;
  5408. function TranslateMDISysAccel(Wnd: hWnd; const Msg: TMsg): Bool;
  5409. function TranslateMessage(const Msg: TMsg): Bool;
  5410. function UnhookWindowsHookEx(Hook: HHook): Bool;
  5411. function UnionRect(var Dest: TRect; const Src1,Src2: TRect): Bool;
  5412. function UnlockFile(FileHandle: THandle; FileOffsetLow,FileOffsetHigh,NumberOfBytesToUnlockLow,NumberOfBytesToUnlockHigh: DWord): Bool;
  5413. function UnpackDDElParam(Msg: UInt; Param: Longint; Lo,Hi: PUINT): Bool;
  5414. function UnrealizeObject(GDIObj: HGDIObj): Bool;
  5415. function UnregisterClass(ClassName: PChar; Inst: hInst): Bool;
  5416. function UpdateWindow(Wnd: hWnd): Bool;
  5417. function ValidateRect(Wnd: hWnd; Rect: PRect): Bool;
  5418. function ValidateRgn(Wnd: hWnd; Rgn: HRgn): Bool;
  5419. function VkKeyScan(keyScan: Char): SmallInt;
  5420. function WaitForMultipleObjects(Count: DWord; Handles: PWOHandleArray; WaitAll: Bool; Milliseconds: DWord): DWord;
  5421. function WaitForSingleObject(Handle: THandle; Milliseconds: DWord): DWord;
  5422. function WaitMessage: Bool;
  5423. function WidenPath(DC: HDC): Bool;
  5424. function WinExec(CmdLine: PChar; CmdShow: UInt): UInt;
  5425. function WinHelp(WndMain: hWnd; Help: PChar; Command,Data: DWord): Bool;
  5426. function WindowFromPoint(Point: TPoint): hWnd;
  5427. function WindowFromDC(DC: HDC): hWnd;
  5428. function WriteFile(FileHandle: THandle; const Buffer; NumberOfBytesToWrite: DWord; var NumberOfBytesWritten: DWord; Overlapped: POverlapped): Bool;
  5429. function WritePrivateProfileString(AppName,KeyName,Str,FileName: PChar): Bool;
  5430. function WriteProfileString(AppName,KeyName,Str: PChar): Bool;
  5431. procedure ZeroMemory(Destination: Pointer; Length: DWord);
  5432. function _lclose(FileHandle: HFile): HFile;
  5433. function _lcreat(PathName: PChar; Attribute: Integer): HFile;
  5434. function _lopen(PathName: PChar; ReadWrite: Integer): HFile;
  5435. function _lread(FileHandle: HFile; Buffer: Pointer; Bytes: UInt): UInt;
  5436. function _llseek(FileHandle: HFile; Offset: Longint; Origin: Integer): Longint;
  5437. function _lwrite(FileHandle: HFile; const Buffer: PChar; Bytes: UInt): UInt;
  5438. function wsprintf(Output,Format: PChar): Integer;
  5439. function wvsprintf(Output,Format: PChar; var ArgList): Longint;
  5440. function CharNext(Ch: PChar): PChar;
  5441. function CharPrev(Start,Current: PChar): PChar;
  5442. function GetDesktopWindow: hWnd;
  5443. function CharToOem(Src,Dest: PChar): Bool;
  5444. function OemToChar(Src,Dest: PChar): Bool;
  5445. function CharToOemBuff(Src,Dest: PChar; DstLength: DWord): Bool;
  5446. function OemToCharBuff(Src,Dest: PChar; DstLength: DWord): Bool;
  5447. function IsBadHugeReadPtr(P: Pointer; cb: UInt): Bool;
  5448. function IsBadHugeWritePtr(P: Pointer; cb: UInt): Bool;
  5449. function FloodFill(DC: HDC; XStart,YStart: Integer; FillColor: TColorRef): Bool;
  5450. function IsCharAlpha(Ch: Char): Bool;
  5451. function IsCharAlphaNumeric(Ch: Char): Bool;
  5452. function IsCharLower(Ch: Char): Bool;
  5453. function IsCharUpper(Ch: Char): Bool;
  5454. function lstrcat(Str1,Str2: PChar): PChar;
  5455. function lstrcmp(Str1,Str2: PChar): Integer;
  5456. function lstrcmpi(Str1,Str2: PChar): Integer;
  5457. function lstrcpy(Str1,Str2: PChar): PChar;
  5458. function lstrlen(Str: PChar): Integer;
  5459.  
  5460. function MoveTo(DC: HDC; X,Y: Integer): Bool;  inline;
  5461. var
  5462.   pt: tPoint;
  5463. begin
  5464.   MoveTo := MoveToEx(dc, X, Y, @pt);
  5465. end;
  5466.  
  5467. function SmallPointToPoint(const P: TSmallPoint): TPoint;
  5468. function PointToSmallPoint(const P: TPoint): TSmallPoint;
  5469.  
  5470. function TPointFromLong(L: Longint): TPoint;
  5471.  
  5472. {$IFNDEF Open32}
  5473.  
  5474. type
  5475.   LCID = DWord;
  5476.   LangId = Word;
  5477.  
  5478. type
  5479.   LONGLONG = Comp;
  5480.   PSID = Pointer;
  5481.   PLargeInteger = ^TLargeInteger;
  5482.   TLargeInteger = record
  5483.     case Integer of
  5484.     0: (
  5485.       LowPart: DWord;
  5486.       HighPart: Longint);
  5487.     1: (
  5488.       QuadPart: LONGLONG);
  5489.   end;
  5490.  
  5491. (*
  5492.  *  Language IDs.
  5493.  *
  5494.  *  The following two combinations of primary language ID and
  5495.  *  sublanguage ID have special semantics:
  5496.  *
  5497.  *    Primary Language ID   Sublanguage ID      Result
  5498.  *    -------------------   ---------------     ------------------------
  5499.  *    LANG_NEUTRAL          SUBLANG_NEUTRAL     Language neutral
  5500.  *    LANG_NEUTRAL          SUBLANG_DEFAULT     User default language
  5501.  *    LANG_NEUTRAL          SUBLANG_SYS_DEFAULT System default language
  5502.  *)
  5503.  
  5504. const
  5505. { Primary language IDs. }
  5506.  
  5507.   Lang_Neutral                         = $00;
  5508.  
  5509.   Lang_Afrikaans                       = $36;
  5510.   Lang_Albanian                        = $1c;
  5511.   Lang_Arabic                          = $01;
  5512.   Lang_Basqur                          = $2d;
  5513.   Lang_Belarusian                      = $23;
  5514.   Lang_Bulgarian                       = $02;
  5515.   Lang_Catalan                         = $03;
  5516.   Lang_Chinese                         = $04;
  5517.   Lang_Croatian                        = $1a;
  5518.   Lang_Czech                           = $05;
  5519.   Lang_Danish                          = $06;
  5520.   Lang_Dutch                           = $13;
  5521.   Lang_English                         = $09;
  5522.   Lang_Estonian                        = $25;
  5523.   Lang_Faeroese                        = $38;
  5524.   Lang_Farsi                           = $29;
  5525.   Lang_Finnish                         = $0b;
  5526.   Lang_French                          = $0c;
  5527.   Lang_German                          = $07;
  5528.   Lang_Greek                           = $08;
  5529.   Lang_Hebrew                          = $0d;
  5530.   Lang_Hungarian                       = $0e;
  5531.   Lang_Icelandic                       = $0f;
  5532.   Lang_Indonesian                      = $21;
  5533.   Lang_Italian                         = $10;
  5534.   Lang_Japanese                        = $11;
  5535.   Lang_Korean                          = $12;
  5536.   Lang_Latvian                         = $26;
  5537.   Lang_Lithuanian                      = $27;
  5538.   Lang_Norvegian                       = $14;
  5539.   Lang_Polish                          = $15;
  5540.   Lang_Portuguese                      = $16;
  5541.   Lang_Romanian                        = $18;
  5542.   Lang_Russian                         = $19;
  5543.   Lang_Serbian                         = $1a;
  5544.   Lang_Slovak                          = $1b;
  5545.   Lang_Slovenian                       = $24;
  5546.   Lang_Spanish                         = $0a;
  5547.   Lang_Swedish                         = $1d;
  5548.   Lang_Thai                            = $1e;
  5549.   Lang_Turkish                         = $1f;
  5550.   Lang_Ukrainian                       = $22;
  5551.   Lang_Vietnamese                      = $2a;
  5552.  
  5553.  
  5554. { Sublanguage IDs. }
  5555.  
  5556.   { The name immediately following SUBLANG_ dictates which primary
  5557.     language ID that sublanguage ID can be combined with to form a
  5558.     valid language ID. }
  5559.  
  5560.   SubLang_Neutral                      = $00;    { language neutral }
  5561.   SubLang_Default                      = $01;    { user default }
  5562.   SubLang_Sys_Default                  = $02;    { system default }
  5563.  
  5564.   SubLang_Arabic_Saudi_Arabia          = $01;    { Arabic (Saudi Arabia) }
  5565.   SubLang_Arabic_Iraq                  = $02;    { Arabic (Iraq) }
  5566.   SubLang_Arabic_Egypt                 = $03;    { Arabic (Egypt) }
  5567.   SubLang_Arabic_Libya                 = $04;    { Arabic (Libya) }
  5568.   SubLang_Arabic_Algeria               = $05;    { Arabic (Algeria) }
  5569.   SubLang_Arabic_Morocco               = $06;    { Arabic (Morocco) }
  5570.   SubLang_Arabic_Tunista               = $07;    { Arabic (Tunisia) }
  5571.   SubLang_Arabic_Oman                  = $08;    { Arabic (Oman) }
  5572.   SubLang_Arabic_Yemen                 = $09;    { Arabic (Yemen) }
  5573.   SubLang_Arabic_Syria                 = $0a;    { Arabic (Syria) }
  5574.   SubLang_Arabic_Jordan                = $0b;    { Arabic (Jordan) }
  5575.   SubLang_Arabic_Lebanon               = $0c;    { Arabic (Lebanon) }
  5576.   SubLang_Arabic_Kuwait                = $0d;    { Arabic (Kuwait) }
  5577.   SubLang_Arabic_UAE                   = $0e;    { Arabic (U.A.E) }
  5578.   SubLang_Arabic_Bahrain               = $0f;    { Arabic (Bahrain) }
  5579.   SubLang_Arabic_Qatar                 = $10;    { Arabic (Qatar) }
  5580.   SubLang_Chinese_Traditional          = $01;    { Chinese (Taiwan) }
  5581.   SubLang_Chinese_Simplified           = $02;    { Chinese (PR China) }
  5582.   SubLang_Chinese_Hongkong             = $03;    { Chinese (Hong Kong) }
  5583.   SubLang_Chinese_Singapore            = $04;    { Chinese (Singapore) }
  5584.   SubLang_Dutch                        = $01;    { Dutch }
  5585.   SubLang_Dutch_Belgian                = $02;    { Dutch (Belgian) }
  5586.   SubLang_English_US                   = $01;    { English (USA) }
  5587.   SubLang_English_UK                   = $02;    { English (UK) }
  5588.   SubLang_English_AUS                  = $03;    { English (Australian) }
  5589.   SubLang_English_CAN                  = $04;    { English (Canadian) }
  5590.   SubLang_English_NZ                   = $05;    { English (New Zealand) }
  5591.   SubLang_English_Eire                 = $06;    { English (Irish) }
  5592.   SubLang_English_South_Africa         = $07;    { English (South Africa) }
  5593.   SubLang_English_Jamaica              = $08;    { English (Jamaica) }
  5594.   SubLang_English_Caribbean            = $09;    { English (Caribbean) }
  5595.   SubLang_English_Belize               = $0a;    { English (Belize) }
  5596.   SubLang_English_Trinidad             = $0b;    { English (Trinidad) }
  5597.   SubLang_French                       = $01;    { French }
  5598.   SubLang_French_Belgian               = $02;    { French (Belgian) }
  5599.   SubLang_French_Canadian              = $03;    { French (Canadian) }
  5600.   SubLang_French_Swiss                 = $04;    { French (Swiss) }
  5601.   SubLang_French_Luxembourg            = $05;    { French (Luxembourg) }
  5602.   SubLang_German                       = $01;    { German }
  5603.   SubLang_German_Swiss                 = $02;    { German (Swiss) }
  5604.   SubLang_German_Austrian              = $03;    { German (Austrian) }
  5605.   SubLang_German_Luxembourg            = $04;    { German (Luxembourg) }
  5606.   SubLang_German_Liechtenstein         = $05;    { German (Liechtenstein) }
  5607.   SubLang_Italian                      = $01;    { Italian }
  5608.   SubLang_Italian_Swiss                = $02;    { Italian (Swiss) }
  5609.   SubLang_Korean                       = $01;    { Korean (Extended Wansung) }
  5610.   SubLang_Korean_Johab                 = $02;    { Korean (Johab) }
  5611.   SubLang_Norvegian_Bokmal             = $01;    { Norwegian (Bokmal) }
  5612.   SubLang_Norvegian_Nynorsk            = $02;    { Norwegian (Nynorsk) }
  5613.   SubLang_Portuguese                   = $02;    { Portuguese }
  5614.   SubLang_Portuguese_Brazilian         = $01;    { Portuguese (Brazilian) }
  5615.   SubLang_Serbian_Latin                = $02;    { Serbian (Latin) }
  5616.   SubLang_Serbian_Cyrillic             = $03;    { Serbian (Cyrillic) }
  5617.   SubLang_Spanish                      = $01;    { Spanish (Castilian) }
  5618.   SubLang_Spanish_Mexican              = $02;    { Spanish (Mexican) }
  5619.   SubLang_Spanish_Modern               = $03;    { Spanish (Modern) }
  5620.   SubLang_Spanish_Guatemala            = $04;    { Spanish (Guatemala) }
  5621.   SubLang_Spanish_Costa_Rica           = $05;    { Spanish (Costa Rica) }
  5622.   SubLang_Spanish_Panama               = $06;    { Spanish (Panama) }
  5623.   SubLang_Spanish_Dominican_Republic     = $07;  { Spanish (Dominican Republic) }
  5624.   SubLang_Spanish_Venezuela            = $08;    { Spanish (Venezuela) }
  5625.   SubLang_Spanish_Colombia             = $09;    { Spanish (Colombia) }
  5626.   SubLang_Spanish_Peru                 = $0a;    { Spanish (Peru) }
  5627.   SubLang_Spanish_Argentina            = $0b;    { Spanish (Argentina) }
  5628.   SubLang_Spanish_Ecuador              = $0c;    { Spanish (Ecuador) }
  5629.   SubLang_Spanish_Chile                = $0d;    { Spanish (Chile) }
  5630.   SubLang_Spanish_Uruguay              = $0e;    { Spanish (Uruguay) }
  5631.   SubLang_Spanish_Paraguay             = $0f;    { Spanish (Paraguay) }
  5632.   SubLang_Spanish_Bolivia              = $10;    { Spanish (Bolivia) }
  5633.   SubLang_Spanish_El_Salvador          = $11;    { Spanish (El Salvador) }
  5634.   SubLang_Spanish_Honduras             = $12;    { Spanish (Honduras) }
  5635.   SubLang_Spanish_Nicaragua            = $13;    { Spanish (Nicaragua) }
  5636.   SubLang_Spanish_Puerto_Rico          = $14;    { Spanish (Puerto Rico) }
  5637.   SUBLANG_Swedish                      = $01;    { Swedish }
  5638.   SUBLANG_Swedish_Finland              = $02;    { Swedish (Finland) }
  5639.  
  5640.  
  5641. { Sorting IDs. }
  5642.  
  5643.   Sort_Default                         = $0;     { sorting default }
  5644.  
  5645.   Sort_Japanese_XJIS                   = $0;     { Japanese XJIS order }
  5646.   Sort_Japanese_Unicode                = $1;     { Japanese Unicode order }
  5647.  
  5648.   Sort_Chinese_BIG5                    = $0;     { Chinese BIG5 order }
  5649.   Sort_Chinese_PRCP                    = $0;     { PRC Chinese Phonetic order }
  5650.   Sort_Chinese_Unicode                 = $1;     { Chinese Unicode order }
  5651.   Sort_Chinese_PRC                     = $2;     { PRC Chinese Stroke Count order }
  5652.  
  5653.   Sort_Korean_Ksc                      = $0;     { Korean KSC order }
  5654.   Sort_Korean_Unicode                  = $1;     { Korean Unicode order }
  5655.  
  5656.   Sort_German_Phone_Book               = $1;     { German Phone Book order }
  5657.  
  5658.  
  5659. (*
  5660.  *  A language ID is a 16 bit value which is the combination of a
  5661.  *  primary language ID and a secondary language ID.  The bits are
  5662.  *  allocated as follows:
  5663.  *
  5664.  *       +-----------------------+-------------------------+
  5665.  *       |     Sublanguage ID    |   Primary Language ID   |
  5666.  *       +-----------------------+-------------------------+
  5667.  *        15                   10 9                       0   bit
  5668.  *
  5669.  *
  5670.  *
  5671.  *  A locale ID is a 32 bit value which is the combination of a
  5672.  *  language ID, a sort ID, and a reserved area.  The bits are
  5673.  *  allocated as follows:
  5674.  *
  5675.  *       +-------------+---------+-------------------------+
  5676.  *       |   Reserved  | Sort ID |      Language ID        |
  5677.  *       +-------------+---------+-------------------------+
  5678.  *        31         20 19     16 15                      0   bit
  5679.  *
  5680.  *)
  5681.  
  5682. { Default System and User IDs for language and locale. }
  5683.  
  5684.   Lang_System_Default   = (SubLang_Sys_Default shl 10) or Lang_Neutral;
  5685.   Lang_User_Default     = (Sublang_Default shl 10) or Lang_Neutral;
  5686.  
  5687.   Locale_System_Default = (Sort_Default shl 16) or Lang_System_Default;
  5688.   Locale_User_Default   = (Sort_Default shl 16) or Lang_User_Default;
  5689.  
  5690.  
  5691.   Status_User_APC                 = $000000C0;
  5692.   Status_Pending                  = $00000103;
  5693.   Status_Segment_Notification     = $40000005;
  5694.   Status_Guard_Page_Violation     = $80000001;
  5695.   Status_Datatype_Misalignment    = $80000002;
  5696.   Status_Breakpoint               = $80000003;
  5697.   Status_Single_Step              = $80000004;
  5698.   Status_In_Page_Error            = $C0000006;
  5699.   Status_Invalid_Handle           = $C0000008;
  5700.   Status_Illegal_Instruction      = $C000001D;
  5701.   Status_Noncontinuable_Exception = $C0000025;
  5702.   Status_Invalid_Disposition      = $C0000026;
  5703.   Status_Array_Bounds_Exceeded    = $C000008C;
  5704.   Status_Float_Denormal_Operand   = $C000008D;
  5705.   Status_Float_Divide_By_Zero     = $C000008E;
  5706.   Status_Float_Inexact_Result     = $C000008F;
  5707.   Status_Float_Invalid_Operation  = $C0000090;
  5708.   Status_Float_Overflow           = $C0000091;
  5709.   Status_Float_Stack_Check        = $C0000092;
  5710.   Status_Float_Underflow          = $C0000093;
  5711.   Status_Integer_Divide_By_Zero   = $C0000094;
  5712.   Status_Integer_Overflow         = $C0000095;
  5713.   Status_Privileged_Instruction   = $C0000096;
  5714.   Status_Stack_Overflow           = $C00000FD;
  5715.   Status_Control_C_Exit           = $C000013A;
  5716.  
  5717.   Size_Of_80387_Registers = 80;
  5718.  
  5719.   { The following flags control the contents of the CONTEXT structure. }
  5720.  
  5721.   Context_i386 = $10000;     { this assumes that i386 and }
  5722.   Context_i486 = $10000;     { i486 have identical context records }
  5723.  
  5724.   Context_Control         = (Context_i386 or $00000001); { SS:SP, CS:IP, FLAGS, BP }
  5725.   Context_Integer         = (Context_i386 or $00000002); { AX, BX, CX, DX, SI, DI }
  5726.   Context_Segments        = (Context_i386 or $00000004); { DS, ES, FS, GS }
  5727.   Context_Floating_Point  = (Context_i386 or $00000008); { 387 state }
  5728.   Context_Debug_Registers = (Context_i386 or $00000010); { DB 0-3,6,7 }
  5729.   Context_Full = (Context_Control or Context_Integer or Context_Segments);
  5730.  
  5731. type
  5732.   PFloatingSaveArea = ^TFloatingSaveArea;
  5733.   TFloatingSaveArea = record
  5734.     ControlWord: DWord;
  5735.     StatusWord: DWord;
  5736.     TagWord: DWord;
  5737.     ErrorOffset: DWord;
  5738.     ErrorSelector: DWord;
  5739.     DataOffset: DWord;
  5740.     DataSelector: DWord;
  5741.     RegisterArea: array[0..Size_Of_80387_Registers - 1] of Byte;
  5742.     Cr0NpxState: DWord;
  5743.   end;
  5744.  
  5745. { This frame has a several purposes: 1) it is used as an argument to
  5746.   NtContinue, 2) is is used to constuct a call frame for APC delivery,
  5747.   and 3) it is used in the user level thread creation routines.
  5748.   The layout of the record conforms to a standard call frame. }
  5749.  
  5750.   PContext = ^TContext;
  5751.   TContext = record
  5752.  
  5753.   { The flags values within this flag control the contents of
  5754.     a CONTEXT record.
  5755.  
  5756.     If the context record is used as an input parameter, then
  5757.     for each portion of the context record controlled by a flag
  5758.     whose value is set, it is assumed that that portion of the
  5759.     context record contains valid context. If the context record
  5760.     is being used to modify a threads context, then only that
  5761.     portion of the threads context will be modified.
  5762.  
  5763.     If the context record is used as an IN OUT parameter to capture
  5764.     the context of a thread, then only those portions of the thread's
  5765.     context corresponding to set flags will be returned.
  5766.  
  5767.     The context record is never used as an OUT only parameter. }
  5768.  
  5769.     ContextFlags: DWord;
  5770.  
  5771.   { This section is specified/returned if CONTEXT_DEBUG_REGISTERS is
  5772.     set in ContextFlags.  Note that CONTEXT_DEBUG_REGISTERS is NOT
  5773.     included in CONTEXT_FULL. }
  5774.  
  5775.     Dr0: DWord;
  5776.     Dr1: DWord;
  5777.     Dr2: DWord;
  5778.     Dr3: DWord;
  5779.     Dr6: DWord;
  5780.     Dr7: DWord;
  5781.  
  5782.   { This section is specified/returned if the
  5783.     ContextFlags word contians the flag CONTEXT_FLOATING_POINT. }
  5784.  
  5785.     FloatSave: TFloatingSaveArea;
  5786.  
  5787.   { This section is specified/returned if the
  5788.     ContextFlags word contians the flag CONTEXT_SEGMENTS. }
  5789.  
  5790.     SegGs: DWord;
  5791.     SegFs: DWord;
  5792.     SegEs: DWord;
  5793.     SegDs: DWord;
  5794.  
  5795.   { This section is specified/returned if the
  5796.     ContextFlags word contians the flag CONTEXT_INTEGER. }
  5797.  
  5798.     Edi: DWord;
  5799.     Esi: DWord;
  5800.     Ebx: DWord;
  5801.     Edx: DWord;
  5802.     Ecx: DWord;
  5803.     Eax: DWord;
  5804.  
  5805.   { This section is specified/returned if the
  5806.     ContextFlags word contians the flag CONTEXT_CONTROL. }
  5807.  
  5808.     Ebp: DWord;
  5809.     Eip: DWord;
  5810.     SegCs: DWord;
  5811.     EFlags: DWord;
  5812.     Esp: DWord;
  5813.     SegSs: DWord;
  5814.   end;
  5815.  
  5816. const
  5817.   { bitfield constants for Flags field of TLDTEntry }
  5818.  
  5819.   ldtf_BaseMid      = $FF000000;  {8}
  5820.   ldtf_Type_8       = $00F80000;  {5}
  5821.   ldtf_Dpl          = $00060000;  {2}
  5822.   ldtf_Pres         = $00010000;  {1}
  5823.   ldtf_LimitHi      = $0000F000;  {4}
  5824.   ldtf_Sys          = $00000800;  {1}
  5825.   ldtf_Reserved_0   = $00000400;  {1}
  5826.   ldtf_Default_Big  = $00000200;  {1}
  5827.   ldtf_Granularity  = $00000100;  {1}
  5828.   ldtf_BaseHi       = $000000FF;  {8}
  5829.  
  5830.  
  5831. type
  5832.   PLDTEntry = ^TLDTEntry;
  5833.   TLDTEntry = record
  5834.     LimitLow: Word;
  5835.     BaseLow: Word;
  5836.     case Integer of
  5837.       0: (
  5838.         BaseMid: Byte;
  5839.         Flags1: Byte;
  5840.         Flags2: Byte;
  5841.         BaseHi: Byte);
  5842.       1: (
  5843.         Flags: Longint);
  5844.   end;
  5845.  
  5846. const
  5847.   Exception_NonContinuable     = 1;    { Noncontinuable exception }
  5848.   Exception_Maximum_Parameters = 15;   { maximum number of exception parameters }
  5849.  
  5850. type
  5851.   PExceptionRecord = ^TExceptionRecord;
  5852.   TExceptionRecord = record
  5853.     ExceptionCode: DWord;
  5854.     ExceptionFlags: DWord;
  5855.     ExceptionRecord: PExceptionRecord;
  5856.     ExceptionAddress: Pointer;
  5857.     NumberParameters: DWord;
  5858.     ExceptionInformation: array[0..EXCEPTION_MAXIMUM_PARAMETERS - 1] of DWord;
  5859.   end;
  5860.  
  5861. { Typedef for pointer returned by exception_info() }
  5862.  
  5863.   TExceptionPointers = record
  5864.     ExceptionRecord : PExceptionRecord;
  5865.     ContextRecord : PContext;
  5866.   end;
  5867.  
  5868. const
  5869.   Mutant_Query_State = $0001;
  5870.   Mutant_All_Access = (Standard_Rights_Required or Synchronize or
  5871.                        Mutant_Query_State);
  5872.  
  5873. type
  5874.   PMemoryBasicInformation = ^TMemoryBasicInformation;
  5875.   TMemoryBasicInformation = record
  5876.     BaseAddress : Pointer;
  5877.     AllocationBase : Pointer;
  5878.     AllocationProtect : DWord;
  5879.     RegionSize : DWord;
  5880.     State : DWord;
  5881.     Protect : DWord;
  5882.     Type_9 : DWord;
  5883.   end;
  5884.  
  5885. const
  5886.   Section_Query = 1;
  5887.   Section_Map_Write = 2;
  5888.   Section_Map_Read = 4;
  5889.   Section_Map_Execute = 8;
  5890.   Section_Extend_Size = $10;
  5891.   Section_All_Access = (Standard_Rights_Required or Section_Query or
  5892.     Section_Map_Write or Section_Map_Read or Section_Map_Execute or Section_Extend_Size);
  5893.  
  5894.   Mem_Reset = $80000;
  5895.  
  5896.  
  5897.   File_Share_Delete                   = $00000004;
  5898.   File_Atrribute_Offline              = $00001000;
  5899.   File_Notify_Change_Last_Access      = $00000020;
  5900.   File_Notify_Change_Creation         = $00000040;
  5901.   File_Action_Added                   = $00000001;
  5902.   File_Action_Removed                 = $00000002;
  5903.   File_Action_Modified                = $00000003;
  5904.   File_Action_Renamed_Old_Name        = $00000004;
  5905.   File_Action_Renamed_New_Name        = $00000005;
  5906.   Mailslot_No_Message                 = -1;
  5907.   Mailslot_Wait_Forever               = -1;
  5908.  
  5909. type
  5910.   PSECURITY_DESCRIPTOR = Pointer;
  5911.  
  5912.  
  5913. const
  5914.   { The following are masks for the predefined standard access types }
  5915.  
  5916.   ACCESS_SYSTEM_SECURITY   = $01000000;
  5917.   MAXIMUM_ALLOWED          = $02000000;
  5918.  
  5919. type
  5920.   { Define the generic mapping array.  This is used to denote the
  5921.     mapping of each generic access right to a specific access mask. }
  5922.  
  5923.   PGenericMapping = ^TGenericMapping;
  5924.   TGenericMapping = record
  5925.     GenericRead: ACCESS_MASK;
  5926.     GenericWrite: ACCESS_MASK;
  5927.     GenericExecute: ACCESS_MASK;
  5928.     GenericAll: ACCESS_MASK;
  5929.   end;
  5930.  
  5931.   PLUIDAndAttributes = ^TLUIDAndAttributes;
  5932.   TLUIDAndAttributes = record
  5933.     Luid: TLargeInteger;
  5934.     Attributes: DWord;
  5935.   end;
  5936.  
  5937. { ////////////////////////////////////////////////////////////////////// }
  5938. {                                                                    // }
  5939. {              Security Id     (SID)                                 // }
  5940. {                                                                    // }
  5941. { ////////////////////////////////////////////////////////////////////// }
  5942.  
  5943.  
  5944. { Pictorially the structure of an SID is as follows: }
  5945.  
  5946. {         1   1   1   1   1   1 }
  5947. {         5   4   3   2   1   0   9   8   7   6   5   4   3   2   1   0 }
  5948. {      +---------------------------------------------------------------+ }
  5949. {      |      SubAuthorityCount        |Reserved1 (SBZ)|   Revision    | }
  5950. {      +---------------------------------------------------------------+ }
  5951. {      |                   IdentifierAuthority[0]                      | }
  5952. {      +---------------------------------------------------------------+ }
  5953. {      |                   IdentifierAuthority[1]                      | }
  5954. {      +---------------------------------------------------------------+ }
  5955. {      |                   IdentifierAuthority[2]                      | }
  5956. {      +---------------------------------------------------------------+ }
  5957. {      |                                                               | }
  5958. {      +- -  -  -  -  -  -  -  SubAuthority[]  -  -  -  -  -  -  -  - -+ }
  5959. {      |                                                               | }
  5960. {      +---------------------------------------------------------------+ }
  5961.  
  5962.   PSIDIdentifierAuthority = ^TSIDIdentifierAuthority;
  5963.   TSIDIdentifierAuthority = record
  5964.     Value: array[0..5] of Byte;
  5965.   end;
  5966.  
  5967. const
  5968.   SidTypeUser = 1;
  5969.   SidTypeGroup = 2;
  5970.   SidTypeDomain = 3;
  5971.   SidTypeAlias = 4;
  5972.   SidTypeWellKnownGroup = 5;
  5973.   SidTypeDeletedAccount = 6;
  5974.   SidTypeInvalid = 7;
  5975.   SidTypeUnknown = 8;
  5976. type
  5977.   SID_NAME_USE = DWord;
  5978.  
  5979.   PSIDAndAttributes = ^TSIDAndAttributes;
  5980.   TSIDAndAttributes = record
  5981.     Sid: PSID;
  5982.     Attributes: DWord;
  5983.   end;
  5984.  
  5985.   PACL = ^TACL;
  5986.   TACL = record
  5987.     AclRevision: Byte;
  5988.     Sbz1: Byte;
  5989.     AclSize: Word;
  5990.     AceCount: Word;
  5991.     Sbz2: Word;
  5992.   end;
  5993.  
  5994.   { The following declarations are used for setting and querying information
  5995.     about and ACL.  First are the various information classes available to
  5996.     the user. }
  5997.  
  5998.   TAclInformationClass = (AclInfoPad, AclRevisionInformation, AclSizeInformation);
  5999.  
  6000. { Security Descriptor and related data types. }
  6001.  
  6002. const
  6003.   Security_Descriptor_Min_Length = 20;
  6004.   se_Owner_Defaulted = $0001;
  6005.   se_Group_Defaulted = $0002;
  6006.   se_DACL_Present    = $0004;
  6007.   se_DACL_Defaulted  = $0008;
  6008.   se_SACL_Present    = $0010;
  6009.   se_SACL_Defaulted  = $0020;
  6010.   se_SELF_Relative   = $8000;
  6011.  
  6012. {  Where: }
  6013.  
  6014. {      SE_OWNER_DEFAULTED - This boolean flag, when set, indicates that the }
  6015. {          SID pointed to by the Owner field was provided by a }
  6016. {          defaulting mechanism rather than explicitly provided by the }
  6017. {          original provider of the security descriptor.  This may }
  6018. {          affect the treatment of the SID with respect to inheritence }
  6019. {          of an owner. }
  6020.  
  6021. {      SE_GROUP_DEFAULTED - This boolean flag, when set, indicates that the }
  6022. {          SID in the Group field was provided by a defaulting mechanism }
  6023. {          rather than explicitly provided by the original provider of }
  6024. {          the security descriptor.  This may affect the treatment of }
  6025. {          the SID with respect to inheritence of a primary group. }
  6026.  
  6027. {      SE_DACL_PRESENT - This boolean flag, when set, indicates that the }
  6028. {          security descriptor contains a discretionary ACL.  If this }
  6029. {          flag is set and the Dacl field of the SECURITY_DESCRIPTOR is }
  6030. {          null, then a null ACL is explicitly being specified. }
  6031.  
  6032. {      SE_DACL_DEFAULTED - This boolean flag, when set, indicates that the }
  6033. {          ACL pointed to by the Dacl field was provided by a defaulting }
  6034. {          mechanism rather than explicitly provided by the original }
  6035. {          provider of the security descriptor.  This may affect the }
  6036. {          treatment of the ACL with respect to inheritence of an ACL. }
  6037. {          This flag is ignored if the DaclPresent flag is not set. }
  6038.  
  6039. {      SE_SACL_PRESENT - This boolean flag, when set,  indicates that the }
  6040. {          security descriptor contains a system ACL pointed to by the }
  6041. {          Sacl field.  If this flag is set and the Sacl field of the }
  6042. {          SECURITY_DESCRIPTOR is null, then an empty (but present) }
  6043. {          ACL is being specified. }
  6044.  
  6045. {      SE_SACL_DEFAULTED - This boolean flag, when set, indicates that the }
  6046. {          ACL pointed to by the Sacl field was provided by a defaulting }
  6047. {          mechanism rather than explicitly provided by the original }
  6048. {          provider of the security descriptor.  This may affect the }
  6049. {          treatment of the ACL with respect to inheritence of an ACL. }
  6050. {          This flag is ignored if the SaclPresent flag is not set. }
  6051.  
  6052. {      SE_SELF_RELATIVE - This boolean flag, when set, indicates that the }
  6053. {          security descriptor is in self-relative form.  In this form, }
  6054. {          all fields of the security descriptor are contiguous in memory }
  6055. {          and all pointer fields are expressed as offsets from the }
  6056. {          beginning of the security descriptor.  This form is useful }
  6057. {          for treating security descriptors as opaque data structures }
  6058. {          for transmission in communication protocol or for storage on }
  6059. {          secondary media. }
  6060.  
  6061.  
  6062.  
  6063. { Pictorially the structure of a security descriptor is as follows: }
  6064.  
  6065. {       3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 }
  6066. {       1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 }
  6067. {      +---------------------------------------------------------------+ }
  6068. {      |            Control            |Reserved1 (SBZ)|   Revision    | }
  6069. {      +---------------------------------------------------------------+ }
  6070. {      |                            Owner                              | }
  6071. {      +---------------------------------------------------------------+ }
  6072. {      |                            Group                              | }
  6073. {      +---------------------------------------------------------------+ }
  6074. {      |                            Sacl                               | }
  6075. {      +---------------------------------------------------------------+ }
  6076. {      |                            Dacl                               | }
  6077. {      +---------------------------------------------------------------+ }
  6078.  
  6079. { In general, this data structure should be treated opaquely to ensure future }
  6080. { compatibility. }
  6081.  
  6082.  
  6083. type
  6084.   Security_Descriptor_Control = Word;
  6085.   pSecurity_Descriptor_Control = ^WORD;
  6086.  
  6087. { Privilege Related Data Structures }
  6088.  
  6089. const
  6090.   { Privilege attributes }
  6091.  
  6092.   se_Privilege_Enabled_By_Default = $00000001;
  6093.   se_Privilege_Enabled            = $00000002;
  6094.   se_Privilege_Used_For_Access    = $80000000;
  6095.  
  6096.   { Privilege Set Control flags }
  6097.  
  6098.   Privilege_Set_All_Necessary = 1;
  6099.  
  6100.   {  Privilege Set - This is defined for a privilege set of one.
  6101.                    If more than one privilege is needed, then this structure
  6102.                    will need to be allocated with more space.}
  6103.   {  Note: don't change this structure without fixing the INITIAL_PRIVILEGE_SET}
  6104.  
  6105. type
  6106.   PPrivilegeSet = ^TPrivilegeSet;
  6107.   TPrivilegeSet = record
  6108.     PrivilegeCount: DWord;
  6109.     Control: DWord;
  6110.     Privilege: array[0..0] of TLUIDAndAttributes;
  6111.   end;
  6112.  
  6113. { line 3130 }
  6114.   TSecurityImpersonationLevel = (SecurityAnonymous,
  6115.     SecurityIdentification, SecurityImpersonation, SecurityDelegation);
  6116.  
  6117. const
  6118.   Security_Max_Impersonation_Level     = SecurityDelegation;
  6119.   Default_Impersonation_Level     = SecurityImpersonation;
  6120.  
  6121. const
  6122.   Token_Assign_Primary = $0001;
  6123.   Token_Duplicate = $0002;
  6124.   Token_Impersonate = $0004;
  6125.   Token_Query = $0008;
  6126.   Token_Query_Source = $0010;
  6127.   Token_Adjust_Privileges = $0020;
  6128.   Token_Adjust_Groups = $0040;
  6129.   Token_Adjust_Default = $0080;
  6130.   Token_All_Access = (Standard_Rights_Required or Token_Assign_Primary or
  6131.     Token_Duplicate or Token_Impersonate or Token_Query or
  6132.     Token_Query_Source or Token_Adjust_Privileges or Token_Adjust_Groups or
  6133.     Token_Adjust_Default);
  6134.   Token_Read = (Standard_Rights_Read or Token_Query);
  6135.   Token_Write = (Standard_Rights_Write or Token_Adjust_Privileges or
  6136.     Token_Adjust_Groups or Token_Adjust_Default);
  6137.   Token_Execute = Standard_Rights_Execute;
  6138.  
  6139. type
  6140.         TTokenType = (TokenTPad, TokenPrimary, TokenImpersonation);
  6141.  
  6142.   TTokenInformationClass = (TokenICPad, TokenUser, TokenGroups, TokenPrivileges,
  6143.     TokenOwner, TokenPrimaryGroup, TokenDefaultDacl, TokenSource, TokenType,
  6144.     TokenImpersonationLevel, TokenStatistics);
  6145.  
  6146.   PTokenGroups = ^TTokenGroups;
  6147.   TTokenGroups = record
  6148.     GroupCount: DWord;
  6149.     Groups: array[0..0] of TSIDAndAttributes;
  6150.   end;
  6151.  
  6152.   PTokenPrivileges = ^TTokenPrivileges;
  6153.   TTokenPrivileges = record
  6154.     PrivilegeCount: DWord;
  6155.     Privileges: array[0..0] of TLUIDAndAttributes;
  6156.   end;
  6157.  
  6158. const
  6159.   Security_Dynamic_Tracking = True;
  6160.   Security_Static_Tracking  = False;
  6161.  
  6162. type
  6163.   Security_Context_Tracking_Mode = Boolean;
  6164.  
  6165.   PSecurityQualityOfService = ^TSecurityQualityOfService;
  6166.   TSecurityQualityOfService = record
  6167.     Length: DWord;
  6168.     ImpersonationLevel: TSecurityImpersonationLevel;
  6169.     ContextTrackingMode: SECURITY_CONTEXT_TRACKING_MODE;
  6170.     EffectiveOnly: Boolean;
  6171.   end;
  6172.  
  6173.   Security_Information = DWord;
  6174.   pSecurity_Information = ^DWord;
  6175.  
  6176. const
  6177.   Owner_Security_Information =  $00000001;
  6178.   Group_Security_Information =  $00000002;
  6179.   DACL_Security_Information  =  $00000004;
  6180.   SACL_Security_Information  =  $00000008;
  6181.  
  6182. const
  6183.   Image_DOS_Signature                     = $5A4D;      { MZ }
  6184.   Image_OS2_Signature                     = $454E;      { NE }
  6185.   Image_OS2_Signature_Le                  = $454C;      { LE }
  6186.   Image_VXD_Signature                     = $454C;      { LE }
  6187.   Image_NT_SIignature                     = $00004550;  { PE00 }
  6188.  
  6189. { File header format. }
  6190.  
  6191. type
  6192.   PImageFileHeader = ^TImageFileHeader;
  6193.   TImageFileHeader = packed record
  6194.     Machine: Word;
  6195.     NumberOfSections: Word;
  6196.     TimeDateStamp: DWord;
  6197.     PointerToSymbolTable: DWord;
  6198.     NumberOfSymbols: DWord;
  6199.     SizeOfOptionalHeader: Word;
  6200.     Characteristics: Word;
  6201.   end;
  6202.  
  6203. const
  6204.   Image_SizeOf_File_Header                 = 20;
  6205.  
  6206.   Image_File_Relocs_Stripped               = $0001;  { Relocation info stripped from file. }
  6207.   Image_File_Executable_Image              = $0002;  { File is executable  (i.e. no unresolved externel references). }
  6208.   Image_File_Line_Nums_Stripped            = $0004;  { Line nunbers stripped from file. }
  6209.   Image_File_Local_Syms_Stripped           = $0008;  { Local symbols stripped from file. }
  6210.   Image_File_Aggresive_WS_Trim             = $0010;  { Agressively trim working set }
  6211.   Image_File_Bytes_Reversed_Lo             = $0080;  { Bytes of machine word are reversed. }
  6212.   Image_File_32Bit_Machine                 = $0100;  { 32 bit word machine. }
  6213.   Image_File_Debug_Stripped                = $0200;  { Debugging info stripped from file in .DBG file }
  6214.   Image_File_Removalbe_Run_From_Swap       = $0400;  { If Image is on removable media, copy and run from the swap file. }
  6215.   Image_File_Net_Run_From_Swap             = $0800;  { If Image is on Net, copy and run from the swap file. }
  6216.   Image_File_System                        = $1000;  { System File. }
  6217.   Image_File_DLL                           = $2000;  { File is a DLL. }
  6218.   Image_File_UP_System_Only                = $4000;  { File should only be run on a UP machine }
  6219.   Image_File_Bytes_Reversed_Hi             = $8000;  { Bytes of machine word are reversed. }
  6220.  
  6221.   Image_File_Machine_Unknown               = 0;
  6222.   Image_File_Machine_I386                  = $14c;   { Intel 386. }
  6223.   Image_File_Machine_R3000                 = $162;   { MIPS little-endian, 0x160 big-endian }
  6224.   Image_File_Machine_R4000                 = $166;   { MIPS little-endian }
  6225.   Image_File_Machine_R10000                = $168;   { MIPS little-endian }
  6226.   Image_File_Machine_Alpha                 = $184;   { Alpha_AXP }
  6227.   Image_File_Machine_PowerPC               = $1F0;   { IBM PowerPC Little-Endian }
  6228.  
  6229. { Directory format. }
  6230.  
  6231. type
  6232.   PImageDataDirectory = ^TImageDataDirectory;
  6233.   TImageDataDirectory = record
  6234.     VirtualAddress: DWord;
  6235.     Size: DWord;
  6236.   end;
  6237.  
  6238. const
  6239.   Image_NumberOf_Directory_Entries        = 16;
  6240.  
  6241. { Optional header format. }
  6242.  
  6243. type
  6244.   PimageOptionalHeader = ^TImageOptionalHeader;
  6245.   TImageOptionalHeader = packed record
  6246.     { Standard fields. }
  6247.     Magic: Word;
  6248.     MajorLinkerVersion: Byte;
  6249.     MinorLinkerVersion: Byte;
  6250.     SizeOfCode: DWord;
  6251.     SizeOfInitializedData: DWord;
  6252.     SizeOfUninitializedData: DWord;
  6253.     AddressOfEntryPoint: DWord;
  6254.     BaseOfCode: DWord;
  6255.     BaseOfData: DWord;
  6256.     { NT additional fields. }
  6257.     ImageBase: DWord;
  6258.     SectionAlignment: DWord;
  6259.     FileAlignment: DWord;
  6260.     MajorOperatingSystemVersion: Word;
  6261.     MinorOperatingSystemVersion: Word;
  6262.     MajorImageVersion: Word;
  6263.     MinorImageVersion: Word;
  6264.     MajorSubsystemVersion: Word;
  6265.     MinorSubsystemVersion: Word;
  6266.     Win32VersionValue: DWord;
  6267.     SizeOfImage: DWord;
  6268.     SizeOfHeaders: DWord;
  6269.     CheckSum: DWord;
  6270.     Subsystem: Word;
  6271.     DllCharacteristics: Word;
  6272.     SizeOfStackReserve: DWord;
  6273.     SizeOfStackCommit: DWord;
  6274.     SizeOfHeapReserve: DWord;
  6275.     SizeOfHeapCommit: DWord;
  6276.     LoaderFlags: DWord;
  6277.     NumberOfRvaAndSizes: DWord;
  6278.     DataDirectory: packed array[0..IMAGE_NUMBEROF_DIRECTORY_ENTRIES-1] of TImageDataDirectory;
  6279.   end;
  6280.  
  6281.   PImageRomOptionalHeader = ^TImageRomOptionalHeader;
  6282.   TImageRomOptionalHeader = packed record
  6283.     Magic: Word;
  6284.     MajorLinkerVersion: Byte;
  6285.     MinorLinkerVersion: Byte;
  6286.     SizeOfCode: DWord;
  6287.     SizeOfInitializedData: DWord;
  6288.     SizeOfUninitializedData: DWord;
  6289.     AddressOfEntryPoint: DWord;
  6290.     BaseOfCode: DWord;
  6291.     BaseOfData: DWord;
  6292.     BaseOfBss: DWord;
  6293.     GprMask: DWord;
  6294.     CprMask: packed array[0..3] of DWord;
  6295.     GpValue: DWord;
  6296.   end;
  6297.  
  6298. const
  6299.   Image_SizeOf_Rom_Optional_Header       = 56;
  6300.   Image_SizeOf_Std_Optional_Header       = 28;
  6301.   Image_SizeOf_NT_Optional_Header        = 224;
  6302.  
  6303.   Image_NT_Optional_Hdr_Magic            = $010B;
  6304.   Image_ROM_Optional_Hdr_Magic           = $0107;
  6305.  
  6306. type
  6307.   PImageNtHeaders = ^TImageNtHeaders;
  6308.   TImageNtHeaders = packed record
  6309.     Signature: DWord;
  6310.     FileHeader: TImageFileHeader;
  6311.     OptionalHeader: TImageOptionalHeader;
  6312.   end;
  6313.  
  6314.   PImageRomHeaders = ^TImageRomHeaders;
  6315.   TImageRomHeaders = packed record
  6316.     FileHeader: TImageFileHeader;
  6317.     OptionalHeader: TImageRomOptionalHeader;
  6318.   end;
  6319.  
  6320. { Subsystem Values }
  6321.  
  6322. const
  6323.   Image_SubSystem_Unknown                  = 0;  { Unknown subsystem. }
  6324.   Image_SubSystem_Native                   = 1;  { Image doesn't require a subsystem. }
  6325.   Image_SubSystem_Windows_GUI              = 2;  { Image runs in the Windows GUI subsystem. }
  6326.   Image_SubSystem_Wubdows_CUI              = 3;  { Image runs in the Windows character subsystem. }
  6327.   Image_SubSystem_OS2_CUI                  = 5;  { image runs in the OS/2 character subsystem. }
  6328.   Image_SubSystem_Posix_CUI                = 7;  { image run  in the Posix character subsystem. }
  6329.   Image_SubSystem_Reserved8                = 8;  { image run  in the 8 subsystem. }
  6330.  
  6331.  
  6332. { Directory Entries }
  6333.  
  6334.   Image_Directory_Entry_Export             = 0;  { Export Directory }
  6335.   Image_Directory_Entry_Import             = 1;  { Import Directory }
  6336.   Image_Directory_Entry_Resource           = 2;  { Resource Directory }
  6337.   Image_Directory_Entry_Exception          = 3;  { Exception Directory }
  6338.   Image_Directory_Entry_Security           = 4;  { Security Directory }
  6339.   Image_Directory_Entry_BaseReloc          = 5;  { Base Relocation Table }
  6340.   Image_Directory_Entry_Debug              = 6;  { Debug Directory }
  6341.   Image_Directory_Entry_Copyright          = 7;  { Description String }
  6342.   Image_Directory_Entry_GlobalPtr          = 8;  { Machine Value (MIPS GP) }
  6343.   Image_Directory_Entry_TLS                = 9;  { TLS Directory }
  6344.   Image_Directory_Entry_Load_Config       = 10;  { Load Configuration Directory }
  6345.   Image_Directory_Entry_Bound_Import      = 11;  { Bound Import Directory in headers }
  6346.   Image_Directory_Entry_IAT               = 12;  { Import Address Table }
  6347.  
  6348. { Section header format. }
  6349.  
  6350.   Image_SizeOf_Short_Name                  = 8;
  6351.  
  6352. type
  6353.   TISHMisc = packed record
  6354.     case Integer of
  6355.       0: (PhysicalAddress: DWord);
  6356.       1: (VirtualSize: DWord);
  6357.   end;
  6358.  
  6359.   PImageSectionHeader = ^TImageSectionHeader;
  6360.   TImageSectionHeader = packed record
  6361.     Name: packed array[0..IMAGE_SIZEOF_SHORT_NAME-1] of Byte;
  6362.     Misc: TISHMisc;
  6363.     VirtualAddress: DWord;
  6364.     SizeOfRawData: DWord;
  6365.     PointerToRawData: DWord;
  6366.     PointerToRelocations: DWord;
  6367.     PointerToLinenumbers: DWord;
  6368.     NumberOfRelocations: Word;
  6369.     NumberOfLinenumbers: Word;
  6370.     Characteristics: DWord;
  6371.   end;
  6372.  
  6373. const
  6374.   Image_SizeOf_Section_Header              = 40;
  6375.  
  6376.  
  6377. { Section characteristics. }
  6378.  
  6379. {      Image_Scn_Type_Reg                   0x00000000  // Reserved. }
  6380. {      Image_Scn_Type_DSect                 0x00000001  // Reserved. }
  6381. {      Image_Scn_Type_NoLoad                0x00000002  // Reserved. }
  6382. {      Image_Scn_Type_Group                 0x00000004  // Reserved. }
  6383.   Image_Scn_Type_No_Pad                    = $00000008;  { Reserved. }
  6384. {      Image_Scn_Type_Copy                  0x00000010  // Reserved. }
  6385.  
  6386.   Image_Scn_Cnt_Code                       = $00000020;  { Section contains code. }
  6387.   Image_Scn_Cnt_Initialized_Data           = $00000040;  { Section contains initialized data. }
  6388.   Image_Scn_Cnt_UnInitialized_Data         = $00000080;  { Section contains uninitialized data. }
  6389.  
  6390.   Imate_Scn_Lnk_Other                      = $00000100;  { Reserved. }
  6391.   Imate_Scn_Lnk_Info                       = $00000200;  { Section contains comments or some other type of information. }
  6392. {      IMAGE_SCN_TYPE_OVER                  0x00000400  // Reserved. }
  6393.   Imate_Scn_Lnk_Remove                     = $00000800;  { Section contents will not become part of image. }
  6394.   Imate_Scn_Lnk_Comdat                     = $00001000;  { Section contents comdat. }
  6395. {                                           0x00002000  // Reserved. }
  6396.  
  6397. {      Image_Scn_Mem_Protected - Obsolete   0x00004000 }
  6398.   Image_Scn_Mem_FarData                    = $00008000;
  6399. {      Image_Scn_Mem_SysHeap  - Obsolete    0x00010000 }
  6400.   Image_Scn_Mem_Pugreable                  = $00020000;
  6401.   Image_Scn_Mem_16Bit                      = $00020000;
  6402.   Image_Scn_Mem_Locked                     = $00040000;
  6403.   Image_Scn_Mem_Preload                    = $00080000;
  6404.  
  6405.   Image_Scn_Align_1Bytes                   = $00100000;
  6406.   Image_Scn_Align_2Bytes                   = $00200000;
  6407.   Image_Scn_Align_4Bytes                   = $00300000;
  6408.   Image_Scn_Align_8Bytes                   = $00400000;
  6409.   Image_Scn_Align_16Bytes                  = $00500000;  { Default alignment if no others are specified. }
  6410.   Image_Scn_Align_32Bytes                  = $00600000;
  6411.   Image_Scn_Align_64Bytes                  = $00700000;
  6412. { Unused                                    0x00800000 }
  6413.  
  6414.   Image_Scn_Lnk_NReloc_Ovfl                = $01000000;  { Section contains extended relocations. }
  6415.   Image_Scn_Mem_Discardable                = $02000000;  { Section can be discarded. }
  6416.   Image_Scn_Mem_Not_Cached                 = $04000000;  { Section is not cachable. }
  6417.   Image_Scn_Mem_Not_Paged                  = $08000000;  { Section is not pageable. }
  6418.   Image_Scn_Mem_Shared                     = $10000000;  { Section is shareable. }
  6419.   Image_Scn_Mem_Execute                    = $20000000;  { Section is executable. }
  6420.   Image_Scn_Mem_Read                       = $40000000;  { Section is readable. }
  6421.   Image_Scn_Mem_Write                      = $80000000;  { Section is writeable. }
  6422.  
  6423.  
  6424. type
  6425.   PImageLoadConfigDirectory = ^TImageLoadConfigDirectory;
  6426.   TImageLoadConfigDirectory = packed record
  6427.     Characteristics: DWord;
  6428.     TimeDateStamp: DWord;
  6429.     MajorVersion: Word;
  6430.     MinorVersion: Word;
  6431.     GlobalFlagsClear: DWord;
  6432.     GlobalFlagsSet: DWord;
  6433.     CriticalSectionDefaultTimeout: DWord;
  6434.     DeCommitFreeBlockThreshold: DWord;
  6435.     DeCommitTotalFreeThreshold: DWord;
  6436.     LockPrefixTable: Pointer;
  6437.     MaximumAllocationSize: DWord;
  6438.     VirtualMemoryThreshold: DWord;
  6439.     ProcessHeapFlags: DWord;
  6440.     ProcessAffinityMask: DWord;
  6441.     Reserved: array[0..2] of DWord;
  6442.   end;
  6443.  
  6444. // Function table entry format for MIPS/ALPHA images.  Function table is
  6445. // pointed to by the IMAGE_DIRECTORY_ENTRY_EXCEPTION directory entry.
  6446. // This definition duplicates ones in ntmips.h and ntalpha.h for use
  6447. // by portable image file mungers.
  6448.  
  6449.   PImageRuntimeFunctionEntry = ^TImageRuntimeFunctionEntry;
  6450.   TImageRuntimeFunctionEntry = record
  6451.     BeginAddress: DWord;
  6452.     EndAddress: DWord;
  6453.     ExceptionHandler: Pointer;
  6454.     HandlerData: Pointer;
  6455.     PrologEndAddress: DWord;
  6456.   end;
  6457.  
  6458. //
  6459. // Debug Format
  6460. //
  6461.  
  6462.   PImageDebugDirectory = ^TImageDebugDirectory;
  6463.   TImageDebugDirectory = packed record
  6464.     Characteristics: DWord;
  6465.     TimeDateStamp: DWord;
  6466.     MajorVersion: Word;
  6467.     MinorVersion: Word;
  6468.     _Type: DWord;
  6469.     SizeOfData: DWord;
  6470.     AddressOfRawData: DWord;
  6471.     PointerToRawData: DWord;
  6472.   end;
  6473.  
  6474. const
  6475.   Image_Debug_Type_Unknown          = 0;
  6476.   Image_Debug_Type_COff             = 1;
  6477.   Image_Debug_Type_Codeview         = 2;
  6478.   Image_Debug_Type_FPO              = 3;
  6479.   Image_Debug_Type_Misc             = 4;
  6480.   Image_Debug_Type_Exception        = 5;
  6481.   Image_Debug_Type_Fixup            = 6;
  6482.   Image_Debug_Type_OMap_To_Src      = 7;
  6483.   Image_Debug_Type_OMap_From_Src    = 8;
  6484.  
  6485. type
  6486.   PImageCOFFSymbolsHeader = ^TImageCOFFSymbolsHeader;
  6487.   TImageCOFFSymbolsHeader = record
  6488.     NumberOfSymbols: DWord;
  6489.     LvaToFirstSymbol: DWord;
  6490.     NumberOfLinenumbers: DWord;
  6491.     LvaToFirstLinenumber: DWord;
  6492.     RvaToFirstByteOfCode: DWord;
  6493.     RvaToLastByteOfCode: DWord;
  6494.     RvaToFirstByteOfData: DWord;
  6495.     RvaToLastByteOfData: DWord;
  6496.   end;
  6497.  
  6498. const
  6499.   Frame_FPO       = 0;
  6500.   Frame_Trap      = 1;
  6501.   Frame_TSS       = 2;
  6502.   Frame_NonFPO    = 3;
  6503.  
  6504. type
  6505.   PFpoData = ^TFpoData;
  6506.   TFpoData = packed record
  6507.     ulOffStart: DWord;             // offset 1st byte of function code
  6508.     cbProcSize: DWord;             // # bytes in function
  6509.     cdwLocals: DWord;              // # bytes in locals/4
  6510.     cdwParams: Word;              // # bytes in params/4
  6511. {    WORD        cbProlog : 8;           // # bytes in prolog
  6512.      WORD        cbRegs   : 3;           // # regs saved
  6513.      WORD        fHasSEH  : 1;           // TRUE if SEH in func
  6514.      WORD        fUseBP   : 1;           // TRUE if EBP has been allocated
  6515.      WORD        reserved : 1;           // reserved for future use
  6516.      WORD        cbFrame  : 2;}           // frame type
  6517.      cbProlog: Byte;
  6518.      OtherStuff: Byte;
  6519.   end;
  6520.  
  6521. const
  6522.   SizeOf_RFPO_Data         = 16;
  6523.   Image_Debug_Misc_ExeName = 1;
  6524.  
  6525. type
  6526.   PImageDebugMisc = ^TImageDebugMisc;
  6527.   TImageDebugMisc = packed record
  6528.     DataType: DWord;               // type of misc data, see defines
  6529.     Length: DWord;                 // total length of record, rounded to four
  6530.                                    // byte multiple.
  6531.     Unicode: ByteBool;             // TRUE if data is unicode string
  6532.     Reserved: array[0..2] of Byte;
  6533.     Data: array[0..0] of Byte;     // Actual data
  6534.   end;
  6535.  
  6536. //
  6537. // Function table extracted from MIPS/ALPHA images.  Does not contain
  6538. // information needed only for runtime support.  Just those fields for
  6539. // each entry needed by a debugger.
  6540. //
  6541.   PImageFunctionEntry = ^TImageFunctionEntry;
  6542.   TImageFunctionEntry = record
  6543.     StartingAddress: DWord;
  6544.     EndingAddress: DWord;
  6545.     EndOfPrologue: DWord;
  6546.   end;
  6547.  
  6548. const
  6549.   rtl_CritSect_Type = 0;
  6550.   rtl_Resource_Type = 1;
  6551.  
  6552.  
  6553.   DLL_Thread_Attach = 2;
  6554.   DLL_Thread_Detach = 3;
  6555.  
  6556.   { Registry Open/Create Options }
  6557.  
  6558.   reg_Option_Reserved     = $00000000;    { Parameter is reserved }
  6559.  
  6560.   reg_Option_Create_Link  = $00000002;    { Created key is a }
  6561.                                             { symbolic link }
  6562.  
  6563.   reg_Option_Backup_Restore = $00000004;  { open for backup or restore }
  6564.                                             { special access rules }
  6565.                                             { privilege required   }
  6566.  
  6567.   reg_Legal_Option  = (reg_Option_Reserved or
  6568.                        reg_Option_Non_Volatile or
  6569.                        reg_Option_Volatile or
  6570.                        reg_Option_Create_Link or
  6571.                        reg_Option_Backup_Restore);
  6572.  
  6573.   { Registry Key restore flags }
  6574.  
  6575.   reg_Whole_Hive_Volatile = $00000001;    { Restore whole hive volatile }
  6576.   reg_Refresh_Hive        = $00000002;    { Unwind changes to last flush }
  6577.  
  6578.   { Registry Notify filter values }
  6579.  
  6580.   reg_Notify_Change_Name       = $00000001; { Create or delete (child) }
  6581.   reg_Notify_Change_Attributes = $00000002;
  6582.   reg_Notify_Change_Last_Set   = $00000004; { time stamp }
  6583.   reg_Notify_Change_Security   = $00000008;
  6584.  
  6585.   reg_Legal_Change_Filter = (reg_Option_Reserved or
  6586.                              reg_Notify_Change_Name or
  6587.                              reg_Notify_Change_Attributes or
  6588.                              reg_Notify_Change_Last_Set or
  6589.                              reg_Notify_Change_Security);
  6590.  
  6591.   { Registry Predefined Value Types }
  6592.  
  6593.   reg_Full_Resource_Descriptor = 9;
  6594.   reg_Resource_Requirements_List = 10;
  6595.  
  6596. { END Translated from WINNT.H }
  6597.  
  6598. function MakeWord(A,B: Byte): SmallWord; inline;
  6599. begin
  6600.   Result := A or B shl 8;
  6601. end;
  6602.  
  6603. function MakeLong(A,B: SmallWord): Longint; inline;
  6604. begin
  6605.   Result := A or B shl 16;
  6606. end;
  6607.  
  6608. function HiWord(L: Longint): SmallWord; inline;
  6609. begin
  6610.   Result := L shr 16;
  6611. end;
  6612.  
  6613. function HiByte(W: SmallWord): Byte; inline;
  6614. begin
  6615.   Result := W shr 8;
  6616. end;
  6617.  
  6618.  
  6619. type
  6620.   hColorSpace = Integer;
  6621.   hGlRc = Integer;
  6622.   hDesk = Integer;
  6623.   hTask = Integer;
  6624.   hWinSta = Integer;
  6625.   hKl = Integer;
  6626.  
  6627.   ColorRef = DWord;
  6628.  
  6629. { Compatiblity functions and procedures }
  6630.  
  6631. function DefineHandleTable(Offset: Word): Bool; inline;
  6632. begin
  6633.   Result := True;
  6634. end;
  6635.  
  6636. procedure LimitEmsPages(Kbytes: Longint); inline;
  6637. begin
  6638. end;
  6639.  
  6640. function SetSwapAreaSize(Size: Word): Longint; inline;
  6641. begin
  6642.   Result := Size;
  6643. end;
  6644.  
  6645. function CreateWindow(lpClassName: PChar; lpWindowName: PChar;
  6646.   dwStyle: DWord; X, Y, nWidth, nHeight: Integer; hWndParent: hWnd;
  6647.   hMenu: hMenu; hInstance: hInst; lpParam: Pointer): hWnd;
  6648.  
  6649. function Yield: Bool; inline;
  6650. begin
  6651.   Result := True;
  6652. end;
  6653.  
  6654.  
  6655. const
  6656.   Invalid_File_Size = DWord($FFFFFFFF);
  6657.  
  6658.  
  6659.   Time_Zone_Id_Invalid = DWord($FFFFFFFF);
  6660.  
  6661.  
  6662.  
  6663.   Wait_IO_Completion = Status_User_APC;
  6664.   Exception_Access_Violation = Status_Access_Violation;
  6665.   Exception_Datatype_Misalignment = Status_Datatype_Misalignment;
  6666.   Exception_Breakpoint = Status_Breakpoint;
  6667.   Exception_Single_Step = Status_Single_Step;
  6668.   Exception_Array_Bounds_Exceeded = Status_Array_Bounds_Exceeded;
  6669.   Exception_Flt_Denormal_Operand = Status_Float_Denormal_Operand;
  6670.   Exception_Flt_Divide_By_Zero = Status_Float_Divide_By_Zero;
  6671.   Exception_Flt_Inexact_Result = Status_Float_Inexact_Result;
  6672.   Exception_Flt_Invalid_Operation = Status_Float_Invalid_Operation;
  6673.   Exception_Flt_Overflow = Status_Float_Overflow;
  6674.   Exception_Flt_Stack_Check = Status_Float_Stack_Check;
  6675.   Exception_Flt_Underflow = Status_Float_Underflow;
  6676.   Exception_Int_Divide_By_Zero = Status_Integer_Divide_By_Zero;
  6677.   Exception_Int_Overflow = Status_Integer_Overflow;
  6678.   Exception_Priv_Instruction = Status_Privileged_Instruction;
  6679.   Exception_In_Page_Error = Status_In_Page_Error;
  6680.   Exception_Illegal_Instruction = Status_Illegal_Instruction;
  6681.   Exception_NonContinuable_Exception = Status_NonContinuable_Exception;
  6682.   Exception_Stack_Overflow = Status_Stack_Overflow;
  6683.   Exception_Invalid_Disposition = Status_Invalid_Disposition;
  6684.   Exception_Guard_Page = Status_Guard_Page_Violation;
  6685.   Exception_Invalid_Handle = Status_Invalid_Handle;
  6686.   CONTROL_C_EXIT = STATUS_CONTROL_C_EXIT;
  6687.  
  6688. procedure MoveMemory(Destination: Pointer; Source: Pointer; Length: DWord); inline;
  6689. begin
  6690.   Move(Source^, Destination^, Length);
  6691. end;
  6692.  
  6693. procedure CopyMemory(Destination: Pointer; Source: Pointer; Length: DWord); inline;
  6694. begin
  6695.   Move(Source^, Destination^, Length);
  6696. end;
  6697.  
  6698. procedure FillMemory(Destination: Pointer; Length: DWord; Fill: Byte); inline;
  6699. begin
  6700.   FillChar(Destination^, Length, Fill);
  6701. end;
  6702.  
  6703. const
  6704.  
  6705. { Define possible return codes from the CopyFileEx callback routine }
  6706.  
  6707.   Progress_Continue = 0;
  6708.   Progress_Cancel = 1;
  6709.   Progress_Stop = 2;
  6710.   Progress_Quiet = 3;
  6711.  
  6712.  
  6713. { Define CopyFileEx callback routine state change values }
  6714.  
  6715.   Callback_Chunk_Finished = $00000000;
  6716.   Callback_Stream_Switch = $00000001;
  6717.  
  6718.  
  6719. { Define CopyFileEx option flags }
  6720.  
  6721.   Copy_File_Fail_If_Exists = $00000001;
  6722.   Copy_File_Restartable = $00000002;
  6723.  
  6724.  
  6725. { Define the NamedPipe definitions}
  6726.  
  6727.   { Define the dwOpenMode values for CreateNamedPipe }
  6728.  
  6729.   Pipe_Access_Inbound = 1;
  6730.   Pipe_Access_Outbound = 2;
  6731.   Pipe_Access_Duplex = 3;
  6732.  
  6733.   { Define the Named Pipe End flags for GetNamedPipeInfo }
  6734.  
  6735.   Pipe_Client_End = 0;
  6736.   Pipe_Server_End = 1;
  6737.  
  6738.   { Define the dwPipeMode values for CreateNamedPipe }
  6739.  
  6740.   Pipe_Wait = 0;
  6741.   Pipe_NoWait = 1;
  6742.   Pipe_ReadMode_Byte = 0;
  6743.   Pipe_ReadMode_Message = 2;
  6744.   Pipe_Type_Byte = 0;
  6745.   Pipe_Type_Message = 4;
  6746.  
  6747.   { Define the well known values for CreateNamedPipe nMaxInstances }
  6748.  
  6749.   Pipe_Unlimited_Instances = 255;
  6750.  
  6751.   { Define the Security Quality of Service bits to be passed into CreateFile }
  6752.  
  6753.   Security_Anonymous = (Ord(SecurityAnonymous) shl 16);
  6754.   Security_Identification = (Ord(SecurityIdentification) shl 16);
  6755.   Security_Impersonation = (Ord(SecurityImpersonation) shl 16);
  6756.   Security_Delegation = (Ord(SecurityDelegation) shl 16);
  6757.  
  6758.   Security_Context_Tracking = $40000;
  6759.   Security_Effective_Only = $80000;
  6760.  
  6761.   Security_SQOS_Present = $100000;
  6762.   Security_Valid_SQOS_Flags = $1F0000;
  6763.  
  6764. { File structures }
  6765.  
  6766. type
  6767.   TFNFiberStartRoutine = TFarProc;
  6768.  
  6769. const
  6770.   Mutex_Modify_State = Mutant_Query_State;
  6771.  
  6772.   { Serial provider type. }
  6773.  
  6774.   sp_SerialComm = $00000001;
  6775.  
  6776.   { Provider SubTypes }
  6777.  
  6778.   pst_Unspecified = $00000000;
  6779.   pst_RS232 = $00000001;
  6780.   pst_Parallelport = $00000002;
  6781.   pst_RS422 = $00000003;
  6782.   pst_RS423 = $00000004;
  6783.   pst_RS449 = $00000005;
  6784.   pst_Modem = $00000006;
  6785.   pst_Fax = $00000021;
  6786.   pst_Scanner = $00000022;
  6787.   pst_Network_Bridge = $00000100;
  6788.   pst_LAT = $00000101;
  6789.   pst_TCPIP_Telnet = $00000102;
  6790.   pst_X25 = $00000103;
  6791.  
  6792.   { Provider capabilities flags. }
  6793.  
  6794.   pcf_DtrDsr = $0001;
  6795.   pcf_RtsCts = $0002;
  6796.   pcf_RLSD = $0004;
  6797.   pcf_Parity_Check = $0008;
  6798.   pcf_XonXoff = $0010;
  6799.   pcf_SetXChar = $0020;
  6800.   pcf_TotalTimeouts = $0040;
  6801.   pcf_IntTimeouts = $0080;
  6802.   pcf_SpecialChars = $0100;
  6803.   pcf_16BitMode = $0200;
  6804.  
  6805.   { Comm provider settable parameters. }
  6806.  
  6807.   sp_Parity = $0001;
  6808.   sp_Baud = $0002;
  6809.   sp_DataBits = $0004;
  6810.   sp_StopBits = $0008;
  6811.   sp_Handshaking = $0010;
  6812.   sp_Parity_Check = $0020;
  6813.   sp_RLSD = $0040;
  6814.  
  6815.   { Settable baud rates in the provider. }
  6816.  
  6817.   Baud_075 = $00000001;
  6818.   Baud_110 = $00000002;
  6819.   Baud_134_5 = $00000004;
  6820.   Baud_150 = $00000008;
  6821.   Baud_300 = $00000010;
  6822.   Baud_600 = $00000020;
  6823.   Baud_1200 = $00000040;
  6824.   Baud_1800 = $00000080;
  6825.   Baud_2400 = $00000100;
  6826.   Baud_4800 = $00000200;
  6827.   Baud_7200 = $00000400;
  6828.   Baud_9600 = $00000800;
  6829.   Baud_14400 = $00001000;
  6830.   Baud_19200 = $00002000;
  6831.   Baud_38400 = $00004000;
  6832.   Baud_56K = $00008000;
  6833.   Baud_128K = $00010000;
  6834.   Baud_115200 = $00020000;
  6835.   Baud_57600 = $00040000;
  6836.   Baud_User = $10000000;
  6837.  
  6838.   { Settable Data Bits }
  6839.  
  6840.   DataBits_5 = $0001;
  6841.   DataBits_6 = $0002;
  6842.   DataBits_7 = $0004;
  6843.   DataBits_8 = $0008;
  6844.   DataBits_16 = $0010;
  6845.   DataBits_16X = $0020;
  6846.  
  6847.   { Settable Stop and Parity bits. }
  6848.  
  6849.   StopBits_10 = $0001;
  6850.   StopBits_15 = $0002;
  6851.   StopBits_20 = $0004;
  6852.   Parity_None = $0100;
  6853.   Parity_Odd = $0200;
  6854.   Parity_Even = $0400;
  6855.   Parity_Mark = $0800;
  6856.   Parity_Space = $1000;
  6857.  
  6858. type
  6859.   PCommProp = ^TCommProp;
  6860.   TCommProp = record
  6861.     wPacketLength: Word;
  6862.     wPacketVersion: Word;
  6863.     dwServiceMask: DWord;
  6864.     dwReserved1: DWord;
  6865.     dwMaxTxQueue: DWord;
  6866.     dwMaxRxQueue: DWord;
  6867.     dwMaxBaud: DWord;
  6868.     dwProvSubType: DWord;
  6869.     dwProvCapabilities: DWord;
  6870.     dwSettableParams: DWord;
  6871.     dwSettableBaud: DWord;
  6872.     wSettableData: Word;
  6873.     wSettableStopParity: Word;
  6874.     dwCurrentTxQueue: DWord;
  6875.     dwCurrentRxQueue: DWord;
  6876.     dwProvSpec1: DWord;
  6877.     dwProvSpec2: DWord;
  6878.     wcProvChar: array[0..0] of WCHAR;
  6879.   end;
  6880.  
  6881.   { Set dwProvSpec1 to COMMPROP_INITIALIZED to indicate that wPacketLength
  6882.     is valid before a call to GetCommProperties(). }
  6883. const
  6884.   CommProp_Initialized = $E73CF52E;
  6885.  
  6886. type
  6887.   TComStateFlag = (fCtlHold, fDsrHold, fRlsHold, fXoffHold, fXOffSent, fEof,
  6888.     fTxim);
  6889.   TComStateFlags = set of TComStateFlag;
  6890.   TComStat = packed record
  6891.     Flags: TComStateFlags;
  6892.     Reserved: array[0..2] of Byte;
  6893.     cbInQue: DWord;
  6894.     cbOutQue: DWord;
  6895.   end;
  6896.   PComStat = ^TComStat;
  6897.  
  6898. const
  6899.   { DTR Control Flow Values. }
  6900.   dtr_Control_Disable = 0;
  6901.   dtr_Control_Enable = 1;
  6902.   dtr_Control_Handshake = 2;
  6903.  
  6904.   { RTS Control Flow Values}
  6905.   rts_Control_Disable = 0;
  6906.   rts_Control_Enable = 1;
  6907.   rts_Control_Handshake = 2;
  6908.   rts_Control_Toggle = 3;
  6909.  
  6910. type
  6911.   tDCB = packed record
  6912.     DCBlength: DWord;
  6913.     BaudRate: DWord;
  6914.     Flags: Longint;
  6915.     wReserved: Word;
  6916.     XonLim: Word;
  6917.     XoffLim: Word;
  6918.     ByteSize: Byte;
  6919.     Parity: Byte;
  6920.     StopBits: Byte;
  6921.     XonChar: CHAR;
  6922.     XoffChar: CHAR;
  6923.     ErrorChar: CHAR;
  6924.     EofChar: CHAR;
  6925.     EvtChar: CHAR;
  6926.     wReserved1: Word;
  6927.   end;
  6928.   pDCB = ^tDCB;
  6929.  
  6930.   PCommTimeouts = ^TCommTimeouts;
  6931.   TCommTimeouts = record
  6932.     ReadIntervalTimeout: DWord;
  6933.     ReadTotalTimeoutMultiplier: DWord;
  6934.     ReadTotalTimeoutConstant: DWord;
  6935.     WriteTotalTimeoutMultiplier: DWord;
  6936.     WriteTotalTimeoutConstant: DWord;
  6937.   end;
  6938.  
  6939.   PCommConfig = ^TCommConfig;
  6940.   TCommConfig = record
  6941.     dwSize: DWord;
  6942.     wVersion: Word;
  6943.     wReserved: Word;
  6944.     dcb: TDCB;
  6945.     dwProviderSubType: DWord;
  6946.     dwProviderOffset: DWord;
  6947.     dwProviderSize: DWord;
  6948.     wcProviderData: array[0..0] of WCHAR;
  6949.   end;
  6950.  
  6951.   PSystemInfo = ^TSystemInfo;
  6952.   TSystemInfo = record
  6953.     case Integer of
  6954.       0: (
  6955.         dwOemId: DWord);
  6956.       1: (
  6957.         wProcessorArchitecture: Word;
  6958.         wReserved: Word;
  6959.         dwPageSize: DWord;
  6960.         lpMinimumApplicationAddress: Pointer;
  6961.         lpMaximumApplicationAddress: Pointer;
  6962.         dwActiveProcessorMask: DWord;
  6963.         dwNumberOfProcessors: DWord;
  6964.         dwProcessorType: DWord;
  6965.         dwAllocationGranularity: DWord;
  6966.         wProcessorLevel: Word;
  6967.         wProcessorRevision: Word);
  6968.   end;
  6969.  
  6970. function FreeModule(var hLibModule: hInst): Bool; inline;
  6971. begin
  6972.   Result := FreeLibrary(hLibModule);
  6973. end;
  6974.  
  6975. function MakeProcInstance(Proc: TFarProc; Instance: THandle): TFarProc; inline;
  6976. begin
  6977.   Result := Proc;
  6978. end;
  6979.  
  6980. procedure FreeProcInstance(Proc: TFarProc); inline;
  6981. begin
  6982. end;
  6983.  
  6984. const
  6985.   { Global Memory Flags }
  6986.  
  6987.   GMEM_VALID_FLAGS = $7F72;
  6988.  
  6989. function GlobalLRUNewest(h: THandle): THandle; inline;
  6990. begin
  6991.   Result := h;
  6992. end;
  6993.  
  6994. function GlobalLRUOldest(h: THandle): THandle; inline;
  6995. begin
  6996.   Result := h;
  6997. end;
  6998.  
  6999. function GlobalAllocPtr(Flags: Integer; Bytes: Longint): Pointer;
  7000. function GlobalReAllocPtr(P: Pointer; Bytes: Longint; Flags: Integer): Pointer;
  7001. function GlobalFreePtr(P: Pointer): THandle;
  7002.  
  7003. const
  7004.   Create_Shared_WOW_VDM           = $00001000;
  7005.   Create_ForceDOS                 = $00002000;
  7006.  
  7007.   Profile_User                    = $10000000;
  7008.   Profile_Kernel                  = $20000000;
  7009.   Profile_Server                  = $40000000;
  7010.  
  7011. { Debug APIs }
  7012.  
  7013.   Exception_Debug_Event = 1;
  7014.   Create_Thread_Debug_Event = 2;
  7015.   Create_Process_Debug_Event = 3;
  7016.   Exit_Thread_Debug_Event = 4;
  7017.   Exit_Process_Debug_Event = 5;
  7018.   Load_DLL_Debug_Event = 6;
  7019.   Unload_DLL_Debug_Event = 7;
  7020.   Output_Debug_String_Event = 8;
  7021.   RIP_Event = 9;
  7022.  
  7023. type
  7024.   PExceptionDebugInfo = ^TExceptionDebugInfo;
  7025.   TExceptionDebugInfo = record
  7026.     ExceptionRecord: TExceptionRecord;
  7027.     dwFirstChance: DWord;
  7028.   end;
  7029.  
  7030.   PCreateThreadDebugInfo = ^TCreateThreadDebugInfo;
  7031.   TCreateThreadDebugInfo = record
  7032.     hThread: THandle;
  7033.     lpThreadLocalBase: Pointer;
  7034.     lpStartAddress: TFNThreadStartRoutine;
  7035.   end;
  7036.  
  7037.   PCreateProcessDebugInfo = ^TCreateProcessDebugInfo;
  7038.   TCreateProcessDebugInfo = record
  7039.     hFile: THandle;
  7040.     hProcess: THandle;
  7041.     hThread: THandle;
  7042.     lpBaseOfImage: Pointer;
  7043.     dwDebugInfoFileOffset: DWord;
  7044.     nDebugInfoSize: DWord;
  7045.     lpThreadLocalBase: Pointer;
  7046.     lpStartAddress: TFNThreadStartRoutine;
  7047.     lpImageName: Pointer;
  7048.     fUnicode: Word;
  7049.   end;
  7050.  
  7051.   PExitThreadDebugInfo = ^TExitThreadDebugInfo;
  7052.   TExitThreadDebugInfo = record
  7053.     dwExitCode: DWord;
  7054.   end;
  7055.  
  7056.   PExitProcessDebugInfo = ^TExitProcessDebugInfo;
  7057.   TExitProcessDebugInfo = record
  7058.     dwExitCode: DWord;
  7059.   end;
  7060.  
  7061.   PLoadDLLDebugInfo = ^TLoadDLLDebugInfo;
  7062.   TLoadDLLDebugInfo = record
  7063.     hFile: THandle;
  7064.     lpBaseOfDll: Pointer;
  7065.     dwDebugInfoFileOffset: DWord;
  7066.     nDebugInfoSize: DWord;
  7067.     lpImageName: Pointer;
  7068.     fUnicode: Word;
  7069.   end;
  7070.  
  7071.   PUnloadDLLDebugInfo = ^TUnloadDLLDebugInfo;
  7072.   TUnloadDLLDebugInfo = record
  7073.     lpBaseOfDll: Pointer;
  7074.   end;
  7075.  
  7076.   POutputDebugStringInfo = ^TOutputDebugStringInfo;
  7077.   TOutputDebugStringInfo = record
  7078.     lpDebugStringData: LPSTR;
  7079.     fUnicode: Word;
  7080.     nDebugStringLength: Word;
  7081.   end;
  7082.  
  7083.   PRIPInfo = ^TRIPInfo;
  7084.   TRIPInfo = record
  7085.     dwError: DWord;
  7086.     dwType: DWord;
  7087.   end;
  7088.  
  7089.   PDebugEvent = ^TDebugEvent;
  7090.   TDebugEvent = record
  7091.     dwDebugEventCode: DWord;
  7092.     dwProcessId: DWord;
  7093.     dwThreadId: DWord;
  7094.     case Integer of
  7095.       0: (Exception: TExceptionDebugInfo);
  7096.       1: (CreateThread: TCreateThreadDebugInfo);
  7097.       2: (CreateProcessInfo: TCreateProcessDebugInfo);
  7098.       3: (ExitThread: TExitThreadDebugInfo);
  7099.       4: (ExitProcess: TExitThreadDebugInfo);
  7100.       5: (LoadDll: TLoadDLLDebugInfo);
  7101.       6: (UnloadDll: TUnloadDLLDebugInfo);
  7102.       7: (DebugString: TOutputDebugStringInfo);
  7103.       8: (RipInfo: TRIPInfo);
  7104.   end;
  7105.  
  7106. function GetFreeSpace(w: Word): DWord; inline;
  7107. begin
  7108.   Result := $100000;
  7109. end;
  7110.  
  7111. const
  7112.   NoParity = 0;
  7113.   OddParity = 1;
  7114.   EvenParity = 2;
  7115.   MarkParity = 3;
  7116.   SpaceParity = 4;
  7117.  
  7118.   OneStopbit = 0;
  7119.   One5StopBits = 1;
  7120.   TwoStopBits = 2;
  7121.  
  7122.   Ignore = 0;               { Ignore signal }
  7123.  
  7124.   { Baud rates at which the communication device operates }
  7125.  
  7126.   cbr_110 = 110;
  7127.   cbr_300 = 300;
  7128.   cbr_600 = 600;
  7129.   cbr_1200 = 1200;
  7130.   cbr_2400 = 2400;
  7131.   cbr_4800 = 4800;
  7132.   cbr_9600 = 9600;
  7133.   cbr_14400 = 14400;
  7134.   cbr_19200 = 19200;
  7135.   cbr_38400 = 38400;
  7136.   cbr_56000 = 56000;
  7137.   cbr_57600 = 57600;
  7138.   cbr_115200 = $1C200;
  7139.   cbr_128000 = $1F400;
  7140.   cbr_256000 = $3E800;
  7141.  
  7142.   { Error Flags }
  7143.  
  7144.   ce_RxOver = 1;        { Receive Queue overflow }
  7145.   ce_Overrun = 2;       { Receive Overrun Error }
  7146.   ce_RxParity = 4;      { Receive Parity Error }
  7147.   ce_Frame = 8;         { Receive Framing error }
  7148.   ce_Break = $10;       { Break Detected }
  7149.   ce_TxFull = $100;     { TX Queue is full }
  7150.   ce_PTO = $200;        { LPTx Timeout }
  7151.   ce_IOE = $400;        { LPTx I/O Error }
  7152.   ce_DNS = $800;        { LPTx Device not selected }
  7153.   ce_OOP = $1000;       { LPTx Out-Of-Paper }
  7154.   ce_Mode = $8000;      { Requested mode unsupported }
  7155.  
  7156.   ie_BadId = -1;        { Invalid or unsupported id }
  7157.   ie_Open = -2;         { Device Already Open }
  7158.   ie_NOpen = -3;        { Device Not Open }
  7159.   ie_Memory = -4;       { Unable to allocate queues }
  7160.   ie_Default = -5;      { Error in default parameters }
  7161.   ie_Hardware = -10;    { Hardware Not Present }
  7162.   ie_ByteSize = -11;    { Illegal Byte Size }
  7163.   ie_Baudrate = -12;    { Unsupported BaudRate }
  7164.  
  7165.   { Events }
  7166.  
  7167.   ev_RxChar = 1;        { Any Character received }
  7168.   ev_RxFlag = 2;        { Received certain character }
  7169.   ev_TxEmpty = 4;       { Transmitt Queue Empty }
  7170.   ev_CTS = 8;           { CTS changed state }
  7171.   ev_DSR = $10;         { DSR changed state }
  7172.   ev_RLSD = $20;        { RLSD changed state }
  7173.   ev_Break = $40;       { BREAK received }
  7174.   ev_Err = $80;         { Line status error occurred }
  7175.   ev_Ring = $100;       { Ring signal detected }
  7176.   ev_PErr = $200;       { Printer error occured }
  7177.   ev_Rx80Full = $400;   { Receive buffer is 80 percent full }
  7178.   ev_Event1 = $800;     { Provider specific event 1 }
  7179.   ev_Event2 = $1000;    { Provider specific event 2 }
  7180.  
  7181.   { Escape functions }
  7182.  
  7183.   SetXOff = 1;    { Simulate XOFF received }
  7184.   SetXOn = 2;     { Simulate XON received }
  7185.   SetRTS = 3;     { Set RTS high }
  7186.   ClrRTS = 4;     { Set RTS low }
  7187.   SetDTR = 5;     { Set DTR high }
  7188.   ClrDTR = 6;     { Set DTR low }
  7189.   ResetDev = 7;   { Reset device if possible }
  7190.   SetBreak = 8;   { Set the device break line. }
  7191.   ClrBreak = 9;   { Clear the device break line. }
  7192.  
  7193.   { PURGE function flags. }
  7194.  
  7195.   Purge_TxAbort = 1;     { Kill the pending/current writes to the comm port. }
  7196.   Purge_RxAbort = 2;     { Kill the pending/current reads to the comm port. }
  7197.   Purge_TxClear = 4;     { Kill the transmit queue if there. }
  7198.   Purge_RxClear = 8;     { Kill the typeahead buffer if there. }
  7199.  
  7200.   LPTx = $80;     { Set if ID is for LPT device }
  7201.  
  7202.   { Modem Status Flags }
  7203.  
  7204.   ms_CTS_ON = DWord($0010);
  7205.   ms_DSR_ON = DWord($0020);
  7206.   ms_Ring_ON = DWord($0040);
  7207.   ms_RLSD_ON = DWord($0080);
  7208.  
  7209.   { WaitSoundState() Constants }
  7210.  
  7211.   s_QueueEmpty = 0;
  7212.   s_Threshold = 1;
  7213.   s_AllThreshold = 2;
  7214.  
  7215.   { Accent Modes }
  7216.  
  7217.   s_Normal = 0;
  7218.   s_Legato = 1;
  7219.   s_Staccato = 2;
  7220.  
  7221.   { SetSoundNoise() Sources }
  7222.  
  7223.   s_Period512 = 0;     { Freq = N/512 high pitch, less coarse hiss }
  7224.   s_Period1024 = 1;    { Freq = N/1024 }
  7225.   s_Period2048 = 2;    { Freq = N/2048 low pitch, more coarse hiss }
  7226.   s_PeriodVoice = 3;   { Source is frequency from voice channel (3) }
  7227.   s_White512 = 4;      { Freq = N/512 high pitch, less coarse hiss }
  7228.   s_White1024 = 5;     { Freq = N/1024 }
  7229.   s_White2048 = 6;     { Freq = N/2048 low pitch, more coarse hiss }
  7230.   s_WhiteVoice = 7;    { Source is frequency from voice channel (3) }
  7231.  
  7232.   s_serDvNa = -1;     { Device not available  }
  7233.   s_serOFM = -2;      { Out of memory }
  7234.   s_serMAct = -3;     { Music active }
  7235.   s_serQFul = -4;     { Queue full }
  7236.   s_serBdNt = -5;     { Invalid note }
  7237.   s_serDLN = -6;      { Invalid note length }
  7238.   s_serDCC = -7;      { Invalid note count }
  7239.   s_serDTP = -8;      { Invalid tempo }
  7240.   s_serDVL = -9;      { Invalid volume }
  7241.   s_serDMD = -10;     { Invalid mode }
  7242.   s_serDSH = -11;     { Invalid shape }
  7243.   s_serDPT = -12;     { Invalid pitch }
  7244.   s_serDFQ = -13;     { Invalid frequency }
  7245.   s_serDDR = -14;     { Invalid duration }
  7246.   s_serDSR = -15;     { Invalid source }
  7247.   s_serDST = -16;     { Invalid state }
  7248.  
  7249.   nmpwait_Wait_Forever = $FFFFFFFF;
  7250.   nmpwait_NoWait = 1;
  7251.   nmpwait_Use_Default_Wait = 0;
  7252.  
  7253.   fs_Persistent_ACLs = file_Persistent_ACLs;
  7254.   fs_Vol_is_Compressed = file_Volume_is_Compressed;
  7255.   fs_File_Compression = file_File_Compression;
  7256.  
  7257.   file_Map_Copy = Section_Query;
  7258.   file_Map_Write = Section_Map_Write;
  7259.   file_Map_Read = Section_Map_Read;
  7260.   file_Map_All_Access = Section_All_Access;
  7261.  
  7262. const
  7263.   MaxintAtom = $C000;
  7264.   Invalid_Atom = 0;
  7265.  
  7266. procedure FreeLibraryAndExitThread(hLibModule: hModule; dwExitCode: DWord);
  7267. function DisableThreadLibraryCalls(hLibModule: hModule): Bool;
  7268. function GetVersion: DWord;
  7269. function GlobalCompact(dwMinFree: DWord): UInt;
  7270. procedure GlobalFix(hMem: HGLOBAL);
  7271. procedure GlobalUnfix(hMem: HGLOBAL);
  7272. function GlobalWire(hMem: HGLOBAL): Pointer;
  7273. function GlobalUnWire(hMem: HGLOBAL): Bool;
  7274. function LocalShrink(hMem: HLOCAL; cbNewSize: UInt): UInt;
  7275. function LocalCompact(uMinFree: UInt): UInt;
  7276. function FlushInstructionCache(hProcess: THandle;
  7277.   const lpBaseAddress: Pointer; dwSize: DWord): Bool;
  7278. function VirtualAlloc(lpvAddress: Pointer;
  7279.   dwSize, flAllocationType, flProtect: DWord): Pointer;
  7280. function VirtualFree(lpAddress: Pointer; dwSize, dwFreeType: DWord): Bool;
  7281. function VirtualProtect(lpAddress: Pointer; dwSize, flNewProtect: DWord;
  7282.   lpflOldProtect: Pointer): Bool;
  7283. function VirtualQuery(lpAddress: Pointer;
  7284.   var lpBuffer: TMemoryBasicInformation; dwLength: DWord): DWord;
  7285. function VirtualAllocEx(hProcess: THandle; lpAddress: Pointer;
  7286.   dwSize, flAllocationType: DWord; flProtect: DWord): Pointer;
  7287. function VirtualFreeEx(hProcess: THandle; lpAddress: Pointer;
  7288.         dwSize, dwFreeType: DWord): Pointer;
  7289. function VirtualProtectEx(hProcess: THandle; lpAddress: Pointer;
  7290.   dwSize, flNewProtect: DWord; lpflOldProtect: Pointer): Bool;
  7291. function VirtualQueryEx(hProcess: THandle; lpAddress: Pointer;
  7292.   var lpBuffer: TMemoryBasicInformation; dwLength: DWord): DWord;
  7293. function HeapValidate(hHeap: THandle; dwFlags: DWord; lpMem: Pointer): Bool;
  7294. function HeapCompact(hHeap: THandle; dwFlags: DWord): UInt;
  7295. function GetProcessHeap: THandle;
  7296. function GetProcessHeaps(NumberOfHeaps: DWord; var ProcessHeaps: THandle): DWord;
  7297.  
  7298. procedure LockSegment(Segment: THandle); inline;
  7299. begin
  7300.   GlobalFix(Segment);
  7301. end;
  7302.  
  7303. procedure UnlockSegment(Segment: THandle); inline;
  7304. begin
  7305.   GlobalUnfix(Segment);
  7306. end;
  7307.  
  7308. type
  7309.   PProcessHeapEntry = ^TProcessHeapEntry;
  7310.   TProcessHeapEntry = record
  7311.     lpData: Pointer;
  7312.     cbData: DWord;
  7313.     cbOverhead: Byte;
  7314.     iRegionIndex: Byte;
  7315.     wFlags: Word;
  7316.     case Integer of
  7317.       0: (
  7318.         hMem: THandle);
  7319.       1: (
  7320.         dwCommittedSize: DWord;
  7321.         dwUnCommittedSize: DWord;
  7322.         lpFirstBlock: Pointer;
  7323.         lpLastBlock: Pointer);
  7324.   end;
  7325.  
  7326. const
  7327.   Process_Heap_Region = 1;
  7328.   Process_Heap_Uncommitted_Range = 2;
  7329.   Process_Heap_Entry_Busy = 4;
  7330.   Process_Heap_Entry_Moveable = $10;
  7331.   Process_Heap_Entry_DDEShare = $20;
  7332.  
  7333. function HeapLock(hHeap: THandle): Bool;
  7334. function HeapUnlock(hHeap: THandle): Bool;
  7335. function HeapWalk(hHeap: THandle; var lpEntry: TProcessHeapEntry): Bool;
  7336.  
  7337.  
  7338. { GetBinaryType return values.}
  7339.  
  7340. const
  7341.   scs_32Bit_Binary = 0;
  7342.   scs_DOS_Binary = 1;
  7343.   scs_WOW_Binary = 2;
  7344.   scs_PIF_Binary = 3;
  7345.   scs_Poxix_Binary = 4;
  7346.   scs_OS216_Binary = 5;
  7347.  
  7348. function GetBinaryType(lpApplicationName: PChar; var lpBinaryType: DWord): Bool;
  7349. function GetShortPathName(lpszLongPath: PChar; lpszShortPath: PChar;
  7350.   cchBuffer: DWord): DWord;
  7351. function GetProcessAffinityMask(hProcess: THandle;
  7352.   var lpProcessAffinityMask, lpSystemAffinityMask: DWord): Bool;
  7353. function SetProcessAffinityMask(hProcess: THandle;
  7354.   dwProcessAffinityMask: DWord): Bool;
  7355. function GetProcessTimes(hProcess: THandle;
  7356.   var lpCreationTime, lpExitTime, lpKernelTime, lpUserTime: TFileTime): Bool;
  7357. function GetProcessWorkingSetSize(hProcess: THandle;
  7358.   var lpMinimumWorkingSetSize, lpMaximumWorkingSetSize: DWord): Bool;
  7359. function SetProcessWorkingSetSize(hProcess: THandle;
  7360.   dwMinimumWorkingSetSize, dwMaximumWorkingSetSize: DWord): Bool;
  7361. function FreeEnvironmentStrings(P1: PChar): Bool;
  7362. procedure RaiseException(dwExceptionCode, dwExceptionFlags, nNumberOfArguments: DWord;
  7363.   lpArguments: PDWORD);
  7364. function UnhandledExceptionFilter(const ExceptionInfo: TExceptionPointers): Longint;
  7365. function CreateFiber(dwStackSize: DWord; lpStartAddress: TFNFiberStartRoutine;
  7366.   lpParameter: Pointer): Bool;
  7367. function DeleteFiber(lpFiber: Pointer): Bool;
  7368. function ConvertThreadToFiber(lpParameter: Pointer): Bool;
  7369. function SwitchToFiber(lpFiber: Pointer): Bool;
  7370. function SwitchToThread: Bool;
  7371.  
  7372. type
  7373.   TFNTopLevelExceptionFilter = TFarProc;
  7374.  
  7375. function SetUnhandledExceptionFilter(lpTopLevelExceptionFilter: TFNTopLevelExceptionFilter):
  7376.   TFNTopLevelExceptionFilter;
  7377. function CreateRemoteThread(hProcess: THandle; lpThreadAttributes: Pointer;
  7378.   dwStackSize: DWord; lpStartAddress: TFNThreadStartRoutine; lpParameter: Pointer;
  7379.   dwCreationFlags: DWord; var lpThreadId: DWord): THandle;
  7380. function SetThreadAffinityMask(hThread: THandle; dwThreadAffinityMask: DWord): DWord;
  7381. function SetThreadIdealProcessor(hThread: THandle; dwIdealProcessor: DWord): Bool;
  7382. function SetProcessPriorityBoost(hThread: THandle; DisablePriorityBoost: Bool): Bool;
  7383. function GetProcessPriorityBoost(hThread: THandle; var DisablePriorityBoost: Bool): Bool;
  7384. function SetThreadPriorityBoost(hThread: THandle; DisablePriorityBoost: Bool): Bool;
  7385. function GetThreadPriorityBoost(hThread: THandle; var DisablePriorityBoost: Bool): Bool;
  7386. function GetThreadTimes(hThread: THandle;
  7387.   var lpCreationTime, lpExitTime, lpKernelTime, lpUserTime: TFileTime): Bool;
  7388. function GetThreadSelectorEntry(hThread: THandle; dwSelector: DWord;
  7389.   var lpSelectorEntry: TLDTEntry): Bool;
  7390. function CreateIoCompletionPort(FileHandle, ExistingCompletionPort: THandle;
  7391.   CompletionKey, NumberOfConcurrentThreads: DWord): THandle;
  7392. function GetQueuedCompletionStatus(CompletionPort: THandle;
  7393.   var lpNumberOfBytesTransferred, lpCompletionKey: DWord;
  7394.   var lpOverlapped: POverlapped; dwMilliseconds: DWord): Bool;
  7395. function PostQueuedCompletionStatus(CompletionPort: THandle; dwNumberOfBytesTransferred: DWord;
  7396.   dwCompletionKey: DWord; lpOverlapped: POverlapped): Bool;
  7397. function SetErrorMode(uMode: UInt): UInt;
  7398. function ReadProcessMemory(hProcess: THandle; const lpBaseAddress: Pointer; lpBuffer: Pointer;
  7399.   nSize: DWord; var lpNumberOfBytesRead: DWord): Bool;
  7400. function WriteProcessMemory(hProcess: THandle; const lpBaseAddress: Pointer; lpBuffer: Pointer;
  7401.   nSize: DWord; var lpNumberOfBytesWritten: DWord): Bool;
  7402. function GetThreadContext(hThread: THandle; var lpContext: TContext): Bool;
  7403. function SetThreadContext(hThread: THandle; const lpContext: TContext): Bool;
  7404.  
  7405. type
  7406.   TFNAPCProc = TFarProc;
  7407.  
  7408. function QueueUserAPC(pfnAPC: TFNAPCProc; hThread: THandle; dwData: DWord): Bool;
  7409. procedure DebugBreak;
  7410. function WaitForDebugEvent(var lpDebugEvent: TDebugEvent; dwMilliseconds: DWord): Bool;
  7411. function ContinueDebugEvent(dwProcessId, dwThreadId, dwContinueStatus: DWord): Bool;
  7412. function DebugActiveProcess(dwProcessId: DWord): Bool;
  7413. function TryEnterCriticalSection(var lpCriticalSection: TRTLCriticalSection): Bool;
  7414. function LockFileEx(hFile: THandle; dwFlags, dwReserved: DWord;
  7415.   nNumberOfBytesToLockLow, nNumberOfBytesToLockHigh: DWord;
  7416.   const lpOverlapped: TOverlapped): Bool;
  7417.  
  7418. const
  7419.   Lockfile_Fail_Immediately = 1;
  7420.   Lockfile_Exclusive_Lock = 2;
  7421.  
  7422. function UnlockFileEx(hFile: THandle; dwReserved, nNumberOfBytesToUnlockLow: DWord;
  7423.   nNumberOfBytesToUnlockHigh: DWord; const lpOverlapped: TOverlapped): Bool;
  7424.  
  7425. function DeviceIoControl(hDevice: THandle; dwIoControlCode: DWord; lpInBuffer: Pointer;
  7426.   nInBufferSize: DWord; lpOutBuffer: Pointer; nOutBufferSize: DWord;
  7427.   var lpBytesReturned: DWord; lpOverlapped: POverlapped): Bool;
  7428. function GetHandleInformation(hObject: THandle; var lpdwFlags: DWord): Bool;
  7429. function SetHandleInformation(hObject: THandle; dwMask: DWord; dwFlags: DWord): Bool;
  7430.  
  7431. const
  7432.   Handle_Flag_Inherit = 1;
  7433.   Handle_Flag_Protect_From_Close = 2;
  7434.  
  7435. function ClearCommBreak(hFile: THandle): Bool;
  7436. function ClearCommError(hFile: THandle; var lpErrors: DWord; lpStat: PComStat): Bool;
  7437. function SetupComm(hFile: THandle; dwInQueue, dwOutQueue: DWord): Bool;
  7438. function EscapeCommFunction(hFile: THandle; dwFunc: DWord): Bool;
  7439. function GetCommConfig(hCommDev: THandle; var lpCC: TCommConfig; var lpdwSize: DWord): Bool;
  7440. function GetCommMask(hFile: THandle; var lpEvtMask: DWord): Bool;
  7441. function GetCommProperties(hFile: THandle; var lpCommProp: TCommProp): Bool;
  7442. function GetCommModemStatus(hFile: THandle; var lpModemStat: DWord): Bool;
  7443. function GetCommState(hFile: THandle; var lpDCB: TDCB): Bool;
  7444. function GetCommTimeouts(hFile: THandle; var lpCommTimeouts: TCommTimeouts): Bool;
  7445. function PurgeComm(hFile: THandle; dwFlags: DWord): Bool;
  7446. function SetCommBreak(hFile: THandle): Bool;
  7447. function SetCommConfig(hCommDev: THandle; const lpCC: TCommConfig; dwSize: DWord): Bool;
  7448. function SetCommMask(hFile: THandle; dwEvtMask: DWord): Bool;
  7449. function SetCommState(hFile: THandle; const lpDCB: TDCB): Bool;
  7450. function SetCommTimeouts(hFile: THandle; const lpCommTimeouts: TCommTimeouts): Bool;
  7451. function TransmitCommChar(hFile: THandle; cChar: CHAR): Bool;
  7452. function WaitCommEvent(hFile: THandle; var lpEvtMask: DWord; lpOverlapped: POverlapped): Bool;
  7453. function SetTapePosition(hDevice: THandle; dwPositionMethod, dwPartition: DWord;
  7454.   dwOffsetLow, dwOffsetHigh: DWord; bImmediate: Bool): DWord;
  7455. function GetTapePosition(hDevice: THandle; dwPositionType: DWord;
  7456.   var lpdwPartition, lpdwOffsetLow: DWord; lpdwOffsetHigh: Pointer): DWord;
  7457. function PrepareTape(hDevice: THandle; dwOperation: DWord; bImmediate: Bool): DWord;
  7458. function EraseTape(hDevice: THandle; dwEraseType: DWord; bImmediate: Bool): DWord;
  7459. function CreateTapePartition(hDevice: THandle; dwPartitionMethod, dwCount, dwSize: DWord): DWord;
  7460. function WriteTapemark(hDevice: THandle;
  7461.   dwTapemarkType, dwTapemarkCount: DWord; bImmediate: Bool): DWord;
  7462. function GetTapeStatus(hDevice: THandle): DWord;
  7463. function GetTapeParameters(hDevice: THandle; dwOperation: DWord;
  7464.   var lpdwSize: DWord; lpTapeInformation: Pointer): DWord;
  7465.  
  7466. const
  7467.   Get_Tape_Media_Information = 0;
  7468.   Get_Tape_Drive_Information = 1;
  7469.  
  7470. function SetTapeParameters(hDevice: THandle; dwOperation: DWord;
  7471.   lpTapeInformation: Pointer): DWord;
  7472.  
  7473. const
  7474.   Set_Tape_Media_Information = 0;
  7475.   Set_Tape_Drive_Information = 1;
  7476.  
  7477. procedure GetSystemTimeAsFileTime(var lpSystemTimeAsFileTime: TFileTime);
  7478. procedure GetSystemInfo(var lpSystemInfo: TSystemInfo);
  7479. function IsProcessorFeaturePresent(ProcessorFeature: DWord): Bool;
  7480.  
  7481. { Routines to convert back and forth between system time and file time }
  7482.  
  7483. function SetSystemTimeAdjustment(dwTimeAdjustment: DWord; bTimeAdjustmentDisabled: Bool): Bool;
  7484. function GetSystemTimeAdjustment(var lpTimeAdjustment, lpTimeIncrement: DWord;
  7485.   var lpTimeAdjustmentDisabled: Bool): Bool;
  7486. function FormatMessage(dwFlags: DWord; lpSource: Pointer; dwMessageId: DWord; dwLanguageId: DWord;
  7487.   lpBuffer: PChar; nSize: DWord; Arguments: Pointer): DWord;
  7488.  
  7489. const
  7490.   Format_Message_Allocate_Buffer = $100;
  7491.   Format_Message_Ignore_Inserts = $200;
  7492.   Format_Message_From_String = $400;
  7493.   Format_Message_From_HModule = $800;
  7494.   Format_Message_From_System = $1000;
  7495.   Format_Message_Argument_Array = $2000;
  7496.   Format_Message_Max_Width_Mask = 255;
  7497.  
  7498. function CreatePipe(var hReadPipe, hWritePipe: THandle;
  7499.   lpPipeAttributes: PSecurityAttributes; nSize: DWord): Bool;
  7500. function ConnectNamedPipe(hNamedPipe: THandle; lpOverlapped: POverlapped): Bool;
  7501. function DisconnectNamedPipe(hNamedPipe: THandle): Bool;
  7502. function SetNamedPipeHandleState(hNamedPipe: THandle; var lpMode: DWord;
  7503.   lpMaxCollectionCount, lpCollectDataTimeout: Pointer): Bool;
  7504. function GetNamedPipeInfo(hNamedPipe: THandle; var lpFlags: DWord;
  7505.   lpOutBufferSize, lpInBufferSize, lpMaxInstances: Pointer): Bool;
  7506. function PeekNamedPipe(hNamedPipe: THandle; lpBuffer: Pointer; nBufferSize: DWord;
  7507.   lpBytesRead, lpTotalBytesAvail, lpBytesLeftThisMessage: Pointer): Bool;
  7508. function TransactNamedPipe(hNamedPipe: THandle; lpInBuffer: Pointer; nInBufferSize: DWord;
  7509.   lpOutBuffer: Pointer; nOutBufferSize: DWord; var lpBytesRead: DWord;
  7510.   lpOverlapped: POverlapped): Bool;
  7511.  
  7512. function CreateMailslot(lpName: PChar; nMaxMessageSize: DWord;
  7513.   lReadTimeout: DWord; lpSecurityAttributes: PSecurityAttributes): THandle;
  7514. function GetMailslotInfo(hMailslot: THandle; lpMaxMessageSize: Pointer;
  7515.   var lpNextSize: DWord; lpMessageCount, lpReadTimeout: Pointer): Bool;
  7516. function SetMailslotInfo(hMailslot: THandle; lReadTimeout: DWord): Bool;
  7517. function MapViewOfFile(hFileMappingObject: THandle; dwDesiredAccess: DWord;
  7518.   dwFileOffsetHigh, dwFileOffsetLow, dwNumberOfBytesToMap: DWord): Pointer;
  7519. function FlushViewOfFile(const lpBaseAddress: Pointer; dwNumberOfBytesToFlush: DWord): Bool;
  7520. function UnmapViewOfFile(lpBaseAddress: Pointer): Bool;
  7521.  
  7522. { _l Compat Functions }
  7523.  
  7524. function lstrcpyn(lpString1, lpString2: PChar; iMaxLength: Integer): PChar;
  7525.  
  7526. function _hread(hFile: HFILE; lpBuffer: Pointer; lBytes: Longint): Longint;
  7527. function _hwrite(hFile: HFILE; lpBuffer: LPCSTR; lBytes: Longint): Longint;
  7528. function IsTextUnicode(lpBuffer: Pointer; cb: Integer; lpi: PINT): Bool;
  7529.  
  7530. const
  7531.   tls_Out_of_Indexes = DWord($FFFFFFFF);
  7532.  
  7533.  
  7534. type
  7535.   TPROverlappedCompletionRoutine =
  7536.     procedure (dwErrorCode, dwNumberOfBytesTransfered: DWord;
  7537.     lpOverlapped: POverlapped);
  7538.  
  7539. function SleepEx(dwMilliseconds: DWord; bAlertable: Bool): DWord;
  7540. function WaitForSingleObjectEx(hHandle: THandle; dwMilliseconds: DWord; bAlertable: Bool): DWord;
  7541. function WaitForMultipleObjectsEx(nCount: DWord; lpHandles: PWOHandleArray;
  7542.   bWaitAll: Bool; dwMilliseconds: DWord; bAlertable: Bool): DWord;
  7543. function SignalObjectAndWait(hObjectToSignal: THandle; hObjectToWaitOn: THandle;
  7544.   dwMilliseconds: DWord; bAlertable: Bool): Bool;
  7545. function ReadFileEx(hFile: THandle; lpBuffer: Pointer; nNumberOfBytesToRead: DWord;
  7546.   lpOverlapped: POverlapped; lpCompletionRoutine: TPROverlappedCompletionRoutine): Bool;
  7547. function WriteFileEx(hFile: THandle; lpBuffer: Pointer; nNumberOfBytesToWrite: DWord;
  7548.   const lpOverlapped: TOverlapped; lpCompletionRoutine: FARPROC): Bool;
  7549. function BackupRead(hFile: THandle; lpBuffer: PByte; nNumberOfBytesToRead: DWord;
  7550.   var lpNumberOfBytesRead: DWord; bAbort: Bool;
  7551.   bProcessSecurity: Bool; var lpContext: Pointer): Bool;
  7552. function BackupSeek(hFile: THandle; dwLowBytesToSeek, dwHighBytesToSeek: DWord;
  7553.   var lpdwLowByteSeeked, lpdwHighByteSeeked: DWord; lpContext: Pointer): Bool;
  7554. function BackupWrite(hFile: THandle; lpBuffer: PByte; nNumberOfBytesToWrite: DWord;
  7555.   var lpNumberOfBytesWritten: DWord; bAbort, bProcessSecurity: Bool; var lpContext: Pointer): Bool;
  7556.  
  7557. type
  7558.   PWIN32StreamID = ^TWIN32StreamID;
  7559.   TWIN32StreamID = record
  7560.     dwStreamId: DWord;
  7561.     dwStreamAttributes: DWord;
  7562.     Size: TLargeInteger;
  7563.     dwStreamNameSize: DWord;
  7564.     cStreamName: array[0..0] of WCHAR;
  7565.   end;
  7566.  
  7567. const
  7568.   { Stream IDs }
  7569.   Backup_Invalid = 0;
  7570.   Backup_Data = 1;
  7571.   Backup_EA_Data = 2;
  7572.   Backup_Security_Data = 3;
  7573.   Backup_Alternate_Data = 4;
  7574.   Backup_Link = 5;
  7575.   Backup_Property_Data = 6;
  7576.  
  7577.   { Stream Attributes}
  7578.   Stream_Normal_Attribute = 0;
  7579.   Stream_Modified_When_Read = 1;
  7580.   Stream_Contains_Security = 2;
  7581.   Stream_Contains_Properties = 4;
  7582.  
  7583.   { Dual Mode API below this line. Dual Mode Structures also included. }
  7584.   StartF_UseCountChars = 8;
  7585.   StartF_UseFillAttribuge = $10;
  7586.   StartF_RunFullScreen = $20;  { ignored for non-x86 platforms }
  7587.   StartF_ForceOnFeedback = $40;
  7588.   StartF_ForceOffFeedback = $80;
  7589.   StartF_UseStdHandles = $100;
  7590.   StartF_UseHotKey = $200;
  7591.  
  7592. const
  7593.   Shutdown_NoRetry = 1;
  7594.  
  7595. type
  7596.   PWin32FileAttributeData = ^TWin32FileAttributeData;
  7597.   TWin32FileAttributeData = record
  7598.     dwFileAttributes: DWord;
  7599.     ftCreationTime: TFileTime;
  7600.     ftLastAccessTime: TFileTime;
  7601.     ftLastWriteTime: TFileTime;
  7602.     nFileSizeHigh: DWord;
  7603.     nFileSizeLow: DWord;
  7604.   end;
  7605.  
  7606. type
  7607.   TFNTimerAPCRoutine = TFarProc;
  7608.  
  7609. function CreateWaitableTimer(lpTimerAttributes: PSecurityAttributes;
  7610.   bManualReset: Bool; lpTimerName: PChar): Bool;
  7611. function OpenWaitableTimer(dwDesiredAccess: DWord; bInheritHandle: Bool;
  7612.   lpTimerName: PChar): Bool;
  7613. function SetWaitableTimer(hTimer: THandle; const lpDueTime: TLargeInteger;
  7614.   lPeriod: Longint; pfnCompletionRoutine: TFNTimerAPCRoutine;
  7615.   lpArgToCompletionRoutine: Pointer; fResume: Bool): Bool;
  7616. function CancelWaitableTimer(hTimer: THandle): Bool;
  7617. function CreateFileMapping(hFile: THandle; lpFileMappingAttributes: PSecurityAttributes;
  7618.   flProtect, dwMaximumSizeHigh, dwMaximumSizeLow: DWord; lpName: PChar): THandle;
  7619. function OpenFileMapping(dwDesiredAccess: DWord; bInheritHandle: Bool; lpName: PChar): THandle;
  7620. function LoadLibraryEx(lpLibFileName: PChar; hFile: THandle; dwFlags: DWord): hModule;
  7621.  
  7622. const
  7623.   Dont_Resolve_DLL_References = 1;
  7624.   Load_Library_as_Datafile = 2;
  7625.   Load_With_Altered_Search_Path = 8;
  7626.  
  7627. function SetProcessShutdownParameters(dwLevel, dwFlags: DWord): Bool;
  7628. function GetProcessShutdownParameters(var lpdwLevel, lpdwFlags: DWord): Bool;
  7629. function GetProcessVersion(ProcessId: DWord): DWord;
  7630. procedure GetStartupInfo(var lpStartupInfo: TStartupInfo);
  7631. function ExpandEnvironmentStrings(lpSrc: PChar; lpDst: PChar; nSize: DWord): DWord;
  7632. function FindResourceEx(hModule: hModule; lpType, lpName: PChar; wLanguage: Word): HRSRC;
  7633.  
  7634. type
  7635.   EnumResTypeProc = FarProc;
  7636.   EnumResNameproc = FarProc;
  7637.   EnumResLangProc = FarProc;
  7638.  
  7639. function EnumResourceTypes(hModule: hModule; lpEnumFunc: ENUMRESTYPEPROC;
  7640.   lParam: Longint): Bool;
  7641. function EnumResourceNames(hModule: hModule; lpType: PChar;
  7642.   lpEnumFunc: ENUMRESNAMEPROC; lParam: Longint): Bool;
  7643. function EnumResourceLanguages(hModule: hModule; lpType, lpName: PChar;
  7644.   lpEnumFunc: ENUMRESLANGPROC; lParam: Longint): Bool;
  7645. function BeginUpdateResource(pFileName: PChar; bDeleteExistingResources: Bool): THandle;
  7646. function UpdateResource(hUpdate: THandle; lpType, lpName: PChar;
  7647.   wLanguage: Word; lpData: Pointer; cbData: DWord): Bool;
  7648. function EndUpdateResource(hUpdate: THandle; fDiscard: Bool): Bool;
  7649. function GetProfileSection(lpAppName: PChar; lpReturnedString: PChar; nSize: DWord): DWord;
  7650. function WriteProfileSection(lpAppName, lpString: PChar): Bool;
  7651. function GetPrivateProfileSection(lpAppName: PChar;
  7652.   lpReturnedString: PChar; nSize: DWord; lpFileName: PChar): DWord;
  7653. function WritePrivateProfileSection(lpAppName, lpString, lpFileName: PChar): Bool;
  7654. function GetPrivateProfileSectionNames(lpszReturnBuffer: PChar; nSize: DWord; lpFileName: PChar): DWord;
  7655. function GetPrivateProfileStruct(lpszSection, lpszKey: PChar;
  7656.   lpStruct: Pointer; uSizeStruct: UInt; szFile: PChar): Bool;
  7657. function WritePrivateProfileStruct(lpszSection, lpszKey: PChar;
  7658.   lpStruct: Pointer; uSizeStruct: UInt; szFile: PChar): Bool;
  7659. function GetDiskFreeSpaceEx(lpDirectoryName: PChar;
  7660.   var lpFreeBytesAvailableToCaller, lpTotalNumberOfBytes: Integer;
  7661.   lpTotalNumberOfFreeBytes: PInteger): Bool;
  7662. function CreateDirectoryEx(lpTemplateDirectory, lpNewDirectory: PChar;
  7663.   lpSecurityAttributes: PSecurityAttributes): Bool;
  7664.  
  7665. const
  7666.   ddd_Raw_Target_Path             = $00000001;
  7667.   ddd_Remove_Definition           = $00000002;
  7668.   ddd_Exact_Match_on_Remove       = $00000004;
  7669.   ddd_no_Broadcast_System         = $00000008;
  7670.  
  7671. function DefineDosDevice(dwFlags: DWord; lpDeviceName, lpTargetPath: PChar): Bool;
  7672. function QueryDosDevice(lpDeviceName: PChar;
  7673.   lpTargetPath: PChar; ucchMax: DWord): DWord;
  7674. type
  7675.   TGetFileExInfoLevels = (GetFileExInfoStandard, GetFileExMaxInfoLevel);
  7676. function GetFileAttributesEx(lpFileName: PChar;
  7677.   fInfoLevelId: TGetFileExInfoLevels; lpFileInformation: Pointer): Bool;
  7678. function GetCompressedFileSize(lpFileName: PChar; lpFileSizeHigh: PDWORD): DWord;
  7679. type
  7680.   TFindexInfoLevels = (FindExInfoStandard, FindExInfoMaxInfoLevel);
  7681.   TFindexSearchOps = (FindExSearchNameMatch, FindExSearchLimitToDirectories,
  7682.     FindExSearchLimitToDevices, FindExSearchMaxSearchOp);
  7683.  
  7684. const
  7685.   FIND_FIRST_EX_CASE_SENSITIVE = $00000001;
  7686.  
  7687. function FindFirstFileEx(lpFileName: PChar; fInfoLevelId: TFindexInfoLevels;
  7688.   lpFindFileData: Pointer; fSearchOp: TFindexSearchOps; lpSearchFilter: Pointer;
  7689.   dwAdditionalFlags: DWord): Bool;
  7690.  
  7691. type
  7692.   TFNProgressRoutine = TFarProc;
  7693.  
  7694. function CopyFileEx(lpExistingFileName, lpNewFileName: PChar;
  7695.   lpProgressRoutine: TFNProgressRoutine; lpData: Pointer; pbCancel: PBool;
  7696.   dwCopyFlags: DWord): Bool;
  7697. function MoveFileEx(lpExistingFileName, lpNewFileName: PChar; dwFlags: DWord): Bool;
  7698.  
  7699. const
  7700.   MoveFile_Replace_Existing       = $00000001;
  7701.   MoveFile_Copy_Allowed           = $00000002;
  7702.   MoveFile_Delay_Until_Reboot     = $00000004;
  7703.   MoveFile_Write_Through          = $00000008;
  7704.  
  7705. function CreateNamedPipe(lpName: PChar;
  7706.   dwOpenMode, dwPipeMode, nMaxInstances, nOutBufferSize, nInBufferSize, nDefaultTimeOut: DWord;
  7707.   lpSecurityAttributes: PSecurityAttributes): THandle;
  7708. function GetNamedPipeHandleState(hNamedPipe: THandle;
  7709.   lpState, lpCurInstances, lpMaxCollectionCount, lpCollectDataTimeout: PDWORD;
  7710.   lpUserName: PChar; nMaxUserNameSize: DWord): Bool;
  7711. function CallNamedPipe(lpNamedPipeName: PChar; lpInBuffer: Pointer;
  7712.   nInBufferSize: DWord; lpOutBuffer: Pointer; nOutBufferSize: DWord;
  7713.   var lpBytesRead: DWord; nTimeOut: DWord): Bool;
  7714. function WaitNamedPipe(lpNamedPipeName: PChar; nTimeOut: DWord): Bool;
  7715. procedure SetFileApisToOEM;
  7716. procedure SetFileApisToANSI;
  7717. function AreFileApisANSI: Bool;
  7718.  
  7719. function CancelIo(hFile: THandle): Bool;
  7720.  
  7721. { Event logging APIs }
  7722.  
  7723. function ClearEventLog(hEventLog: THandle; lpBackupFileName: PChar): Bool;
  7724. function BackupEventLog(hEventLog: THandle; lpBackupFileName: PChar): Bool;
  7725. function CloseEventLog(hEventLog: THandle): Bool;
  7726. function DeregisterEventSource(hEventLog: THandle): Bool;
  7727. function NotifyChangeEventLog(hEventLog, hEvent: THandle): Bool;
  7728. function GetNumberOfEventLogRecords(hEventLog: THandle; var NumberOfRecords: DWord): Bool;
  7729. function GetOldestEventLogRecord(hEventLog: THandle; var OldestRecord: DWord): Bool;
  7730. function OpenEventLog(lpUNCServerName, lpSourceName: PChar): THandle;
  7731. function RegisterEventSource(lpUNCServerName, lpSourceName: PChar): THandle;
  7732. function OpenBackupEventLog(lpUNCServerName, lpFileName: PChar): THandle;
  7733. function ReadEventLog(hEventLog: THandle; dwReadFlags, dwRecordOffset: DWord;
  7734.   lpBuffer: Pointer; nNumberOfBytesToRead: DWord;
  7735.   var pnBytesRead, pnMinNumberOfBytesNeeded: DWord): Bool;
  7736. function ReportEvent(hEventLog: THandle; wType, wCategory: Word;
  7737.   dwEventID: DWord; lpUserSid: Pointer; wNumStrings: Word;
  7738.   dwDataSize: DWord; lpStrings, lpRawData: Pointer): Bool;
  7739.  
  7740. { Security APIs }
  7741.  
  7742. function DuplicateToken(ExistingTokenHandle: THandle;
  7743.   ImpersonationLevel: TSecurityImpersonationLevel; DuplicateTokenHandle: PHandle): Bool;
  7744. function GetKernelObjectSecurity(Handle: THandle; RequestedInformation: SECURITY_INFORMATION;
  7745.   pSecurityDescriptor: PSecurityDescriptor; nLength: DWord;
  7746.   var lpnLengthNeeded: DWord): Bool;
  7747. function ImpersonateNamedPipeClient(hNamedPipe: THandle): Bool;
  7748. function ImpersonateSelf(ImpersonationLevel: TSecurityImpersonationLevel): Bool;
  7749. function RevertToSelf: Bool;
  7750. function SetThreadToken(Thread: PHandle; Token: THandle): Bool;
  7751. function AccessCheck(pSecurityDescriptor: PSecurityDescriptor;
  7752.   ClientToken: THandle; DesiredAccess: DWord; const GenericMapping: TGenericMapping;
  7753.   var PrivilegeSet: TPrivilegeSet; var PrivilegeSetLength: DWord;
  7754.   var GrantedAccess: DWord; var AccessStatus: Bool): Bool;
  7755. function OpenProcessToken(ProcessHandle: THandle; DesiredAccess: DWord;
  7756.   var TokenHandle: THandle): Bool;
  7757. function OpenThreadToken(ThreadHandle: THandle; DesiredAccess: DWord;
  7758.   OpenAsSelf: Bool; var TokenHandle: THandle): Bool;
  7759. function GetTokenInformation(TokenHandle: THandle;
  7760.   TokenInformationClass: TTokenInformationClass; TokenInformation: Pointer;
  7761.   TokenInformationLength: DWord; var ReturnLength: DWord): Bool;
  7762. function SetTokenInformation(TokenHandle: THandle;
  7763.   TokenInformationClass: TTokenInformationClass; TokenInformation: Pointer;
  7764.   TokenInformationLength: DWord): Bool;
  7765. function AdjustTokenPrivileges(TokenHandle: THandle; DisableAllPrivileges: Bool;
  7766.   const NewState: TTokenPrivileges; BufferLength: DWord;
  7767.   var PreviousState: TTokenPrivileges; var ReturnLength: DWord): Bool;
  7768. function AdjustTokenGroups(TokenHandle: THandle; ResetToDefault: Bool;
  7769.   const NewState: TTokenGroups; BufferLength: DWord;
  7770.   var PreviousState: TTokenGroups; var ReturnLength: DWord): Bool;
  7771. function PrivilegeCheck(ClientToken: THandle; const RequiredPrivileges: TPrivilegeSet;
  7772.   var pfResult: Bool): Bool;
  7773. function AccessCheckAndAuditAlarm(SubsystemName: PChar;
  7774.   HandleId: Pointer; ObjectTypeName, ObjectName: PChar;
  7775.   SecurityDescriptor: PSecurityDescriptor; DesiredAccess: DWord;
  7776.   const GenericMapping: TGenericMapping;  ObjectCreation: Bool;
  7777.   var GrantedAccess: DWord; var AccessStatus, pfGenerateOnClose: Bool): Bool;
  7778. function ObjectOpenAuditAlarm(SubsystemName: PChar; HandleId: Pointer;
  7779.   ObjectTypeName: PChar; ObjectName: PChar; pSecurityDescriptor: PSecurityDescriptor;
  7780.   ClientToken: THandle; DesiredAccess, GrantedAccess: DWord;
  7781.   var Privileges: TPrivilegeSet; ObjectCreation, AccessGranted: Bool;
  7782.   var GenerateOnClose: Bool): Bool;
  7783. function ObjectPrivilegeAuditAlarm(SubsystemName: PChar;
  7784.   HandleId: Pointer; ClientToken: THandle; DesiredAccess: DWord;
  7785.   var Privileges: TPrivilegeSet; AccessGranted: Bool): Bool;
  7786. function ObjectCloseAuditAlarm(SubsystemName: PChar;
  7787.   HandleId: Pointer; GenerateOnClose: Bool): Bool;
  7788. function ObjectDeleteAuditAlarm(SubsystemName: PChar;
  7789.   HandleId: Pointer; GenerateOnClose: Bool): Bool;
  7790. function PrivilegedServiceAuditAlarm(SubsystemName, ServiceName: PChar;
  7791.   ClientToken: THandle; var Privileges: TPrivilegeSet; AccessGranted: Bool): Bool;
  7792. function IsValidSid(pSid: Pointer): Bool;
  7793. function EqualSid(pSid1, pSid2: Pointer): Bool;
  7794. function EqualPrefixSid(pSid1, pSid2: Pointer): Bool;
  7795. function GetSidLengthRequired(nSubAuthorityCount: UCHAR): DWord;
  7796. function AllocateAndInitializeSid(const pIdentifierAuthority: TSIDIdentifierAuthority;
  7797.   nSubAuthorityCount: Byte; nSubAuthority0, nSubAuthority1: DWord;
  7798.   nSubAuthority2, nSubAuthority3, nSubAuthority4: DWord;
  7799.   nSubAuthority5, nSubAuthority6, nSubAuthority7: DWord;
  7800.   var pSid: Pointer): Bool;
  7801. function FreeSid(pSid: Pointer): Pointer;
  7802. function InitializeSid(Sid: Pointer; const pIdentifierAuthority: TSIDIdentifierAuthority;
  7803.   nSubAuthorityCount: Byte): Bool;
  7804. function GetSidIdentifierAuthority(pSid: Pointer): PSIDIdentifierAuthority;
  7805. function GetSidSubAuthority(pSid: Pointer; nSubAuthority: DWord): PDWORD;
  7806. function GetSidSubAuthorityCount(pSid: Pointer): PUCHAR;
  7807. function GetLengthSid(pSid: Pointer): DWord;
  7808. function CopySid(nDestinationSidLength: DWord;
  7809.   pDestinationSid, pSourceSid: Pointer): Bool;
  7810. function AreAllAccessesGranted(GrantedAccess, DesiredAccess: DWord): Bool;
  7811. function AreAnyAccessesGranted(GrantedAccess, DesiredAccess: DWord): Bool;
  7812. procedure MapGenericMask(var AccessMask: DWord; const GenericMapping: TGenericMapping);
  7813. function IsValidAcl(const pAcl: TACL): Bool;
  7814. function InitializeAcl(var pAcl: TACL; nAclLength, dwAclRevision: DWord): Bool;
  7815. function GetAclInformation(const pAcl: TACL; pAclInformation: Pointer;
  7816.   nAclInformationLength: DWord; dwAclInformationClass: TAclInformationClass): Bool;
  7817. function SetAclInformation(var pAcl: TACL; pAclInformation: Pointer;
  7818.   nAclInformationLength: DWord; dwAclInformationClass: TAclInformationClass): Bool;
  7819. function AddAce(var pAcl: TACL; dwAceRevision, dwStartingAceIndex: DWord; pAceList: Pointer;
  7820.   nAceListLength: DWord): Bool;
  7821. function DeleteAce(var pAcl: TACL; dwAceIndex: DWord): Bool;
  7822. function GetAce(const pAcl: TACL; dwAceIndex: DWord; var pAce: Pointer): Bool;
  7823. function AddAccessAllowedAce(var pAcl: TACL; dwAceRevision: DWord;
  7824.   AccessMask: DWord; pSid: PSID): Bool;
  7825. function AddAccessDeniedAce(var pAcl: TACL; dwAceRevision: DWord;
  7826.   AccessMask: DWord; pSid: PSID): Bool;
  7827. function AddAuditAccessAce(var pAcl: TACL; dwAceRevision: DWord;
  7828.   dwAccessMask: DWord; pSid: Pointer; bAuditSuccess, bAuditFailure: Bool): Bool;
  7829. function FindFirstFreeAce(var pAcl: TACL; var pAce: Pointer): Bool;
  7830. function InitializeSecurityDescriptor(pSecurityDescriptor: PSecurityDescriptor;
  7831.   dwRevision: DWord): Bool;
  7832. function IsValidSecurityDescriptor(pSecurityDescriptor: PSecurityDescriptor): Bool;
  7833. function GetSecurityDescriptorLength(pSecurityDescriptor: PSecurityDescriptor): DWord;
  7834. function GetSecurityDescriptorControl(pSecurityDescriptor: PSecurityDescriptor;
  7835.   var pControl: SECURITY_DESCRIPTOR_CONTROL; var lpdwRevision: DWord): Bool;
  7836. function SetSecurityDescriptorDacl(pSecurityDescriptor: PSecurityDescriptor;
  7837.   bDaclPresent: Bool; pDacl: PACL; bDaclDefaulted: Bool): Bool;
  7838. function GetSecurityDescriptorDacl(pSecurityDescriptor: PSecurityDescriptor;
  7839.   var lpbDaclPresent: Bool; var pDacl: PACL; var lpbDaclDefaulted: Bool): Bool;
  7840. function SetSecurityDescriptorSacl(pSecurityDescriptor: PSecurityDescriptor;
  7841.   bSaclPresent: Bool; pSacl: PACL; bSaclDefaulted: Bool): Bool;
  7842. function GetSecurityDescriptorSacl(pSecurityDescriptor: PSecurityDescriptor;
  7843.   var lpbSaclPresent: Bool; var pSacl: PACL; var lpbSaclDefaulted: Bool): Bool;
  7844. function SetSecurityDescriptorOwner(pSecurityDescriptor: PSecurityDescriptor;
  7845.   pOwner: PSID; bOwnerDefaulted: Bool): Bool;
  7846. function GetSecurityDescriptorOwner(pSecurityDescriptor: PSecurityDescriptor;
  7847.   var pOwner: PSID; var lpbOwnerDefaulted: Bool): Bool;
  7848. function SetSecurityDescriptorGroup(pSecurityDescriptor: PSecurityDescriptor;
  7849.   pGroup: PSID; bGroupDefaulted: Bool): Bool;
  7850. function GetSecurityDescriptorGroup(pSecurityDescriptor: PSecurityDescriptor;
  7851.   var pGroup: PSID; var lpbGroupDefaulted: Bool): Bool;
  7852. function CreatePrivateObjectSecurity(ParentDescriptor, CreatorDescriptor: PSecurityDescriptor;
  7853.   var NewDescriptor: PSecurityDescriptor; IsDirectoryObject: Bool;
  7854.   Token: THandle; const GenericMapping: TGenericMapping): Bool;
  7855. function SetPrivateObjectSecurity(SecurityInformation: SECURITY_INFORMATION;
  7856.   ModificationDescriptor: PSecurityDescriptor; var ObjectsSecurityDescriptor: PSecurityDescriptor;
  7857.   const GenericMapping: TGenericMapping; Token: THandle): Bool;
  7858. function GetPrivateObjectSecurity(ObjectDescriptor: PSecurityDescriptor;
  7859.   SecurityInformation: SECURITY_INFORMATION; ResultantDescriptor: PSecurityDescriptor;
  7860.   DescriptorLength: DWord; var ReturnLength: DWord): Bool;
  7861. function DestroyPrivateObjectSecurity(var ObjectDescriptor: PSecurityDescriptor): Bool;
  7862. function MakeSelfRelativeSD(pAbsoluteSecurityDescriptor: PSecurityDescriptor;
  7863.   pSelfRelativeSecurityDescriptor: PSecurityDescriptor; var lpdwBufferLength: DWord): Bool;
  7864. function MakeAbsoluteSD(pSelfRelativeSecurityDescriptor: PSecurityDescriptor;
  7865.   pAbsoluteSecurityDescriptor: PSecurityDescriptor; var lpdwAbsoluteSecurityDescriptorSi: DWord;
  7866.   var pDacl: TACL; var lpdwDaclSize: DWord; var pSacl: TACL;
  7867.   var lpdwSaclSize: DWord; pOwner: PSID; var lpdwOwnerSize: DWord;
  7868.   pPrimaryGroup: Pointer; var lpdwPrimaryGroupSize: DWord): Bool;
  7869.  
  7870. function SetFileSecurity(lpFileName: PChar; SecurityInformation: SECURITY_INFORMATION;
  7871.   pSecurityDescriptor: PSecurityDescriptor): Bool;
  7872. function GetFileSecurity(lpFileName: PChar; RequestedInformation: SECURITY_INFORMATION;
  7873.   pSecurityDescriptor: PSecurityDescriptor; nLength: DWord; var lpnLengthNeeded: DWord): Bool;
  7874. function SetKernelObjectSecurity(Handle: THandle; SecurityInformation: SECURITY_INFORMATION;
  7875.   SecurityDescriptor: PSecurityDescriptor): Bool;
  7876. function FindFirstChangeNotification(lpPathName: PChar;
  7877.   bWatchSubtree: Bool; dwNotifyFilter: DWord): THandle;
  7878. function FindNextChangeNotification(hChangeHandle: THandle): Bool;
  7879. function FindCloseChangeNotification(hChangeHandle: THandle): Bool;
  7880. function ReadDirectoryChanges(hDirectory: THandle; lpBuffer: Pointer;
  7881.   nBufferLength: DWord; bWatchSubtree: Bool; dwNotifyFilter: DWord;
  7882.   lpBytesReturned: LPDWORD; lpOverlapped: POverlapped;
  7883.   lpCompletionRoutine: FARPROC): Bool;
  7884. function VirtualLock(lpAddress: Pointer; dwSize: DWord): Bool;
  7885. function VirtualUnlock(lpAddress: Pointer; dwSize: DWord): Bool;
  7886. function MapViewOfFileEx(hFileMappingObject: THandle;
  7887.   dwDesiredAccess, dwFileOffsetHigh, dwFileOffsetLow, dwNumberOfBytesToMap: DWord;
  7888.   lpBaseAddress: Pointer): Pointer;
  7889. function LookupAccountSid(lpSystemName: PChar; Sid: PSID;
  7890.   Name: PChar; var cbName: DWord; ReferencedDomainName: PChar;
  7891.   var cbReferencedDomainName: DWord; var peUse: SID_NAME_USE): Bool;
  7892. function LookupAccountName(lpSystemName, lpAccountName: PChar;
  7893.   Sid: PSID; var cbSid: DWord; ReferencedDomainName: PChar;
  7894.   var cbReferencedDomainName: DWord; var peUse: SID_NAME_USE): Bool;
  7895. function LookupPrivilegeValue(lpSystemName, lpName: PChar;
  7896.   var lpLuid: TLargeInteger): Bool;
  7897. function LookupPrivilegeName(lpSystemName: PChar;
  7898.   var lpLuid: TLargeInteger; lpName: PChar; var cbName: DWord): Bool;
  7899. function LookupPrivilegeDisplayName(lpSystemName, lpName: PChar;
  7900.   lpDisplayName: PChar; var cbDisplayName, lpLanguageId: DWord): Bool;
  7901. function AllocateLocallyUniqueId(var Luid: TLargeInteger): Bool;
  7902. function BuildCommDCB(lpDef: PChar; var lpDCB: TDCB): Bool;
  7903. function BuildCommDCBAndTimeouts(lpDef: PChar; var lpDCB: TDCB;
  7904.   var lpCommTimeouts: TCommTimeouts): Bool;
  7905. function CommConfigDialog(lpszName: PChar; hWnd: hWnd; var lpCC: TCommConfig): Bool;
  7906. function GetDefaultCommConfig(lpszName: PChar;
  7907.   var lpCC: TCommConfig; var lpdwSize: DWord): Bool;
  7908. function SetDefaultCommConfig(lpszName: PChar; lpCC: PCommConfig; dwSize: DWord): Bool;
  7909.  
  7910. const
  7911.   Max_Computername_Length = 15;
  7912.  
  7913. function GetComputerName(lpBuffer: PChar; var nSize: DWord): Bool;
  7914. function SetComputerName(lpComputerName: PChar): Bool;
  7915. function GetUserName(lpBuffer: PChar; var nSize: DWord): Bool;
  7916.  
  7917. { Logon Support APIs }
  7918.  
  7919. const
  7920.   Logon32_Logon_Interactive = 2;
  7921.   Logon32_Logon_Network = 3;
  7922.   Logon32_Logon_Batch = 4;
  7923.   Logon32_Logon_Service = 5;
  7924.  
  7925.   Logon32_Provider_Default = 0;
  7926.   Logon32_Provider_WinNt35 = 1;
  7927.   Logon32_Provider_WinNt40 = 2;
  7928.  
  7929. function LogonUser(lpszUsername, lpszDomain, lpszPassword: PChar;
  7930.   dwLogonType, dwLogonProvider: DWord; var phToken: THandle): Bool;
  7931. function ImpersonateLoggedOnUser(hToken: THandle): Bool;
  7932. function CreateProcessAsUser(hToken: THandle; lpApplicationName: PChar;
  7933.   lpCommandLine: PChar; lpProcessAttributes: PSecurityAttributes;
  7934.   lpThreadAttributes: PSecurityAttributes; bInheritHandles: Bool;
  7935.   dwCreationFlags: DWord; lpEnvironment: Pointer; lpCurrentDirectory: PChar;
  7936.   const lpStartupInfo: TStartupInfo; var lpProcessInformation: TProcessInformation): Bool;
  7937.  
  7938. function DuplicateTokenEx(hExistingToken: THandle; dwDesiredAccess: DWord;
  7939.   lpTokenAttributes: PSecurityAttributes;
  7940.   ImpersonationLevel: TSecurityImpersonationLevel; TokenType: TTokenType;
  7941.   var phNewToken: THandle): Bool;
  7942.  
  7943. { Plug-and-Play API's }
  7944. const
  7945.   hw_Profile_GUIDLen = 39;                 { 36-characters plus NULL terminator }
  7946.   max_Profile_Len = 80;
  7947.  
  7948.   DockInfo_Undocked = $1;
  7949.   DockInfo_Docked = $2;
  7950.   DockInfo_User_Supplied = $4;
  7951.   DockInfo_User_Undocked = DockInfo_User_Supplied or DockInfo_Undocked;
  7952.   DockInfo_User_Docked = DockInfo_User_Supplied or DockInfo_Docked;
  7953.  
  7954. type
  7955.   PHWProfileInfo = ^THWProfileInfo;
  7956.   THWProfileInfo = packed record
  7957.     dwDockInfo: DWord;
  7958.     szHwProfileGuid: packed array[0..hw_Profile_GUIDLen-1] of Char;
  7959.     szHwProfileName: packed array[0..max_Profile_Len-1] of Char;
  7960.   end;
  7961.  
  7962. function GetCurrentHwProfile(var lpHwProfileInfo: THWProfileInfo): Bool;
  7963.  
  7964. { Performance counter API's }
  7965.  
  7966. function QueryPerformanceCounter(var lpPerformanceCount: TLargeInteger): Bool;
  7967. function QueryPerformanceFrequency(var lpFrequency: TLargeInteger): Bool;
  7968.  
  7969. type
  7970.   POSVersionInfo = ^TOSVersionInfo;
  7971.   TOSVersionInfo = record
  7972.     dwOSVersionInfoSize: DWord;
  7973.     dwMajorVersion: DWord;
  7974.     dwMinorVersion: DWord;
  7975.     dwBuildNumber: DWord;
  7976.     dwPlatformId: DWord;
  7977.     szCSDVersion: array[0..127] of Char; { Maintenance string for PSS usage }
  7978.   end;
  7979.  
  7980. { dwPlatformId defines }
  7981. const
  7982.   ver_Platform_Win32s = 0;
  7983.   ver_Platform_Win32_Windows = 1;
  7984.   ver_Platform_Win32_NT = 2;
  7985.  
  7986. function GetVersionEx(var lpVersionInformation: TOSVersionInfo): Bool;
  7987.  
  7988. { DOS and OS/2 Compatible Error Code definitions returned by the Win32 Base
  7989.   API functions. }
  7990.  
  7991.  
  7992. { Translated from WINERROR.H }
  7993. { Error code definitions for the Win32 API functions }
  7994.  
  7995. (*
  7996.   Values are 32 bit values layed out as follows:
  7997.    3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
  7998.    1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
  7999.   +---+-+-+-----------------------+-------------------------------+
  8000.   |Sev|C|R|     Facility          |               Code            |
  8001.   +---+-+-+-----------------------+-------------------------------+
  8002.  
  8003.   where
  8004.       Sev - is the severity code
  8005.           00 - Success
  8006.           01 - Informational
  8007.           10 - Warning
  8008.           11 - Error
  8009.  
  8010.       C - is the Customer code flag
  8011.       R - is a reserved bit
  8012.       Facility - is the facility code
  8013.       Code - is the facility's status code
  8014. *)
  8015.  
  8016. { Define the facility codes }
  8017.  
  8018. const
  8019.   Facility_SSPI                        = 9;
  8020.   Facility_Internet                    = 12;
  8021.   Facility_CERT                        = 11;
  8022.  
  8023.   {  The image file %1 is valid, but is for a machine type other }
  8024.   {  than the current machine. }
  8025.   Error_Exe_Machine_Type_Mismatch = 216;
  8026.  
  8027.   {  The account specified for this service is different from the account }
  8028.   {  specified for other services running in the same process. }
  8029.   Error_Different_Service_Account = 1079;
  8030.  
  8031.   { An attempt to change the system power state was vetoed by another }
  8032.   { application or driver. }
  8033.   Error_Set_Power_State_Vetoed = 1140;
  8034.  
  8035.   { The system BIOS failed an attempt to change the system power state. }
  8036.   Error_Set_Power_State_Failed = 1141;
  8037.  
  8038.   {  An attempt was made to create more links on a file than }
  8039.   {  the file system supports. }
  8040.   Error_Too_Many_Links = 1142;
  8041.  
  8042.   { The specified program requires a newer version of Windows. }
  8043.   Error_Old_Win_Version = 1150;
  8044.  
  8045.   { The specified program is not a Windows or MS-DOS program. }
  8046.   Error_App_Wrong_OS = 1151;
  8047.  
  8048.   { Cannot start more than one instance of the specified program. }
  8049.   Error_Single_Instance_App = 1152;
  8050.  
  8051.   {  The specified program was written for an older version of Windows. }
  8052.   Error_RMode_Aapp= 1153;
  8053.  
  8054.   { One of the library files needed to run this application is damaged. }
  8055.   Error_Invalid_DLL = 1154;
  8056.  
  8057.   { No application is associated with the specified file for this operation. }
  8058.   Error_No_Association = 1155;
  8059.  
  8060.   { An error occurred in sending the command to the application. }
  8061.   Error_DDE_Fail = 1156;
  8062.  
  8063.   { One of the library files needed to run this application cannot be found. }
  8064.   Error_DLL_Not_Found = 1157;
  8065.  
  8066.  
  8067. { Winnet32 Status Codes }
  8068.  
  8069.   { The operation being requested was not performed because the user }
  8070.   { has not been authenticated. }
  8071.   Error_Not_Authenticated = 1244;
  8072.  
  8073.   { The operation being requested was not performed because the user }
  8074.   { has not logged on to the network. }
  8075.   { The specified service does not exist. }
  8076.   Error_Not_Logged_On = 1245;
  8077.  
  8078.   { Return that wants caller to continue with work in progress. }
  8079.   Error_Continue = 1246;
  8080.  
  8081.   { An attempt was made to perform an initialization operation when }
  8082.   { initialization has already been completed. }
  8083.   Error_Already_Initialized = 1247;
  8084.  
  8085.   { No more local devices. }
  8086.   Error_No_More_Devices = 1248;
  8087.  
  8088.  
  8089. { Security Status Codes }
  8090.  
  8091.   { The file or directory is corrupt and non-readable. }
  8092.  
  8093.   { The disk structure is corrupt and non-readable. }
  8094.  
  8095.   { There is no user session key for the specified logon session. }
  8096.  
  8097.   { The service being accessed is licensed for a particular number of connections. }
  8098.   { No more connections can be made to the service at this time }
  8099.   { because there are already as many connections as the service can accept. }
  8100.   Error_License_Quota_Exceeded = 1395;
  8101.  
  8102.  
  8103. { WinUser Error Codes }
  8104.  
  8105.   { Insufficient system resources exist to complete the requested service. }
  8106.   Error_No_System_Resources = 1450;
  8107.  
  8108.   { Insufficient system resources exist to complete the requested service. }
  8109.   Error_NonPaged_System_Resources = 1451;
  8110.  
  8111.   { Insufficient system resources exist to complete the requested service. }
  8112.   Error_Paged_System_Resources = 1452;
  8113.  
  8114.   { Insufficient quota to complete the requested service. }
  8115.   Error_Working_Set_Quota = 1453;
  8116.  
  8117.   { Insufficient quota to complete the requested service. }
  8118.   Error_Pagefile_Quota = 1454;
  8119.  
  8120.   { The paging file is too small for this operation to complete. }
  8121.   Error_Commitment_Limit = 1455;
  8122.  
  8123.   { A menu item was not found. }
  8124.   Error_Menu_Item_Not_Found = 1456;
  8125.  
  8126.   { Invalid keyboard layout handle. }
  8127.   Error_Invalid_Keyboard_Handle = 1457;
  8128.  
  8129.   { Hook type not allowed. }
  8130.   Error_Hook_Type_Not_Allowed = 1458;
  8131.  
  8132.   { This operation requires an interactive windowstation. }
  8133.   Error_Requires_Interactive_Windowstation = 1459;
  8134.  
  8135.   { This operation returned because the timeout period expired. }
  8136.   Error_Timeout = 1460;
  8137.  
  8138.  
  8139. { Eventlog Status Codes }
  8140.  
  8141. { RPC Status Codes }
  8142.  
  8143.   { The string binding is invalid. }
  8144.   rpc_s_Invalid_String_Binding = 1700;
  8145.  
  8146.   { The binding handle is not the correct type. }
  8147.   rpc_s_Wrong_Kind_of_Binding = 1701;
  8148.  
  8149.   { The binding handle is invalid. }
  8150.   rpc_s_Invalid_Binding = 1702;
  8151.  
  8152.   { The RPC protocol sequence is not supported. }
  8153.   rpc_s_ProtSeq_not_Supported = 1703;
  8154.  
  8155.   { The RPC protocol sequence is invalid. }
  8156.   rpc_s_Invalid_rpc_ProtSeq = 1704;
  8157.  
  8158.   { The string universal unique identifier (UUID) is invalid. }
  8159.   rpc_s_Invalid_String_UUID = 1705;
  8160.  
  8161.   { The endpoint format is invalid. }
  8162.   rpc_s_Invalid_EndPoint_Format = 1706;
  8163.  
  8164.   { The network address is invalid. }
  8165.   rpc_s_Invalid_Net_Addr = 1707;
  8166.  
  8167.   { No endpoint was found. }
  8168.   rpc_s_no_EndPoint_Found = 1708;
  8169.  
  8170.   { The timeout value is invalid. }
  8171.   rpc_s_Invalid_Timeout = 1709;
  8172.  
  8173.   { The object universal unique identifier (UUID) was not found. }
  8174.   rpc_s_Object_not_Found = 1710;
  8175.  
  8176.   { The object universal unique identifier (UUID) has already been registered. }
  8177.   rpc_s_Already_Registered = 1711;
  8178.  
  8179.   { The type universal unique identifier (UUID) has already been registered. }
  8180.   rpc_s_Type_Already_Registered = 1712;
  8181.  
  8182.   { The RPC server is already listening. }
  8183.   rpc_s_Already_Listening = 1713;
  8184.  
  8185.   { No protocol sequences have been registered. }
  8186.   rpc_s_no_ProtSeqs_Registered = 1714;
  8187.  
  8188.   { The RPC server is not listening. }
  8189.   rpc_s_not_Listening = 1715;
  8190.  
  8191.   { The manager type is unknown. }
  8192.   rpc_s_Unknown_MGR_Type = 1716;
  8193.  
  8194.   { The interface is unknown. }
  8195.   rpc_s_Unknown_IF = 1717;
  8196.  
  8197.   { There are no bindings. }
  8198.   rpc_s_no_Bindings = 1718;
  8199.  
  8200.   { There are no protocol sequences. }
  8201.   rpc_s_no_ProtSeqs = 1719;
  8202.  
  8203.   { The endpoint cannot be created. }
  8204.   rpc_s_cant_Create_EndPoint = 1720;
  8205.  
  8206.   { Not enough resources are available to complete this operation. }
  8207.   rpc_s_Out_of_Resources = 1721;
  8208.  
  8209.   { The RPC server is unavailable. }
  8210.   rpc_s_Server_Unavailable = 1722;
  8211.  
  8212.   { The RPC server is too busy to complete this operation. }
  8213.   rpc_s_Server_too_Busy = 1723;
  8214.  
  8215.   { The network options are invalid. }
  8216.   rpc_s_Invalid_Network_Options = 1724;
  8217.  
  8218.   { There is not a remote procedure call active in this thread. }
  8219.   rpc_s_no_Call_Active = 1725;
  8220.  
  8221.   { The remote procedure call failed. }
  8222.   rpc_s_Call_Failed = 1726;
  8223.  
  8224.   { The remote procedure call failed and did not execute. }
  8225.   rpc_s_Call_Failed_DNE = 1727;
  8226.  
  8227.   { A remote procedure call (RPC) protocol error occurred. }
  8228.   rpc_s_Protocol_Error = 1728;
  8229.  
  8230.   { The transfer syntax is not supported by the RPC server. }
  8231.   rpc_s_Unsupported_Trans_Syn = 1730;
  8232.  
  8233.   { The universal unique identifier (UUID) type is not supported. }
  8234.   rpc_s_Unsupported_Type = 1732;
  8235.  
  8236.   { The tag is invalid. }
  8237.   rpc_s_Invalid_Tag = 1733;
  8238.  
  8239.   { The array bounds are invalid. }
  8240.   rpc_s_Invalid_Bound = 1734;
  8241.  
  8242.   { The binding does not contain an entry name. }
  8243.   rpc_s_no_Entry_Name = 1735;
  8244.  
  8245.   { The name syntax is invalid. }
  8246.   rpc_s_Invalid_Name_Syntax = 1736;
  8247.  
  8248.   { The name syntax is not supported. }
  8249.   rpc_s_Unsupported_Name_Syntax = 1737;
  8250.  
  8251.   { No network address is available to use to construct a universal }
  8252.  
  8253.   { unique identifier (UUID). }
  8254.   rpc_s_UUID_no_Address = 1739;
  8255.  
  8256.   { The endpoint is a duplicate. }
  8257.   rpc_s_Duplicate_EndPoint = 1740;
  8258.  
  8259.   { The authentication type is unknown. }
  8260.   rpc_s_Unknown_Authn_Type = 1741;
  8261.  
  8262.   { The maximum number of calls is too small. }
  8263.   rpc_s_Max_Calls_too_Small = 1742;
  8264.  
  8265.   { The string is too long. }
  8266.   rpc_s_String_too_Long = 1743;
  8267.  
  8268.   { The RPC protocol sequence was not found. }
  8269.   rpc_s_ProtSeq_not_Found = 1744;
  8270.  
  8271.   { The procedure number is out of range. }
  8272.   rpc_s_ProcNum_out_of_Range = 1745;
  8273.  
  8274.   { The binding does not contain any authentication information. }
  8275.   rpc_s_Binding_has_no_Auth = 1746;
  8276.  
  8277.   { The authentication service is unknown. }
  8278.   rpc_s_Unknown_Authn_Service = 1747;
  8279.  
  8280.   { The authentication level is unknown. }
  8281.   rpc_s_Unknown_Authn_Level = 1748;
  8282.  
  8283.   { The security context is invalid. }
  8284.   rpc_s_Invalid_Auth_Identity = 1749;
  8285.  
  8286.   { The authorization service is unknown. }
  8287.   rpc_s_Unknown_Authz_Service = 1750;
  8288.  
  8289.   { The entry is invalid. }
  8290.   ept_s_Invalid_Entry = 1751;
  8291.  
  8292.   { The server endpoint cannot perform the operation. }
  8293.   ept_s_cant_Perform_OP = 1752;
  8294.  
  8295.   { There are no more endpoints available from the endpoint mapper. }
  8296.   ept_s_not_Registered = 1753;
  8297.  
  8298.   { No interfaces have been exported. }
  8299.   rpc_s_Nothing_to_Export = 1754;
  8300.  
  8301.   { The entry name is incomplete. }
  8302.   rpc_s_Incomplete_Name = 1755;
  8303.  
  8304.   { The version option is invalid. }
  8305.   rpc_s_Invalid_Vers_Option = 1756;
  8306.  
  8307.   { There are no more members. }
  8308.   rpc_s_no_More_Members = 1757;
  8309.  
  8310.   { There is nothing to unexport. }
  8311.   rpc_s_not_all_Objs_Unexported = 1758;
  8312.  
  8313.   { The interface was not found. }
  8314.   rpc_s_Interface_not_Found = 1759;
  8315.  
  8316.   { The entry already exists. }
  8317.   rpc_s_Entry_Already_Exists = 1760;
  8318.  
  8319.   { The entry is not found. }
  8320.   rpc_s_Entry_not_Found = 1761;
  8321.  
  8322.   { The name service is unavailable. }
  8323.   rpc_s_Name_Service_Unavailable = 1762;
  8324.  
  8325.   { The network address family is invalid. }
  8326.   rpc_s_Invalid_NAF_ID = 1763;
  8327.  
  8328.   { The requested operation is not supported. }
  8329.   rpc_s_Cannot_Support = 1764;
  8330.  
  8331.   { No security context is available to allow impersonation. }
  8332.   rpc_s_no_Context_Available = 1765;
  8333.  
  8334.   { An internal error occurred in a remote procedure call (RPC). }
  8335.   rpc_s_Internal_Error = 1766;
  8336.  
  8337.   { The RPC server attempted an integer division by zero. }
  8338.   rpc_s_Zero_Divide = 1767;
  8339.  
  8340.   { An addressing error occurred in the RPC server. }
  8341.   rpc_s_Address_Error = 1768;
  8342.  
  8343.   { A floating-point operation at the RPC server caused a division by zero. }
  8344.   rpc_s_FP_Div_Zero = 1769;
  8345.  
  8346.   { A floating-point underflow occurred at the RPC server. }
  8347.   rpc_s_FP_Underflow = 1770;
  8348.  
  8349.   { A floating-point overflow occurred at the RPC server. }
  8350.   rpc_s_FP_Overflow = 1771;
  8351.  
  8352.   { The list of RPC servers available for the binding of auto handles }
  8353.   { has been exhausted. }
  8354.   rpc_x_no_More_Entries = 1772;
  8355.  
  8356.   { Unable to open the character translation table file. }
  8357.   rpc_x_SS_Char_Trans_Open_Fail = 1773;
  8358.  
  8359.   { The file containing the character translation table has fewer than }
  8360.   { 512 bytes. }
  8361.   rpc_x_SS_Char_Trans_Short_File = 1774;
  8362.  
  8363.   { A null context handle was passed from the client to the host during }
  8364.   { a remote procedure call. }
  8365.   rpc_x_SS_in_Null_Context = 1775;
  8366.  
  8367.   { The context handle changed during a remote procedure call. }
  8368.   rpc_x_SS_Context_Damaged = 1777;
  8369.  
  8370.   { The binding handles passed to a remote procedure call do not match. }
  8371.   rpc_x_SS_Handles_Mismatch = 1778;
  8372.  
  8373.   { The stub is unable to get the remote procedure call handle. }
  8374.   rpc_x_SS_Cannot_get_Call_Handle = 1779;
  8375.  
  8376.   { A null reference pointer was passed to the stub. }
  8377.   rpc_x_Null_Ref_Pointer = 1780;
  8378.  
  8379.   { The enumeration value is out of range. }
  8380.   rpc_x_Enum_Value_out_of_Range = 1781;
  8381.  
  8382.   { The byte count is too small. }
  8383.   rpc_x_Byte_Count_too_Small = 1782;
  8384.  
  8385.   { The stub received bad data. }
  8386.   rpc_x_bad_Stub_Data = 1783;
  8387.  
  8388.   { A remote procedure call is already in progress for this thread. }
  8389.   rpc_s_Call_in_Progress = 1791;
  8390.  
  8391.   { There are no more bindings. }
  8392.   rpc_s_no_More_Bindings = 1806;
  8393.  
  8394.   { No interfaces have been registered. }
  8395.   rpc_s_no_Interfaces = 1817;
  8396.  
  8397.   { The server was altered while processing this call. }
  8398.   rpc_s_Call_Cancelled = 1818;
  8399.  
  8400.   { The binding handle does not contain all required information. }
  8401.   rpc_s_Binding_Incomplete = 1819;
  8402.  
  8403.   { Communications failure. }
  8404.   rpc_s_Comm_Failure = 1820;
  8405.  
  8406.   { The requested authentication level is not supported. }
  8407.   rpc_s_Unsupported_Authn_Level = 1821;
  8408.  
  8409.   { No principal name registered. }
  8410.   rpc_s_no_Princ_Name = 1822;
  8411.  
  8412.   { The error specified is not a valid Windows NT RPC error code. }
  8413.   rpc_s_not_RPC_Error = 1823;
  8414.  
  8415.   { A UUID that is valid only on this computer has been allocated. }
  8416.   rpc_s_UUID_Local_Only = 1824;
  8417.  
  8418.   { A security package specific error occurred. }
  8419.   rpc_s_Sec_Pkg_Error = 1825;
  8420.  
  8421.   { Thread is not cancelled. }
  8422.   rpc_s_not_Cancelled = 1826;
  8423.  
  8424.   { Invalid operation on the encoding/decoding handle. }
  8425.   rpc_x_Invalid_ES_Action = 1827;
  8426.  
  8427.   { Incompatible version of the serializing package. }
  8428.   rpc_x_Wrong_ES_Version = 1828;
  8429.  
  8430.   { Incompatible version of the RPC stub. }
  8431.   rpc_x_Wrong_Stub_Version = 1829;
  8432.  
  8433.   { The idl pipe object is invalid or corrupted. }
  8434.   rpc_x_Invalid_Pipe_Object = 1830;
  8435.  
  8436.   { The operation is invalid for a given idl pipe object. }
  8437.   rpc_x_Invalid_Pipe_Operation = 1831;
  8438.  
  8439.   { The idl pipe version is not supported. }
  8440.   rpc_x_Wrong_Pipe_Version = 1832;
  8441.  
  8442.   { The group member was not found. }
  8443.   rpc_s_Group_Member_not_Found = 1898;
  8444.  
  8445.   { The endpoint mapper database could not be created. }
  8446.   rpc_s_cant_Create = 1899;
  8447.  
  8448.   { The object universal unique identifier (UUID) is the nil UUID. }
  8449.   rpc_s_Invalid_Object = 1900;
  8450.  
  8451.   { The referenced account is currently locked out and may not be logged on to. }
  8452.  
  8453.   { The object exporter specified was not found. }
  8454.   or_Invalid_OXID = 1910;
  8455.  
  8456.   { The object specified was not found. }
  8457.   or_Invalid_OID = 1911;
  8458.  
  8459.   { The object resolver set specified was not found. }
  8460.   or_Invalid_Set = 1912;
  8461.  
  8462.   { Some data remains to be sent in the request buffer. }
  8463.   rpc_s_Send_Incomplete = 1913;
  8464.  
  8465.   { The list of servers for this workgroup is not currently available }
  8466.   Error_no_Browser_Servers_Found = 6118;
  8467.  
  8468.  
  8469.   { The specified print monitor does not have the required functions. }
  8470.   Error_Invalid_Print_Monitor = 3007;
  8471.  
  8472.   { The specified print monitor is currently in use. }
  8473.   Error_Print_Monitor_in_Use = 3008;
  8474.  
  8475.   { The requested operation is not allowed when there are jobs queued to the printer. }
  8476.   Error_Printer_has_Jobs_Queued = 3009;
  8477.  
  8478.   { The requested operation is successful.  Changes will not be effective until the system is rebooted. }
  8479.   Error_Success_Reboot_Required = 3010;
  8480.  
  8481.   { The requested operation is successful.  Changes will not be effective until the service is restarted. }
  8482.   Error_Success_Restart_Required = 3011;
  8483.  
  8484. {------------------------------}
  8485. {     OLE Error Codes          }
  8486. {------------------------------}
  8487.  
  8488. (*
  8489.   The return value of OLE APIs and methods is an HRESULT.
  8490.   This is not a handle to anything, but is merely a 32-bit value
  8491.   with several fields encoded in the value.  The parts of an
  8492.   HRESULT are shown below.
  8493.  
  8494.   HRESULTs are 32 bit values layed out as follows:
  8495.  
  8496.    3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
  8497.    1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
  8498.   +-+-+-+-+-+---------------------+-------------------------------+
  8499.   |S|R|C|N|r|    Facility         |               Code            |
  8500.   +-+-+-+-+-+---------------------+-------------------------------+
  8501.  
  8502.   where
  8503.  
  8504.       S - Severity - indicates success/fail
  8505.           0 - Success
  8506.           1 - Fail (COERROR)
  8507.  
  8508.       R - reserved portion of the facility code, corresponds to NT's
  8509.               second severity bit.
  8510.  
  8511.       C - reserved portion of the facility code, corresponds to NT's
  8512.               C field.
  8513.  
  8514.       N - reserved portion of the facility code. Used to indicate a
  8515.               mapped NT status value.
  8516.  
  8517.       r - reserved portion of the facility code. Reserved for internal
  8518.               use. Used to indicate HRESULT values that are not status
  8519.               values, but are instead message ids for display strings.
  8520.  
  8521.       Facility - is the facility code
  8522.  
  8523.       Code - is the facility's status code
  8524. *)
  8525.  
  8526. const
  8527.   { Severity values }
  8528.   Severity_Success = 0;
  8529.   Severity_Error = 1;
  8530.  
  8531. function Succeeded(Status: HRESULT): Bool;
  8532.  
  8533. { and the inverse }
  8534. function Failed(Status: HRESULT): Bool;
  8535.  
  8536. { Generic test for error on any status value. }
  8537. function IsError(Status: HRESULT): Bool;
  8538.  
  8539. { Return the code }
  8540. function HResultCode(hr: HRESULT): Integer;
  8541.  
  8542. { Return the facility }
  8543. function HResultFacility(hr: HRESULT): Integer;
  8544.  
  8545. { Return the severity }
  8546. function HResultSeverity(hr: HRESULT): Integer;
  8547.  
  8548. { Create an HRESULT value from component pieces }
  8549. function MakeResult(sev, fac, code: Integer): HResult;
  8550.  
  8551. { Map a WIN32 error value into a HRESULT }
  8552. { Note: This assumes that WIN32 errors fall in the range -32k to 32k. }
  8553. const
  8554.   { Define bits here so macros are guaranteed to work }
  8555.   facility_NT_Bit = $10000000;
  8556.  
  8557. function HResultFromWin32(x: Integer): HRESULT;
  8558.  
  8559. { Map an NT status value into a HRESULT }
  8560. function HResultFromNT(x: Integer): HRESULT;
  8561.  
  8562. const
  8563.   { HRESULT value definitions }
  8564.   { Codes $4000-$40ff are reserved for OLE }
  8565.  
  8566.   { Success codes }
  8567.   s_OK    = $00000000;
  8568.   s_False = $00000001;
  8569.  
  8570.   NoError = 0;
  8571.  
  8572.   { Catastrophic failure }
  8573.   E_Unexpected = $8000FFFF;
  8574.  
  8575.   { Not implemented }
  8576.   E_NotImpl = $80004001;
  8577.  
  8578.   { Ran out of memory }
  8579.   E_OutOfMemory = $8007000E;
  8580.  
  8581.   { One or more arguments are invalid }
  8582.   E_InvalidArg = $80070057;
  8583.  
  8584.   { No such interface supported }
  8585.   E_NoInterface = $80004002;
  8586.  
  8587.   { Invalid pointer }
  8588.   E_Pointer = $80004003;
  8589.  
  8590.   { Invalid handle }
  8591.   E_Handle = $80070006;
  8592.  
  8593.   { Operation aborted }
  8594.   E_Abort = $80004004;
  8595.  
  8596.   { Unspecified error }
  8597.   E_Fail = $80004005;
  8598.  
  8599.   { General access denied error }
  8600.   E_AccessDenied = $80070005;
  8601.  
  8602.   { The data necessary to complete this operation is not yet available. }
  8603.   E_Pending = $8000000A;
  8604.  
  8605.   { Thread local storage failure }
  8606.   CO_E_Init_TLS = $80004006;
  8607.  
  8608.   { Get shared memory allocator failure }
  8609.   CO_E_Init_Shared_Allocator = $80004007;
  8610.  
  8611.   { Get memory allocator failure }
  8612.   CO_E_Init_Memory_Allocator = $80004008;
  8613.  
  8614.   { Unable to initialize class cache }
  8615.   CO_E_Init_Class_Cache = $80004009;
  8616.  
  8617.   { Unable to initialize RPC services }
  8618.   CO_E_Init_RPC_Channel = $8000400A;
  8619.  
  8620.   { Cannot set thread local storage channel control }
  8621.   CO_E_Init_TLS_Set_Channel_Contro = $8000400B;
  8622.  
  8623.   { Could not allocate thread local storage channel control }
  8624.   CO_E_Init_TLS_Channel_Control = $8000400C;
  8625.  
  8626.   { The user supplied memory allocator is unacceptable }
  8627.   CO_E_Init_Unaccepted_User_Alloca = $8000400D;
  8628.  
  8629.   { The OLE service mutex already exists }
  8630.   CO_E_Init_SCM_Mutex_Exists = $8000400E;
  8631.  
  8632.   { The OLE service file mapping already exists }
  8633.   CO_E_Init_SCM_File_Mapping_Exist = $8000400F;
  8634.  
  8635.   { Unable to map view of file for OLE service }
  8636.   CO_E_Init_SCM_Map_View_of_Fild = $80004010;
  8637.  
  8638.   { Failure attempting to launch OLE service }
  8639.   CO_E_Init_SCM_Exec_Failure = $80004011;
  8640.  
  8641.   { There was an attempt to call CoInitialize a second time while single threaded }
  8642.   CO_E_Init_only_Single_Threaded = $80004012;
  8643.  
  8644.   { A Remote activation was necessary but was not allowed }
  8645.   CO_E_cant_Remote = $80004013;
  8646.  
  8647.   { A Remote activation was necessary but the server name provided was invalid }
  8648.   CO_E_bad_Server_Name = $80004014;
  8649.  
  8650.   { The class is configured to run as a security id different from the caller }
  8651.   CO_E_Wrong_Server_Identity = $80004015;
  8652.  
  8653.   { Use of Ole1 services requiring DDE windows is disabled }
  8654.   CO_E_OLE1DDE_Disabled = $80004016;
  8655.  
  8656.   { A RunAs specification must be <domain name>\<user name> or simply <user name> }
  8657.   CO_E_RunAs_Syntax = $80004017;
  8658.  
  8659.   { The server process could not be started.  The pathname may be incorrect. }
  8660.   CO_E_CreateProcess_Failure = $80004018;
  8661.  
  8662.   { The server process could not be started as the configured identity.  The pathname may be incorrect or unavailable. }
  8663.   CO_E_RunAs_CreateProcess_Failure = $80004019;
  8664.  
  8665.   { The server process could not be started because the configured identity is incorrect.  Check the username and password. }
  8666.   CO_E_RunAs_Logon_Failure = $8000401A;
  8667.  
  8668.   { The client is not allowed to launch this server. }
  8669.   CO_E_Launch_Permssion_Denied = $8000401B;
  8670.  
  8671.   { The service providing this server could not be started. }
  8672.   CO_E_Start_Service_Failure = $8000401C;
  8673.  
  8674.   { This computer was unable to communicate with the computer providing the server. }
  8675.   CO_E_Remote_Communication_Failure = $8000401D;
  8676.  
  8677.   { The server did not respond after being launched. }
  8678.   CO_E_Server_Start_Timeout = $8000401E;
  8679.  
  8680.   { The registration information for this server is inconsistent or incomplete. }
  8681.   CO_E_ClsReg_Inconsistent = $8000401F;
  8682.  
  8683.   { The registration information for this interface is inconsistent or incomplete. }
  8684.   CO_E_IIdReg_Inconsistent = $80004020;
  8685.  
  8686.   { The operation attempted is not supported. }
  8687.   CO_E_not_Supported = $80004021;
  8688.  
  8689.  
  8690.   { FACILITY_ITF }
  8691.   { Codes $0-$01ff are reserved for the OLE group of }
  8692.  
  8693.   { Generic OLE errors that may be returned by many inerfaces}
  8694.   OLE_E_First = $80040000;
  8695.   OLE_E_Last  = $800400FF;
  8696.   OLE_S_First = $40000;
  8697.   OLE_S_Last  = $400FF;
  8698.  
  8699.   { Invalid OLEVERB structure }
  8700.   OLE_E_OleVerb = $80040000;
  8701.  
  8702.   { Invalid advise flags }
  8703.   OLE_E_AdvF = $80040001;
  8704.  
  8705.   { Can't enumerate any more, because the associated data is missing }
  8706.   OLE_E_Enum_NoMore = $80040002;
  8707.  
  8708.   { This implementation doesn't take advises }
  8709.   OLE_E_AdviseNotSupported = $80040003;
  8710.  
  8711.   { There is no connection for this connection ID }
  8712.   OLE_E_NoConnection = $80040004;
  8713.  
  8714.   { Need to run the object to perform this operation }
  8715.   OLE_E_NotRunning = $80040005;
  8716.  
  8717.   { There is no cache to operate on }
  8718.   OLE_E_NoCache = $80040006;
  8719.  
  8720.   { Uninitialized object }
  8721.   OLE_E_Blank = $80040007;
  8722.  
  8723.   { Linked object's source class has changed }
  8724.   OLE_E_ClassDiff = $80040008;
  8725.  
  8726.   { Not able to get the moniker of the object }
  8727.   OLE_E_Cant_GetMoniker = $80040009;
  8728.  
  8729.   { Not able to bind to the source }
  8730.   OLE_E_Cant_BindToSource = $8004000A;
  8731.  
  8732.   { Object is static; operation not allowed }
  8733.   OLE_E_Static = $8004000B;
  8734.  
  8735.   { User cancelled out of save dialog }
  8736.   OLE_E_PromptSaveCancelled = $8004000C;
  8737.  
  8738.   { Invalid rectangle }
  8739.   OLE_E_InvalidRect = $8004000D;
  8740.  
  8741.   { compobj.dll is too old for the ole2.dll initialized }
  8742.   OLE_E_WrongCompObj = $8004000E;
  8743.  
  8744.   { Invalid window handle }
  8745.   OLE_E_InvalidHWnd = $8004000F;
  8746.  
  8747.   { Object is not in any of the inplace active states }
  8748.   OLE_E_not_InplaceActive = $80040010;
  8749.  
  8750.   { Not able to convert object }
  8751.   OLE_E_CantConvert = $80040011;
  8752.  
  8753.   OLE_E_NoStorage = $80040012;
  8754.  
  8755.   { Invalid FORMATETC structure }
  8756.   DV_E_FormatEtc = $80040064;
  8757.  
  8758.   { Invalid DVTARGETDEVICE structure }
  8759.   DV_E_DvTargetDevice = $80040065;
  8760.  
  8761.   { Invalid STDGMEDIUM structure }
  8762.   DV_E_StgMedium = $80040066;
  8763.  
  8764.   { Invalid STATDATA structure }
  8765.   DV_E_StatData = $80040067;
  8766.  
  8767.   { Invalid lindex }
  8768.   DV_E_LIndex = $80040068;
  8769.  
  8770.   { Invalid tymed }
  8771.   DV_E_TYMED = $80040069;
  8772.  
  8773.   { Invalid clipboard format }
  8774.   DV_E_ClipFormat = $8004006A;
  8775.  
  8776.   { Invalid aspect(s) }
  8777.   DV_E_DvAspect = $8004006B;
  8778.  
  8779.   { tdSize parameter of the DVTARGETDEVICE structure is invalid }
  8780.   DV_E_DvTargetDevice_Size = $8004006C;
  8781.  
  8782.   { Object doesn't support IViewObject interface }
  8783.   DV_E_NoIViewObject = $8004006D;
  8784.  
  8785.   DragDrop_E_First = $80040100;
  8786.   DragDrop_E_Last  = $8004010F;
  8787.   DragDrop_S_First = $40100;
  8788.  
  8789.   { Trying to revoke a drop target that has not been registered }
  8790.   DragDrop_E_NotRegistered = $80040100;
  8791.  
  8792.   { This window has already been registered as a drop target }
  8793.   DragDrop_E_AlreadyRegistered = $80040101;
  8794.  
  8795.   { Invalid window handle }
  8796.   DragDrop_E_InvalidHWnd = $80040102;
  8797.  
  8798.   ClassFactory_E_First = $80040110;
  8799.   ClassFactory_E_LAST  = $8004011F;
  8800.   ClassFactory_S_FIRST = $40110;
  8801.  
  8802.   { Class does not support aggregation (or class object is remote) }
  8803.   CLASS_E_NoAggregation = $80040110;
  8804.  
  8805.   { ClassFactory cannot supply requested class }
  8806.   CLASS_E_ClassNotAvailable = $80040111;
  8807.  
  8808.   MARSHAL_E_First = $80040120;
  8809.   MARSHAL_E_Last  = $8004012F;
  8810.   MARSHAL_S_First = $40120;
  8811.   MARSHAL_S_Last  = $4012F;
  8812.   DATA_E_First    = $80040130;
  8813.   DATA_E_Last     = $8004013F;
  8814.   DATA_S_Fisrt    = $40130;
  8815.   DATA_S_Last     = $4013F;
  8816.   VIEW_E_First    = $80040140;
  8817.   VIEW_E_Last     = $8004014F;
  8818.   VIEW_S_First    = $40140;
  8819.  
  8820.   { Error drawing view }
  8821.   VIEW_E_Draw = $80040140;
  8822.  
  8823.   RegDB_E_First = $80040150;
  8824.   RegDB_E_Last  = $8004015F;
  8825.   RegDB_S_First = $40150;
  8826.  
  8827.   { Could not read key from registry }
  8828.   RegDB_E_ReadRegDB = $80040150;
  8829.  
  8830.   { Could not write key to registry }
  8831.   RegDB_E_WriteRegDB = $80040151;
  8832.  
  8833.   { Could not find the key in the registry }
  8834.   RegDB_E_KeyMissing = $80040152;
  8835.  
  8836.   { Invalid value for registry }
  8837.   RegDB_E_InvalidValue = $80040153;
  8838.  
  8839.   { Class not registered }
  8840.   RegDB_E_ClassNotReg = $80040154;
  8841.  
  8842.   { Interface not registered }
  8843.   RegDB_E_IIdNotReg = $80040155;
  8844.  
  8845.   CACHE_E_First = $80040170;
  8846.   CACHE_E_Last  = $8004017F;
  8847.   CACHE_S_First = $40170;
  8848.  
  8849.   { Cache not updated }
  8850.   CACHE_E_NoCache_Updated = $80040170;
  8851.  
  8852.   OleObj_E_First = $80040180;
  8853.   OleObj_E_Last  = $8004018F;
  8854.   OleObj_S_First = $40180;
  8855.  
  8856.   { No verbs for OLE object }
  8857.   OleObj_E_NoVerbs = $80040180;
  8858.  
  8859.   { Invalid verb for OLE object }
  8860.   OleObj_E_ImvalidVerb = $80040181;
  8861.  
  8862.   ClientSite_E_First = $80040190;
  8863.   ClientSite_E_Last = $8004019F;
  8864.   ClientSite_S_First = $40190;
  8865.  
  8866.   { Undo is not available }
  8867.   InPlace_E_NotUndoable = $800401A0;
  8868.  
  8869.   { Space for tools is not available }
  8870.   InPlace_E_NoToolSpace = $800401A1;
  8871.  
  8872.   InPlace_E_First = $800401A0;
  8873.   InPlace_E_Last  = $800401AF;
  8874.   InPlace_S_First = $401A0;
  8875.   InPlace_S_Last  = $401AF;
  8876.   ENUM_E_First = $800401B0;
  8877.   ENUM_E_Last  = $800401BF;
  8878.   ENUM_S_First = $401B0;
  8879.   ENUM_S_Last  = $401BF;
  8880.   Convert10_E_First = $800401C0;
  8881.   Convert10_E_Last  = $800401CF;
  8882.   Convert10_S_First = $401C0;
  8883.  
  8884.   { OLESTREAM Get method failed }
  8885.   Convert10_E_OleStream_Get = $800401C0;
  8886.  
  8887.   { OLESTREAM Put method failed }
  8888.   Convert10_E_OleStream_Put = $800401C1;
  8889.  
  8890.   { Contents of the OLESTREAM not in correct format }
  8891.   Convert10_E_OleStream_FMT = $800401C2;
  8892.  
  8893.   { There was an error in a Windows GDI call while converting the bitmap to a DIB }
  8894.   Convert10_E_OleStream_Bitmap_to_DIB = $800401C3;
  8895.  
  8896.   { Contents of the IStorage not in correct format }
  8897.   Convert10_E_STg_FMT = $800401C4;
  8898.  
  8899.   { Contents of IStorage is missing one of the standard streams }
  8900.   Convert10_E_STg_no_Std_Stream = $800401C5;
  8901.  
  8902.   Convert10_E_STg_DIB_to_Bitmap = $800401C6;
  8903.  
  8904.   ClipBrd_E_First = $800401D0;
  8905.   ClipBrd_E_Last  = $800401DF;
  8906.   ClipBrd_S_First = $401D0;
  8907.  
  8908.   { OpenClipboard Failed }
  8909.   ClipBrd_E_cant_Open = $800401D0;
  8910.  
  8911.   { EmptyClipboard Failed }
  8912.   ClipBrd_E_cant_Empty = $800401D1;
  8913.  
  8914.   { SetClipboard Failed }
  8915.   ClipBrd_E_cant_Set = $800401D2;
  8916.  
  8917.   { Data on clipboard is invalid }
  8918.   ClipBrd_E_bad_Data = $800401D3;
  8919.  
  8920.   { CloseClipboard Failed }
  8921.   ClipBrd_E_cant_Close = $800401D4;
  8922.  
  8923.   MK_E_First = $800401E0;
  8924.   MK_E_Last  = $800401EF;
  8925.   MK_S_First = $401E0;
  8926.  
  8927.   { Moniker needs to be connected manually }
  8928.   MK_E_ConnectManually = $800401E0;
  8929.  
  8930.   { Operation exceeded deadline }
  8931.   MK_E_ExceededDeadline = $800401E1;
  8932.  
  8933.   { Moniker needs to be generic }
  8934.   MK_E_NeedGeneric = $800401E2;
  8935.  
  8936.   { Operation unavailable }
  8937.   MK_E_Unavailable = $800401E3;
  8938.  
  8939.   { Invalid syntax }
  8940.   MK_E_Syntax = $800401E4;
  8941.  
  8942.   { No object for moniker }
  8943.   MK_E_NoObject = $800401E5;
  8944.  
  8945.   { Bad extension for file }
  8946.   MK_E_InvalidExtension = $800401E6;
  8947.  
  8948.   { Intermediate operation failed }
  8949.   MK_E_IntermediateInterfaceNotSup = $800401E7;
  8950.  
  8951.   { Moniker is not bindable }
  8952.   MK_E_NotBindable = $800401E8;
  8953.  
  8954.   { Moniker is not bound }
  8955.   MK_E_NotBound = $800401E9;
  8956.  
  8957.   { Moniker cannot open file }
  8958.   MK_E_CantOpenFile = $800401EA;
  8959.  
  8960.   { User input required for operation to succeed }
  8961.   MK_E_MustBotherUser = $800401EB;
  8962.  
  8963.   { Moniker class has no inverse }
  8964.   MK_E_NoInverse = $800401EC;
  8965.  
  8966.   { Moniker does not refer to storage }
  8967.   MK_E_NoStorage = $800401ED;
  8968.  
  8969.   { No common prefix }
  8970.   MK_E_NoPrefix = $800401EE;
  8971.  
  8972.   { Moniker could not be enumerated }
  8973.   MK_E_Enumeration_Failed = $800401EF;
  8974.  
  8975.   CO_E_First = $800401F0;
  8976.   CO_E_Last  = $800401FF;
  8977.   CO_S_First = $401F0;
  8978.  
  8979.   { CoInitialize has not been called. }
  8980.   CO_E_NotInitialized = $800401F0;
  8981.  
  8982.   { CoInitialize has already been called. }
  8983.   CO_E_AlreadyInitialized = $800401F1;
  8984.  
  8985.   { Class of object cannot be determined }
  8986.   CO_E_CantDetermineClass = $800401F2;
  8987.  
  8988.   { Invalid class string }
  8989.   CO_E_ClassString = $800401F3;
  8990.  
  8991.   { Invalid interface string }
  8992.   CO_E_IIdString = $800401F4;
  8993.  
  8994.   { Application not found }
  8995.   CO_E_AppNotFound = $800401F5;
  8996.  
  8997.   { Application cannot be run more than once }
  8998.   CO_E_AppSingleUse = $800401F6;
  8999.  
  9000.   { Some error in application program }
  9001.   CO_E_ErrorInApp = $800401F7;
  9002.  
  9003.   { DLL for class not found }
  9004.   CO_E_DllNotFound = $800401F8;
  9005.  
  9006.   { Error in the DLL }
  9007.   CO_E_ErrorInDll = $800401F9;
  9008.  
  9009.   { Wrong OS or OS version for application }
  9010.   CO_E_WrongOsForApp = $800401FA;
  9011.  
  9012.   { Object is not registered }
  9013.   CO_E_OjbNotReg = $800401FB;
  9014.  
  9015.   { Object is already registered }
  9016.   CO_E_ObjIsReg = $800401FC;
  9017.  
  9018.   { Object is not connected to server }
  9019.   CO_E_ObjNotConnected = $800401FD;
  9020.  
  9021.   { Application was launched but it didn't register a class factory }
  9022.   CO_E_AppDidntReg = $800401FE;
  9023.  
  9024.   { Object has been released }
  9025.   CO_E_Released = $800401FF;
  9026.  
  9027.   { Use the registry database to provide the requested information }
  9028.   OLE_S_UseReg = $40000;
  9029.  
  9030.   { Success, but static }
  9031.   OLE_S_Static = $40001;
  9032.  
  9033.   { Macintosh clipboard format }
  9034.   OLE_S_Mac_ClipFormat = $40002;
  9035.  
  9036.   { Successful drop took place }
  9037.   DragDrop_S_Drio = $40100;
  9038.  
  9039.   { Drag-drop operation canceled }
  9040.   DragDrop_S_Cancel = $40101;
  9041.  
  9042.   { Use the default cursor }
  9043.   DragDrop_S_UseDefaultCursors = $40102;
  9044.  
  9045.   { Data has same FORMATETC }
  9046.   DATA_S_SameFormatEtc = $40130;
  9047.  
  9048.   { View is already frozen }
  9049.   VIEW_S_Already_Frozen = $40140;
  9050.  
  9051.   { FORMATETC not supported }
  9052.   CACHE_S_FormatEtc_NotSupported = $40170;
  9053.  
  9054.   { Same cache }
  9055.   CACHE_S_SameCache = $40171;
  9056.  
  9057.   { Some cache(s) not updated }
  9058.   CACHE_S_SomeCaches_NotUpdated = $40172;
  9059.  
  9060.   { Invalid verb for OLE object }
  9061.   OleObj_S_InvalidVerb = $40180;
  9062.  
  9063.   { Verb number is valid but verb cannot be done now }
  9064.   OleObj_S_Cannot_DoVerb_NoW = $40181;
  9065.  
  9066.   { Invalid window handle passed }
  9067.   OleObj_S_InvalidHWnd = $40182;
  9068.  
  9069.   { Message is too long; some of it had to be truncated before displaying }
  9070.   Inplace_S_Truncated = $401A0;
  9071.  
  9072.   { Unable to convert OLESTREAM to IStorage }
  9073.   Convert10_S_no_Presentation = $401C0;
  9074.  
  9075.   { Moniker reduced to itself }
  9076.   MK_S_Reduced_to_Self = $401E2;
  9077.  
  9078.   { Common prefix is this moniker }
  9079.   MK_S_Me = $401E4;
  9080.  
  9081.   { Common prefix is input moniker }
  9082.   MK_S_Him = $401E5;
  9083.  
  9084.   { Common prefix is both monikers }
  9085.   MK_S_Us = $401E6;
  9086.  
  9087.   { Moniker is already registered in running object table }
  9088.   MK_S_MonikerAlreadyRegistered = $401E7;
  9089.  
  9090.  
  9091.   { FACILITY_WINDOWS }
  9092.   { Codes $0-$01ff are reserved for the OLE group of}
  9093.  
  9094.   { Attempt to create a class object failed }
  9095.   CO_E_Class_Create_Failed = $80080001;
  9096.  
  9097.   { OLE service could not bind object }
  9098.   CO_E_SCM_Error = $80080002;
  9099.  
  9100.   { RPC communication failed with OLE service }
  9101.   CO_E_SCM_RPC_Failure = $80080003;
  9102.  
  9103.   { Bad path to object }
  9104.   CO_E_Bad_Path = $80080004;
  9105.  
  9106.   { Server execution failed }
  9107.   CO_E_Server_Exec_Failure = $80080005;
  9108.  
  9109.   { OLE service could not communicate with the object server }
  9110.   CO_E_ObjSrv_RPC_Failure = $80080006;
  9111.  
  9112.   { Moniker path could not be normalized }
  9113.   MK_E_NO_Normalized = $80080007;
  9114.  
  9115.   { Object server is stopping when OLE service contacts it }
  9116.   CO_E_Server_Stopping = $80080008;
  9117.  
  9118.   { An invalid root block pointer was specified }
  9119.   Mem_E_Invalid_Root = $80080009;
  9120.  
  9121.   { An allocation chain contained an invalid link pointer }
  9122.   Mem_E_Invalid_Link = $80080010;
  9123.  
  9124.   { The requested allocation size was too large }
  9125.   MEM_E_Invalid_Size = $80080011;
  9126.  
  9127.   { Not all the requested interfaces were available }
  9128.   CO_S_NotAllInterfaces = $00080012;
  9129.  
  9130.  
  9131.   { FACILITY_DISPATCH }
  9132.  
  9133.   { Unknown interface. }
  9134.   Disp_E_UnknownInterface = $80020001;
  9135.  
  9136.   { Member not found. }
  9137.   Disp_E_MemberNotFound = $80020003;
  9138.  
  9139.   { Parameter not found. }
  9140.   Disp_E_ParamNotFound = $80020004;
  9141.  
  9142.   { Type mismatch. }
  9143.   Disp_E_TypeMismatch = $80020005;
  9144.  
  9145.   { Unknown name. }
  9146.   Disp_E_UnknownName = $80020006;
  9147.  
  9148.   { No named arguments. }
  9149.   Disp_E_NonamedArgs = $80020007;
  9150.  
  9151.   { Bad variable type. }
  9152.   Disp_E_BadVarType = $80020008;
  9153.  
  9154.   { Exception occurred. }
  9155.   Disp_E_Exception = $80020009;
  9156.  
  9157.   { Out of present range. }
  9158.   Disp_E_Overflow = $8002000A;
  9159.  
  9160.   { Invalid index. }
  9161.   Disp_E_BadIndex = $8002000B;
  9162.  
  9163.   { Unknown language. }
  9164.   Disp_E_UnknownLCId = $8002000C;
  9165.  
  9166.   { Memory is locked. }
  9167.   Disp_E_ArrayIsLocked = $8002000D;
  9168.  
  9169.   { Invalid number of parameters. }
  9170.   Disp_E_BadParamCount = $8002000E;
  9171.  
  9172.   { Parameter not optional. }
  9173.   Disp_E_ParamNotOptional = $8002000F;
  9174.  
  9175.   { Invalid callee. }
  9176.   Disp_E_BadCallee = $80020010;
  9177.  
  9178.   { Does not support a collection. }
  9179.   Disp_E_NotACollection = $80020011;
  9180.  
  9181.   { Buffer too small. }
  9182.   Type_E_BufferTooSmall = $80028016;
  9183.  
  9184.   { Old format or invalid type library. }
  9185.   Type_E_InvDataRead = $80028018;
  9186.  
  9187.   { Old format or invalid type library. }
  9188.   Type_E_UnsupFormat = $80028019;
  9189.  
  9190.   { Error accessing the OLE registry. }
  9191.   Type_E_RegistryAccess = $8002801C;
  9192.  
  9193.   { Library not registered. }
  9194.   Type_E_LibNotRegistered = $8002801D;
  9195.  
  9196.   { Bound to unknown type. }
  9197.   Type_E_UndefinedType = $80028027;
  9198.  
  9199.   { Qualified name disallowed. }
  9200.   Type_E_QualifiedNameDisallowed = $80028028;
  9201.  
  9202.   { Invalid forward reference, or reference to uncompiled type. }
  9203.   Type_E_InvalidState = $80028029;
  9204.  
  9205.   { Type mismatch. }
  9206.   Type_E_WrongTypeKind = $8002802A;
  9207.  
  9208.   { Element not found. }
  9209.   Type_E_ElementNotFound = $8002802B;
  9210.  
  9211.   { Ambiguous name. }
  9212.   Type_E_AmbiguousName = $8002802C;
  9213.  
  9214.   { Name already exists in the library. }
  9215.   Type_E_NameConflict = $8002802D;
  9216.  
  9217.   { Unknown LCID. }
  9218.   Type_E_UnknownLCID = $8002802E;
  9219.  
  9220.   { Function not defined in specified DLL. }
  9221.   Type_E_DllFunctionNotFound = $8002802F;
  9222.  
  9223.   { Wrong module kind for the operation. }
  9224.   Type_E_BadModuleKind = $800288BD;
  9225.  
  9226.   { Size may not exceed 64K. }
  9227.   Type_E_SizeTooBig = $800288C5;
  9228.  
  9229.   { Duplicate ID in inheritance hierarchy. }
  9230.   Type_E_DuplicateId = $800288C6;
  9231.  
  9232.   { Incorrect inheritance depth in standard OLE hmember. }
  9233.   Type_E_InvalidId = $800288CF;
  9234.  
  9235.   { Type mismatch. }
  9236.   Type_E_TypeMismatch = $80028CA0;
  9237.  
  9238.   { Invalid number of arguments. }
  9239.   Type_E_OutOfBounds = $80028CA1;
  9240.  
  9241.   { I/O Error. }
  9242.   Type_E_IoError = $80028CA2;
  9243.  
  9244.   { Error creating unique tmp file. }
  9245.   Type_E_CantCreateTmpFile = $80028CA3;
  9246.  
  9247.   { Error loading type library/DLL. }
  9248.   Type_E_CantLoadLibrary = $80029C4A;
  9249.  
  9250.   { Inconsistent property functions. }
  9251.   Type_E_InconsistentPropFuncs = $80029C83;
  9252.  
  9253.   { Circular dependency between types/modules. }
  9254.   Type_E_CircularType = $80029C84;
  9255.  
  9256.  
  9257.   { FACILITY_STORAGE }
  9258.  
  9259.   { Unable to perform requested operation. }
  9260.   STG_E_InvalidFunction = $80030001;
  9261.  
  9262.   { %l could not be found. }
  9263.   STG_E_FileNotFound = $80030002;
  9264.  
  9265.   { The path %l could not be found. }
  9266.   STG_E_PathNotFound = $80030003;
  9267.  
  9268.   { There are insufficient resources to open another file. }
  9269.   STG_E_TooManyOpenFiles = $80030004;
  9270.  
  9271.   { Access Denied. }
  9272.   STG_E_AccessDenied = $80030005;
  9273.  
  9274.   { Attempted an operation on an invalid object. }
  9275.   STG_E_InvalidHandle = $80030006;
  9276.  
  9277.   { There is insufficient memory available to complete operation. }
  9278.   STG_E_InsufficientMemory = $80030008;
  9279.  
  9280.   { Invalid pointer error. }
  9281.   STG_E_InvalidPointer = $80030009;
  9282.  
  9283.   { There are no more entries to return. }
  9284.   STG_E_NoMoreFiles = $80030012;
  9285.  
  9286.   { Disk is write-protected. }
  9287.   STG_E_DiskIsWriteProtected = $80030013;
  9288.  
  9289.   { An error occurred during a seek operation. }
  9290.   STG_E_SeekError = $80030019;
  9291.  
  9292.   { A disk error occurred during a write operation. }
  9293.   STG_E_WriteFault = $8003001D;
  9294.  
  9295.   { A disk error occurred during a read operation. }
  9296.   STG_E_ReadFault = $8003001E;
  9297.  
  9298.   { A share violation has occurred. }
  9299.   STG_E_ShareViolation = $80030020;
  9300.  
  9301.   { A lock violation has occurred. }
  9302.   STG_E_LockViolation = $80030021;
  9303.  
  9304.   { %l already exists. }
  9305.   STG_E_FileAlreadyExists = $80030050;
  9306.  
  9307.   { Invalid parameter error. }
  9308.   STG_E_InvalidParameter = $80030057;
  9309.  
  9310.   { There is insufficient disk space to complete operation. }
  9311.   STG_E_MediumFull = $80030070;
  9312.  
  9313.   { Illegal write of non-simple property to simple property set. }
  9314.   STG_E_PropSetMismatched = $800300F0;
  9315.  
  9316.   { An API call exited abnormally. }
  9317.   STG_E_AbnormalApiExit = $800300FA;
  9318.  
  9319.   { The file %l is not a valid compound file. }
  9320.   STG_E_InvalidHeader = $800300FB;
  9321.  
  9322.   { The name %l is not valid. }
  9323.   STG_E_InvalidName = $800300FC;
  9324.  
  9325.   { An unexpected error occurred. }
  9326.   STG_E_Unknown = $800300FD;
  9327.  
  9328.   { That function is not implemented. }
  9329.   STG_E_UnimplementedFunction = $800300FE;
  9330.  
  9331.   { Invalid flag error. }
  9332.   STG_E_InvalidFlag = $800300FF;
  9333.  
  9334.   { Attempted to use an object that is busy. }
  9335.   STG_E_InUse = $80030100;
  9336.  
  9337.   { The storage has been changed since the last commit. }
  9338.   STG_E_NotCurrent = $80030101;
  9339.  
  9340.   { Attempted to use an object that has ceased to exist. }
  9341.   STG_E_Reverted = $80030102;
  9342.  
  9343.   { Can't save. }
  9344.   STG_E_CantSave = $80030103;
  9345.  
  9346.   { The compound file %l was produced with an incompatible version of storage. }
  9347.   STG_E_OldFormat = $80030104;
  9348.  
  9349.   { The compound file %l was produced with a newer version of storage. }
  9350.   STG_E_OldDll = $80030105;
  9351.  
  9352.   { Share.exe or equivalent is required for operation. }
  9353.   STG_E_ShareRequired = $80030106;
  9354.  
  9355.   { Illegal operation called on non-file based storage. }
  9356.   STG_E_NotFileBasedStorage = $80030107;
  9357.  
  9358.   { Illegal operation called on object with extant marshallings. }
  9359.   STG_E_ExtantMarshallings = $80030108;
  9360.  
  9361.   { The docfile has been corrupted. }
  9362.   STG_E_DocFileCorrupt = $80030109;
  9363.  
  9364.   { OLE32.DLL has been loaded at the wrong address. }
  9365.   STG_E_BadBaseAddress = $80030110;
  9366.  
  9367.   { The file download was aborted abnormally.  The file is incomplete. }
  9368.   STG_E_Incomplete = $80030201;
  9369.  
  9370.   { The file download has been terminated. }
  9371.   STG_E_Terminated = $80030202;
  9372.  
  9373.   { The underlying file was converted to compound file format. }
  9374.   STG_S_Converted = $00030200;
  9375.  
  9376.   { The storage operation should block until more data is available. }
  9377.   STG_S_Block = $00030201;
  9378.  
  9379.   { The storage operation should retry immediately. }
  9380.   STG_S_RetryNow = $00030202;
  9381.  
  9382.   { The notified event sink will not influence the storage operation. }
  9383.   STG_S_Monitoring = $00030203;
  9384.  
  9385.  
  9386.   { FACILITY_RPC }
  9387.  
  9388.   { Call was rejected by callee. }
  9389.   RPC_E_Call_Rejected = $80010001;
  9390.  
  9391.   { Call was canceled by the message filter. }
  9392.   RPC_E_Call_Canceled = $80010002;
  9393.  
  9394.   { The caller is dispatching an intertask SendMessage call and }
  9395.   { cannot call out via PostMessage. }
  9396.   RPC_E_CantPost_InSendCall = $80010003;
  9397.  
  9398.   { The caller is dispatching an asynchronous call and cannot }
  9399.   { make an outgoing call on behalf of this call. }
  9400.   RPC_E_CantCallOut_InAsyncCall = $80010004;
  9401.  
  9402.   { It is illegal to call out while inside message filter. }
  9403.   RPC_E_CantCallOut_InExternalCall = $80010005;
  9404.  
  9405.   { The connection terminated or is in a bogus state }
  9406.   { and cannot be used any more. Other connections }
  9407.   { are still valid. }
  9408.   RPC_E_Connection_Terminated = $80010006;
  9409.  
  9410.   { The callee (server [not server application]) is not available }
  9411.   { and disappeared; all connections are invalid.  The call may }
  9412.   { have executed. }
  9413.   RPC_E_Server_Died = $80010007;
  9414.  
  9415.   { The caller (client) disappeared while the callee (server) was }
  9416.   { processing a call. }
  9417.   RPC_E_Client_Died = $80010008;
  9418.  
  9419.   { The data packet with the marshalled parameter data is incorrect. }
  9420.   RPC_E_Invalid_DataPacket = $80010009;
  9421.  
  9422.   { The call was not transmitted properly; the message queue }
  9423.   { was full and was not emptied after yielding. }
  9424.   RPC_E_CantTransmit_Call = $8001000A;
  9425.  
  9426.   { The client (caller) cannot marshall the parameter data - low memory, etc. }
  9427.   RPC_E_Client_CantMarshal_Data = $8001000B;
  9428.  
  9429.   { The client (caller) cannot unmarshall the return data - low memory, etc. }
  9430.   RPC_E_Client_CantUnmarshal_Data = $8001000C;
  9431.  
  9432.   { The server (callee) cannot marshall the return data - low memory, etc. }
  9433.   RPC_E_Server_CantMarshal_Data = $8001000D;
  9434.  
  9435.   { The server (callee) cannot unmarshall the parameter data - low memory, etc. }
  9436.   RPC_E_Server_CantUnmarshal_Data = $8001000E;
  9437.  
  9438.   { Received data is invalid; could be server or client data. }
  9439.   RPC_E_Invalid_Data = $8001000F;
  9440.  
  9441.   { A particular parameter is invalid and cannot be (un)marshalled. }
  9442.   RPC_E_Invalid_Parameter = $80010010;
  9443.  
  9444.   { There is no second outgoing call on same channel in DDE conversation. }
  9445.   RPC_E_CantCallOut_Again = $80010011;
  9446.  
  9447.   { The callee (server [not server application]) is not available }
  9448.   { and disappeared; all connections are invalid.  The call did not execute. }
  9449.   RPC_E_Server_Died_DNE = $80010012;
  9450.  
  9451.   { System call failed. }
  9452.   RPC_E_Sys_Call_Failed = $80010100;
  9453.  
  9454.   { Could not allocate some required resource (memory, events, ...) }
  9455.   RPC_E_Out_Of_Resources = $80010101;
  9456.  
  9457.   { Attempted to make calls on more than one thread in single threaded mode. }
  9458.   RPC_E_Attempted_MultiThread = $80010102;
  9459.  
  9460.   { The requested interface is not registered on the server object. }
  9461.   RPC_E_Not_Registered = $80010103;
  9462.  
  9463.   { RPC could not call the server or could not return the results of calling the server. }
  9464.   RPC_E_Fault = $80010104;
  9465.  
  9466.   { The server threw an exception. }
  9467.   RPC_E_ServerFault = $80010105;
  9468.  
  9469.   { Cannot change thread mode after it is set. }
  9470.   RPC_E_Changed_Mode = $80010106;
  9471.  
  9472.   { The method called does not exist on the server. }
  9473.   RPC_E_InvalidMethod = $80010107;
  9474.  
  9475.   { The object invoked has disconnected from its clients. }
  9476.   RPC_E_Disconnected = $80010108;
  9477.  
  9478.   { The object invoked chose not to process the call now.  Try again later. }
  9479.   RPC_E_Retry = $80010109;
  9480.  
  9481.   { The message filter indicated that the application is busy. }
  9482.   RPC_E_ServerCall_RetryLater = $8001010A;
  9483.  
  9484.   { The message filter rejected the call. }
  9485.   RPC_E_ServerCall_Rejected = $8001010B;
  9486.  
  9487.   { A call control interfaces was called with invalid data. }
  9488.   RPC_E_Invalid_CallData = $8001010C;
  9489.  
  9490.   { An outgoing call cannot be made since the application is dispatching an input-synchronous call. }
  9491.   RPC_E_CantCallOut_InInputSyncCal = $8001010D;
  9492.  
  9493.   { The application called an interface that was marshalled for a different thread. }
  9494.   RPC_E_Wrong_Thread = $8001010E;
  9495.  
  9496.   { CoInitialize has not been called on the current thread. }
  9497.   RPC_E_Thread_Not_Init = $8001010F;
  9498.  
  9499.   { The version of OLE on the client and server machines does not match. }
  9500.   RPC_E_Version_Mismatch = $80010110;
  9501.  
  9502.   { OLE received a packet with an invalid header. }
  9503.   RPC_E_Invalid_Header = $80010111;
  9504.  
  9505.   { OLE received a packet with an invalid extension. }
  9506.   RPC_E_Invalid_Extension = $80010112;
  9507.  
  9508.   { The requested object or interface does not exist. }
  9509.   RPC_E_Invalid_IPID = $80010113;
  9510.  
  9511.   { The requested object does not exist. }
  9512.   RPC_E_Invalid_Object = $80010114;
  9513.  
  9514.   { OLE has sent a request and is waiting for a reply. }
  9515.   RPC_S_CallPending = $80010115;
  9516.  
  9517.   { OLE is waiting before retrying a request. }
  9518.   RPC_S_WaitOnTimer = $80010116;
  9519.  
  9520.   { Call context cannot be accessed after call completed. }
  9521.   RPC_E_Call_Complete = $80010117;
  9522.  
  9523.   { Impersonate on unsecure calls is not supported. }
  9524.   RPC_E_Unsecure_Call = $80010118;
  9525.  
  9526.   { Security must be initialized before any interfaces are marshalled or }
  9527.   RPC_E_Too_Late = $80010119;
  9528.  
  9529.   { No security packages are installed on this machine or the user is not logged }
  9530.   RPC_E_No_Good_Security_Packages = $8001011A;
  9531.  
  9532.   { Access is denied. }
  9533.   RPC_E_Access_Denied = $8001011B;
  9534.  
  9535.   { Remote calls are not allowed for this process. }
  9536.   RPC_E_Remote_Disabled = $8001011C;
  9537.  
  9538.   { The marshaled interface data packet (OBJREF) has an invalid or unknown format. }
  9539.   RPC_E_Invalid_ObjRef = $8001011D;
  9540.  
  9541.   { An internal error occurred. }
  9542.   RPC_E_Unexpected = $8001FFFF;
  9543.  
  9544.  
  9545. { FACILITY_SSPI }
  9546.  
  9547.   { Bad UID. }
  9548.   NTE_Bad_UID = $80090001;
  9549.  
  9550.   { Bad Hash. }
  9551.   NTE_Bad_Hash = $80090002;
  9552.  
  9553.   { Bad Key. }
  9554.   NTE_Bad_Key = $80090003;
  9555.  
  9556.   { Bad Length. }
  9557.   NTE_Bad_Len = $80090004;
  9558.  
  9559.   { Bad Data. }
  9560.   NTE_Bad_Data = $80090005;
  9561.  
  9562.   { Invalid Signature. }
  9563.   NTE_Bad_Signature = $80090006;
  9564.  
  9565.   { Bad Version of provider. }
  9566.   NTE_Bad_Ver = $80090007;
  9567.  
  9568.   { Invalid algorithm specified. }
  9569.   NTE_Bad_AlgId = $80090008;
  9570.  
  9571.   { Invalid flags specified. }
  9572.   NTE_Bad_Flags = $80090009;
  9573.  
  9574.   { Invalid type specified. }
  9575.   NTE_Bad_Type = $8009000A;
  9576.  
  9577.   { Key not valid for use in specified state. }
  9578.   NTE_Bad_Key_State = $8009000B;
  9579.  
  9580.   { Hash not valid for use in specified state. }
  9581.   NTE_Bad_Hash_State = $8009000C;
  9582.  
  9583.   { Key does not exist. }
  9584.   NTE_No_Key = $8009000D;
  9585.  
  9586.   { Insufficient memory available for the operation. }
  9587.   NTE_No_Memory = $8009000E;
  9588.  
  9589.   { Object already exists. }
  9590.   NTE_Exists = $8009000F;
  9591.  
  9592.   { Access denied. }
  9593.   NTE_Perm = $80090010;
  9594.  
  9595.   { Object was not found. }
  9596.   NTE_Not_Found = $80090011;
  9597.  
  9598.   { Data already encrypted. }
  9599.   NTE_Double_Encrypt = $80090012;
  9600.  
  9601.   { Invalid provider specified. }
  9602.   NTE_Bad_Provider = $80090013;
  9603.  
  9604.   { Invalid provider type specified. }
  9605.   NTE_Bad_Prov_Type = $80090014;
  9606.  
  9607.   { Provider's public key is invalid. }
  9608.   NTE_Bad_Public_Key = $80090015;
  9609.  
  9610.   { Keyset does not exist }
  9611.   NTE_Bad_KeySet = $80090016;
  9612.  
  9613.   { Provider type not defined. }
  9614.   NTE_Prov_Type_Not_Def = $80090017;
  9615.  
  9616.   { Provider type as registered is invalid. }
  9617.   NTE_Prov_Type_Entry_Bad = $80090018;
  9618.  
  9619.   { The keyset is not defined. }
  9620.   NTE_KeySet_Not_Def = $80090019;
  9621.  
  9622.   { Keyset as registered is invalid. }
  9623.   NTE_KeySet_Entry_Bad = $8009001A;
  9624.  
  9625.   { Provider type does not match registered value. }
  9626.   NTE_Prov_Type_no_Match = $8009001B;
  9627.  
  9628.   { The digital signature file is corrupt. }
  9629.   NTE_Signature_File_Bad = $8009001C;
  9630.  
  9631.   { Provider DLL failed to initialize correctly. }
  9632.   NTE_Provider_DLL_Fail = $8009001D;
  9633.  
  9634.   { Provider DLL could not be found. }
  9635.   NTE_Prov_DLL_not_Found = $8009001E;
  9636.  
  9637.   { The Keyset parameter is invalid. }
  9638.   NTE_Bad_KeySet_Param = $8009001F;
  9639.  
  9640.   { An internal error occurred. }
  9641.   NTE_Fail = $80090020;
  9642.  
  9643.   { A base error occurred. }
  9644.   NTE_Sys_Err = $80090021;
  9645.  
  9646.   NTE_Op_Ok = 0;
  9647.  
  9648. { FACILITY_CERT }
  9649.  
  9650.   { The specified trust provider is not known on this system. }
  9651.   Trust_E_Provider_Unknown = $800B0001;
  9652.  
  9653.   { The trust verification action specified is not supported by the specified trust provider. }
  9654.   Trust_E_Action_Unknown = $800B0002;
  9655.  
  9656.   { The form specified for the subject is not one supported or known by the specified trust provider. }
  9657.   Trust_E_Subject_Form_Unknown = $800B0003;
  9658.  
  9659.   { The subject is not trusted for the specified action. }
  9660.   Trust_E_Subject_not_Trusted = $800B0004;
  9661.  
  9662.   { Error due to problem in ASN.1 encoding process. }
  9663.   DigSig_E_Encode = $800B0005;
  9664.  
  9665.   { Error due to problem in ASN.1 decoding process. }
  9666.   DigSig_E_Decode = $800B0006;
  9667.  
  9668.   { Reading / writing Extensions where Attributes are appropriate, and visa versa. }
  9669.   DigSig_E_Extensibility = $800B0007;
  9670.  
  9671.   { Unspecified cryptographic failure. }
  9672.   DigSig_E_Crypto = $800B0008;
  9673.  
  9674.   { The size of the data could not be determined. }
  9675.   Persist_E_SizeDefinite = $800B0009;
  9676.  
  9677.   { The size of the indefinite-sized data could not be determined. }
  9678.   Persist_E_SizeIndefinite = $800B000A;
  9679.  
  9680.   { This object does not read and write self-sizing data. }
  9681.   Persist_E_NotSelfSizing = $800B000B;
  9682.  
  9683.   { No signature was present in the subject. }
  9684.   Trust_E_NoSignature = $800B0100;
  9685.  
  9686.   { A required certificate is not within its validity period. }
  9687.   Cert_E_Expired = $800B0101;
  9688.  
  9689.   { The validity periods of the certification chain do not nest correctly. }
  9690.   Cert_E_ValidiyPeriodNesting = $800B0102;
  9691.  
  9692.   { A certificate that can only be used as an end-entity is being used as a CA or visa versa. }
  9693.   Cert_E_Role = $800B0103;
  9694.  
  9695.   { A path length constraint in the certification chain has been violated. }
  9696.   Cert_E_PathLenConst = $800B0104;
  9697.  
  9698.   { An extension of unknown type that is labeled 'critical' is present in a certificate. }
  9699.   Cert_E_Critical = $800B0105;
  9700.  
  9701.   { A certificate is being used for a purpose other than that for which it is permitted. }
  9702.   Cert_E_Purpose = $800B0106;
  9703.  
  9704.   { A parent of a given certificate in fact did not issue that child certificate. }
  9705.   Cert_E_IssuerChaining = $800B0107;
  9706.  
  9707.   { A certificate is missing or has an empty value for an important field, such as a subject or issuer name. }
  9708.   Cert_E_Malformed = $800B0108;
  9709.  
  9710.   { A certification chain processed correctly, but terminated in a root certificate which isn't trusted by the trust provider. }
  9711.   Cert_E_UntrustedRoot = $800B0109;
  9712.  
  9713.   { A chain of certs didn't chain as they should in a certain application of chaining. }
  9714.   Cert_E_Chaining = $800B010A;
  9715.  
  9716. { End WINERROR.H }
  9717.  
  9718.  
  9719.   { Abnormal termination codes }
  9720.  
  9721.   TC_Normal = 0;
  9722.   TC_HardErr = 1;
  9723.   TC_GP_Trap = 2;
  9724.   TC_Signal = 3;
  9725.  
  9726.   { Power Management APIs }
  9727.  
  9728.   AC_Line_Offline = 0;
  9729.   AC_Line_Online = 1;
  9730.   AC_Line_Backup_Power = 2;
  9731.   AC_Line_Unknown = 255;
  9732.  
  9733.   Battery_Flag_High = 1;
  9734.   Battery_Flag_Low = 2;
  9735.   Battery_Flag_Critical = 4;
  9736.   Battery_Flag_Charging = 8;
  9737.   Battery_Flag_no_Battery = $80;
  9738.   Battery_Flag_Unknown = 255;
  9739.   Battery_Percentage_Unknown = 255;
  9740.   Battery_Life_Unknown = $FFFFFFFF;
  9741.  
  9742. type
  9743.   PSystemPowerStatus = ^TSystemPowerStatus;
  9744.   TSystemPowerStatus = packed record
  9745.     ACLineStatus : Byte;
  9746.     BatteryFlag : Byte;
  9747.     BatteryLifePercent : Byte;
  9748.     Reserved1 : Byte;
  9749.     BatteryLifeTime : DWord;
  9750.     BatteryFullLifeTime : DWord;
  9751.   end;
  9752.  
  9753. function GetSystemPowerStatus(var lpSystemPowerStatus: TSystemPowerStatus): Bool;
  9754. function SetSystemPowerState(fSuspend, fForce: Bool): Bool;
  9755.  
  9756.  
  9757. { Win Certificate API and Structures }
  9758.  
  9759. { Structures }
  9760. type
  9761.   PWinCertificate = ^TWinCertificate;
  9762.   TWinCertificate = packed record
  9763.     dwLength: DWord;
  9764.     wRevision: Word;
  9765.     wCertificateType: Word;         { WIN_CERT_TYPE_xxx }
  9766.     bCertificate: packed array[0..0] of Byte;
  9767.   end;
  9768.  
  9769. { Currently, the only defined certificate revision is WIN_CERT_REVISION_1_0 }
  9770.  
  9771. const
  9772.   WIN_CERT_REVISION_1_0 = $0100;
  9773.  
  9774. { Possible certificate types are specified by the following values }
  9775.  
  9776.   Win_Cert_Type_X509 = $0001;                        { bCertificate contains an X.509 Certificate }
  9777.   Win_Cert_Type_PKCS_Signed_Data = $0002;            { bCertificate contains a PKCS SignedData structure }
  9778.   Win_Cert_Type_Reserved_1 = $0003;                  { Reserved }
  9779.  
  9780. { API }
  9781.  
  9782. function WinSubmitCertificate(var lpCertificate: TWinCertificate): Bool;
  9783.  
  9784. const
  9785.   HGDI_Error = $FFFFFFFF;
  9786.  
  9787.   { PolyFill() Modes }
  9788.   PolyFill_Last = 2;
  9789.  
  9790.   { Text Alignment Options }
  9791.   TA_RtlReading = $100;
  9792.  
  9793.  
  9794.   ETO_Glyph_Index = $10;
  9795.   ETO_RtlReading = $80;
  9796.   ETO_IgnoreLanguage = $1000;
  9797.  
  9798.   Aspect_Filtering = 1;
  9799.  
  9800.   { Flag returned from QUERYDIBSUPPORT }
  9801.   QDI_SetDibIts = 1;
  9802.   QDI_GetDibIts = 2;
  9803.   QDI_DibToScreen = 4;
  9804.   QDI_StretchDib = 8;
  9805.  
  9806.  
  9807.   { Spooler Error Codes }
  9808.  
  9809.   PR_JobStatus = 0;
  9810.  
  9811.  
  9812.   { xform stuff }
  9813.  
  9814.   MWT_Min = MWT_Identity;
  9815.   MWT_Max = MWT_RightMultiply;
  9816.  
  9817.  
  9818. type
  9819.   { Image Color Matching color definitions }
  9820.   LCSCSType = Longint;
  9821. const
  9822.   LCS_Calibrated_RGB = 0;
  9823.   LCS_Device_RGB = 1;
  9824.   LCS_Device_CMYK = 2;
  9825.  
  9826. type
  9827.   LCSGamutMatch = Longint;
  9828. const
  9829.   LCS_GM_Business = 1;
  9830.   LCS_GM_Graphics = 2;
  9831.   LCS_GM_Images = 4;
  9832.  
  9833.  
  9834.   { ICM Defines for results from CheckColorInGamut() }
  9835.   CM_out_of_Gamut = 255;
  9836.   CM_in_Gamut = 0;
  9837.  
  9838.  
  9839. { functions to retrieve CMYK values from a COLORREF }
  9840.  
  9841. function GetCValue(cmyk: TColorRef): Byte;
  9842. function GetMValue(cmyk: TColorRef): Byte;
  9843. function GetYValue(cmyk: TColorRef): Byte;
  9844. function GetKValue(cmyk: TColorRef): Byte;
  9845. function CMYK(c, m, y, k: Byte): TColorRef;
  9846.  
  9847. type
  9848.   FxPt16Dot16 = Longint;
  9849.   LPFxPt16Dot16 = ^Longint;
  9850.   FxPt2Dot30 = Longint;
  9851.   LPFxPt2Dot30 = ^Longint;
  9852.  
  9853.  
  9854.   { ICM Color Definitions }
  9855.   { The following two structures are used for defining RGB's in terms of
  9856.     CIEXYZ. The values are fixed point 16.16. }
  9857.  
  9858.   PCIEXYZ = ^TCIEXYZ;
  9859.   TCIEXYZ = packed record
  9860.     ciexyzX: FXPT2DOT30;
  9861.     ciexyzY: FXPT2DOT30;
  9862.     ciexyzZ: FXPT2DOT30;
  9863.   end;
  9864.  
  9865.   PCIEXYZTriple = ^TCIEXYZTriple;
  9866.   TCIEXYZTriple = packed record
  9867.     ciexyzRed: TCIEXYZ;
  9868.     ciexyzGreen: TCIEXYZ;
  9869.     ciexyzBlue: TCIEXYZ;
  9870.   end;
  9871.  
  9872.   { The next structures the logical color space. Unlike pens and brushes,
  9873.     but like palettes, there is only one way to create a LogColorSpace.
  9874.     A pointer to it must be passed, its elements can't be pushed as
  9875.     arguments. }
  9876.  
  9877. type
  9878.   PLogColorSpace = ^TLogColorSpace;
  9879.   PLogColorSpaceA = ^TLogColorSpaceA;
  9880.   PLogColorSpaceW = ^TLogColorSpaceW;
  9881.   TLogColorSpace = packed record
  9882.     lcsSignature: DWord;
  9883.     lcsVersion: DWord;
  9884.     lcsSize: DWord;
  9885.     lcsCSType: LCSCSTYPE;
  9886.     lcsIntent: LCSGAMUTMATCH;
  9887.     lcsEndpoints: TCIEXYZTriple;
  9888.     lcsGammaRed: DWord;
  9889.     lcsGammaGreen: DWord;
  9890.     lcsGammaBlue: DWord;
  9891.     lcsFilename: array[0..259] of AnsiChar;
  9892.   end;
  9893.   TLogColorSpaceW = packed record
  9894.     lcsSignature: DWord;
  9895.     lcsVersion: DWord;
  9896.     lcsSize: DWord;
  9897.     lcsCSType: LCSCSTYPE;
  9898.     lcsIntent: LCSGAMUTMATCH;
  9899.     lcsEndpoints: TCIEXYZTriple;
  9900.     lcsGammaRed: DWord;
  9901.     lcsGammaGreen: DWord;
  9902.     lcsGammaBlue: DWord;
  9903.     lcsFilename: array[0..259] of WideChar;
  9904.   end;
  9905.   tLogColorSpaceA = tLogColorSpace;
  9906.  
  9907.   PBitmapV4Header = ^TBitmapV4Header;
  9908.   TBitmapV4Header = packed record
  9909.     bV4Size: DWord;
  9910.     bV4Width: Longint;
  9911.     bV4Height: Longint;
  9912.     bV4Planes: Word;
  9913.     bV4BitCount: Word;
  9914.     bV4V4Compression: DWord;
  9915.     bV4SizeImage: DWord;
  9916.     bV4XPelsPerMeter: Longint;
  9917.     bV4YPelsPerMeter: Longint;
  9918.     bV4ClrUsed: DWord;
  9919.     bV4ClrImportant: DWord;
  9920.     bV4RedMask: DWord;
  9921.     bV4GreenMask: DWord;
  9922.     bV4BlueMask: DWord;
  9923.     bV4AlphaMask: DWord;
  9924.     bV4CSType: DWord;
  9925.     bV4Endpoints: TCIEXYZTriple;
  9926.     bV4GammaRed: DWord;
  9927.     bV4GammaGreen: DWord;
  9928.     bV4GammaBlue: DWord;
  9929.   end;
  9930.  
  9931. type
  9932.   PFontSignature = ^TFontSignature;
  9933.   TFontSignature = packed record
  9934.     fsUsb: array[0..3] of DWord;
  9935.     fsCsb: array[0..1] of DWord;
  9936.   end;
  9937.  
  9938.   PCharsetInfo = ^TCharsetInfo;
  9939.   TCharsetInfo = packed record
  9940.     ciCharset: UInt;
  9941.     ciACP: UInt;
  9942.     fs: TFontSignature;
  9943.   end;
  9944.  
  9945. const
  9946.   TCI_SrcCharset = 1;
  9947.   TCI_SrcCodePage = 2;
  9948.   TCI_SrcFontSig = 3;
  9949.  
  9950. type
  9951.   PLocaleSignature = ^TLocaleSignature;
  9952.   TLocaleSignature = packed record
  9953.     lsUsb: array[0..3] of DWord;
  9954.     lsCsbDefault: array[0..1] of DWord;
  9955.     lsCsbSupported: array[0..1] of DWord;
  9956.   end;
  9957.  
  9958. const
  9959.   { tmPitchAndFamily flags }
  9960.   TMPF_Fixed_Pitch = 1;
  9961.   TMPF_Vector = 2;
  9962.   TMPF_Device = 8;
  9963.   TMPF_Truetype = 4;
  9964.  
  9965. const
  9966.   { ntmFlags field flags }
  9967.   NTM_Regular = $40;
  9968.   NTM_Bold = $20;
  9969.   NTM_Italic = 1;
  9970.  
  9971. type
  9972.   PNewTextMetric = ^TNewTextMetric;
  9973.   TNewTextMetric = record
  9974.     tmHeight: Longint;
  9975.     tmAscent: Longint;
  9976.     tmDescent: Longint;
  9977.     tmInternalLeading: Longint;
  9978.     tmExternalLeading: Longint;
  9979.     tmAveCharWidth: Longint;
  9980.     tmMaxCharWidth: Longint;
  9981.     tmWeight: Longint;
  9982.     tmOverhang: Longint;
  9983.     tmDigitizedAspectX: Longint;
  9984.     tmDigitizedAspectY: Longint;
  9985.     tmFirstChar: AnsiChar;
  9986.     tmLastChar: AnsiChar;
  9987.     tmDefaultChar: AnsiChar;
  9988.     tmBreakChar: AnsiChar;
  9989.     tmItalic: Byte;
  9990.     tmUnderlined: Byte;
  9991.     tmStruckOut: Byte;
  9992.     tmPitchAndFamily: Byte;
  9993.     tmCharSet: Byte;
  9994.     ntmFlags: DWord;
  9995.     ntmSizeEM: UInt;
  9996.     ntmCellHeight: UInt;
  9997.     ntmAvgWidth: UInt;
  9998.   end;
  9999.  
  10000.   PNewTextMetricEx = ^TNewTextMetricEx;
  10001.   TNewTextMetricEx = packed record
  10002.     ntmTm: TNewTextMetric;
  10003.     ntmFontSig: TFontSignature;
  10004.   end;
  10005.  
  10006. { GDI Logical Objects: }
  10007.  
  10008.   { Pel Array }
  10009.   PPelArray = ^TPelArray;
  10010.   TPelArray = record
  10011.     paXCount: Longint;
  10012.     paYCount: Longint;
  10013.     paXExt: Longint;
  10014.     paYExt: Longint;
  10015.     paRGBs: Byte;
  10016.   end;
  10017.  
  10018.   PPattern = ^TPattern;
  10019.   TPattern = TLogBrush;
  10020.  
  10021.   PMaxLogPalette = ^TMaxLogPalette;
  10022.   TMaxLogPalette = packed record
  10023.     palVersion: Word;
  10024.     palNumEntries: Word;
  10025.     palPalEntry: array [Byte] of TPaletteEntry;
  10026.   end;
  10027.  
  10028. const
  10029.   LF_FullFaceSize = 64;
  10030.  
  10031. type
  10032.   { Structure passed to FONTENUMPROC }
  10033.   PEnumLogFont = ^TEnumLogFont;
  10034.   TEnumLogFont = packed record
  10035.     elfLogFont: TLogFont;
  10036.     elfFullName: array[0..LF_FullFaceSize - 1] of Char;
  10037.     elfStyle: array[0..LF_FaceSize - 1] of Char;
  10038.   end;
  10039.  
  10040.   PEnumLogFontEx = ^TEnumLogFontEx;
  10041.   TEnumLogFontEx = packed record
  10042.     elfLogFont: TLogFont;
  10043.     elfFullName: array[0..LF_FullFaceSize - 1] of Char;
  10044.     elfStyle: array[0..LF_FaceSize - 1] of Char;
  10045.     elfScript: array[0..LF_FaceSize - 1] of Char;
  10046.   end;
  10047.  
  10048. const
  10049.   OUT_Screen_Outline_Precis = 9;
  10050.  
  10051.   NonAntiAliased_Quality = 3;
  10052.   AntiAliased_Quality = 4;
  10053.  
  10054.   Mono_Font = 8;
  10055.  
  10056.   Vietnamese_Charset = 163;
  10057.  
  10058.   Mac_Charset = 77;
  10059.   Baltic_Charset = 186;
  10060.  
  10061.   FS_Latin1 = 1;
  10062.   FS_Latin2 = 2;
  10063.   FS_Cyrillic = 4;
  10064.   FS_Greek = 8;
  10065.   FS_Turkish = $10;
  10066.   FS_Hebrew = $20;
  10067.   FS_Arabic = $40;
  10068.   FS_Baltic = $80;
  10069.   FS_Vietnamese = $00000100;
  10070.   FS_Thai = $10000;
  10071.   FS_JisJapan = $20000;
  10072.   FS_ChineseSimp = $40000;
  10073.   FS_Wansung = $80000;
  10074.   FS_ChineseTrad = $100000;
  10075.   FS_Johab = $200000;
  10076.   FS_Symbol = $80000000;
  10077.  
  10078.   { Font Weights }
  10079.  
  10080.   Panose_Count = 10;
  10081.   PAN_FamilyType_Index = 0;
  10082.   PAN_SerifStyle_Index = 1;
  10083.   PAN_Weight_Index = 2;
  10084.   PAN_Proportion_Index = 3;
  10085.   PAN_Contrast_Index = 4;
  10086.   PAN_StrokeVariation_Index = 5;
  10087.   PAN_ArmStyle_Index = 6;
  10088.   PAN_LetterForm_Index = 7;
  10089.   PAN_MidLine_Index = 8;
  10090.   PAN_XHeight_Index = 9;
  10091.  
  10092.   PAN_Culture_Latin = 0;
  10093.  
  10094. const
  10095.   PAN_any = 0;
  10096.   PAN_no_fit = 1;
  10097.  
  10098.   PAN_Family_Text_Display = 2;
  10099.   PAN_Family_Script = 3;
  10100.   PAN_Family_Decorative = 4;
  10101.   PAN_Family_Pictorial = 5;
  10102.  
  10103.   PAN_Serif_Cove = 2;
  10104.   PAN_Serif_Obtuse_Cove = 3;
  10105.   PAN_Serif_Square_Cove = 4;
  10106.   PAN_Serif_Obtuse_Square_Cove = 5;
  10107.   PAN_Serif_Square = 6;
  10108.   PAN_Serif_Thin = 7;
  10109.   PAN_Serif_Bone = 8;
  10110.   PAN_Serif_Exaggerated = 9;
  10111.   PAN_Serif_Triangle = 10;
  10112.   PAN_Serif_Normal_Sans = 11;
  10113.   PAN_Serif_Obtuse_Sans = 12;
  10114.   PAN_Serif_Perp_Sans = 13;
  10115.   PAN_Serif_Flared = 14;
  10116.   PAN_Serif_Rounded = 15;
  10117.  
  10118.   PAN_Weight_Very_Light = 2;
  10119.   PAN_Weight_Light = 3;
  10120.   PAN_Weight_Thin = 4;
  10121.   PAN_Weight_Book = 5;
  10122.   PAN_Weight_Medium = 6;
  10123.   PAN_Weight_Demi = 7;
  10124.   PAN_Weight_Bold = 8;
  10125.   PAN_Weight_Heavy = 9;
  10126.   PAN_Weight_Black = 10;
  10127.   PAN_Weight_Nord = 11;
  10128.  
  10129.   PAN_Prop_Old_Style = 2;
  10130.   PAN_Prop_Modern = 3;
  10131.   PAN_Prop_Even_Width = 4;
  10132.   PAN_Prop_Expanded = 5;
  10133.   PAN_Prop_Condensed = 6;
  10134.   PAN_Prop_Very_Expanded = 7;
  10135.   PAN_Prop_Very_Condensed = 8;
  10136.   PAN_Prop_MonoSpaced = 9;
  10137.  
  10138.   PAN_Contrast_None = 2;
  10139.   PAN_Contrast_Very_Low = 3;
  10140.   PAN_Contrast_Low = 4;
  10141.   PAN_Contrast_Medium_Low = 5;
  10142.   PAN_Contrast_Medium = 6;
  10143.   PAN_Contrast_Medium_High = 7;
  10144.   PAN_Contrast_High = 8;
  10145.   PAN_Contrast_Very_High = 9;
  10146.  
  10147.   PAN_Stroke_Gradual_Diag = 2;
  10148.   PAN_Stroke_Gradual_Tran = 3;
  10149.   PAN_Stroke_Gradual_Vert = 4;
  10150.   PAN_Stroke_Gradual_Horz = 5;
  10151.   PAN_Stroke_Rapid_Vert = 6;
  10152.   PAN_Stroke_Rapid_Horz = 7;
  10153.   PAN_Stroke_Instant_Vert = 8;
  10154.  
  10155.   PAN_Straight_Arms_Horz = 2;
  10156.   PAN_Straight_Arms_Wedge = 3;
  10157.   PAN_Straight_Arms_Vert = 4;
  10158.   PAN_Straight_Arms_Single_Serif = 5;
  10159.   PAN_Straight_Arms_Double_Serif = 6;
  10160.   PAN_Bent_Arms_Horz = 7;
  10161.   PAN_Bent_Arms_WedgE = 8;
  10162.   PAN_Bent_Arms_Vert = 9;
  10163.   PAN_Bent_Arms_Single_Serif = 10;
  10164.   PAN_Bent_Arms_Double_Serif = 11;
  10165.  
  10166.   PAN_Lett_Normal_Contact = 2;
  10167.   PAN_Lett_Normal_Weighted = 3;
  10168.   PAN_Lett_Normal_Boxed = 4;
  10169.   PAN_Lett_Normal_Flattened = 5;
  10170.   PAN_Lett_Normal_Rounded = 6;
  10171.   PAN_Lett_Normal_off_Center = 7;
  10172.   PAN_Lett_Normal_Square = 8;
  10173.   PAN_Lett_Oblique_Contact = 9;
  10174.   PAN_Lett_Oblique_Weighted = 10;
  10175.   PAN_Lett_Oblique_Boxed = 11;
  10176.   PAN_Lett_Oblique_Flattened = 12;
  10177.   PAN_Lett_Oblique_Rounded = 13;
  10178.   PAN_Lett_Oblique_off_Center = 14;
  10179.   PAN_Lett_Oblique_Square = 15;
  10180.  
  10181.   PAN_MidLine_Standard_Trimmed = 2;
  10182.   PAN_MidLine_Standard_Pointed = 3;
  10183.   PAN_MidLine_Standard_Serifed = 4;
  10184.   PAN_MidLine_High_Trimmed = 5;
  10185.   PAN_MidLine_High_Pointed = 6;
  10186.   PAN_MidLine_High_Serifed = 7;
  10187.   PAN_MidLine_Constant_Trimmed = 8;
  10188.   PAN_MidLine_Constant_Pointed = 9;
  10189.   PAN_MidLine_Constant_Serifed = 10;
  10190.   PAN_MidLine_Low_Trimmed = 11;
  10191.   PAN_MidLine_Low_Pointed = 12;
  10192.   PAN_MidLine_Low_Serifed = 13;
  10193.  
  10194.   PAN_XHeight_Constant_Small = 2;
  10195.   PAN_XHeight_Constant_Std = 3;
  10196.   PAN_XHeight_Constant_Large = 4;
  10197.   PAN_XHeight_Ducking_Small = 5;
  10198.   PAN_XHeight_Ducking_Std = 6;
  10199.   PAN_XHeight_Ducking_Large = 7;
  10200.  
  10201.   ELF_Vendor_Size = 4;
  10202.  
  10203. { The extended logical font       }
  10204. { An extension of the ENUMLOGFONT }
  10205.  
  10206. type
  10207.   PExtLogFont = ^TExtLogFont;
  10208.   TExtLogFont = record
  10209.     elfLogFont: TLogFont;
  10210.     elfFullName: array[0..LF_FULLFACESIZE - 1] of Char;
  10211.     elfStyle: array[0..LF_FACESIZE - 1] of Char;
  10212.     elfVersion: DWord;     { 0 for the first release of NT }
  10213.     elfStyleSize: DWord;
  10214.     elfMatch: DWord;
  10215.     elfReserved: DWord;
  10216.     elfVendorId: array[0..ELF_VENDOR_SIZE - 1] of Byte;
  10217.     elfCulture: DWord;     { 0 for Latin }
  10218.     elfPanose: TPanose;
  10219.   end;
  10220.  
  10221. const
  10222.   ELF_VERSION = 0;
  10223.   ELF_CULTURE_LATIN = 0;
  10224.  
  10225. function RGB(r, g, b: Byte): TColorRef;
  10226. function PaletteRGB(r, g, b: Byte): TColorRef;
  10227. function PaletteIndex(i: Word): TColorRef;
  10228. function GetRValue(rgb: DWord): Byte;
  10229. function GetGValue(rgb: DWord): Byte;
  10230. function GetBValue(rgb: DWord): Byte;
  10231.  
  10232. const
  10233.   { Graphics Modes }
  10234.   GM_Last = 2;
  10235.   { Min and Max Mapping Mode values }
  10236.   MM_Min = MM_Text;
  10237.   MM_Max = MM_Anisotropic;
  10238.   MM_Max_FixedScale = MM_TWIPS;
  10239.  
  10240.   { Coordinate Modes }
  10241.   Absolute = 1;
  10242.   Relative = 2;
  10243.  
  10244.   { Stock Logical Objects }
  10245.   Default_GUI_Font = 17;
  10246.  
  10247.  
  10248.   { Brush Styles }
  10249.   BS_MonoPattern          = 9;
  10250.  
  10251.   NumBrushes    = $10;   { Number of brushes the device has          }
  10252.   NumPens       = 18;    { Number of pens the device has             }
  10253.   NumMarkers    = 20;    { Number of markers the device has          }
  10254.  
  10255.   { Display driver specific}
  10256.   VRefresh       = 116;     { Current vertical refresh rate of the     }
  10257.                             { display device (for displays only) in Hz}
  10258.   DesktopVertRes = 117;     { Horizontal width of entire desktop in    }
  10259.                             { pixels                                  }
  10260.   DesktopHorzRes = 118;     { Vertical height of entire desktop in     }
  10261.                             { pixels                                  }
  10262.   BltAlignment   = 119;     { Preferred blt alignment                  }
  10263.  
  10264.  
  10265. { Device Capability Masks: }
  10266.  
  10267. { Device Technologies }
  10268.  
  10269.   DT_CharStream = 4;     { Character-stream, PLP             }
  10270.   DT_DispFile   = 6;     { Display-file                      }
  10271.  
  10272. { Polygonal Capabilities }
  10273.  
  10274.   PC_PolyPolygon = $100;  { Can do polypolygons               }
  10275.   PC_Paths       = $200;  { Can do paths                      }
  10276.  
  10277. { Clipping Capabilities }
  10278.  
  10279.   CP_None      = 0;     { No clipping of output             }
  10280.   CP_Rectangle = 1;     { Output clipped to rects           }
  10281.   CP_Region    = 2;     { obsolete                          }
  10282.  
  10283. { Text Capabilities }
  10284.  
  10285.   TC_OP_Character = 1;      { Can do OutputPrecision   CHARACTER       }
  10286.   TC_OP_Stroke    = 2;      { Can do OutputPrecision   STROKE          }
  10287.   TC_CP_Stroke    = 4;      { Can do ClipPrecision     STROKE          }
  10288.   TC_SA_Double    = $40;    { Can do ScaleAbility      DOUBLE          }
  10289.   TC_EA_Double    = $200;   { Can do EmboldenAbility   DOUBLE          }
  10290.  
  10291. { Raster Capabilities }
  10292.  
  10293.   RC_GDI20_Output = $10;   { has 2.0 output calls          }
  10294.   RC_GDI20_State  = $20;
  10295.   RC_SaveBitmap   = $40;
  10296.   RC_BigFont      = $400;  { supports >64K fonts           }
  10297.   RC_OP_Dx_Output = $4000;
  10298.   RC_DevBits      = $8000;
  10299.  
  10300. const
  10301.  
  10302. { field selection bits }
  10303.  
  10304.   DM_LogPixels = $20000;
  10305.   DM_BitsPerPel = $40000;
  10306.   DM_PelsWidth = $80000;
  10307.   DM_PelsHeight = $100000;
  10308.   DM_DisplayFlags = $200000;
  10309.   DM_DisplayFrequency = $400000;
  10310.   DM_PanningWidth = $00800000;
  10311.   DM_PanningHeight = $01000000;
  10312.   DM_IcmMethod = $2000000;
  10313.   DM_IcmIntent = $4000000;
  10314.   DM_MediaType = $8000000;
  10315.   DM_DitherType = $10000000;
  10316.   DM_IccManufacturer = $20000000;
  10317.   DM_IccModel = $40000000;
  10318.  
  10319. { orientation selections }
  10320.  
  10321. { paper selections }
  10322.  
  10323.   DmPaper_ISO_B4             = 42;  { B4 (ISO) 250 x 353 mm               }
  10324.   DmPaper_Japanese_Postcard  = 43;  { Japanese Postcard 100 x 148 mm      }
  10325.   DmPaper_9X11               = 44;  { 9 x 11 in                           }
  10326.   DmPaper_10X11              = 45;  { 10 x 11 in                          }
  10327.   DmPaper_15X11              = 46;  { 15 x 11 in                          }
  10328.   DmPaper_Env_Invite         = 47;  { Envelope Invite 220 x 220 mm        }
  10329.   DmPaper_Reserved_48        = 48;  { RESERVED--DO NOT USE                }
  10330.   DmPaper_Reserved_49        = 49;  { RESERVED--DO NOT USE                }
  10331.   DmPaper_Letter_Extra       = 50;  { Letter Extra 9 \275 x 12 in         }
  10332.   DmPaper_Legal_Extra        = 51;  { Legal Extra 9 \275 x 15 in          }
  10333.   DmPaper_Tabloid_Extra      = 52;  { Tabloid Extra 11.69 x 18 in         }
  10334.   DmPaper_A4_Extra           = 53;  { A4 Extra 9.27 x 12.69 in            }
  10335.   DmPaper_Letter_Transverse  = 54;  { Letter Transverse 8 \275 x 11 in    }
  10336.   DmPaper_A4_Transverse      = 55;  { A4 Transverse 210 x 297 mm          }
  10337.   DmPaper_Letter_Extra_Transverse = 56;     { Letter Extra Transverse 9\275 x 12 in  }
  10338.   DmPaper_A_Plus        = 57;     { SuperASuperAA4 227 x 356 mm       }
  10339.   DmPaper_B_Plus        = 58;     { SuperBSuperBA3 305 x 487 mm       }
  10340.   DmPaper_Letter_Plus   = 59;     { Letter Plus 8.5 x 12.69 in          }
  10341.   DmPaper_A4_Plus       = 60;     { A4 Plus 210 x 330 mm                }
  10342.   DmPaper_A5_Transverse = 61;     { A5 Transverse 148 x 210 mm          }
  10343.   DmPaper_B5_Transverse = 62;     { B5 (JIS) Transverse 182 x 257 mm    }
  10344.   DmPaper_A3_Extra      = 63;     { A3 Extra 322 x 445 mm               }
  10345.   DmPaper_A5_Extra      = $40;    { A5 Extra 174 x 235 mm               }
  10346.   DmPaper_B5_Extra      = 65;     { B5 (ISO) Extra 201 x 276 mm         }
  10347.   DmPaper_A2            = 66;     { A2 420 x 594 mm                     }
  10348.   DmPaper_A3_Transverse = 67;     { A3 Transverse 297 x 420 mm          }
  10349.   DmPaper_A3_Extra_Transverse = 68;     { A3 Extra Transverse 322 x 445 mm    }
  10350. {
  10351.  ** the following sizes are reserved for the Far East version of Win95.
  10352.  ** Rotated papers rotate the physical page but not the logical page.
  10353. }
  10354.   DmPaper_Dbl_Japanese_Postcard = 69; { Japanese Double Postcard 200 x 148 mm }
  10355.   DmPaper_A6                  = 70;  { A6 105 x 148 mm                 }
  10356.   DmPaper_JEnv_Kaku2          = 71;  { Japanese Envelope Kaku #2       }
  10357.   DmPaper_JEnv_Kaku3          = 72;  { Japanese Envelope Kaku #3       }
  10358.   DmPaper_JEnv_Chou3          = 73;  { Japanese Envelope Chou #3       }
  10359.   DmPaper_JEnv_Chou4          = 74;  { Japanese Envelope Chou #4       }
  10360.   DmPaper_Letter_Rotated      = 75;  { Letter Rotated 11 x 8 1/2 11 in }
  10361.   DmPaper_A3_Rotated          = 76;  { A3 Rotated 420 x 297 mm         }
  10362.   DmPaper_A4_Rotated          = 77;  { A4 Rotated 297 x 210 mm         }
  10363.   DmPaper_A5_Rotated          = 78;  { A5 Rotated 210 x 148 mm         }
  10364.   DmPaper_B4_JIS_Rotated      = 79;  { B4 (JIS) Rotated 364 x 257 mm   }
  10365.   DmPaper_B5_JIS_Rotated      = 80;  { B5 (JIS) Rotated 257 x 182 mm   }
  10366.   DmPaper_Japanese_Postcard_Rotated = 81; { Japanese Postcard Rotated 148 x 100 mm }
  10367.   DmPaper_Dbl_Japanese_Postcard_Rotated = 82; { Double Japanese Postcard Rotated 148 x 200 mm }
  10368.   DmPaper_A6_Rotated          = 83;  { A6 Rotated 148 x 105 mm         }
  10369.   DmPaper_JEnv_Kaku2_Rotated  = 84;  { Japanese Envelope Kaku #2 Rotated}
  10370.   DmPaper_JEnv_Kaku3_Rotated  = 85;  { Japanese Envelope Kaku #3 Rotated}
  10371.   DmPaper_JEnv_Chou3_Rotated  = 86;  { Japanese Envelope Chou #3 Rotated}
  10372.   DmPaper_JEnv_Chou4_Rotated  = 87;  { Japanese Envelope Chou #4 Rotated}
  10373.   DmPaper_B6_JIS              = 88;  { B6 (JIS) 128 x 182 mm           }
  10374.   DmPaper_B6_JIS_Rotated      = 89;  { B6 (JIS) Rotated 182 x 128 mm   }
  10375.   DmPaper_12X11               = 90;  { 12 x 11 in                      }
  10376.   DmPaper_JEnv_You4           = 91;  { Japanese Envelope You #4        }
  10377.   DmPaper_JEnv_You4_Rotated   = 92;  { Japanese Envelope You #4 Rotated}
  10378.   DmPaper_P16K                = 93;  { PRC 16K 146 x 215 mm            }
  10379.   DmPaper_P32K                = 94;  { PRC 32K 97 x 151 mm             }
  10380.   DmPaper_P32KBig             = 95;  { PRC 32K(Big) 97 x 151 mm        }
  10381.   DmPaper_PEnv_1              = 96;  { PRC Envelope #1 102 x 165 mm    }
  10382.   DmPaper_PEnv_2              = 97;  { PRC Envelope #2 102 x 176 mm    }
  10383.   DmPaper_PEnv_3              = 98;  { PRC Envelope #3 125 x 176 mm    }
  10384.   DmPaper_PEnv_4              = 99;  { PRC Envelope #4 110 x 208 mm    }
  10385.   DmPaper_PEnv_5              = 100; { PRC Envelope #5 110 x 220 mm    }
  10386.   DmPaper_PEnv_6              = 101; { PRC Envelope #6 120 x 230 mm    }
  10387.   DmPaper_PEnv_7              = 102; { PRC Envelope #7 160 x 230 mm    }
  10388.   DmPaper_PEnv_8              = 103; { PRC Envelope #8 120 x 309 mm    }
  10389.   DmPaper_PEnv_9              = 104; { PRC Envelope #9 229 x 324 mm    }
  10390.   DmPaper_PEnv_10             = 105; { PRC Envelope #10 324 x 458 mm   }
  10391.   DmPaper_P16K_Rotated        = 106; { PRC 16K Rotated                 }
  10392.   DmPaper_P32K_Rotated        = 107; { PRC 32K Rotated                 }
  10393.   DmPaper_P32KBig_Rotated     = 108; { PRC 32K(Big) Rotated            }
  10394.   DmPaper_PENV_1_Rotated      = 109; { PRC Envelope #1 Rotated 165 x 102 mm}
  10395.   DmPaper_PENV_2_Rotated      = 110; { PRC Envelope #2 Rotated 176 x 102 mm}
  10396.   DmPaper_PENV_3_Rotated      = 111; { PRC Envelope #3 Rotated 176 x 125 mm}
  10397.   DmPaper_PENV_4_Rotated      = 112; { PRC Envelope #4 Rotated 208 x 110 mm}
  10398.   DmPaper_PENV_5_Rotated      = 113; { PRC Envelope #5 Rotated 220 x 110 mm}
  10399.   DmPaper_PENV_6_Rotated      = 114; { PRC Envelope #6 Rotated 230 x 120 mm}
  10400.   DmPaper_PENV_7_Rotated      = 115; { PRC Envelope #7 Rotated 230 x 160 mm}
  10401.   DmPaper_PENV_8_Rotated      = 116; { PRC Envelope #8 Rotated 309 x 120 mm}
  10402.   DmPaper_PENV_9_Rotated      = 117; { PRC Envelope #9 Rotated 324 x 229 mm}
  10403.   DmPaper_PENV_10_Rotated     = 118; { PRC Envelope #10 Rotated 458 x 324 mm }
  10404.  
  10405. { bin selections }
  10406.  
  10407.   DMTT_Download_Outline = 4;     { download TT fonts as outline soft fonts  }
  10408.  
  10409.   { Collation selections }
  10410.  
  10411.   { DEVMODE dmDisplayFlags flags }
  10412.   Dm_TextMode = $00000004;   { removed in 4.0 SDK }
  10413.   DmDisplayFlags_TextMode     = $00000004;
  10414.  
  10415.   { ICM methods }
  10416.   DmIcmMethod_None   = 1;     { ICM disabled  }
  10417.   DmIcmMethod_System = 2;     { ICM handled by system  }
  10418.   DmIcmMethod_Driver = 3;     { ICM handled by driver  }
  10419.   DmIcmMethod_Device = 4;     { ICM handled by device  }
  10420.  
  10421.   DmIcmMethod_User = $100;    { Device-specific methods start here  }
  10422.  
  10423.   { ICM Intents }
  10424.   DmIcm_Saturate    = 1;     { Maximize color saturation  }
  10425.   DmIcm_Contrast    = 2;     { Maximize color contrast  }
  10426.   DmIcm_ColorMetric = 3;     { Use specific color metric  }
  10427.  
  10428.   DmIcm_User = $100;     { Device-specific intents start here  }
  10429.  
  10430.  
  10431.   { Media types }
  10432.   DmMedia_Standard     = 1;     { Standard paper  }
  10433.   DmMedia_Transparency = 2;     { Transparency  }
  10434.   DmMedia_Glossy       = 3;     { Glossy paper  }
  10435.  
  10436.   DmMedia_User = $100;     { Device-specific media start here  }
  10437.  
  10438.  
  10439.   { Dither types }
  10440.   DmDither_None      = 1;     { No dithering  }
  10441.   DmDither_Coarse    = 2;     { Dither with a coarse brush  }
  10442.   DmDither_Fine      = 3;     { Dither with a fine brush  }
  10443.   DmDither_LineArt   = 4;     { LineArt dithering  }
  10444.   DmDither_GrayScale = 5;     { Device does grayscaling  }
  10445.  
  10446.   DmDither_User = 256;        { Device-specific dithers start here  }
  10447.  
  10448.  
  10449. { GetRegionData / ExtCreateRegion }
  10450.  
  10451. //  RDH_Rectangles = 1;
  10452.  
  10453. type
  10454.  
  10455.   PABCFloat = ^TABCFloat;
  10456.   TABCFloat = packed record
  10457.     abcfA: Single;
  10458.     abcfB: Single;
  10459.     abcfC: Single;
  10460.   end;
  10461.  
  10462. type
  10463.   PPolyText = ^TPolyText;
  10464.   TPolyText = packed record
  10465.     x: Integer;
  10466.     y: Integer;
  10467.     n: UInt;
  10468.     PAnsiChar: PChar;
  10469.     uiFlags: UInt;
  10470.     rcl: TRect;
  10471.     pdx: PINT;
  10472.   end;
  10473.  
  10474. const
  10475.   { GetGlyphOutline constants }
  10476.  
  10477.   GGO_Gray2_Bitmap = 4;
  10478.   GGO_Gray4_Bitmap = 5;
  10479.   GGO_Gray8_Bitmap = 6;
  10480.   GGO_Glyph_Index = $80;
  10481.  
  10482. const
  10483.   GCP_DBCS = 1;
  10484.   GCP_Reorder = 2;
  10485.   GCP_UseKerning = 8;
  10486.   GCP_GlyphShape = $10;
  10487.   GCP_Ligate = 32;
  10488.   GCP_GlyphIndexing = $0080;
  10489.  
  10490.   GCP_Diacritic = $100;
  10491.   GCP_Kashida = $400;
  10492.   GCP_Error = $8000;
  10493.   FLI_Mask = 4155;
  10494.  
  10495.   GCP_Justify = $10000;
  10496.   GCP_NoDiacritics = $00020000;
  10497.  
  10498.   FLI_Glyphs = $40000;
  10499.   GCP_Classin = $80000;
  10500.   GCP_MaxExtent = $100000;
  10501.   GCP_JustifyIn = $200000;
  10502.   GCP_DisplayZwg = $400000;
  10503.   GCP_SymSwapOff = $800000;
  10504.   GCP_NumericOverride = $1000000;
  10505.   GCP_NeutralOverride = $2000000;
  10506.   GCP_NumericsLatin = $4000000;
  10507.   GCP_NumericsLocal = $8000000;
  10508.  
  10509.   GcpClass_Latin = 1;
  10510.   GcpClass_Hebrew = 2;
  10511.   GcpClass_Arabic = 2;
  10512.   GcpClass_Neutral = 3;
  10513.   GcpClass_LocalNumber = 4;
  10514.   GcpClass_LatinNumber = 5;
  10515.   GcpClass_LatinNumericTerminator = 6;
  10516.   GcpClass_LatinNumericSeparator = 7;
  10517.   GcpClass_NumericSeparator = 8;
  10518.   GcpClass_PreboundRtl = $80;
  10519.   GcpClass_PreboundLtr = $40;
  10520.   GcpClass_PostboundLtr        = $20;
  10521.   GcpClass_PostboundRtl        = $10;
  10522.  
  10523.   GcpGlyph_LinkBefore          = $8000;
  10524.   GcpGlyph_LinkAfter           = $4000;
  10525.  
  10526.  
  10527. type
  10528.   PGCPResults = ^TGCPResults;
  10529.   TGCPResults = packed record
  10530.     lStructSize: DWord;
  10531.     lpOutString: PChar;
  10532.     lpOrder: PUINT;
  10533.     lpDx: PINT;
  10534.     lpCaretPos: PINT;
  10535.     lpClass: PChar;
  10536.     lpGlyphs: PUINT;
  10537.     nGlyphs: UInt;
  10538.     nMaxFit: Integer;
  10539.   end;
  10540.  
  10541. type
  10542.   { Pixel format descriptor }
  10543.   PPixelFormatDescriptor = ^TPixelFormatDescriptor;
  10544.   TPixelFormatDescriptor = packed record
  10545.     nSize: Word;
  10546.     nVersion: Word;
  10547.     dwFlags: DWord;
  10548.     iPixelType: Byte;
  10549.     cColorBits: Byte;
  10550.     cRedBits: Byte;
  10551.     cRedShift: Byte;
  10552.     cGreenBits: Byte;
  10553.     cGreenShift: Byte;
  10554.     cBlueBits: Byte;
  10555.     cBlueShift: Byte;
  10556.     cAlphaBits: Byte;
  10557.     cAlphaShift: Byte;
  10558.     cAccumBits: Byte;
  10559.     cAccumRedBits: Byte;
  10560.     cAccumGreenBits: Byte;
  10561.     cAccumBlueBits: Byte;
  10562.     cAccumAlphaBits: Byte;
  10563.     cDepthBits: Byte;
  10564.     cStencilBits: Byte;
  10565.     cAuxBuffers: Byte;
  10566.     iLayerType: Byte;
  10567.     bReserved: Byte;
  10568.     dwLayerMask: DWord;
  10569.     dwVisibleMask: DWord;
  10570.     dwDamageMask: DWord;
  10571.   end;
  10572.  
  10573. const
  10574.   { pixel types }
  10575.   PFD_Type_RGBA = 0;
  10576.   PFD_Type_ColorIndex = 1;
  10577.  
  10578.   { layer types }
  10579.   PFD_Main_Plane = 0;
  10580.   PFD_Overlay_Plane = 1;
  10581.   PFD_Underlay_Plane = -1;
  10582.  
  10583.   { TPixelFormatDescriptor flags }
  10584.   PFD_DoubleBuffer                = $00000001;
  10585.   PFD_Stereo                      = $00000002;
  10586.   PFD_Draw_to_Window              = $00000004;
  10587.   PFD_Draw_to_Bitmap              = $00000008;
  10588.   PFD_Support_GDI                 = $00000010;
  10589.   PFD_Support_OpenGl              = $00000020;
  10590.   PFD_Generic_Format              = $00000040;
  10591.   PFD_Need_Palette                = $00000080;
  10592.   PFD_Need_System_Palette         = $00000100;
  10593.   PFD_Swap_Exchange               = $00000200;
  10594.   PFD_Swap_Copy                   = $00000400;
  10595.   PFD_Swap_Layer_Buffers          = $00000800;
  10596.   PFD_Generic_Accelerated         = $00001000;
  10597.  
  10598.   { TPixelFormatDescriptor flags for use in ChoosePixelFormat only }
  10599.   PFD_Depth_DontCare              = $20000000;
  10600.   PFD_DoubleBuffer_DontCare       = $40000000;
  10601.   PFD_Stereo_DontCare             = $80000000;
  10602.  
  10603. type
  10604.   TFNOldFontEnumProc = TFarProc;
  10605.  
  10606. function CancelDC(DC: HDC): Bool;
  10607. function ChoosePixelFormat(DC: HDC; P2: PPixelFormatDescriptor): Integer;
  10608. function CreateDiscardableBitmap(DC: HDC; P2, P3: Integer): HBitmap;
  10609. function CreateDIBPatternBrush(P1: HGLOBAL; P2: UInt): HBRUSH;
  10610. function CreateScalableFontResource(P1: DWord; P2,P3,P4: PChar): Bool;
  10611. function DescribePixelFormat(DC: HDC; P2: Integer; P3: UInt; var P4: TPixelFormatDescriptor): Bool;
  10612.  
  10613. { define types of pointers to ExtDeviceMode() and DeviceCapabilities()
  10614.   functions for Win 3.1 compatibility }
  10615.  
  10616. type
  10617.   TFNDevCaps = function(DeviceName, Port: LPSTR;
  10618.     Index: UInt; Output: LPSTR; var DevMode: TDeviceMode): DWord;
  10619.  
  10620. const
  10621.   { device capabilities indices }
  10622.   DC_Collate = 22;
  10623.  
  10624.  
  10625.   { bit fields of the return value (DWord) for DC_TRUETYPE }
  10626.   DCTT_Bitmap = 1;
  10627.   DCTT_Download = 2;
  10628.   DCTT_SubDev = 4;
  10629.   DCTT_Download_Outline = 8;
  10630.  
  10631.  
  10632.   { return values for DC_Binadjust }
  10633.   DCBA_FaceUpNone = 0;
  10634.   DCBA_FaceUpCenter = 1;
  10635.   DCBA_FaceUpLeft = 2;
  10636.   DCBA_FaceUpRight = 3;
  10637.   DCBA_FaceDownNone = $100;
  10638.   DCBA_FaceDownCenter = 257;
  10639.   DCBA_FaceDownLeft = 258;
  10640.   DCBA_FaceDownRight = 259;
  10641.  
  10642.  
  10643. function DeviceCapabilitiesEx(pDriverName, pDeviceName, pPort: PChar;
  10644.   iIndex: Integer; pOutput: PChar; DevMode: PDeviceMode): Integer;
  10645.  
  10646. function DrawEscape(DC: HDC; P2, P3: Integer; P4: LPCSTR): Bool;
  10647. function EnumFontFamiliesEx(DC: HDC; var P2: TLogFont;
  10648.   P3: TFNFontEnumProc; P4: lParam; P5: DWord): Bool;
  10649. function ExtEscape(DC: HDC; P2, P3: Integer;
  10650.   const P4: LPCSTR; P5: Integer; P6: LPSTR): Integer;
  10651. function GetCharWidth32(DC: HDC; P2, P3: UInt; const Widths): Bool;
  10652. function GetCharWidthFloat(DC: HDC; P2, P3: UInt; const Widths): Bool;
  10653. function GetCharABCWidthsFloat(DC: HDC; P2, P3: UInt; const ABCFloatSturcts): Bool;
  10654. function GetMetaRgn(DC: HDC; rgn: HRGN): Integer;
  10655. function GetFontData(DC: HDC; P2, P3: DWord; P4: Pointer; P5: DWord): DWord;
  10656. function GetGlyphOutline(DC: HDC; P2, P3: UInt;
  10657.   const P4: TGlyphMetrics; P5: DWord; P6: Pointer; const P7: TMat2): DWord;
  10658. function GetPixelFormat(DC: HDC): Integer;
  10659. function GetSystemPaletteUse(DC: HDC): UInt;
  10660. function GetTextExtentExPoint(DC: HDC; P2: PChar;
  10661.   P3, P4: Integer; var P5, P6: Integer; var P7: TSize): Bool;
  10662. function GetTextCharset(hdc: HDC): Integer;
  10663. function GetTextCharsetInfo(hdc: HDC; lpSig: PFontSignature; dwFlags: DWord): Bool;
  10664. function TranslateCharsetInfo(var lpSrc: DWord; var lpCs: TCharsetInfo; dwFlags: DWord): Bool;
  10665. function GetFontLanguageInfo(DC: HDC): DWord;
  10666. function GetCharacterPlacement(DC: HDC; P2: PChar; P3, P4: Bool;
  10667.   var P5: TGCPResults; P6: DWord): DWord;
  10668. function PlgBlt(DC: HDC; const PointsArray; P3: HDC;
  10669.   P4, P5, P6, P7: Integer; P8: HBitmap; P9, P10: Integer): Bool;
  10670. function SetMetaRgn(DC: HDC): Integer;
  10671. function SetPixelV(DC: HDC; X, Y: Integer; Color: TColorRef): Bool;
  10672. function SetPixelFormat(DC: HDC; P2: Integer; P3: PPixelFormatDescriptor): Bool;
  10673. function SetSystemPaletteUse(DC: HDC; P2: UInt): UInt;
  10674. function UpdateColors(DC: HDC): Bool;
  10675.  
  10676. { Enhanced Metafile Function Declarations }
  10677.  
  10678. function GetEnhMetaFileDescription(P1: HENHMETAFILE; P2: UInt; P3: PChar): UInt;
  10679. function GetEnhMetaFilePixelFormat(P1: HENHMETAFILE; P2: Cardinal;
  10680.   var P3: TPixelFormatDescriptor): UInt;
  10681. function PlayEnhMetaFileRecord(DC: HDC; var P2: THandleTable;
  10682.   const P3: TEnhMetaRecord; P4: UInt): Bool;
  10683. function GdiComment(DC: HDC; P2: UInt; P3: PChar): Bool;
  10684.  
  10685. { new GDI }
  10686.  
  10687. type
  10688.   PDIBSection = ^TDIBSection;
  10689.   TDIBSection = packed record
  10690.     dsBm: TBitmap;
  10691.     dsBmih: TBitmapInfoHeader;
  10692.     dsBitfields: array[0..2] of DWord;
  10693.     dshSection: THandle;
  10694.     dsOffset: DWord;
  10695.   end;
  10696.  
  10697. function CombineTransform(var P1: TXForm; const P2, P3: TXForm): Bool;
  10698. function CreateDIBSection(DC: HDC; const P2: TBitmapInfo; P3: UInt;
  10699.   var P4: Pointer; P5: THandle; P6: DWord): HBitmap;
  10700. function GetDIBColorTable(DC: HDC; P2, P3: UInt; var RGBQuadStructs): UInt;
  10701. function SetDIBColorTable(DC: HDC; P2, P3: UInt; var RGBQuadSTructs): UInt;
  10702.  
  10703. const
  10704.   { Flags value for ColorAdjustment }
  10705.   CA_Negative = 1;
  10706.   CA_Log_Filter = 2;
  10707.  
  10708.   { IlluminantIndex values }
  10709.   Illuminant_Device_Default = 0;
  10710.   Illuminant_A = 1;
  10711.   Illuminant_B = 2;
  10712.   Illuminant_C = 3;
  10713.   Illuminant_D50 = 4;
  10714.   Illuminant_D55 = 5;
  10715.   Illuminant_D65 = 6;
  10716.   Illuminant_D75 = 7;
  10717.   Illuminant_F2 = 8;
  10718.  
  10719.   Illuminant_Max_Index = Illuminant_F2;
  10720.   Illuminant_Tungsten = Illuminant_A;
  10721.   Illuminant_Daylight = Illuminant_C;
  10722.   Illuminant_Fluorescent = Illuminant_F2;
  10723.   Illuminant_NTSC = Illuminant_C;
  10724.  
  10725.   { Min and max for RedGamma, GreenGamma, BlueGamma }
  10726.   RGB_Gamma_Min = 02500;
  10727.   RGB_Gamma_Max = 65000;
  10728.  
  10729.   { Min and max for ReferenceBlack and ReferenceWhite }
  10730.   Reference_White_Min = 6000;
  10731.   Reference_White_Max = 10000;
  10732.   Reference_Black_Min = 0;
  10733.   Reference_Black_Max = 4000;
  10734.  
  10735.   { Min and max for Contrast, Brightness, Colorfulness, RedGreenTint }
  10736.   Color_Adj_Min = -100;
  10737.   Color_Adj_Max = 100;
  10738.  
  10739. const
  10740.   DI_APPBANDING = 1;
  10741.  
  10742. function SetAbortProc(DC: HDC; lpAbortProc: TFNAbortProc): Integer;
  10743. function SelectClipPath(DC: HDC; Mode: Integer): Bool;
  10744. function PolyTextOut(DC: HDC; const PolyTextArray; Strings: Integer): Bool;
  10745.  
  10746. const
  10747.   FontMapper_Max = 10;
  10748.  
  10749. const
  10750.   ICM_Off = 1;
  10751.   ICM_On = 2;
  10752.   ICM_Query = 3;
  10753.  
  10754.   ICM_AddProfile = 1; { removed in 4.0 SDK }
  10755.   ICM_DeleteProfile = 2; { removed in 4.0 SDK }
  10756.   ICM_QueryProfile = 3; { removed in 4.0 SDK }
  10757.   ICM_SetDefaultProfile = 4; { removed in 4.0 SDK }
  10758.   ICM_RegisterIcMatcher = 5; { removed in 4.0 SDK }
  10759.   ICM_UnregisterIcMatcher = 6; { removed in 4.0 SDK }
  10760.   ICM_QueryMatch = 7; { removed in 4.0 SDK }
  10761.  
  10762. function SetICMMode(DC: HDC; Mode: Integer): Integer;
  10763. function CheckColorsInGamut(DC: HDC; var RGBQuads, Results; Count: DWord): Bool;
  10764. function GetColorSpace(DC: HDC): THandle;
  10765. function GetLogColorSpace(P1: HCOLORSPACE; var ColorSpace: TLogColorSpace; Size: DWord): Bool;
  10766. function CreateColorSpace(var ColorSpace: TLogColorSpace): HCOLORSPACE;
  10767. function SetColorSpace(DC: HDC; ColorSpace: HCOLORSPACE): Bool;
  10768. function DeleteColorSpace(ColorSpace: HCOLORSPACE): Bool;
  10769. function GetICMProfile(DC: HDC; var Size: DWord; Name: PChar): Bool;
  10770. function SetICMProfile(DC: HDC; Name: PChar): Bool;
  10771. function GetDeviceGammaRamp(DC: HDC; var Ramp): Bool;
  10772. function SetDeviceGammaRamp(DC: HDC; var Ramp): Bool;
  10773. function ColorMatchToTarget(DC: HDC; Target: HDC; Action: DWord): Bool;
  10774.  
  10775. type
  10776.   TFNICMEnumProc = TFarProc;
  10777.  
  10778. function EnumICMProfiles(DC: HDC; ICMProc: TFNICMEnumProc; P3: lParam): Integer;
  10779.  
  10780. const
  10781.   EMR_GlsRecord = 102;
  10782.   EMR_GlsBoundedRecord = 103;
  10783.   EMR_PixelFormat = 104;
  10784.  
  10785. type
  10786.   TEMRAbortPath = TAbortPath;
  10787.   PEMRAbortPath = PAbortPath;
  10788.   TEMRBeginPath = TAbortPath;
  10789.   PEMRBeginPath = PAbortPath;
  10790.   TEMREndPath = TAbortPath;
  10791.   PEMREndPath = PAbortPath;
  10792.   TEMRCloseFigure = TAbortPath;
  10793.   PEMRCloseFigure = PAbortPath;
  10794.   TEMRFlattenPath = TAbortPath;
  10795.   PEMRFlattenPath = PAbortPath;
  10796.   TEMRWidenPath = TAbortPath;
  10797.   PEMRWidenPath = PAbortPath;
  10798.   TEMRSetMetaRgn = TAbortPath;
  10799.   PEMRSetMetaRgn = PAbortPath;
  10800.   TEMRSaveDC = TAbortPath;
  10801.   PEMRSaveDC = PAbortPath;
  10802.   TEMRRealizePalette = TAbortPath;
  10803.   PEMRRealizePalette = PAbortPath;
  10804.  
  10805.   TEMRSetBkMode = TEMRSelectClipPath;
  10806.   PEMRSetBkMode = PEMRSelectClipPath;
  10807.   TEMRSetMapMode = TEMRSelectClipPath;
  10808.   PEMRSetMapMode = PEMRSelectClipPath;
  10809.   TEMRSetPolyFillMode = TEMRSelectClipPath;
  10810.   PEMRSetPolyFillMode = PEMRSelectClipPath;
  10811.   TEMRSetRop2 = TEMRSelectClipPath;
  10812.   PEMRSetRop2 = PEMRSelectClipPath;
  10813.   TEMRSetStretchBltMode = TEMRSelectClipPath;
  10814.   PEMRSetStretchBltMode = PEMRSelectClipPath;
  10815.   TEMRSetICMMode = TEMRSelectClipPath;
  10816.   PEMRSetICMMode = PEMRSelectClipPath;
  10817.   TEMRSetTextAlign = TEMRSelectClipPath;
  10818.   PEMRSetTextAlign = PEMRSelectClipPath;
  10819.  
  10820.   EMRRectangle = TEMREllipse;
  10821.   PEMRRectangle = PEMREllipse;
  10822.  
  10823.   EMRArcTo = TEMRArc;
  10824.   PEMRArcTo = PEMRArc;
  10825.   EMRChord = TEMRArc;
  10826.   PEMRChord = PEMRArc;
  10827.   EMRPie = TEMRArc;
  10828.   PEMRPie = PEMRArc;
  10829.  
  10830.   PEMRExtCreateFontIndirect = ^TEMRExtCreateFontIndirect;
  10831.   TEMRExtCreateFontIndirect = record
  10832.     emr: TEMR;
  10833.     ihFont: DWord;     { Font handle index}
  10834.     elfw: TExtLogFont;
  10835.   end;
  10836.  
  10837.   PEMRCreateColorSpace = ^TEMRCreateColorSpace;
  10838.   TEMRCreateColorSpace = packed record
  10839.     emr: TEMR;
  10840.     ihCS: DWord;          { ColorSpace handle index}
  10841.     lcs: TLogColorSpace;
  10842.   end;
  10843.  
  10844.   PEMRGLSRecord = ^TEMRGLSRecord;
  10845.   TEMRGLSRecord = packed record
  10846.     emr: TEMR;
  10847.     cbData: DWord;              { Size of data in bytes }
  10848.     Data: packed array[0..0] of Byte;
  10849.   end;
  10850.  
  10851.   PEMRGLSBoundedRecord = ^TEMRGLSBoundedRecord;
  10852.   TEMRGLSBoundedRecord = packed record
  10853.     emr: TEMR;
  10854.     rclBounds: TRect;           { Bounds in recording coordinates }
  10855.     cbData: DWord;              { Size of data in bytes }
  10856.     Data: packed array[0..0] of Byte;
  10857.   end;
  10858.  
  10859.   PEMRPixelFormat = ^TEMRPixelFormat;
  10860.   TEMRPixelFormat = packed record
  10861.     emr: TEMR;
  10862.     pfd: TPixelFormatDescriptor;
  10863.   end;
  10864.  
  10865. { OpenGL wgl prototypes}
  10866.  
  10867. function wglCopyContext(P1: HGLRC; P2: HGLRC; P3: Cardinal): Bool;
  10868. function wglCreateContext(DC: HDC): HGLRC;
  10869. function wglCreateLayerContext(P1: HDC; P2: Integer): HGLRC;
  10870. function wglDeleteContext(P1: HGLRC): Bool;
  10871. function wglGetCurrentContext: HGLRC;
  10872. function wglGetCurrentDC: HDC;
  10873. function wglMakeCurrent(DC: HDC; P2: HGLRC): Bool;
  10874. function wglShareLists(P1, P2: HGLRC): Bool;
  10875. function wglUseFontBitmaps(DC: HDC; P2, P3, P4: DWord): Bool;
  10876. function SwapBuffers(DC: HDC): Bool;
  10877.  
  10878. type
  10879.   PPointFloat = ^TPointFloat;
  10880.   TPointFloat = packed record
  10881.     x: Single;
  10882.     y: Single;
  10883.   end;
  10884.  
  10885.   PGlyphMetricsFloat = ^TGlyphMetricsFloat;
  10886.   TGlyphMetricsFloat = packed record
  10887.     gmfBlackBoxX: Single;
  10888.     gmfBlackBoxY: Single;
  10889.     gmfptGlyphOrigin: TPointFloat;
  10890.     gmfCellIncX: Single;
  10891.     gmfCellIncY: Single;
  10892.   end;
  10893.  
  10894. const
  10895.   WGL_FONT_LINES = 0;
  10896.   WGL_FONT_POLYGONS = 1;
  10897.  
  10898. function wglUseFontOutlines(P1: HDC; P2, P3, P4: DWord;
  10899.   P5, P6: Single; P7: Integer; P8: PGlyphMetricsFloat): Bool;
  10900.  
  10901. { Layer plane descriptor }
  10902. type
  10903.   PLayerPlaneDescriptor = ^TLayerPlaneDescriptor;
  10904.   TLayerPlaneDescriptor = packed record   { lpd }
  10905.     nSize: Word;
  10906.     nVersion: Word;
  10907.     dwFlags: DWord;
  10908.     iPixelType: Byte;
  10909.     cColorBits: Byte;
  10910.     cRedBits: Byte;
  10911.     cRedShift: Byte;
  10912.     cGreenBits: Byte;
  10913.     cGreenShift: Byte;
  10914.     cBlueBits: Byte;
  10915.     cBlueShift: Byte;
  10916.     cAlphaBits: Byte;
  10917.     cAlphaShift: Byte;
  10918.     cAccumBits: Byte;
  10919.     cAccumRedBits: Byte;
  10920.     cAccumGreenBits: Byte;
  10921.     cAccumBlueBits: Byte;
  10922.     cAccumAlphaBits: Byte;
  10923.     cDepthBits: Byte;
  10924.     cStencilBits: Byte;
  10925.     cAuxBuffers: Byte;
  10926.     iLayerPlane: Byte;
  10927.     bReserved: Byte;
  10928.     crTransparent: TColorRef;
  10929.   end;
  10930.  
  10931. { TLayerPlaneDescriptor flags }
  10932. const
  10933.   LPD_DoubleBuffer = $00000001;
  10934.   LPD_Stereo = $00000002;
  10935.   LPD_Support_GDI = $00000010;
  10936.   LPD_Support_OpenGL = $00000020;
  10937.   LPD_Share_Depth = $00000040;
  10938.   LPD_Share_Stencil = $00000080;
  10939.   LPD_Share_Accum = $00000100;
  10940.   LPD_Swap_Exchange = $00000200;
  10941.   LPD_Swap_Copy = $00000400;
  10942.   LPD_Transparent = $00001000;
  10943.  
  10944.   LPD_TYPE_RGBA = 0;
  10945.   LPD_TYPE_COLORINDEX = 1;
  10946.  
  10947. { wglSwapLayerBuffers flags }
  10948.   WGL_Swap_Main_Plane = $00000001;
  10949.   WGL_Swap_Overlay1 = $00000002;
  10950.   WGL_Swap_Overlay2 = $00000004;
  10951.   WGL_Swap_Overlay3 = $00000008;
  10952.   WGL_Swap_Overlay4 = $00000010;
  10953.   WGL_Swap_Overlay5 = $00000020;
  10954.   WGL_Swap_Overlay6 = $00000040;
  10955.   WGL_Swap_Overlay7 = $00000080;
  10956.   WGL_Swap_Overlay8 = $00000100;
  10957.   WGL_Swap_Overlay9 = $00000200;
  10958.   WGL_Swap_Overlay10 = $00000400;
  10959.   WGL_Swap_Overlay11 = $00000800;
  10960.   WGL_Swap_Overlay12 = $00001000;
  10961.   WGL_Swap_Overlay13 = $00002000;
  10962.   WGL_Swap_Overlay14 = $00004000;
  10963.   WGL_Swap_Overlay15 = $00008000;
  10964.   WGL_Swap_Underlay1 = $00010000;
  10965.   WGL_Swap_Underlay2 = $00020000;
  10966.   WGL_Swap_Underlay3 = $00040000;
  10967.   WGL_Swap_Underlay4 = $00080000;
  10968.   WGL_Swap_Underlay5 = $00100000;
  10969.   WGL_Swap_Underlay6 = $00200000;
  10970.   WGL_Swap_Underlay7 = $00400000;
  10971.   WGL_Swap_Underlay8 = $00800000;
  10972.   WGL_Swap_Underlay9 = $01000000;
  10973.   WGL_Swap_Underlay10 = $02000000;
  10974.   WGL_Swap_Underlay11 = $04000000;
  10975.   WGL_Swap_Underlay12 = $08000000;
  10976.   WGL_Swap_Underlay13 = $10000000;
  10977.   WGL_Swap_Underlay14 = $20000000;
  10978.   WGL_Swap_Underlay15 = $40000000;
  10979.  
  10980. function wglDescribeLayerPlane(P1: HDC; P2, P3: Integer; P4: Cardinal;
  10981.   var P5: TLayerPlaneDescriptor): Bool;
  10982. function wglSetLayerPaletteEntries(P1: HDC; P2, P3, P4: Integer;
  10983.   var pcr): Integer;
  10984. function wglGetLayerPaletteEntries(P1: HDC; P2, P3, P4: Integer;
  10985.   var pcr): Integer;
  10986. function wglRealizeLayerPalette(P1: HDC; P2: Integer; P3: Bool): Bool;
  10987. function wglSwapLayerBuffers(P1: HDC; P2: Cardinal): Bool;
  10988.  
  10989.  
  10990. { Translated from WINUSER.H }
  10991.  
  10992. type
  10993.   PMENUTEMPLATE = Pointer;
  10994.   va_list = PChar;
  10995.  
  10996.   TFNGrayStringProc = TFarProc;
  10997.   TFNSendAsyncProc = TFarProc;
  10998.   TFNDrawStateProc = TFarProc;
  10999.  
  11000. type
  11001.   TFNEditWordBreakProc = TFarProc;
  11002.   TFNNameEnumProc = TFarProc;
  11003.   TFNWinStaEnumProc = TFNNameEnumProc;
  11004.   TFNDeskTopEnumProc = TFNNameEnumProc;
  11005.  
  11006. const
  11007.   { Predefined Resource Types }
  11008.   Difference = 11;
  11009.  
  11010.   RT_Group_Cursor = MakeIntResource(DWord(RT_Cursor + Difference));
  11011.   RT_Group_Icon   = MakeIntResource(DWord(RT_Icon + Difference));
  11012.   RT_Version      = MakeIntResource(16);
  11013.   RT_PlugPlay     = MakeIntResource(19);
  11014.   RT_VXD          = MakeIntResource(20);
  11015.   RT_AniCursor    = MakeIntResource(21);
  11016.   RT_AniIcon      = MakeIntResource(22);
  11017.  
  11018. const
  11019.   { Identifiers for the WM_ShowWindow message }
  11020.   SW_ParentClosing = 1;
  11021.   SW_OtherZoom = 2;
  11022.   SW_ParentOpening = 3;
  11023.   SW_OtherUnzoom = 4;
  11024.  
  11025.   { WM_KeyUpDownChar HiWord(lParam) flags }
  11026.   KF_Extended = $100;
  11027.   KF_DlgMode = $800;
  11028.   KF_MenuMode = $1000;
  11029.   KF_AltDown = $2000;
  11030.   KF_Repeat = $4000;
  11031.   KF_Up = $8000;
  11032.  
  11033.   { Virtual Keys, Standard Set }
  11034.   VK_Kana = 21;
  11035.   VK_Hangul = 21;
  11036.   VK_Junja = 23;
  11037.   VK_Final = 24;
  11038.   VK_Hanja = 25;
  11039.   VK_Kanji = 25;
  11040.   VK_Convert = 28;
  11041.   VK_NonConvert = 29;
  11042.   VK_Accept = 30;
  11043.   VK_ModeChange = 31;
  11044. { VK_0 thru VK_9 are the same as ASCII '0' thru '9' ($30 - $39) }
  11045. { VK_A thru VK_Z are the same as ASCII 'A' thru 'Z' ($41 - $5A) }
  11046.   VK_ProcessKey = 229;
  11047.   WH_CallWndProcRet = 12;
  11048.   WH_MinHook = WH_Min;
  11049.   WH_MaxHook = WH_Max;
  11050.  
  11051.   { CBT Hook Codes }
  11052.   HCBT_MoveSize = 0;
  11053.   HCBT_MinMax = 1;
  11054.   HCBT_QS = 2;
  11055.   HCBT_CreateWnd = 3;
  11056.   HCBT_DestroyWnd = 4;
  11057.   HCBT_Activate = 5;
  11058.   HCBT_ClickSkipped = 6;
  11059.   HCBT_KeySkipped = 7;
  11060.   HCBT_SysCommand = 8;
  11061.   HCBT_SetFocus = 9;
  11062.  
  11063.  
  11064. type
  11065.   { HCBT_CREATEWND parameters pointed to by lParam }
  11066.   PCBTCreateWnd = ^TCBTCreateWnd;
  11067.   TCBTCreateWnd = packed record
  11068.     lpcs: PCreateStruct;
  11069.     hwndInsertAfter: hWnd;
  11070.   end;
  11071.  
  11072.   { HCBT_ACTIVATE structure pointed to by lParam }
  11073.   PCBTActivateStruct = ^TCBTActivateStruct;
  11074.   TCBTActivateStruct = packed record
  11075.     fMouse: Bool;
  11076.     hWndActive: hWnd;
  11077.   end;
  11078.  
  11079. const
  11080.   { WH_MsgFilter Filter Proc Codes }
  11081.  
  11082.   { Shell support }
  11083.   HShell_WindowCreated = 1;
  11084.   HShell_WindowDestroyed = 2;
  11085.   HShell_ActivateShellWindow = 3;
  11086.   HShell_WindowActivated = 4;
  11087.   HShell_GetMinRect = 5;
  11088.   HShell_Redraw = 6;
  11089.   HShell_Taskman = 7;
  11090.   HShell_Language = 8;
  11091.  
  11092.  
  11093. type
  11094.   { Message structure used by WH_CallWndProcRet }
  11095.   PCWPRetStruct = ^TCWPRetStruct;
  11096.   TCWPRetStruct = packed record
  11097.     lResult: lResult;
  11098.     lParam: lParam;
  11099.     wParam: wParam;
  11100.     message: UInt;
  11101.     hWnd: hWnd;
  11102.   end;
  11103.  
  11104.   { Structure used by WH_Hardware }
  11105.   PHardwareHookStruct = ^THardwareHookStruct;
  11106.   THardwareHookStruct = packed record
  11107.     hWnd: hWnd;
  11108.     message: UInt;
  11109.     wParam: wParam;
  11110.     lParam: lParam;
  11111.   end;
  11112.  
  11113. const
  11114.   { Keyboard Layout API }
  11115.   HKL_Prev = 0;
  11116.   HKL_Next = 1;
  11117.  
  11118.   KLF_Activate = 1;
  11119.   KLF_Substitute_Ok = 2;
  11120.   KLF_UnloadPrevious = 4;
  11121.   KLF_Reorder = 8;
  11122.   KLF_ReplaceLang = $10;
  11123.   KLF_NoTellShell = 128;
  11124.  
  11125.   { Size of KeyboardLayoutName (number of characters), including nul terminator }
  11126.   KL_NameLength = 9;
  11127.  
  11128.  
  11129. function LoadKeyboardLayout(pwszKLID: PChar; Flags: UInt): HKL;
  11130. function ActivateKeyboardLayout(hkl: HKL; Flags: UInt): HKL;
  11131. function UnloadKeyboardLayout(hkl: HKL): Bool;
  11132. function ToUnicodeEx(wVirtKey, wScanCode: UInt; lpKeyState: PByte;
  11133.   pwszBuff: pChar; cchBuff: Integer; wFlags: UInt; dwhkl: HKL): Integer;
  11134. function GetKeyboardLayoutName(pwszKLID: PChar): Bool;
  11135. function GetKeyboardLayoutList(nBuff: Integer; var List): UInt;
  11136. function GetKeyboardLayout(dwLayout: DWord): HKL;
  11137.  
  11138.  
  11139. const
  11140.   { Desktop-specific access flags }
  11141.   Desktop_ReadObjects = 1;
  11142.   Desktop_CreateWindow = 2;
  11143.   Desktop_CreateMenu = 4;
  11144.   Desktop_HookControl = 8;
  11145.   Desktop_JournalRecord = $10;
  11146.   Desktop_JournalPlayback = $20;
  11147.   Desktop_Enumerate = $40;
  11148.   Desktop_WriteObjects = 128;
  11149.   Desktop_SwitchDesktop = $100;
  11150.  
  11151.   { Desktop-specific control flags }
  11152.   DF_AllowOtherAccountHook = 1;
  11153.  
  11154.  
  11155. function CreateDesktop(lpszDesktop, lpszDevice: PChar;
  11156.   pDevmode: PDeviceMode; dwFlags: DWord; dwDesiredAccess:
  11157.   DWord; lpsa: PSecurityAttributes): HDESK;
  11158. function OpenDesktop(lpszDesktop: PChar; dwFlags: DWord; fInherit: Bool;
  11159.   dwDesiredAccess: DWord): HDESK;
  11160. function EnumDesktops(hwinsta: HWINSTA; lpEnumFunc: TFNDeskTopEnumProc; lParam: lParam): Bool;
  11161. function OpenInputDesktop(dwFlags: DWord; fInherit: Bool; dwDesiredAccess: DWord): HDESK;
  11162. function EnumDesktopWindows(hDesktop: HDESK; lpfn: TFNWndEnumProc; lParam: lParam): Bool;
  11163. function SwitchDesktop(hDesktop: HDESK): Bool;
  11164. function SetThreadDesktop(hDesktop: HDESK): Bool;
  11165. function CloseDesktop(hDesktop: HDESK): Bool;
  11166. function GetThreadDesktop(dwThreadId: DWord): HDESK;
  11167.  
  11168. const
  11169.   { Windowstation-specific access flags }
  11170.   WinSta_EnumDesktops = 1;
  11171.   WinSta_ReadAttributes = 2;
  11172.   WinSta_AccessClipboard = 4;
  11173.   WinSta_CreateDesktop = 8;
  11174.   WinSta_WriteAttributes = $10;
  11175.   WinSta_AccessGlobalAtoms = $20;
  11176.   WinSta_ExitWindows = $40;
  11177.   WinSta_Enumerate = $100;
  11178.   WinSta_ReadScreen = $200;
  11179.  
  11180.   { Windowstation-specific attribute flags }
  11181.   WSF_Visible = 1;
  11182.  
  11183. function CreateWindowStation(lpwinsta: PChar; dwReserved, dwDesiredAccess: DWord;
  11184.   lpsa: PSecurityAttributes): HWINSTA;
  11185. function OpenWindowStation(lpszWinSta: PChar; fInherit: Bool;
  11186.   dwDesiredAccess: DWord): HWINSTA;
  11187. function EnumWindowStations(lpEnumFunc: TFNWinStaEnumProc; lParam: lParam): Bool;
  11188. function CloseWindowStation(hWinSta: HWINSTA): Bool;
  11189. function SetProcessWindowStation(hWinSta: HWINSTA): Bool;
  11190. function GetProcessWindowStation: HWINSTA;
  11191. function SetUserObjectSecurity(hObj: THandle; var pSIRequested: DWord;
  11192.   pSID: PSecurityDescriptor): Bool;
  11193. function GetUserObjectSecurity(hObj: THandle; var pSIRequested: DWord;
  11194.   pSID: PSecurityDescriptor; nLength: DWord; var lpnLengthNeeded: DWord): Bool;
  11195.  
  11196. const
  11197.   UOI_Flags = 1;
  11198.   UOI_Name = 2;
  11199.   UOI_Type = 3;
  11200.   UOI_User_SID = 4;
  11201.  
  11202. type
  11203.   PUserObjectFlags = ^TUserObjectFlags;
  11204.   TUserObjectFlags = packed record
  11205.     fInherit: Bool;
  11206.     fReserved: Bool;
  11207.     dwFlags: DWord;
  11208.   end;
  11209.  
  11210. function GetUserObjectInformation(hObj: THandle; nIndex: Integer; pvInfo: Pointer;
  11211.   nLength: DWord; var lpnLengthNeeded: DWord): Bool;
  11212. function SetUserObjectInformation(hObj: THandle; nIndex: Integer;
  11213.   pvInfo: Pointer; nLength: DWord): Bool;
  11214.  
  11215. type
  11216.   PWndClassEx = ^TWndClassEx;
  11217.   TWndClassEx = packed record
  11218.     cbSize: UINT;
  11219.     style: UINT;
  11220.     lpfnWndProc: TFNWndProc;
  11221.     cbClsExtra: Integer;
  11222.     cbWndExtra: Integer;
  11223.     hInstance: HINST;
  11224.     hIcon: HICON;
  11225.     hCursor: HCURSOR;
  11226.     hbrBackground: HBRUSH;
  11227.     lpszMenuName: PChar;
  11228.     lpszClassName: PChar;
  11229.     hIconSm: HICON;
  11230.   end;
  11231.  
  11232. function MakeWParam(L,H: SmallWord): wParam; inline;
  11233. begin
  11234.   Result := L or H shl 16;
  11235. end;
  11236.  
  11237. function MakeLParam(L,H: SmallWord): lParam; inline;
  11238. begin
  11239.   Result := L or H shl 16;
  11240. end;
  11241.  
  11242. function MakeLResult(L,H: SmallWord): lResult; inline;
  11243. begin
  11244.   Result := L or H shl 16;
  11245. end;
  11246.  
  11247. const
  11248. { Window field offsets for GetWindowLong() }
  11249.   GCL_HIconSm = -34;
  11250.  
  11251. const
  11252.   { wParam for WM_Power window message and DRV_Power driver notification }
  11253.   PWR_Ok = 1;
  11254.   PWR_Fail = -1;
  11255.   PWR_SuspendRequest = 1;
  11256.   PWR_SuspendResume = 2;
  11257.   PWR_CriticalResume = 3;
  11258.  
  11259. type
  11260.   { lParam of WM_CopyData message points to... }
  11261.   PCopyDataStruct = ^TCopyDataStruct;
  11262.   TCopyDataStruct = packed record
  11263.     dwData: DWord;
  11264.     cbData: DWord;
  11265.     lpData: Pointer;
  11266.   end;
  11267.  
  11268. const
  11269.   NFR_ANSI = 1;
  11270.   NFR_UniCode = 2;
  11271.   NF_Query = 3;
  11272.   NF_Requery = 4;
  11273.  
  11274.   Wheel_Delta = 120;            { Value for rolling one detent }
  11275.   Wheel_PageScroll = MaxDWord;  { Scroll one page }
  11276.  
  11277.   MenuLoop_Window = 0;
  11278.   MenuLoop_Popup = 1;
  11279.  
  11280. type
  11281.   PMDINextMenu = ^TMDINextMenu;
  11282.   TMDINextMenu = packed record
  11283.     hmenuIn: hMenu;
  11284.     hmenuNext: hMenu;
  11285.     hwndNext: hWnd;
  11286.   end;
  11287.  
  11288. const
  11289.   { wParam for WM_NotifyWow message  }
  11290.  
  11291.   { wParam for WM_Sizing message  }
  11292.   WMSZ_Left = 1;
  11293.   WMSZ_Right = 2;
  11294.   WMSZ_Top = 3;
  11295.   WMSZ_TopLeft = 4;
  11296.   WMSZ_TopRight = 5;
  11297.   WMSZ_Bottom = 6;
  11298.   WMSZ_BottomLeft = 7;
  11299.   WMSZ_BottomRight = 8;
  11300.  
  11301.   { WM_NChitTest and MouseHookStruct Mouse Position Codes }
  11302.   HTObject = 19;
  11303.   HTClose = 20;
  11304.   HTHelp = 21;
  11305.  
  11306.   { WM_SetIcon / WM_GetIcon Type Codes }
  11307.   Icon_Small = 0;
  11308.   Icon_Big = 1;
  11309.  
  11310. type
  11311.   { WM_NcCalcSize parameter structure }
  11312.   PNCCalcSizeParams = ^TNCCalcSizeParams;
  11313.   TNCCalcSizeParams = packed record
  11314.     rgrc: array[0..2] of TRect;
  11315.     lppos: PWindowPos;
  11316.   end;
  11317.  
  11318. const
  11319.   { WM_NcCalcSize "window valid rect" return values }
  11320.   WVR_AlignTop = $10;
  11321.   WVR_AlignLeft = $20;
  11322.   WVR_AlignBottom = $40;
  11323.   WVR_AlignRight = $80;
  11324.   WVR_HRedraw = $100;
  11325.   WVR_VRedraw = $200;
  11326.   WVR_Redraw = (WVR_HRedraw or WVR_VRedraw);
  11327.   WVR_ValidRects = $400;
  11328.  
  11329.   TME_Hover           = $00000001;
  11330.   TME_Leave           = $00000002;
  11331.   TME_Query           = $40000000;
  11332.   TME_Cancel          = $80000000;
  11333.  
  11334.   Hover_Default       = $FFFFFFFF;
  11335.  
  11336. type
  11337.   PTrackMouseEvent = ^TTrackMouseEvent;
  11338.   TTrackMouseEvent = record
  11339.     cbSize: DWord;
  11340.     dwFlags: DWord;
  11341.     hwndTrack: hWnd;
  11342.     dwHoverTime: DWord;
  11343.   end;
  11344.  
  11345. function TrackMouseEvent(var EventTrack: TTrackMouseEvent): Bool;
  11346.  
  11347. const
  11348.   { Extended Window Styles }
  11349.   WS_EX_DlgModalFrame = 1;
  11350.   WS_EX_nOParentNotify = 4;
  11351.   WS_EX_Transparent = $20;
  11352.   WS_EX_MdiChild = $40;
  11353.   WS_EX_ToolWindow = $80;
  11354.   WS_EX_WindowEdge = $100;
  11355.   WS_EX_ClientEdge = $200;
  11356.   WS_EX_ContextHelp = $400;
  11357.  
  11358.   WS_EX_Right = $1000;
  11359.   WS_EX_Left = 0;
  11360.   WS_EX_RtlReading = $2000;
  11361.   WS_EX_LtrReading = 0;
  11362.   WS_EX_LeftScrollbar = $4000;
  11363.   WS_EX_RightScrollbar = 0;
  11364.  
  11365.   WS_EX_ControlParent = $10000;
  11366.   WS_EX_StaticEdge = $20000;
  11367.   WS_EX_AppWindow = $40000;
  11368.   WS_EX_OverlappedWindow = (WS_EX_WindowEdge or WS_EX_ClientEdge);
  11369.   WS_EX_PaletteWindow = (WS_EX_WindowEdge or WS_EX_ToolWindow or WS_EX_Topmost);
  11370.  
  11371.   { Class styles }
  11372.   CS_IME = $10000;
  11373.  
  11374.   { WM_Print flags }
  11375.   PRF_CheckVisible = 1;
  11376.   PRF_NonClient = 2;
  11377.   PRF_Client = 4;
  11378.   PRF_EraseBkgnd = 8;
  11379.   PRF_Children = $10;
  11380.   PRF_Owned = $20;
  11381.  
  11382.   { 3D border styles }
  11383.   BDR_RaisedOuter = 1;
  11384.   BDR_SunkenOuter = 2;
  11385.   BDR_RaisedInner = 4;
  11386.   BDR_SunkenInner = 8;
  11387.  
  11388.   BDR_Outer = 3;
  11389.   BDR_Inner = 12;
  11390.   BDR_Raised = 5;
  11391.   BDR_Sunken = 10;
  11392.  
  11393.   Edge_Raised = (BDR_RaisedOuter or BDR_RaisedInner);
  11394.   Edge_Sunken = (BDR_SunkenOuter or BDR_SunkenInner);
  11395.   Edge_Etched = (BDR_SunkenOuter or BDR_RaisedInner);
  11396.   Edge_Bump = (BDR_RaisedOuter or BDR_SunkenInner);
  11397.  
  11398.   { Border flags }
  11399.   BF_Left = 1;
  11400.   BF_Top = 2;
  11401.   BF_Right = 4;
  11402.   BF_Bottom = 8;
  11403.  
  11404.   BF_TopLeft = (BF_Top or BF_Left);
  11405.   BF_TopRight = (BF_Top or BF_Right);
  11406.   BF_BottomLeft = (BF_Bottom or BF_Left);
  11407.   BF_BottomRight = (BF_Bottom or BF_Right);
  11408.   BF_Rect = (BF_Left or BF_Top or BF_Right or BF_Bottom);
  11409.  
  11410.   BF_Diagonal = $10;
  11411.  
  11412.   { For diagonal lines, the BF_Rect flags specify the end point of the}
  11413.   { vector bounded by the rectangle parameter.}
  11414.   BF_Diagonal_EndTopRight = (BF_Diagonal or BF_Top or BF_Right);
  11415.   BF_Diagonal_EndTopLeft = (BF_Diagonal or BF_Top or BF_Left);
  11416.   BF_Diagonal_EndBottomLeft = (BF_Diagonal or BF_Bottom or BF_Left);
  11417.   BF_Diagonal_EndBottomRight = (BF_Diagonal or BF_Bottom or BF_Right);
  11418.  
  11419.   BF_Middle = $800;   { Fill in the middle }
  11420.   BF_Soft = $1000;    { For softer buttons }
  11421.   BF_Adjust = $2000;  { Calculate the space left over }
  11422.   BF_Flat = $4000;    { For flat rather than 3D borders }
  11423.   BF_Mono = $8000;    { For monochrome borders }
  11424.  
  11425. function DrawEdge(hdc: HDC; var qrc: TRect; edge: UInt; grfFlags: UInt): Bool;
  11426.  
  11427. const
  11428.   { flags for DrawFrameControl }
  11429.   DFC_Caption = 1;
  11430.   DFC_Menu = 2;
  11431.   DFC_Scroll = 3;
  11432.   DFC_Button = 4;
  11433.  
  11434.   DFCS_CaptionClose = 0;
  11435.   DFCS_CaptionMin = 1;
  11436.   DFCS_CaptionMax = 2;
  11437.   DFCS_CaptionRestore = 3;
  11438.   DFCS_CaptionHelp = 4;
  11439.  
  11440.   DFCS_MenuArrow = 0;
  11441.   DFCS_MenuCheck = 1;
  11442.   DFCS_MenuBullet = 2;
  11443.   DFCS_MenuArrowRight = 4;
  11444.  
  11445.   DFCS_ScrollUp = 0;
  11446.   DFCS_ScrollDown = 1;
  11447.   DFCS_ScrollLeft = 2;
  11448.   DFCS_ScrollRight = 3;
  11449.   DFCS_ScrollCombobox = 5;
  11450.   DFCS_ScrollSizeGrip = 8;
  11451.   DFCS_ScrollSizeGripRight = $10;
  11452.  
  11453.   DFCS_ButtonCheck = 0;
  11454.   DFCS_ButtonRadioImage = 1;
  11455.   DFCS_ButtonRadioMask = 2;
  11456.   DFCS_ButtonRadio = 4;
  11457.   DFCS_Button3State = 8;
  11458.   DFCS_ButtonPush = $10;
  11459.  
  11460.   DFCS_Inactive = $100;
  11461.   DFCS_Pushed = $200;
  11462.   DFCS_Checked = $400;
  11463.   DFCS_AdjustRect = $2000;
  11464.   DFCS_Flat = $4000;
  11465.   DFCS_Mono = $8000;
  11466.  
  11467. function DrawFrameControl(DC: HDC; const Rect: TRect; uType, uState: UInt): Bool;
  11468.  
  11469. const
  11470.   { flags for DrawCaption }
  11471.   DC_Active = 1;
  11472.   DC_SmallCap = 2;
  11473.   DC_Icon = 4;
  11474.   DC_Text = 8;
  11475.   DC_InButton = $10;
  11476.  
  11477. function DrawCaption(P1: hWnd; P2: HDC; const P3: TRect; P4: UInt): Bool;
  11478.  
  11479. const
  11480.   IDAni_Open = 1;
  11481.   IDAni_Close = 2;
  11482.   IDAni_Caption = 3;
  11483.  
  11484. function DrawAnimatedRects(hWnd: hWnd; idAni: Integer; const lprcFrom, lprcTo: TRect): Bool;
  11485.  
  11486. const
  11487.   { Predefined Clipboard Formats }
  11488.   CF_HDrop = 15;
  11489.   CF_Locale = 16;
  11490.   CF_Max = 17;
  11491.  
  11492. type
  11493.   PNMHdr = ^TNMHdr;
  11494.   TNMHdr = packed record
  11495.     hwndFrom: hWnd;
  11496.     idFrom: UInt;
  11497.     code: Integer;     { NM_ code }
  11498.   end;
  11499.  
  11500.   PStyleStruct = ^TStyleStruct;
  11501.   TStyleStruct = packed record
  11502.     styleOld: DWord;
  11503.     styleNew: DWord;
  11504.   end;
  11505.  
  11506. { Message Function Templates }
  11507.  
  11508. function SetMessageQueue(cMessagesMax: Integer): Bool;
  11509.  
  11510. function RegisterHotKey(hWnd: hWnd; id: Integer; fsModifiers, vk: UInt): Bool;
  11511. function UnregisterHotKey(hWnd: hWnd; id: Integer): Bool;
  11512.  
  11513. const
  11514.   MOD_Alt = 1;
  11515.   MOD_Control = 2;
  11516.   MOD_Shift = 4;
  11517.   MOD_Win = 8;
  11518.  
  11519.   IdHot_SnapWindow = -1;    { Shift-PrintScrn  }
  11520.   IdHot_SnapDesktop = -2;   { PrintScrn        }
  11521.  
  11522.   EW_RestartWindows        = $0042;
  11523.   EW_RebootSystem          = $0043;
  11524.   EW_ExitAndExecApp        = $0044;
  11525.  
  11526.   EndSession_LogOff        = $80000000;
  11527.  
  11528. function SetMessageExtraInfo(lParam: lParam): lParam;
  11529.  
  11530. function SendMessageTimeout(hWnd: hWnd; Msg: UInt; wParam: wParam;
  11531.   lParam: lParam; fuFlags, uTimeout: UInt; var lpdwResult: DWord): lResult;
  11532. function SendNotifyMessage(hWnd: hWnd; Msg: UInt; wParam: wParam;
  11533.   lParam: lParam): Bool;
  11534. function SendMessageCallback(hWnd: hWnd; Msg: UInt; wParam: wParam;
  11535.   lParam: lParam; lpResultCallBack: TFNSendAsyncProc; dwData: DWord): Bool;
  11536. function BroadcastSystemMessage(Flags: DWord; Recipients: PDWORD;
  11537.   uiMessage: UInt; wParam: wParam; lParam: lParam): Longint;
  11538.  
  11539. const
  11540.   { Broadcast Special Message Recipient list }
  11541.   BSM_AllComponents = $00000000;
  11542.   BSM_VXDS = $00000001;
  11543.   BSM_NetDriver = $00000002;
  11544.   BSM_InstallableDrivers = $00000004;
  11545.   BSM_Applications = $00000008;
  11546.   BSM_AllDesktops = $00000010;
  11547.  
  11548.   { Broadcast Special Message Flags }
  11549.   BSF_Query = $00000001;
  11550.   BSF_IgnoreCurrentTask = $00000002;
  11551.   BSF_FlushDisk = $00000004;
  11552.   BSF_NoHang = $00000008;
  11553.   BSF_PostMessage = $00000010;
  11554.   BSF_ForceIfHung = $00000020;
  11555.   BSF_NoTimeoutIfNotHung = $00000040;
  11556.  
  11557. type
  11558.   PBroadcastSysMsg = ^TBroadcastSysMsg;
  11559.   TBroadcastSysMsg = packed record
  11560.     uiMessage: UInt;
  11561.     wParam: wParam;
  11562.     lParam: lParam;
  11563.   end;
  11564.  
  11565. const
  11566.   DBWF_LParamPointer = $8000;
  11567.  
  11568.   Broadcast_Query_Deny = $424D5144;  { Return this value to deny a query. }
  11569.  
  11570. function PostAppMessage(idThread: DWord; Msg: UInt; wParam: wParam; lParam: lParam): Bool;
  11571.  
  11572. const
  11573.   { Special hWnd value for use with PostMessage() and SendMessage() }
  11574.   wnd_Broadcast = HWND_Broadcast;
  11575.  
  11576. function AttachThreadInput(idAttach, idAttachTo: DWord; fAttach: Bool): Bool;
  11577. function WaitForInputIdle(hProcess: THandle; dwMilliseconds: DWord): DWord;
  11578. function RegisterClassEx(const WndClass: TWndClassEx): ATOM;
  11579. function GetClassInfoEx(Instance: hInst; Classname: PChar; var WndClass: TWndClassEx): Bool;
  11580.  
  11581. function ShowWindowAsync(hWnd: hWnd; nCmdShow: Integer): Bool;
  11582. function OpenIcon(hWnd: hWnd): Bool;
  11583. function AnyPopup: Bool;
  11584.  
  11585. const
  11586.   { SetWindowPos Flags }
  11587.   SWP_NoSendChanging = $400;  { Don't send WM_WindowPosChanging }
  11588.   SWP_DeferErase = $2000;
  11589.   SWP_AsyncWindowPos = $4000;
  11590.  
  11591. { Character Translation Routines }
  11592.  
  11593. function CharNextEx(CodePage: Word; lpCurrentChar: LPCSTR; dwFlags: DWord): LPSTR;
  11594. function CharPrevEx(CodePage: Word; lpStart, lpCurrentChar: LPCSTR; dwFlags: DWord): LPSTR;
  11595.  
  11596. { Language dependent Routines }
  11597.  
  11598. function GetKBCodePage: UInt;
  11599. function GetAsyncKeyState(vKey: Integer): SHORT;
  11600.  
  11601. type
  11602.   PKeyboardState = ^TKeyboardState;
  11603.   TKeyboardState = array[0..255] of Byte;
  11604.  
  11605. function GetKeyboardState(var KeyState: TKeyboardState): Bool;
  11606. function SetKeyboardState(var KeyState: TKeyboardState): Bool;
  11607. function ToAscii(uVirtKey, uScanCode: UInt; const KeyState: TKeyboardState;
  11608.   lpChar: PChar; uFlags: UInt): Integer;
  11609. function ToAsciiEx(uVirtKey: UInt; uScanCode: UInt; const KeyState: TKeyboardState;
  11610.   lpChar: PChar; uFlags: UInt; dwhkl: HKL): Integer;
  11611. function ToUnicode(wVirtKey, wScanCode: UInt; const KeyState: TKeyboardState;
  11612.   var pwszBuff; cchBuff: Integer; wFlags: UInt): Integer;
  11613. function OemKeyScan(wOemChar: Word): DWord;
  11614.  
  11615. function VkKeyScanEx(ch: Char; dwhkl: HKL): SHORT;
  11616.  
  11617. const
  11618.   KeyEventF_ExtendedKey = 1;
  11619.   KeyEventF_KeyUp = 2;
  11620.  
  11621. procedure keybd_event(bVk: Byte; bScan: Byte; dwFlags, dwExtraInfo: DWord);
  11622.  
  11623. const
  11624.   MouseEventF_Move            = $0001; { mouse move }
  11625.   MouseEventF_LeftDown        = $0002; { left button down }
  11626.   MouseEventF_LeftUp          = $0004; { left button up }
  11627.   MouseEventF_RightDown       = $0008; { right button down }
  11628.   MouseEventF_RightUp         = $0010; { right button up }
  11629.   MouseEventF_MiddleDown      = $0020; { middle button down }
  11630.   MouseEventF_MiddleUp        = $0040; { middle button up }
  11631.   MouseEventF_Wheel           = $0800; { wheel button rolled }
  11632.   MouseEventF_Absolute        = $8000; { absolute move }
  11633.  
  11634. procedure mouse_event(dwFlags, dx, dy, dwData, dwExtraInfo: DWord);
  11635. function MapVirtualKeyEx(uCode, uMapType: UInt; dwhkl: HKL): UInt;
  11636. function GetInputState: Bool;
  11637. function MsgWaitForMultipleObjectsEx(nCount: DWord; var pHandles;
  11638.   dwMilliseconds, dwWakeMask, dwFlags: DWord): DWord;
  11639.  
  11640. const
  11641.   MWMO_WaitAll = $0001;
  11642.   MWMO_Alertable = $0002;
  11643.  
  11644.   { Queue status flags for GetQueueStatus() and MsgWaitForMultipleObjects() }
  11645.   QS_AllPostMessage       = $0100;
  11646.  
  11647. { Windows Functions }
  11648.  
  11649. function IsWindowUnicode(hWnd: hWnd): Bool;
  11650. function CopyAcceleratorTable(hAccelSrc: HACCEL; var lpAccelDst; cAccelEntries: Integer): Integer;
  11651.  
  11652. const
  11653.   { GetSystemMetrics() codes }
  11654.   SM_CxIconSpacing = 38;
  11655.   SM_CyIconSpacing = 39;
  11656.   SM_PenWindows = 41;
  11657.   SM_DBCSEnabled = 42;
  11658.  
  11659.   SM_CxFixedFrame = SM_CxDlgFrame; { win40 name change }
  11660.   SM_CyFixedfRame = SM_CyDlgFrame; { win40 name change }
  11661.   SM_CxSizeFrame = SM_CxFrame;     { win40 name change }
  11662.   SM_CySizeFrame = SM_CyFrame;     { win40 name change }
  11663.  
  11664.   SM_Secure = 44;
  11665.   SM_CxEdge = 45;
  11666.   SM_CyEdge = 46;
  11667.   SM_CxMinSpacing = 47;
  11668.   SM_CyMinSpacing = 48;
  11669.   SM_CxSmIcon = 49;
  11670.   SM_CySmIcon = 50;
  11671.   SM_CySmCaption = 51;
  11672.   SM_CxSmSize = 52;
  11673.   SM_CySmSize = 53;
  11674.   SM_CxMenuSize = 54;
  11675.   SM_CyMenuSize = 55;
  11676.   SM_ArRange = 56;
  11677.   SM_CxMinimized = 57;
  11678.   SM_CyMinimized = 58;
  11679.   SM_CxMaxTrack = 59;
  11680.   SM_CyMaxTrack = 60;
  11681.   SM_CxMaximized = 61;
  11682.   SM_CyMaximized = 62;
  11683.   SM_Network = 63;
  11684.   SM_CleanBoot = 67;
  11685.   SM_CxDrag = 68;
  11686.   SM_CyDrag = 69;
  11687.   SM_ShowSounds = 70;
  11688.   SM_CxMenuCheck = 71;     { Use instead of GetMenuCheckMarkDimensions()! }
  11689.   SM_CyMenuCheck = 72;
  11690.   SM_SlowMachine = 73;
  11691.   SM_MideastEnabled = 74;
  11692.   SM_MouseWheelPresent = 75;
  11693.  
  11694. function ChangeMenu(hMenu: hMenu; cmd: UInt; lpszNewItem: PChar;
  11695.   cmdInsert: UInt; flags: UInt): Bool;
  11696.  
  11697. const
  11698.   { return codes for WM_MENUCHAR }
  11699.   MNC_Ignore = 0;
  11700.   MNC_Close = 1;
  11701.   MNC_Execute = 2;
  11702.   MNC_Select = 3;
  11703.  
  11704. type
  11705.   PTPMParams = ^TTPMParams;
  11706.   TTPMParams = packed record
  11707.     cbSize: UInt;     { Size of structure }
  11708.     rcExclude: TRect; { Screen coordinates of rectangle to exclude when positioning }
  11709.   end;
  11710.  
  11711. function TrackPopupMenuEx(hMenu: hMenu; Flags: UInt; x, y: Integer;
  11712.   Wnd: hWnd; TPMParams: PTPMParams): Bool;
  11713.  
  11714. const
  11715.   MIIM_State = 1;
  11716.   MIIM_Id = 2;
  11717.   MIIM_Submenu = 4;
  11718.   MIIM_CheckMarks = 8;
  11719.   MIIM_Type = $10;
  11720.   MIIM_Data = $20;
  11721.  
  11722. type
  11723.   PMenuItemInfo = ^TMenuItemInfo;
  11724.   TMenuItemInfo = packed record
  11725.     cbSize: UInt;
  11726.     fMask: UInt;
  11727.     fType: UInt;             { used if MIIM_Type}
  11728.     fState: UInt;            { used if MIIM_State}
  11729.     wID: UInt;               { used if MIIM_Id}
  11730.     hSubMenu: hMenu;         { used if MIIM_Submenu}
  11731.     hbmpChecked: HBitmap;    { used if MIIM_CheckMarks}
  11732.     hbmpUnchecked: HBitmap;  { used if MIIM_CheckMarks}
  11733.     dwItemData: DWord;       { used if MIIM_Data}
  11734.     dwTypeData: PChar;       { used if MIIM_Type}
  11735.     cch: UInt;               { used if MIIM_TYPE}
  11736.   end;
  11737.  
  11738. function InsertMenuItem(P1: hMenu; P2: UInt; P3: Bool; const P4: TMenuItemInfo): Bool;
  11739. function GetMenuItemInfo(P1: hMenu; P2: UInt; P3: Bool; var P4: TMenuItemInfo): Bool;
  11740. function SetMenuItemInfo(P1: hMenu; P2: UInt; P3: Bool; const P4: TMenuItemInfo): Bool;
  11741.  
  11742. const
  11743.   GMDI_UseDisabled = 1;
  11744.   GMDI_GoIntoPopups = 2;
  11745.  
  11746. function GetMenuDefaultItem(hMenu: hMenu; fByPos, gmdiFlags: UInt): UInt;
  11747. function SetMenuDefaultItem(hMenu: hMenu; uItem, fByPos: UInt): Bool;
  11748. function GetMenuItemRect(hWnd: hWnd; hMenu: hMenu; uItem: UInt;
  11749.   var lprcItem: TRect): Bool;
  11750. function MenuItemFromPoint(hWnd: hWnd; hMenu: hMenu; ptScreen: TPoint): Bool;
  11751.  
  11752. const
  11753.   { Flags for TrackPopupMenu }
  11754.   TPM_TopAlign = 0;
  11755.   TPM_VCenteRalign = $10;
  11756.   TPM_BottomAlign = $20;
  11757.  
  11758.   TPM_Horizontal = 0;   { Horz alignment matters more }
  11759.   TPM_Vertical = $40;   { Vert alignment matters more }
  11760.   TPM_NoNotify = $80;   { Don't send any notification msgs }
  11761.   TPM_ReturnCmd = $100;
  11762.  
  11763.  
  11764. { Drag-and-drop support }
  11765.  
  11766. type
  11767.   PDropStruct = ^TDropStruct;
  11768.   TDropStruct = packed record
  11769.     hwndSource: hWnd;
  11770.     hwndSink: hWnd;
  11771.     wFmt: DWord;
  11772.     dwData: DWord;
  11773.     ptDrop: TPoint;
  11774.     dwControlData: DWord;
  11775.   end;
  11776.  
  11777. const
  11778.   DOF_Executable = 32769;
  11779.   DOF_Document = 32770;
  11780.   DOF_Directory = 32771;
  11781.   DOF_Multiple = 32772;
  11782.   DOF_Progman = 1;
  11783.   DOF_Shelldata = 2;
  11784.  
  11785.   DO_DropFile = $454C4946;
  11786.   DO_PrintFile = $544E5250;
  11787.  
  11788. function DragObject(P1, P2: hWnd; P3: UInt; P4: DWord; P5: HIcon): DWord;
  11789. function DragDetect(P1: hWnd; P2: TPoint): Bool;
  11790.  
  11791. const
  11792.   { DrawText() Format Flags }
  11793.   DT_Internal = $1000;
  11794.  
  11795.   DT_EditControl = $2000;
  11796.   DT_Path_Ellipsis = $4000;
  11797.   DT_End_Ellipsis = $8000;
  11798.   DT_ModifyString = $10000;
  11799.   DT_RtlReading = $20000;
  11800.   DT_Word_Ellipsis = $40000;
  11801.  
  11802. type
  11803.   PDrawTextParams = ^TDrawTextParams;
  11804.   TDrawTextParams = packed record
  11805.     cbSize: UInt;
  11806.     iTabLength: Integer;
  11807.     iLeftMargin: Integer;
  11808.     iRightMargin: Integer;
  11809.     uiLengthDrawn: UInt;
  11810.   end;
  11811.  
  11812. function DrawTextEx(DC: HDC; lpchText: PChar; cchText: Integer; var P4: TRect;
  11813.   dwDTFormat: UInt; DTParams: PDrawTextParams): Integer;
  11814. function GrayString(hDC: HDC; hBrush: HBRUSH; lpOutputFunc: TFNGrayStringProc;
  11815.   lpData: lParam; nCount, X, Y, nWidth, nHeight: Integer): Bool;
  11816.  
  11817.  
  11818. { Monolithic state-drawing routine }
  11819.  
  11820. const
  11821.   { Image type }
  11822.   DST_Complex = 0;
  11823.   DST_Text = 1;
  11824.   DST_PrefixText = 2;
  11825.   DST_Icon = 3;
  11826.   DST_Bitmap = 4;
  11827.  
  11828.   { State type }
  11829.   DSS_Normal = 0;
  11830.   DSS_Union = $10;     { Gray string appearance }
  11831.   DSS_Disabled = $20;
  11832.   DSS_Mono = $80;
  11833.   DSS_Right = $8000;
  11834.  
  11835. function DrawState(DC: HDC; P2: HBRUSH; P3: TFNDrawStateProc;
  11836.   P4: lParam; P5: wParam; P6, P7, P8, P9: Integer; P10: UInt): Bool;
  11837. function PaintDesktop(hdc: HDC): Bool;
  11838. function SetWindowRgn(hWnd: hWnd; hRgn: HRGN; bRedraw: Bool): Bool;
  11839. function GetWindowRgn(hWnd: hWnd; hRgn: HRGN): Bool;
  11840.  
  11841. const
  11842.   { EnableScrollBar() flags }
  11843.   ESB_Disable_Left = 1;
  11844.   ESB_Disable_Right = 2;
  11845.   ESB_Disable_Up = 1;
  11846.   ESB_Disable_Down = 2;
  11847.  
  11848. const
  11849.   HelpInfo_Window = 1;
  11850.   HelpInfo_MenuItem = 2;
  11851. type
  11852.   PHelpInfo = ^THelpInfo;
  11853.   THelpInfo = packed record{ Structure pointed to by lParam of WM_HELP }
  11854.     cbSize: UInt;          { Size in bytes of this struct  }
  11855.     iContextType: Integer; { Either HELPINFO_WINDOW or HELPINFO_MENUITEM }
  11856.     iCtrlId: Integer;      { Control Id or a Menu item Id. }
  11857.     hItemHandle: THandle;  { hWnd of control or hMenu.     }
  11858.     dwContextId: DWord;    { Context Id associated with this item }
  11859.     MousePos: TPoint;      { Mouse Position in screen co-ordinates }
  11860.   end;
  11861.  
  11862. function SetWindowContextHelpId(hWnd: hWnd; HelpID: DWord): Bool;
  11863. function GetWindowContextHelpId(hWnd: hWnd): DWord;
  11864. function SetMenuContextHelpId(hMenu: hMenu; HelpID: DWord): Bool;
  11865. function GetMenuContextHelpId(hMenu: hMenu): DWord;
  11866.  
  11867. const
  11868.   { MessageBox() Flags }
  11869.   MB_UserIcon = $00000080;
  11870.   MB_IconWarning                 = MB_IconExclamation;
  11871.   MB_IconError                   = MB_IconHand;
  11872.   MB_DefButton4 = $00000300;
  11873.   MB_TaskModal = $00002000;
  11874.   MB_Help = $00004000;                          { Help Button }
  11875.  
  11876.   MB_Default_Desktop_Only = $00020000;
  11877.  
  11878.   MB_Topmost = $00040000;
  11879.   MB_Right = $00080000;
  11880.   MB_RtlReading = $00100000;
  11881.  
  11882.   MB_Service_Notification_NT3x = $00040000;
  11883.  
  11884. function MessageBoxEx(hWnd: hWnd; lpText, lpCaption: PChar;
  11885.   uType: UInt; wLanguageId: Word): Integer;
  11886.  
  11887. type
  11888.   TPRMsgBoxCallback = procedure(var lpHelpInfo: THelpInfo);
  11889.  
  11890.   PMsgBoxParams = ^TMsgBoxParams;
  11891.   TMsgBoxParams = packed record
  11892.     cbSize: UInt;
  11893.     hwndOwner: hWnd;
  11894.     hInstance: hInst;
  11895.     lpszText: PChar;
  11896.     lpszCaption: PChar;
  11897.     dwStyle: DWord;
  11898.     lpszIcon: PChar;
  11899.     dwContextHelpId: DWord;
  11900.     lpfnMsgBoxCallback: TPRMsgBoxCallback;
  11901.     dwLanguageId: DWord;
  11902.   end;
  11903.  
  11904. function MessageBoxIndirect(const MsgBoxParams: TMsgBoxParams): Bool;
  11905.  
  11906. const
  11907.   CWP_All = 0;
  11908.   CWP_SkipInvisible = 1;
  11909.   CWP_SkipDisabled = 2;
  11910.   CWP_SkipTransparent = 4;
  11911.  
  11912. function ChildWindowFromPointEx(hWnd: hWnd; Point: TPoint; Flags: UInt): hWnd;
  11913.  
  11914. const
  11915.   { Color Types }
  11916.   Color_EndColors = Color_InfoBk;
  11917.   Color_Desktop = Color_Background;
  11918.   Color_3dFace = Color_BtnFace;
  11919.   Color_3dShadow = Color_BtnShadow;
  11920.   Color_3dHighlight = Color_BtnHighlight;
  11921.   Color_3dHilight = Color_BtnHighlight;
  11922.   Color_BtnHilight = Color_BtnHighlight;
  11923.  
  11924. function GetSysColorBrush(nIndex: Integer): HBRUSH;
  11925. function FindWindowEx(Parent, Child: hWnd; ClassName, WindowName: PChar): hWnd;
  11926. function EnumTaskWindows(hTask: THandle; lpfn: FARPROC; lParam: lParam): Bool;
  11927. function GetWindowTask(hWnd: hWnd): THandle;
  11928.  
  11929. function SetWindowsHook(nFilterType: Integer; pfnFilterProc: TFNHookProc): HHOOK;
  11930. function UnhookWindowsHook(nCode: Integer; pfnFilterProc: TFNHookProc): Bool;
  11931.  
  11932. { Macros for source-level compatibility with old functions. }
  11933.  
  11934. type
  11935.   pHHook = ^HHook;
  11936.  
  11937. function DefHookProc(nCode: Integer; wParam: wParam; lParam: lParam; phhk: FARPROC): lResult; inline;
  11938. begin
  11939.   Result := CallNextHookEx( pHHook( phhk )^, nCode, wParam, lParam);
  11940. end;
  11941.  
  11942. const
  11943. { Menu flags for AddCheckEnableMenuItem() }
  11944.  
  11945.   MF_Default = $1000;
  11946.   MF_RightJustify = $4000;
  11947.  
  11948.   MFT_String = MF_String;
  11949.   MFT_Bitmap = MF_Bitmap;
  11950.   MFT_MenubarBreak = MF_MenubarBreak;
  11951.   MFT_MenuBreak = MF_MenuBreak;
  11952.   MFT_OwnerDraw = MF_OwnerDraw;
  11953.   MFT_RadioCheck = $200;
  11954.   MFT_Separator = MF_Separator;
  11955.   MFT_RightOrder = $2000;
  11956.   MFT_RightJustify = MF_RightJustify;
  11957.  
  11958.   { Menu flags for AddCheckEnableMenuItem() }
  11959.   MFS_Grayed = 3;
  11960.   MFS_Disabled = MFS_Grayed;
  11961.   MFS_Checked = MF_Checked;
  11962.   MFS_Hilite = MF_Hilite;
  11963.   MFS_Enabled = MF_Enabled;
  11964.   MFS_Unchecked = MF_Unchecked;
  11965.   MFS_Unhilite = MF_Unhilite;
  11966.   MFS_Default = MF_Default;
  11967.  
  11968. function CheckMenuRadioItem(hMenu: hMenu; First, Last, Check, Flags: UInt): Bool;
  11969.  
  11970. const
  11971.   { System Menu Command Values }
  11972.   SC_Default = 61792;
  11973.   SC_MonitorPower = 61808;
  11974.   SC_ContextHelp = 61824;
  11975.   SC_Separator = 61455;
  11976.  
  11977. { Resource Loading Routines }
  11978.  
  11979. function LoadCursorFromFile(lpFileName: PChar): HCursor;
  11980.  
  11981. const
  11982.   { Standard Cursor IDs }
  11983.   IDC_Help = MakeIntResource(32651);
  11984.  
  11985. function SetSystemCursor(hcur: HIcon; id: DWord): Bool;
  11986.  
  11987. //function DestroyIcon(HIcon: HIcon): Bool;
  11988. function LookupIconIdFromDirectory(presbits: PByte; fIcon: Bool): Integer;
  11989. function LookupIconIdFromDirectoryEx(presbits: PByte; fIcon: Bool;
  11990.   cxDesired, cyDesired: Integer; Flags: UInt): Integer;
  11991. function CreateIconFromResourceEx(presbits: PByte; dwResSize: DWord;
  11992.   fIcon: Bool; dwVer: DWord; cxDesired, cyDesired: Integer; Flags: UInt): HIcon;
  11993.  
  11994. type
  11995.   { IconCursor header }
  11996.   PCursorShape = ^TCursorShape;
  11997.   TCursorShape = record
  11998.     xHotSpot: Integer;
  11999.     yHotSpot: Integer;
  12000.     cx: Integer;
  12001.     cy: Integer;
  12002.     cbWidth: Integer;
  12003.     Planes: Byte;
  12004.     BitsPixel: Byte;
  12005.   end;
  12006.  
  12007. const
  12008.   Image_Bitmap = 0;
  12009.   Image_Icon = 1;
  12010.   Image_Cursor = 2;
  12011.   Image_EnhMetaFile = 3;
  12012.  
  12013.   LR_DefaultColor = $0000;
  12014.   LR_Monochrome = $0001;
  12015.   LR_Color = $0002;
  12016.   LR_CopyReturnOrg = $0004;
  12017.   LR_CopyDeleteOrg = $0008;
  12018.   LR_LoadFromFile = $0010;
  12019.   LR_LoadTransparent = $0020;
  12020.   LR_DefaultSize = $0040;
  12021.   LR_VgaColor = $0080;
  12022.   LR_LoadMap3dColors = $1000;
  12023.   LR_CreateDibSection = $2000;
  12024.   LR_CopyFromResource = $4000;
  12025.   LR_Shared = $8000;
  12026.  
  12027. function LoadImage(hInst: hInst; ImageName: PChar; ImageType: UInt; X, Y: Integer; Flags: UInt): THandle;
  12028. function CopyImage(hImage: THandle; ImageType: UInt; X, Y: Integer; Flags: UInt): THandle;
  12029.  
  12030. const
  12031.   DI_Mask = 1;
  12032.   DI_Image = 2;
  12033.   DI_Normal = 3;
  12034.   DI_Compat = 4;
  12035.   DI_DefaultSize = 8;
  12036.  
  12037. function DrawIconEx(hdc: HDC; xLeft, yTop: Integer; HIcon: HIcon;
  12038.   cxWidth, cyWidth: Integer; istepIfAniCur: UInt;
  12039.   hbrFlickerFreeDraw: HBRUSH; diFlags: UInt): Bool;
  12040.  
  12041. const
  12042.   OCR_Normal              = 32512;
  12043.   OCR_IBeam               = 32513;
  12044.   OCR_Wait                = 32514;
  12045.   OCR_Cross               = 32515;
  12046.   OCR_Up                  = 32516;
  12047.   OCR_Size                = 32640;  { OBSOLETE: use OCR_SizeAll }
  12048.   OCR_Icon                = 32641;  { OBSOLETE: use OCR_Normal }
  12049.   OCR_SizeNWSE            = 32642;
  12050.   OCR_SizeNESW            = 32643;
  12051.   OCR_SizeWE              = 32644;
  12052.   OCR_SizeNS              = 32645;
  12053.   OCR_SizeALL             = 32646;
  12054.   OCR_IcocUR              = 32647;  { OBSOLETE: use OIC_WinLogo }
  12055.   OCR_No                  = 32648;
  12056.   OCR_AppStarting         = 32650;
  12057.  
  12058.   OIC_Sample              = 32512;
  12059.   OIC_Hand                = 32513;
  12060.   OIC_Ques                = 32514;
  12061.   OIC_Bang                = 32515;
  12062.   OIC_Note                = 32516;
  12063.   OIC_WinLogo             = 32517;
  12064.   OIC_Warning             = OIC_Bang;
  12065.   OIC_Error               = OIC_Hand;
  12066.   OIC_Information         = OIC_Note;
  12067.  
  12068.   RES_Icon = 1;
  12069.   RES_Cursor = 2;
  12070.  
  12071.   { The ordinal number for the entry point of language drivers. }
  12072.   ORD_LangDriver = 1;
  12073.  
  12074.   { Standard Icon IDs }
  12075.   IDI_WinLogo = MakeIntResource(32517);
  12076.   IDI_Warning = IDI_Exclamation;
  12077.   IDI_Error = IDI_Hand;
  12078.   IDI_Information = IDI_Asterisk;
  12079.  
  12080. const
  12081. { Control Manager Structures and Definitions }
  12082.  
  12083.   { Edit Control Styles }
  12084.   ES_Number = $2000;
  12085.  
  12086.   { Edit control EM_SetMargin parameters }
  12087.   EC_LeftMargin = 1;
  12088.   EC_RightMargin = 2;
  12089.   EC_UseFontInfo = 65535;
  12090.  
  12091.   { TFNEditWordBreakProc code values }
  12092.   WB_Left = 0;
  12093.   WB_Right = 1;
  12094.   WB_IsDelimiter = 2;
  12095.  
  12096.   { Button Control Styles }
  12097.   BS_Text = 0;
  12098.   BS_Icon = $40;
  12099.   BS_Bitmap = $80;
  12100.   BS_Left = $100;
  12101.   BS_Right = $200;
  12102.   BS_Center = 768;
  12103.   BS_Top = $400;
  12104.   BS_Bottom = $800;
  12105.   BS_VCenter = 3072;
  12106.   BS_PushLike = $1000;
  12107.   BS_Multiline = $2000;
  12108.   BS_Notify = $4000;
  12109.   BS_Flat = $8000;
  12110.   BS_RightButton = BS_LeftText;
  12111.  
  12112.   BST_Unchecked = 0;
  12113.   BST_Checked = 1;
  12114.   BST_InDeterminate = 2;
  12115.   BST_Pushed = 4;
  12116.   BST_Focus = 8;
  12117.  
  12118.   { Static Control Constants }
  12119.   SS_Bitmap = 14;
  12120.   SS_OwnerDraw = 13;
  12121.   SS_EnhMetaFiLe = 15;
  12122.   SS_EtchedHorz = $10;
  12123.   SS_EtchedVert = 17;
  12124.   SS_EtchedFrame = 18;
  12125.   SS_TypeMask = 31;
  12126.   SS_Notify = $100;
  12127.   SS_CenterImage = $200;
  12128.   SS_RightJust = $400;
  12129.   SS_RealSizeImage = $800;
  12130.   SS_Sunken = $1000;
  12131.   SS_EndEllipsis =  $4000;
  12132.   SS_PathEllipsis = $8000;
  12133.   SS_WordEllipsis = $C000;
  12134.   SS_EllipsisMask = $C000;
  12135.  
  12136.   { Static Control Mesages }
  12137.   STM_SetIcon = 368;
  12138.   STM_GetIcon = 369;
  12139.   STM_SetImage = 370;
  12140.   STM_GetImage = 371;
  12141.   STN_Clicked = 0;
  12142.   STN_DblClk = 1;
  12143.   STN_Enable = 2;
  12144.   STN_Disable = 3;
  12145.   STM_MsgMax = 372;
  12146.  
  12147.   { Dialog window class }
  12148.   WC_Dialog = MakeIntAtom($8002);
  12149.  
  12150. { Dialog Manager Routines }
  12151.  
  12152. const
  12153.   { Dialog Styles }
  12154.   DS_3dLook = 4;
  12155.   DS_FixedSys = 8;
  12156.   DS_NoFailCreate = $10;
  12157.   DS_Control = $400;
  12158.   DS_Center = $800;
  12159.   DS_CenterMouse = $1000;
  12160.   DS_ContextHelp = $2000;
  12161.  
  12162.   PSI_SetActive = 1;
  12163.   PSI_KillActive = 2;
  12164.   PSI_Apply = 3;
  12165.   PSI_Reset = 4;
  12166.   PSI_HasHelp = 5;
  12167.   PSI_Help = 6;
  12168.  
  12169.   PSI_Changed = 1;
  12170.   PSI_GuiStart = 2;
  12171.   PSI_Reboot = 3;
  12172.   PSI_GetSiblings = 4;
  12173.  
  12174.   { Dialog Codes }
  12175.   LB_CtlCode = 0;
  12176.  
  12177.   { Listbox Styles }
  12178.   LBS_NoSel = $4000;
  12179.  
  12180.   CBS_UpperCase = $2000;
  12181.   CBS_LowerCase = $4000;
  12182.  
  12183.   SBS_SizeGrip = $10;
  12184.  
  12185.   SIF_Range = 1;
  12186.   SIF_Page = 2;
  12187.   SIF_POS = 4;
  12188.   SIF_DisableNoScroll = 8;
  12189.   SIF_TrackPos = $10;
  12190.   SIF_All = (SIF_Range or SIF_Page or SIF_Pos or SIF_TrackPos);
  12191.  
  12192. type
  12193.   TScrollInfo = packed record
  12194.     cbSize: UInt;
  12195.     fMask: UInt;
  12196.     nMin: Integer;
  12197.     nMax: Integer;
  12198.     nPage: UInt;
  12199.     nPos: Integer;
  12200.     nTrackPos: Integer;
  12201.   end;
  12202.  
  12203. function SetScrollInfo(hWnd: hWnd; BarFlag: Integer; const ScrollInfo: TScrollInfo; Redraw: Bool): Integer;
  12204. function GetScrollInfo(hWnd: hWnd; BarFlag: Integer; var ScrollInfo: TScrollInfo): Bool;
  12205. function TileWindows(hwndParent: hWnd; wHow: UInt; lpRect: PRect; cKids: UInt; lpKids: Pointer): Word;
  12206. function CascadeWindows(hwndParent: hWnd; wHow: UInt; lpRect: PRect; cKids: UInt; lpKids: Pointer): Word;
  12207.  
  12208.  
  12209. { IME class support }
  12210.  
  12211. const
  12212.   { wParam for WM_IME_CONTROL (removed from 4.0 SDK) }
  12213.   IMC_GetCandidatePos = 7;
  12214.   IMC_SetCandidatePos = 8;
  12215.   IMC_GetCompositionFont = 9;
  12216.   IMC_SetCompositionFont = $0A;
  12217.   IMC_GetCompositionWindow = $0B;
  12218.   IMC_SetCompositionWindow = $0C;
  12219.   IMC_GetStatusWindowPos = $0F;
  12220.   IMC_SetStatusWindowPos = $10;
  12221.   IMC_CloseStatusWindow = $21;
  12222.   IMC_OpenStatusWindow = $22;
  12223.  
  12224.   { wParam of report message WM_IME_Notify (removed from 4.0 SDK) }
  12225.   IMN_CloseStatusWindow = 1;
  12226.   IMN_OpenStatusWindow = 2;
  12227.   IMN_ChangeCandidate = 3;
  12228.   IMN_CloseCandidate = 4;
  12229.   IMN_OpenCandidate = 5;
  12230.   IMN_SetConversionMode = 6;
  12231.   IMN_SetSentenceMode = 7;
  12232.   IMN_SetOpenStatus = 8;
  12233.   IMN_SetCandidatePos = 9;
  12234.   IMN_SetCompositionFont = 10;
  12235.   IMN_SetCompositionWindow = 11;
  12236.   IMN_SetStatusWindowPos = 12;
  12237.   IMN_Guideline = 13;
  12238.   IMN_Private = 14;
  12239.  
  12240. { Help support }
  12241.  
  12242. type
  12243.   HelpPoly = DWord;
  12244.   PMultiKeyHelp = ^TMultiKeyHelp;
  12245.   TMultiKeyHelp = record
  12246.     mkSize: DWord;
  12247.     mkKeylist: AnsiChar;
  12248.     szKeyphrase: array[0..0] of AnsiChar;
  12249.   end;
  12250.  
  12251.   PHelpWinInfo = ^THelpWinInfo;
  12252.   THelpWinInfo = record
  12253.     wStructSize: Integer;
  12254.     x: Integer;
  12255.     y: Integer;
  12256.     dx: Integer;
  12257.     dy: Integer;
  12258.     wMax: Integer;
  12259.     rgchMember: array[0..1] of AnsiChar;
  12260.   end;
  12261.  
  12262. const
  12263.   { Commands to pass to WinHelp() }
  12264.   Help_ContextMenu = 10;
  12265.   Help_Finder = 11;
  12266.   Help_WM_Help = 12;
  12267.   Help_SetPopup_Pos = 13;
  12268.  
  12269.   Help_TCard = $8000;
  12270.   Help_TCard_Data = $10;
  12271.   Help_TCard_Other_Caller = 17;
  12272.  
  12273.   { These are in winhelp.h in Win95. }
  12274.   IDH_No_Help = 28440;
  12275.   IDH_Missing_Context = 28441;      { Control doesn't have matching help context }
  12276.   IDH_Generic_Help_Button = 28442;  { Property sheet help button }
  12277.   IDH_Ok = 28443;
  12278.   IDH_Cancel = 28444;
  12279.   IDH_Help = 28445;
  12280.  
  12281. const
  12282.   { Parameter for SystemParametersInfo() }
  12283.   SPI_SetWorkarea = 47;
  12284.   SPI_ScreenSaverRunning = 97;
  12285.   SPI_GetSnapToDefButton = 95;
  12286.   SPI_SetSnapToDefButton = 96;
  12287.   SPI_GetMouseHoverWidth = 98;
  12288.   SPI_SetMouseHoverWidth = 99;
  12289.   SPI_GetMouseHoverHeight = 100;
  12290.   SPI_SetMouseHoverHeight = 101;
  12291.   SPI_GetMouseHoverTime = 102;
  12292.   SPI_SetMouseHoverTime = 103;
  12293.   SPI_GetWheelScrollLines = 104;
  12294.   SPI_SetWheelScrollLines = 105;
  12295.  
  12296.   Metrics_UseDefault = -1;
  12297.  
  12298. type
  12299.   PNonClientMetrics = ^TNonClientMetrics;
  12300.   TNonClientMetrics = packed record
  12301.     cbSize: UInt;
  12302.     iBorderWidth: Integer;
  12303.     iScrollWidth: Integer;
  12304.     iScrollHeight: Integer;
  12305.     iCaptionWidth: Integer;
  12306.     iCaptionHeight: Integer;
  12307.     lfCaptionFont: TLogFont;
  12308.     iSmCaptionWidth: Integer;
  12309.     iSmCaptionHeight: Integer;
  12310.     lfSmCaptionFont: TLogFont;
  12311.     iMenuWidth: Integer;
  12312.     iMenuHeight: Integer;
  12313.     lfMenuFont: TLogFont;
  12314.     lfStatusFont: TLogFont;
  12315.     lfMessageFont: TLogFont;
  12316.   end;
  12317.  
  12318. const
  12319.   ARW_BottomLeft = 0;
  12320.   ARW_BottomRight = 1;
  12321.   ARW_TopLeft = 2;
  12322.   ARW_TopRight = 3;
  12323.   ARW_StartMask = 3;
  12324.   ARW_StartRight = 1;
  12325.   ARW_StartTop = 2;
  12326.  
  12327.   ARW_Left = 0;
  12328.   ARW_Right = 0;
  12329.   ARW_Up = 4;
  12330.   ARW_Down = 4;
  12331.   ARW_Hide = 8;
  12332.   ARW_Valid = 15;
  12333.  
  12334. type
  12335.   PMinimizedMetrics = ^TMinimizedMetrics;
  12336.   TMinimizedMetrics = packed record
  12337.     cbSize: UInt;
  12338.     iWidth: Integer;
  12339.     iHorzGap: Integer;
  12340.     iVertGap: Integer;
  12341.     iArrange: Integer;
  12342.   end;
  12343.  
  12344.   PIconMetrics = ^TIconMetrics;
  12345.   TIconMetrics = packed record
  12346.     cbSize: UInt;
  12347.     iHorzSpacing: Integer;
  12348.     iVertSpacing: Integer;
  12349.     iTitleWrap: Integer;
  12350.     lfFont: TLogFont;
  12351.   end;
  12352.  
  12353.   PAnimationInfo = ^TAnimationInfo;
  12354.   TAnimationInfo = packed record
  12355.     cbSize: UInt;
  12356.     iMinAnimate: Longint;
  12357.   end;
  12358.  
  12359. type
  12360.   PSerialKeys = ^TSerialKeys;
  12361.   TSerialKeys = packed record
  12362.     cbSize: UInt;
  12363.     dwFlags: DWord;
  12364.     lpszActivePort: PChar;
  12365.     lpszPort: PChar;
  12366.     iBaudRate: UInt;
  12367.     iPortState: UInt;
  12368.     iActive: UInt;
  12369.   end;
  12370.  
  12371. const
  12372.   { flags for SERIALKEYS dwFlags field }
  12373.   SERKF_SERIALKEYSON = 1;
  12374.   SERKF_AVAILABLE = 2;
  12375.   SERKF_INDICATOR = 4;
  12376.  
  12377. type
  12378.   PHighContrast = ^PHighContrast;
  12379.   THighContrast = packed record
  12380.     cbSize: UInt;
  12381.     dwFlags: DWord;
  12382.     lpszDefaultScheme: PChar;
  12383.   end;
  12384.  
  12385. const
  12386.   { flags for HIGHCONTRAST dwFlags field }
  12387.   HCF_HIGHCONTRASTON      = $00000001;
  12388.   HCF_AVAILABLE           = $00000002;
  12389.   HCF_HOTKEYACTIVE        = $00000004;
  12390.   HCF_CONFIRMHOTKEY       = $00000008;
  12391.   HCF_HOTKEYSOUND         = $00000010;
  12392.   HCF_INDICATOR           = $00000020;
  12393.   HCF_HOTKEYAVAILABLE     = $00000040;
  12394.  
  12395.   { Flags for ChangeDisplaySettings }
  12396.   CDS_UpdateRegistry      = $00000001;
  12397.   CDS_Test                = $00000002;
  12398.   CDS_Fullscreen          = $00000004;
  12399.   CDS_Global              = $00000008;
  12400.   CDS_Set_Primary         = $00000010;
  12401.   CDS_Reset               = $40000000;
  12402.   CDS_SetRect             = $20000000;
  12403.   CDS_NoReset             = $10000000;
  12404.  
  12405.   { Return values for ChangeDisplaySettings }
  12406.   Disp_Change_Successful           = 0;
  12407.   Disp_Change_Restart              = 1;
  12408.   Disp_Change_Failed              = -1;
  12409.   Disp_Change_BadMode             = -2;
  12410.   Disp_Change_NotUpdated          = -3;
  12411.   Disp_Change_BadFlags            = -4;
  12412.   Disp_Change_BadParam            = -5;
  12413.  
  12414. function ChangeDisplaySettings(var lpDevMode: TDeviceMode; dwFlags: DWord): Longint;
  12415. function ChangeDisplaySettingsEx(lpszDeviceName: PChar; var lpDevMode: TDeviceMode;
  12416.         wnd: hWnd; dwFlags: DWord; lParam: Pointer): Longint;
  12417. function EnumDisplaySettings(lpszDeviceName: PChar; iModeNum: DWord;
  12418.   var lpDevMode: TDeviceMode): Bool;
  12419.  
  12420. type
  12421.   { Accessibility support }
  12422.   PFilterKeys = ^TFilterKeys;
  12423.   TFilterKeys = packed record
  12424.     cbSize: UInt;
  12425.     dwFlags: DWord;
  12426.     iWaitMSec: DWord;       { Acceptance Delay}
  12427.     iDelayMSec: DWord;      { Delay Until Repeat}
  12428.     iRepeatMSec: DWord;     { Repeat Rate}
  12429.     iBounceMSec: DWord;     { Debounce Time}
  12430.   end;
  12431.  
  12432.  
  12433. const
  12434.   { TFilterKeys dwFlags field }
  12435.   FKF_FilterKeysOn = 1;
  12436.   FKF_Available = 2;
  12437.   FKF_HotkeyActive = 4;
  12438.   FKF_ConfirmHotkey = 8;
  12439.   FKF_HotkeySound = $10;
  12440.   FKF_Indicator = $20;
  12441.   FKF_ClickOn = $40;
  12442.  
  12443. type
  12444.   PStickyKeys = ^TStickyKeys;
  12445.   TStickyKeys = packed record
  12446.     cbSize: UInt;
  12447.     dwFlags: DWord;
  12448.   end;
  12449.  
  12450. const
  12451.   { TStickyKeys dwFlags field }
  12452.   SKF_StickyKeysOn = 1;
  12453.   SKF_Available = 2;
  12454.   SKF_HotkeyActive = 4;
  12455.   SKF_ConfirmHotkey = 8;
  12456.   SKF_HotkeySound = $10;
  12457.   SKF_Indicator = $20;
  12458.   SKF_AudibleFeedback = $40;
  12459.   SKF_Tristate = $80;
  12460.   SKF_TwoKeySoff = $100;
  12461.  
  12462. type
  12463.   PMouseKeys = ^TMouseKeys;
  12464.   TMouseKeys = packed record
  12465.     cbSize: UInt;
  12466.     dwFlags: DWord;
  12467.     iMaxSpeed: DWord;
  12468.     iTimeToMaxSpeed: DWord;
  12469.     iCtrlSpeed: DWord;
  12470.     dwReserved1: DWord;
  12471.     dwReserved2: DWord;
  12472.   end;
  12473.  
  12474. const
  12475.   { TMouseKeys dwFlags field }
  12476.   MKF_MouseKeysOn = 1;
  12477.   MKF_Available = 2;
  12478.   MKF_HotKeyActive = 4;
  12479.   MKF_ConfirmHotkey = 8;
  12480.   MKF_HotkeySound = $10;
  12481.   MKF_Indicator = $20;
  12482.   MKF_Modifiers = $40;
  12483.   MKF_ReplaceNumbers = $80;
  12484.  
  12485. type
  12486.   PAccessTimeout = ^TAccessTimeout;
  12487.   TAccessTimeout = packed record
  12488.     cbSize: UInt;
  12489.     dwFlags: DWord;
  12490.     iTimeOutMSec: DWord;
  12491.   end;
  12492.  
  12493. const
  12494.   { TAccessTimeout dwFlags field }
  12495.   ATF_TimeoutOn = 1;
  12496.   ATF_OnOffFeedback = 2;
  12497.  
  12498.   { values for TSoundsEntry iFSGrafEffect field }
  12499.   SSGF_None = 0;
  12500.   SSGF_Display = 3;
  12501.  
  12502.   { values for TSoundsEntry iFSTextEffect field }
  12503.   SSTF_None = 0;
  12504.   SSTF_Chars = 1;
  12505.   SSTF_Border = 2;
  12506.   SSTF_Display = 3;
  12507.  
  12508.   { values for TSoundsEntry iWindowsEffect field }
  12509.   SSWF_None = 0;
  12510.   SSWF_Title = 1;
  12511.   SSWF_Window = 2;
  12512.   SSWF_Display = 3;
  12513.   SSWF_Custom = 4;
  12514.  
  12515. type
  12516.   PSoundsEntry = ^TSoundsEntry;
  12517.   TSoundsEntry = packed record
  12518.     cbSize: UInt;
  12519.     dwFlags: DWord;
  12520.     iFSTextEffect: DWord;
  12521.     iFSTextEffectMSec: DWord;
  12522.     iFSTextEffectColorBits: DWord;
  12523.     iFSGrafEffect: DWord;
  12524.     iFSGrafEffectMSec: DWord;
  12525.     iFSGrafEffectColor: DWord;
  12526.     iWindowsEffect: DWord;
  12527.     iWindowsEffectMSec: DWord;
  12528.     lpszWindowsEffectDLL: PChar;
  12529.     iWindowsEffectOrdinal: DWord;
  12530.   end;
  12531.  
  12532. const
  12533.   { SOUNDSENTRY dwFlags field }
  12534.   SSF_SoundsEntryOn = 1;
  12535.   SSF_Available = 2;
  12536.   SSF_Indicator = 4;
  12537.  
  12538.  
  12539. type
  12540.   PToggleKeys = ^TToggleKeys;
  12541.   TToggleKeys = packed record
  12542.     cbSize: UInt;
  12543.     dwFlags: DWord;
  12544.   end;
  12545.  
  12546. const
  12547.   { TToggleKeys dwFlags field }
  12548.   TKF_ToggleKeysOn = 1;
  12549.   TKF_Available = 2;
  12550.   TKF_HotKeyActive = 4;
  12551.   TKF_ConfirmHotkey = 8;
  12552.   TKF_HotkeySound = $10;
  12553.   TKF_Indicator = $20;
  12554.  
  12555. procedure SetDebugErrorLevel(dwLevel: DWord);
  12556.  
  12557. const
  12558.   { SetLastErrorEx() types. }
  12559.   SLE_Error = 1;
  12560.   SLE_MinorError = 2;
  12561.   SLE_Warning = 3;
  12562.  
  12563. procedure SetLastErrorEx(dwErrCode, dwType: DWord);
  12564.  
  12565.  
  12566. { Translated from WINNLS.H }
  12567.  
  12568. const
  12569.  
  12570. { String Length Maximums. }
  12571.  
  12572.   MAX_LeadBytes = 12; { 5 ranges, 2 bytes ea., 0 term. }
  12573.   MAX_DefaultChar = 2; { single or double byte }
  12574.  
  12575. { MBCS and Unicode Translation Flags. }
  12576.  
  12577.   MB_PreComposed = 1; { use precomposed chars }
  12578.   MB_Composite = 2; { use composite chars }
  12579.   MB_UseGlyphChars = 4; { use glyph chars, not ctrl chars }
  12580.  
  12581.   WC_DefaultCheck = $100; { check for default char }
  12582.   WC_CompositeCheck = $200; { convert composite to precomposed }
  12583.   WC_DiscardNs = $10; { discard non-spacing chars }
  12584.   WC_SepChars = $20; { generate separate chars }
  12585.   WC_DefaultChar = $40; { replace w default char }
  12586.  
  12587. { Character Type Flags. }
  12588.  
  12589.   CT_CType1 = 1; { ctype 1 information }
  12590.   CT_CType2 = 2; { ctype 2 information }
  12591.   CT_CType3 = 4; { ctype 3 information }
  12592.  
  12593. { CType 1 Flag Bits. }
  12594.  
  12595.   C1_Upper = 1; { upper case }
  12596.   C1_Lower = 2; { lower case }
  12597.   C1_Digit = 4; { decimal digits }
  12598.   C1_Space = 8; { spacing characters }
  12599.   C1_Punct = $10; { punctuation characters }
  12600.   C1_Cntrl = $20; { control characters }
  12601.   C1_Blank = $40; { blank characters }
  12602.   C1_XDigit = $80; { other digits }
  12603.   C1_Alpha = $100; { any letter }
  12604.  
  12605. { CType 2 Flag Bits. }
  12606.  
  12607.   C2_LeftToRight = 1; { left to right }
  12608.   C2_RightToLeft = 2; { right to left }
  12609.   C2_EuropeNumber = 3; { European number, digit }
  12610.   C2_EuropeSeparator = 4; { European numeric separator }
  12611.   C2_EuropeTerminator = 5; { European numeric terminator }
  12612.   C2_ArabicNumber = 6; { Arabic number }
  12613.   C2_CommonSeparator = 7; { common numeric separator }
  12614.   C2_BlockSeparator = 8; { block separator }
  12615.   C2_SegmentSeparator = 9; { segment separator }
  12616.   C2_WhiteSpace = 10; { white space }
  12617.   C2_OtherNeutral = 11; { other neutrals }
  12618.   C2_NotApplicable = 0; { no implicit directionality }
  12619.  
  12620. { CType 3 Flag Bits. }
  12621.  
  12622.   C3_NonSpacing = 1; { nonspacing character }
  12623.   C3_Diacritic = 2; { diacritic mark }
  12624.   C3_VowelMark = 4; { vowel mark }
  12625.   C3_Symbol = 8; { symbols }
  12626.   C3_NotApplicable = 0; { ctype 3 is not applicable }
  12627.  
  12628. { String Flags. }
  12629.  
  12630.   Norm_IgnoreCase = 1; { ignore case }
  12631.   Norm_IgnoreNonSpace = 2; { ignore nonspacing chars }
  12632.   Norm_IgnoreSymbols = 4; { ignore symbols }
  12633.   Norm_IgnoreKanatype = $10000;
  12634.   Norm_IgnoreWidth = $20000;
  12635.  
  12636. { Locale Independent Mapping Flags. }
  12637.  
  12638.   Map_FoldCZone = $10; { fold compatibility zone chars }
  12639.   Map_PreComposed = $20; { convert to precomposed chars }
  12640.   Map_Composite = $40; { convert to composite chars }
  12641.   Map_FoldDigits = $80; { all digits to ASCII 0-9 }
  12642.  
  12643. { Locale Dependent Mapping Flags. }
  12644.  
  12645.   LCMap_LowerCase = $00000100;              { lower case letters }
  12646.   LCMap_UpperCase = $00000200;              { upper case letters }
  12647.   LCMap_SortKey = $00000400;                { WC sort key (normalize) }
  12648.   LCMap_ByteRev = $00000800;                { byte reversal }
  12649.  
  12650.   LCMap_Hiragana = $00100000;               { map katakana to hiragana }
  12651.   LCMap_Katakana = $00200000;               { map hiragana to katakana }
  12652.   LCMap_HalfWidth = $00400000;              { map double byte to single byte }
  12653.   LCMap_FullwIdth = $00800000;              { map single byte to double byte }
  12654.  
  12655.   LCMap_Linguistic_Casing = $01000000;      { use linguistic rules for casing }
  12656.  
  12657.   LCMap_Simplified_Chinese      = $02000000;  { map traditional chinese to simplified chinese }
  12658.   LCMap_Traditional_Chinese     = $04000000;  { map simplified chinese to traditional chinese }
  12659.  
  12660. { Locale Enumeration Flags. }
  12661.  
  12662.   LCID_Installed          = $00000001;  { installed locale ids }
  12663.   LCID_Supported          = $00000002;  { supported locale ids }
  12664.  
  12665. { Code Page Enumeration Flags. }
  12666.  
  12667.   CP_Installed            = $00000001;  { installed code page ids }
  12668.   CP_Supported            = $00000002;  { supported code page ids }
  12669.  
  12670.  
  12671. { Sorting Flags.
  12672.  
  12673.      WORD Sort:    culturally correct sort
  12674.                    hyphen and apostrophe are special cased
  12675.                    example: "coop" and "co-op" will sort together in a list
  12676.  
  12677.                          co_op     <-------  underscore (symbol)
  12678.                          coat
  12679.                          comb
  12680.                          coop
  12681.                          co-op     <-------  hyphen (punctuation)
  12682.                          cork
  12683.                          went
  12684.                          were
  12685.                          we're     <-------  apostrophe (punctuation)
  12686.  
  12687.  
  12688.      STRING Sort:  hyphen and apostrophe will sort with all other symbols
  12689.  
  12690.                          co-op     <-------  hyphen (punctuation)
  12691.                          co_op     <-------  underscore (symbol)
  12692.                          coat
  12693.                          comb
  12694.                          coop
  12695.                          cork
  12696.                          we're     <-------  apostrophe (punctuation)
  12697.                          went
  12698.                          were
  12699.  }
  12700.  
  12701.   Sort_StringSort = $1000; { use string sort method }
  12702.  
  12703. { Code Page Default Values. }
  12704.  
  12705.   CP_ACP                   = 0;             { default to ANSI code page }
  12706.   CP_OemCP                 = 1;             { default to OEM  code page }
  12707.   CP_MacCP                 = 2;             { default to MAC  code page }
  12708.  
  12709.   CP_UTF7                  = 65000;         { UTF-7 translation }
  12710.   CP_UTF8                  = 65001;         { UTF-8 translation }
  12711.  
  12712. { Country Codes. }
  12713.  
  12714.   Ctry_Default = 0;
  12715.   Ctry_Australia = 61; { Australia }
  12716.   Ctry_Austria = 43; { Austria }
  12717.   Ctry_Belgium = $20; { Belgium }
  12718.   Ctry_Brazil = 55; { Brazil }
  12719.   Ctry_Canada = 2; { Canada }
  12720.   Ctry_Denmark = 45; { Denmark }
  12721.   Ctry_Finland = 358; { Finland }
  12722.   Ctry_France = 33; { France }
  12723.   Ctry_Germany = 49; { Germany }
  12724.   Ctry_Iceland = 354; { Iceland }
  12725.   Ctry_Ireland = 353; { Ireland }
  12726.   Ctry_Italy = 39; { Italy }
  12727.   Ctry_Japan = 81; { Japan }
  12728.   Ctry_Mexico = 52; { Mexico }
  12729.   Ctry_Netherlands = 31; { Netherlands }
  12730.   Ctry_New_Zealand = $40; { New Zealand }
  12731.   Ctry_Norway = 47; { Norway }
  12732.   Ctry_Portugal = 351; { Portugal }
  12733.   Ctry_PrChina = 86; { PR China }
  12734.   Ctry_South_Korea = 82; { South Korea }
  12735.   Ctry_Spain = 34; { Spain }
  12736.   Ctry_Sweden = 46; { Sweden }
  12737.   Ctry_Switzerland = 41; { Switzerland }
  12738.   Ctry_Taiwan = 886; { Taiwan }
  12739.   Ctry_United_Kingdom = 44; { United Kingdom }
  12740.   Ctry_United_States = 1; { United States }
  12741.  
  12742. { Locale Types.
  12743.   These types are used for the GetLocaleInfoW NLS API routine. }
  12744.  
  12745. { locale_NoUserOverride is also used in GetTimeFormatW and GetDateFormatW. }
  12746.  
  12747.   Locale_NoUserOverride           = $80000000;   { do not use user overrides }
  12748.   Locale_Use_CP_ACP               = $40000000;   { use the system ACP }
  12749.  
  12750.   Locale_ILanguage                = $00000001;   { language id }
  12751.   Locale_SLanguage                = $00000002;   { localized name of language }
  12752.   Locale_SEngLanguage             = $00001001;   { English name of language }
  12753.   Locale_SAbbrevLangName          = $00000003;   { abbreviated language name }
  12754.   Locale_SNativeLangName          = $00000004;   { native name of language }
  12755.  
  12756.   Locale_ICountry                 = $00000005;   { country code }
  12757.   Locale_SCountry                 = $00000006;   { localized name of country }
  12758.   Locale_SEngCountry              = $00001002;   { English name of country }
  12759.   Locale_SAbbrevCtryName          = $00000007;   { abbreviated country name }
  12760.   Locale_SNativeCtryName          = $00000008;   { native name of country }
  12761.  
  12762.   Locale_IDefaultLanguage         = $00000009;   { default language id }
  12763.   Locale_IDefaultCountry          = $0000000A;   { default country code }
  12764.   Locale_IDefaultCodepage         = $0000000B;   { default oem code page }
  12765.   Locale_IDefaultAnsiCodepage     = $00001004;   { default ansi code page }
  12766.   Locale_IDefaultMacCodepage      = $00001011;   { default mac code page }
  12767.  
  12768.   Locale_SList                    = $0000000C;   { list item separator }
  12769.   Locale_IMeasure                 = $0000000D;   { 0 = metric, 1 = US }
  12770.  
  12771.   Locale_SDecimal                 = $0000000E;   { decimal separator }
  12772.   Locale_SThousand                = $0000000F;   { thousand separator }
  12773.   Locale_SGrouping                = $00000010;   { digit grouping }
  12774.   Locale_IDigits                  = $00000011;   { number of fractional digits }
  12775.   Locale_ILZero                   = $00000012;   { leading zeros for decimal }
  12776.   Locale_INegNumber               = $00001010;   { negative number mode }
  12777.   Locale_SNativeDigits            = $00000013;   { native ascii 0-9 }
  12778.  
  12779.   Locale_SCurrency                = $00000014;   { local monetary symbol }
  12780.   Locale_SIntlSymbol              = $00000015;   { intl monetary symbol }
  12781.   Locale_SMonDecimalSep           = $00000016;   { monetary decimal separator }
  12782.   Locale_SMonThousandSep          = $00000017;   { monetary thousand separator }
  12783.   Locale_SMonGrouping             = $00000018;   { monetary grouping }
  12784.   Locale_ICurrDigits              = $00000019;   { # local monetary digits }
  12785.   Locale_IIntlCurrDigits          = $0000001A;   { # intl monetary digits }
  12786.   Locale_ICurrency                = $0000001B;   { positive currency mode }
  12787.   Locale_INegCurr                 = $0000001C;   { negative currency mode }
  12788.  
  12789.   Locale_SDate                    = $0000001D;   { date separator }
  12790.   Locale_STime                    = $0000001E;   { time separator }
  12791.   Locale_SShortDate               = $0000001F;   { short date format string }
  12792.   Locale_SLongDate                = $00000020;   { long date format string }
  12793.   Locale_STimeFormat              = $00001003;   { time format string }
  12794.   Locale_IDate                    = $00000021;   { short date format ordering }
  12795.   Locale_ILDate                   = $00000022;   { long date format ordering }
  12796.   Locale_ITime                    = $00000023;   { time format specifier }
  12797.   Locale_ITimeMarkPosn            = $00001005;   { time marker position }
  12798.   Locale_ICentury                 = $00000024;   { century format specifier (short date) }
  12799.   Locale_ITLZero                  = $00000025;   { leading zeros in time field }
  12800.   Locale_IDayLZero                = $00000026;   { leading zeros in day field (short date) }
  12801.   Locale_IMonlZero                = $00000027;   { leading zeros in month field (short date) }
  12802.   Locale_S1159                    = $00000028;   { AM designator }
  12803.   Locale_S2359                    = $00000029;   { PM designator }
  12804.  
  12805.   Locale_ICalendarType            = $00001009;   { type of calendar specifier }
  12806.   Locale_IOptionalCalendar        = $0000100B;   { additional calendar types specifier }
  12807.   Locale_IFirstDayOfWeek          = $0000100C;   { first day of week specifier }
  12808.   Locale_IFirstWeekOfYear         = $0000100D;   { first week of year specifier }
  12809.  
  12810.   Locale_SDayName1                = $0000002A;   { long name for Monday }
  12811.   Locale_SDayName2                = $0000002B;   { long name for Tuesday }
  12812.   Locale_SDayName3                = $0000002C;   { long name for Wednesday }
  12813.   Locale_SDayName4                = $0000002D;   { long name for Thursday }
  12814.   Locale_SDayName5                = $0000002E;   { long name for Friday }
  12815.   Locale_SDayName6                = $0000002F;   { long name for Saturday }
  12816.   Locale_SDayName7                = $00000030;   { long name for Sunday }
  12817.   Locale_SAbbrevDayName1          = $00000031;   { abbreviated name for Monday }
  12818.   Locale_SAbbrevDayName2          = $00000032;   { abbreviated name for Tuesday }
  12819.   Locale_SAbbrevDayName3          = $00000033;   { abbreviated name for Wednesday }
  12820.   Locale_SAbbrevDayName4          = $00000034;   { abbreviated name for Thursday }
  12821.   Locale_SAbbrevDayName5          = $00000035;   { abbreviated name for Friday }
  12822.   Locale_SAbbrevDayName6          = $00000036;   { abbreviated name for Saturday }
  12823.   Locale_SAbbrevDayName7          = $00000037;   { abbreviated name for Sunday }
  12824.   Locale_SMonthName1              = $00000038;   { long name for January }
  12825.   Locale_SMonthName2              = $00000039;   { long name for February }
  12826.   Locale_SMonthName3              = $0000003A;   { long name for March }
  12827.   Locale_SMonthName4              = $0000003B;   { long name for April }
  12828.   Locale_SMonthName5              = $0000003C;   { long name for May }
  12829.   Locale_SMonthName6              = $0000003D;   { long name for June }
  12830.   Locale_SMonthName7              = $0000003E;   { long name for July }
  12831.   Locale_SMonthName8              = $0000003F;   { long name for August }
  12832.   Locale_SMonthName9              = $00000040;   { long name for September }
  12833.   Locale_SMonthName10             = $00000041;   { long name for October }
  12834.   Locale_SMonthName11             = $00000042;   { long name for November }
  12835.   Locale_SMonthName12             = $00000043;   { long name for December }
  12836.   Locale_SMonthName13             = $0000100E;   { long name for 13th month (if exists) }
  12837.   Locale_SAbbrevMonthName1        = $00000044;   { abbreviated name for January }
  12838.   Locale_SAbbrevMonthName2        = $00000045;   { abbreviated name for February }
  12839.   Locale_SAbbrevMonthName3        = $00000046;   { abbreviated name for March }
  12840.   Locale_SAbbrevMonthName4        = $00000047;   { abbreviated name for April }
  12841.   Locale_SAbbrevMonthName5        = $00000048;   { abbreviated name for May }
  12842.   Locale_SAbbrevMonthName6        = $00000049;   { abbreviated name for June }
  12843.   Locale_SAbbrevMonthName7        = $0000004A;   { abbreviated name for July }
  12844.   Locale_SAbbrevMonthName8        = $0000004B;   { abbreviated name for August }
  12845.   Locale_SAbbrevMonthName9        = $0000004C;   { abbreviated name for September }
  12846.   Locale_SAbbrevMonthName10       = $0000004D;   { abbreviated name for October }
  12847.   Locale_SAbbrevMonthName11       = $0000004E;   { abbreviated name for November }
  12848.   Locale_SAbbrevMonthName12       = $0000004F;   { abbreviated name for December }
  12849.   Locale_SAbbrevMonthName13       = $0000100F;   { abbreviated name for 13th month (if exists) }
  12850.  
  12851.   Locale_SPositiveSign            = $00000050;   { positive sign }
  12852.   Locale_SNegativeSign            = $00000051;   { negative sign }
  12853.   Locale_IPosSignPosn             = $00000052;   { positive sign position }
  12854.   Locale_INegSignPosn             = $00000053;   { negative sign position }
  12855.   Locale_IPosSymPrecedes          = $00000054;   { mon sym precedes pos amt }
  12856.   Locale_IPosSepBySpace           = $00000055;   { mon sym sep by space from pos amt }
  12857.   Locale_INegSymPrecedes          = $00000056;   { mon sym precedes neg amt }
  12858.   Locale_INegSepBySpace           = $00000057;   { mon sym sep by space from neg amt }
  12859.  
  12860.   Locale_FontSignature            = $00000058;   { font signature }
  12861.   Locale_SISO639LangName          = $00000059;   { ISO abbreviated language name }
  12862.   Locale_SISO3166CtryName         = $0000005A;   { ISO abbreviated country name }
  12863.  
  12864.  
  12865. { Time Flags for GetTimeFormatW. }
  12866.  
  12867.   TIME_NoMinutesOrSeconds = 1; { do not use minutes or seconds }
  12868.   TIME_NoSeconds = 2; { do not use seconds }
  12869.   TIME_NoTimeMarker = 4; { do not use time marker }
  12870.   TIME_Force24HourFormat = 8; { always use 24 hour format }
  12871.  
  12872. { Date Flags for GetDateFormatW. }
  12873.  
  12874.   DATE_ShortDate = 1; { use short date picture }
  12875.   DATE_LongDate = 2; { use long date picture }
  12876.   DATE_Use_Alt_Calendar = 4;   { use alternate calendar (if any) }
  12877.  
  12878. { Calendar Types.
  12879.   These types are used for the GetALTCalendarInfoW NLS API routine. }
  12880.  
  12881.   CAL_ICalIntValue = 1;   { calendar type }
  12882.   CAL_SCalName = 2;   { native name of calendar }
  12883.   CAL_IYearOffsetRange = 3;   { starting years of eras }
  12884.   CAL_SEraString = 4;   { era name for IYearOffsetRanges }
  12885.   CAL_SShortDate = 5;   { short date format string }
  12886.   CAL_SLongDate = 6;   { long date format string }
  12887.   CAL_SDayName1 = 7;   { native name for Monday }
  12888.   CAL_SDayName2 = 8;   { native name for Tuesday }
  12889.   CAL_SDayName3 = 9;   { native name for Wednesday }
  12890.   CAL_SDayName4 = 10;   { native name for Thursday }
  12891.   CAL_SDayName5 = 11;   { native name for Friday }
  12892.   CAL_SDayName6 = 12;   { native name for Saturday }
  12893.   CAL_SDayName7 = 13;   { native name for Sunday }
  12894.   CAL_SAbbrevDayName1 = 14;   { abbreviated name for Monday }
  12895.   CAL_SAbbrevDayName2 = 15;   { abbreviated name for Tuesday }
  12896.   CAL_SAbbrevDayName3 = $10;   { abbreviated name for Wednesday }
  12897.   CAL_SAbbrevDayName4 = 17;   { abbreviated name for Thursday }
  12898.   CAL_SAbbrevDayName5 = 18;   { abbreviated name for Friday }
  12899.   CAL_SAbbrevDayName6 = 19;   { abbreviated name for Saturday }
  12900.   CAL_SAbbrevDayName7 = 20;   { abbreviated name for Sunday }
  12901.   CAL_SMonthNAME1 = 21;   { native name for January }
  12902.   CAL_SMonthName2 = 22;   { native name for February }
  12903.   CAL_SMonthName3 = 23;   { native name for March }
  12904.   CAL_SMonthName4 = 24;   { native name for April }
  12905.   CAL_SMonthName5 = 25;   { native name for May }
  12906.   CAL_SMonthName6 = 26;   { native name for June }
  12907.   CAL_SMonthName7 = 27;   { native name for July }
  12908.   CAL_SMonthName8 = 28;   { native name for August }
  12909.   CAL_SMonthName9 = 29;   { native name for September }
  12910.   CAL_SMonthName10 = 30;   { native name for October }
  12911.   CAL_SMonthName11 = 31;   { native name for November }
  12912.   CAL_SMonthName12 = $20;   { native name for December }
  12913.   CAL_SMonthName13 = 33;   { native name for 13th month (if any) }
  12914.   CAL_SAbbrevMonthName1 = 34;   { abbreviated name for January }
  12915.   CAL_SAbbrevMonthName2 = 35;   { abbreviated name for February }
  12916.   CAL_SAbbrevMonthName3 = 36;   { abbreviated name for March }
  12917.   CAL_SAbbrevMonthName4 = 37;   { abbreviated name for April }
  12918.   CAL_SAbbrevMonthName5 = 38;   { abbreviated name for May }
  12919.   CAL_SAbbrevMonthName6 = 39;   { abbreviated name for June }
  12920.   CAL_SAbbrevMonthName7 = 40;   { abbreviated name for July }
  12921.   CAL_SAbbrevMonthName8 = 41;   { abbreviated name for August }
  12922.   CAL_SAbbrevMonthName9 = 42;   { abbreviated name for September }
  12923.   CAL_SAbbrevMonthName10 = 43;   { abbreviated name for October }
  12924.   CAL_SAbbrevMonthName11 = 44;   { abbreviated name for November }
  12925.   CAL_SAbbrevMonthName12 = 45;   { abbreviated name for December }
  12926.   CAL_SAbbrevMonthName13 = 46;   { abbreviated name for 13th month (if any) }
  12927.  
  12928. { Calendar Enumeration Value. }
  12929.  
  12930.   Enum_All_Calendars = $FFFFFFFF;   { enumerate all calendars }
  12931.  
  12932. { Calendar ID Values. }
  12933.  
  12934.   CAL_Gregorian = 1;           { Gregorian (localized) calendar }
  12935.   CAL_Gregorian_US = 2;        { Gregorian (U.S.) calendar }
  12936.   CAL_Japan = 3;               { Japanese Emperor Era calendar }
  12937.   CAL_Taiwan = 4;              { Republic of China Era calendar }
  12938.   CAL_Korea = 5;               { Korean Tangun Era calendar }
  12939.   CAL_Hijri = 6;               { Hijri (Arabic Lunar) calendar }
  12940.   CAL_Thai = 7;                { Thai calendar }
  12941.   CAL_Hebrew = 8;              { Hebrew calendar }
  12942.  
  12943.  
  12944. type
  12945.   LCType = DWord;   { Locale type constant. }
  12946.   CalType = DWord;  { Calendar type constant. }
  12947.   CalId = DWord;    { Calendar ID. }
  12948.  
  12949.   PCPInfo = ^TCPInfo;
  12950.   TCPInfo = record
  12951.     MaxCharSize: UInt;                       { max length (bytes) of a char }
  12952.     DefaultChar: array[0..Max_DefaultChar - 1] of Byte; { default character }
  12953.     LeadByte: array[0..Max_LeadBytes - 1] of Byte;      { lead byte ranges }
  12954.   end;
  12955.  
  12956. type
  12957.   PNumberFmt = ^TNumberFmt;
  12958.   TNumberFmt = packed record
  12959.     NumDigits: UInt;        { number of decimal digits }
  12960.     LeadingZero: UInt;      { if leading zero in decimal fields }
  12961.     Grouping: UInt;         { group size left of decimal }
  12962.     lpDecimalSep: PChar;    { ptr to decimal separator string }
  12963.     lpThousandSep: PChar;   { ptr to thousand separator string }
  12964.     NegativeOrder: UInt;    { negative number ordering }
  12965.   end;
  12966.  
  12967.   PCurrencyFmt = ^TCurrencyFmt;
  12968.   TCurrencyFmt = packed record
  12969.     NumDigits: UInt;           { number of decimal digits }
  12970.     LeadingZero: UInt;         { if leading zero in decimal fields }
  12971.     Grouping: UInt;            { group size left of decimal }
  12972.     lpDecimalSep: PChar;       { ptr to decimal separator string }
  12973.     lpThousandSep: PChar;      { ptr to thousand separator string }
  12974.     NegativeOrder: UInt;       { negative currency ordering }
  12975.     PositiveOrder: UInt;       { positive currency ordering }
  12976.     lpCurrencySymbol: PChar;   { ptr to currency symbol string }
  12977.   end;
  12978.  
  12979. { Enumeration function constants. }
  12980.  
  12981.   TFNLocaleEnumProc = TFarProc;
  12982.   TFNCodepageEnumProc = TFarProc;
  12983.   TFNDateFmtEnumProc = TFarProc;
  12984.   TFNTimeFmtEnumProc = TFarProc;
  12985.   TFNCalInfoEnumProc = TFarProc;
  12986.  
  12987.  
  12988. { Code Page Dependent APIs. }
  12989.  
  12990. function IsValidCodePage(CodePage: UInt): Bool;
  12991. function GetCPInfo(CodePage: UInt; var lpCPInfo: TCPInfo): Bool;
  12992. function IsDBCSLeadByteEx(CodePage: UInt; TestChar: Byte): Bool;
  12993. function MultiByteToWideChar(CodePage: UInt; dwFlags: DWord;
  12994.   const lpMultiByteStr: LPCSTR; cchMultiByte: Integer;
  12995.   lpCharStr: LPWSTR; cchWideChar: Integer): Integer;
  12996. function WideCharToMultiByte(CodePage: UInt; dwFlags: DWord;
  12997.   lpCharStr: LPWSTR; cchWideChar: Integer; lpMultiByteStr: LPSTR;
  12998.   cchMultiByte: Integer; lpDefaultChar: LPCSTR; lpUsedDefaultChar: PBool): Integer;
  12999.  
  13000. { Locale Dependent APIs. }
  13001.  
  13002. function CompareString(Locale: LCID; dwCmpFlags: DWord; lpString1: PChar;
  13003.   cchCount1: Integer; lpString2: PChar; cchCount2: Integer): Integer;
  13004. function LCMapString(Locale: LCID; dwMapFlags: DWord; lpSrcStr: PChar;
  13005.   cchSrc: Integer; lpDestStr: PChar; cchDest: Integer): Integer;
  13006. function GetLocaleInfo(Locale: LCID; LCType: LCTYPE; lpLCData: PChar; cchData: Integer): Integer;
  13007. function SetLocaleInfo(Locale: LCID; LCType: LCTYPE; lpLCData: PChar): Bool;
  13008. function GetTimeFormat(Locale: LCID; dwFlags: DWord; lpTime: PSystemTime;
  13009.   lpFormat: PChar; lpTimeStr: PChar; cchTime: Integer): Integer;
  13010. function GetDateFormat(Locale: LCID; dwFlags: DWord; lpDate: PSystemTime;
  13011.   lpFormat: PChar; lpDateStr: PChar; cchDate: Integer): Integer;
  13012. function GetNumberFormat(Locale: LCID; dwFlags: DWord; lpValue: PChar;
  13013.   lpFormat: PNumberFmt; lpNumberStr: PChar; cchNumber: Integer): Integer;
  13014. function GetCurrencyFormat(Locale: LCID; dwFlags: DWord; lpValue: PChar;
  13015.   lpFormat: PCurrencyFmt; lpCurrencyStr: PChar; cchCurrency: Integer): Integer;
  13016. function EnumCalendarInfo(lpCalInfoEnumProc: TFNCalInfoEnumProc; Locale: LCID;
  13017.   Calendar: CALID; CalType: CALTYPE): Bool;
  13018. function EnumTimeFormats(lpTimeFmtEnumProc: TFNTimeFmtEnumProc;
  13019.   Locale: LCID; dwFlags: DWord): Bool;
  13020. function EnumDateFormats(lpDateFmtEnumProc: TFNDateFmtEnumProc;
  13021.   Locale: LCID; dwFlags: DWord): Bool;
  13022. function IsValidLocale(Locale: LCID; dwFlags: DWord): Bool;
  13023. function ConvertDefaultLocale(Locale: LCID): LCID;
  13024. function GetThreadLocale: LCID;
  13025. function SetThreadLocale(Locale: LCID): Bool;
  13026. function GetSystemDefaultLangID: LANGID;
  13027. function GetUserDefaultLangID: LANGID;
  13028. function GetSystemDefaultLCID: LCID;
  13029. function GetUserDefaultLCID: LCID;
  13030.  
  13031. { Locale Independent APIs. }
  13032.  
  13033. function GetStringTypeEx(Locale: LCID; dwInfoType: DWord;
  13034.   lpSrcStr: PChar; cchSrc: Integer; var lpCharType): Bool;
  13035.  
  13036. function GetStringTypeA(Locale: LCID; dwInfoType: DWord; const lpSrcStr: LPCSTR; cchSrc: Bool; var lpCharType: Word): Bool;
  13037.  
  13038. function FoldString(dwMapFlags: DWord; lpSrcStr: PChar; cchSrc: Integer;
  13039.   lpDestStr: PChar; cchDest: Integer): Integer;
  13040. function EnumSystemLocales(lpLocaleEnumProc: TFNLocaleEnumProc; dwFlags: DWord): Bool;
  13041. function EnumSystemCodePages(lpCodePageEnumProc: TFNCodepageEnumProc; dwFlags: DWord): Bool;
  13042.  
  13043.  
  13044. { Translated from WINCON.H }
  13045.  
  13046. { This module contains the public data structures, data types,
  13047.     and procedures exported by the NT console subsystem. }
  13048.  
  13049. type
  13050.   PCoord = ^TCoord;
  13051.   TCoord = packed record
  13052.     X: SHORT;
  13053.     Y: SHORT;
  13054.   end;
  13055.  
  13056.   PSmallRect = ^TSmallRect;
  13057.   TSmallRect = packed record
  13058.     Left: SHORT;
  13059.     Top: SHORT;
  13060.     Right: SHORT;
  13061.     Bottom: SHORT;
  13062.   end;
  13063.  
  13064.   PKeyEventRecord = ^TKeyEventRecord;
  13065.   TKeyEventRecord = packed record
  13066.     bKeyDown: Bool;
  13067.     wRepeatCount: Word;
  13068.     wVirtualKeyCode: Word;
  13069.     wVirtualScanCode: Word;
  13070.     case Integer of
  13071.       0: (
  13072.         UnicodeChar: WCHAR;
  13073.         dwControlKeyState: DWord);
  13074.       1: (
  13075.         AsciiChar: CHAR);
  13076.   end;
  13077.  
  13078. const
  13079. { ControlKeyState flags }
  13080.  
  13081.   Right_Alt_Pressed = 1;     { the right alt key is pressed. }
  13082.   Left_Alt_Pressed = 2;     { the left alt key is pressed. }
  13083.   Right_Ctrl_Pressed = 4;     { the right ctrl key is pressed. }
  13084.   Left_Ctrl_Pressed = 8;     { the left ctrl key is pressed. }
  13085.   Shift_Pressed = $10;     { the shift key is pressed. }
  13086.   NumLock_On = $20;     { the numlock light is on. }
  13087.   ScrollLock_On = $40;     { the scrolllock light is on. }
  13088.   CapsLock_On = $80;     { the capslock light is on. }
  13089.   Enhanced_Key = $100;     { the key is enhanced. }
  13090.  
  13091. type
  13092.   PMouseEventRecord = ^TMouseEventRecord;
  13093.   TMouseEventRecord = packed record
  13094.     dwMousePosition: TCoord;
  13095.     dwButtonState: DWord;
  13096.     dwControlKeyState: DWord;
  13097.     dwEventFlags: DWord;
  13098.   end;
  13099.  
  13100. const
  13101. { ButtonState flags }
  13102.  
  13103.   From_Left_1st_Button_Pressed = 1;
  13104.   Rightmost_Button_Pressed = 2;
  13105.   From_Left_2nd_Button_Pressed = 4;
  13106.   From_Left_3rd_Button_Pressed = 8;
  13107.   From_Left_4th_Button_Pressed = $10;
  13108.  
  13109. { EventFlags }
  13110.  
  13111.   Mouse_Moved = 1;
  13112.   Double_Click = 2;
  13113.  
  13114. type
  13115.   PWindowBufferSizeRecord = ^TWindowBufferSizeRecord;
  13116.   TWindowBufferSizeRecord = packed record
  13117.     dwSize: TCoord;
  13118.   end;
  13119.  
  13120.   PMenuEventRecord = ^TMenuEventRecord;
  13121.   TMenuEventRecord = packed record
  13122.     dwCommandId: UInt;
  13123.   end;
  13124.  
  13125.   PFocusEventRecord = ^TFocusEventRecord;
  13126.   TFocusEventRecord = packed record
  13127.     bSetFocus: Bool;
  13128.   end;
  13129.  
  13130.   PInputRecord = ^TInputRecord;
  13131.   TInputRecord = record
  13132.     EventType: Word;
  13133.     case Integer of
  13134.       0: (KeyEvent: TKeyEventRecord);
  13135.       1: (MouseEvent: TMouseEventRecord);
  13136.       2: (WindowBufferSizeEvent: TWindowBufferSizeRecord);
  13137.       3: (MenuEvent: TMenuEventRecord);
  13138.       4: (FocusEvent: TFocusEventRecord);
  13139.   end;
  13140.  
  13141.  
  13142. const
  13143. {  EventType flags: }
  13144.  
  13145.   Key_Event = 1;       { Event contains key event record}
  13146.   _Mouse_event = 2;  { Renamed }   { Event contains mouse event record }
  13147.   Window_Buffer_Size_Event = 4;  { Event contains window change event record }
  13148.   Menu_Event = 8;     { Event contains menu event record }
  13149.   Focus_Event = $10;  { event contains focus change }
  13150.  
  13151. type
  13152.   PCharInfo = ^TCharInfo;
  13153.   TCharInfo = packed record
  13154.     case Integer of
  13155.       0: (
  13156.         UnicodeChar: WCHAR;
  13157.         Attributes: Word);
  13158.       1: (
  13159.         AsciiChar: CHAR);
  13160.   end;
  13161.  
  13162. const
  13163. { Attributes flags:}
  13164.  
  13165.   Foreground_Blue = 1;    { text color contains blue.}
  13166.   Foreground_Green = 2;     { text color contains green. }
  13167.   Foreground_Red = 4;     { text color contains red. }
  13168.   Foreground_Intensity = 8;     { text color is intensified. }
  13169.   Background_Blue = $10;     { background color contains blue. }
  13170.   Background_Green = $20;     { background color contains green. }
  13171.   Background_Red = $40;     { background color contains red. }
  13172.   Background_Intensity = $80;     { background color is intensified. }
  13173.  
  13174. type
  13175.   PConsoleScreenBufferInfo = ^TConsoleScreenBufferInfo;
  13176.   TConsoleScreenBufferInfo = packed record
  13177.     dwSize: TCoord;
  13178.     dwCursorPosition: TCoord;
  13179.     wAttributes: Word;
  13180.     srWindow: TSmallRect;
  13181.     dwMaximumWindowSize: TCoord;
  13182.   end;
  13183.  
  13184.   PConsoleCursorInfo = ^TConsoleCursorInfo;
  13185.   TConsoleCursorInfo = packed record
  13186.     dwSize: DWord;
  13187.     bVisible: Bool;
  13188.   end;
  13189.  
  13190.   PWin32Cell = ^TWin32Cell;
  13191.   TWin32Cell = record
  13192.     Ch:     SmallWord;
  13193.     Attr:   SmallWord;
  13194.   end;
  13195.  
  13196.   TFNHandlerRoutine = TFarProc;
  13197.  
  13198. const
  13199.   Ctrl_C_Event = 0;
  13200.   Ctrl_Break_Event = 1;
  13201.   Ctrl_Close_Event = 2;
  13202.   { 3 is reserved! }
  13203.   { 4 is reserved! }
  13204.  
  13205.   Ctrl_LogOff_Event = 5;
  13206.   Ctrl_ShutDown_Event = 6;
  13207.   Enable_Processed_Input = 1;     {  Input Mode flags: }
  13208.   Enable_Line_Input = 2;
  13209.   Enable_Echo_Input = 4;
  13210.   Enable_Window_Input = 8;
  13211.   Enable_MOUSE_Input = $10;
  13212.   Enable_Processed_Output = 1;     { Output Mode flags: }
  13213.   Enable_Wrap_at_Eol_Output = 2;
  13214.  
  13215. { direct API definitions. }
  13216. function PeekConsoleInput(hConsoleInput: THandle; var lpBuffer: TInputRecord;
  13217.   nLength: DWord; var lpNumberOfEventsRead: DWord): Bool;
  13218.  
  13219. function ReadConsoleInput(hConsoleInput: THandle; var lpBuffer: TInputRecord;
  13220.   nLength: DWord; var lpNumberOfEventsRead: DWord): Bool;
  13221.  
  13222. function WriteConsoleInput(hConsoleInput: THandle; const lpBuffer: TInputRecord;
  13223.   nLength: DWord; var lpNumberOfEventsWritten: DWord): Bool;
  13224.  
  13225. function ReadConsoleOutput(hConsoleOutput: THandle; lpBuffer: Pointer;
  13226.   dwBufferSize, dwBufferCoord: TCoord; var lpReadRegion: TSmallRect): Bool;
  13227.  
  13228. function WriteConsoleOutput(hConsoleOutput: THandle; lpBuffer: Pointer;
  13229.   dwBufferSize, dwBufferCoord: TCoord; var lpWriteRegion: TSmallRect): Bool;
  13230.  
  13231. function ReadConsoleOutputCharacter(hConsoleOutput: THandle; lpCharacter: PChar;
  13232.   nLength: DWord; dwReadCoord: TCoord; var lpNumberOfCharsRead: DWord): Bool;
  13233.  
  13234. function ReadConsoleOutputAttribute(hConsoleOutput: THandle; lpAttribute: Pointer;
  13235.   nLength: DWord; dwReadCoord: TCoord; var lpNumberOfAttrsRead: DWord): Bool;
  13236.  
  13237. function WriteConsoleOutputCharacter(hConsoleOutput: THandle;lpCharacter: PChar;
  13238.   nLength: DWord; dwWriteCoord: TCoord; var lpNumberOfCharsWritten: DWord): Bool;
  13239. function WriteConsoleOutputAttribute(hConsoleOutput: THandle; lpAttribute: Pointer;
  13240.   nLength: DWord; dwWriteCoord: TCoord; var lpNumberOfAttrsWritten: DWord): Bool;
  13241. function FillConsoleOutputCharacter(hConsoleOutput: THandle; cCharacter: Char;
  13242.   nLength: DWord; dwWriteCoord: TCoord; var lpNumberOfCharsWritten: DWord): Bool;
  13243. function FillConsoleOutputAttribute(hConsoleOutput: THandle; wAttribute: Word;
  13244.   nLength: DWord; dwWriteCoord: TCoord; var lpNumberOfAttrsWritten: DWord): Bool;
  13245.  
  13246. function GetConsoleMode(hConsoleHandle: THandle; var lpMode: DWord): Bool;
  13247.  
  13248. function GetNumberOfConsoleInputEvents(hConsoleInput: THandle;
  13249.   var lpNumberOfEvents: DWord): Bool;
  13250.  
  13251. function GetConsoleScreenBufferInfo(hConsoleOutput: THandle;
  13252.   var lpConsoleScreenBufferInfo: TConsoleScreenBufferInfo): Bool;
  13253.  
  13254. function GetLargestConsoleWindowSize(hConsoleOutput: THandle): TCoord;
  13255.  
  13256. function GetConsoleCursorInfo(hConsoleOutput: THandle;
  13257.   var lpConsoleCursorInfo: TConsoleCursorInfo): Bool;
  13258.  
  13259. function GetNumberOfConsoleMouseButtons(var lpNumberOfMouseButtons: DWord): Bool;
  13260.  
  13261. function SetConsoleMode(hConsoleHandle: THandle; dwMode: DWord): Bool;
  13262.  
  13263. function SetConsoleActiveScreenBuffer(hConsoleOutput: THandle): Bool;
  13264.  
  13265. function FlushConsoleInputBuffer(hConsoleInput: THandle): Bool;
  13266.  
  13267. function SetConsoleScreenBufferSize(hConsoleOutput: THandle; dwSize: TCoord): Bool;
  13268.  
  13269. function SetConsoleCursorPosition(hConsoleOutput: THandle; dwCursorPosition: TCoord): Bool;
  13270.  
  13271. function SetConsoleCursorInfo(hConsoleOutput: THandle;
  13272.   const lpConsoleCursorInfo: TConsoleCursorInfo): Bool;
  13273.  
  13274. function ScrollConsoleScreenBuffer(hConsoleOutput: THandle;
  13275.   const lpScrollRectangle: TSmallRect; lpClipRectangle: PSmallRect;
  13276.   dwDestinationOrigin: TCoord; var lpFill: TCharInfo): Bool;
  13277.  
  13278. function SetConsoleWindowInfo(hConsoleOutput: THandle; bAbsolute: Bool;
  13279.   const lpConsoleWindow: TSmallRect): Bool;
  13280.  
  13281. function SetConsoleTextAttribute(hConsoleOutput: THandle; wAttributes: Word): Bool;
  13282.  
  13283. function SetConsoleCtrlHandler(HandlerRoutine: TFNHandlerRoutine; Add: Bool): Bool;
  13284.  
  13285. function GenerateConsoleCtrlEvent(dwCtrlEvent: DWord; dwProcessGroupId: DWord): Bool;
  13286.  
  13287. function AllocConsole: Bool;
  13288.  
  13289. function FreeConsole: Bool;
  13290.  
  13291. function GetConsoleTitle(lpConsoleTitle: PChar; nSize: DWord): DWord;
  13292.  
  13293. function SetConsoleTitle(lpConsoleTitle: PChar): Bool;
  13294.  
  13295. function ReadConsole(hConsoleInput: THandle; lpBuffer: Pointer;
  13296.   nNumberOfCharsToRead: DWord; var lpNumberOfCharsRead: DWord; lpReserved: Pointer): Bool;
  13297.  
  13298. function WriteConsole(hConsoleOutput: THandle; const lpBuffer: Pointer;
  13299.   nNumberOfCharsToWrite: DWord; var lpNumberOfCharsWritten: DWord; lpReserved: Pointer): Bool;
  13300.  
  13301. const
  13302.   Console_Textmode_Buffer = 1;
  13303.  
  13304. function CreateConsoleScreenBuffer(dwDesiredAccess, dwShareMode: DWord;
  13305.   lpSecurityAttributes: PSecurityAttributes; dwFlags: DWord; lpScreenBufferData: Pointer): THandle;
  13306. function GetConsoleCP: UInt;
  13307. function SetConsoleCP(wCodePageID: UInt): Bool;
  13308. function GetConsoleOutputCP: UInt;
  13309. function SetConsoleOutputCP(wCodePageID: UInt): Bool;
  13310.  
  13311.  
  13312. { Translated from WINVER.H }
  13313.  
  13314. { Version management functions, types, and definitions
  13315.   Include file for VER.DLL.  This library is designed to allow version
  13316.   stamping of Windows executable files and of special .VER files for
  13317.   DOS executable files. }
  13318.  
  13319. const
  13320. { Symbols }
  13321.  
  13322.   VS_File_Info = RT_Version;
  13323.   VS_Version_Info = 1;
  13324.   VS_User_Defined = 100;
  13325.  
  13326. { VS_Version.dwFileFlags }
  13327.  
  13328.   VS_FFI_Signature = $FEEF04BD;
  13329.   VS_FFI_StrucVersion = $10000;
  13330.   VS_FFI_FileFlagsMask = 63;
  13331.  
  13332. { VS_Version.dwFileFlags }
  13333.  
  13334.   VS_FF_Debug = 1;
  13335.   VS_FF_Prerelease = 2;
  13336.   VS_FF_Patched = 4;
  13337.   VS_FF_PrivateBuild = 8;
  13338.   VS_FF_InfoInferred = $10;
  13339.   VS_FF_SpecialBuild = $20;
  13340.  
  13341. { VS_Version.dwFileOS }
  13342.  
  13343.   VOS_Unknown = 0;
  13344.   VOS_Dos = $10000;
  13345.   VOS_OS216 = $20000;
  13346.   VOS_OS232 = $30000;
  13347.   VOS_NT = $40000;
  13348.  
  13349.   VOS__Base = 0;
  13350.   VOS__Windows16 = 1;
  13351.   VOS__PM16 = 2;
  13352.   VOS__PM32 = 3;
  13353.   VOS__Windows32 = 4;
  13354.  
  13355.   VOS_Dos_Windows16 = $10001;
  13356.   VOS_Dos_Windows32 = $10004;
  13357.   VOS_OS216_PM16 = $20002;
  13358.   VOS_OS232_PM32 = $30003;
  13359.   VOS_NT_Windows32 = $40004;
  13360.  
  13361. { VS_Version.dwFileType }
  13362.  
  13363.   VFT_Unknown = 0;
  13364.   VFT_App = 1;
  13365.   VFT_DLL = 2;
  13366.   VFT_Drv = 3;
  13367.   VFT_Font = 4;
  13368.   VFT_VXD = 5;
  13369.   VFT_Static_Lib = 7;
  13370.  
  13371. { VS_Version.dwFileSubtype for VFT_Windows_Drv }
  13372.  
  13373.   VFT2_Unknown = 0;
  13374.   VFT2_Drv_Printer = 1;
  13375.   VFT2_Drv_Keyboard = 2;
  13376.   VFT2_Drv_Language = 3;
  13377.   VFT2_Drv_Display = 4;
  13378.   VFT2_Drv_Mouse = 5;
  13379.   VFT2_Drv_Network = 6;
  13380.   VFT2_Drv_System = 7;
  13381.   VFT2_Drv_Installable = 8;
  13382.   VFT2_Drv_Sound = 9;
  13383.   VFT2_Drv_Comm = 10;
  13384.  
  13385. { VS_VERSION.dwFileSubtype for VFT_WINDOWS_FONT }
  13386.  
  13387.   VFT2_Font_Raster = 1;
  13388.   VFT2_Font_Vector = 2;
  13389.   VFT2_Font_Truetype = 3;
  13390.  
  13391. { VerFindFile() flags }
  13392.  
  13393.   VFFF_IsSharedFile = 1;
  13394.  
  13395.   VFF_CurNeDest = 1;
  13396.   VFF_FileInUse = 2;
  13397.   VFF_BuffTooSmall = 4;
  13398.  
  13399. { VerInstallFile() flags }
  13400.  
  13401.   VIFF_ForceInstall = 1;
  13402.   VIFF_DontDeleteOld = 2;
  13403.  
  13404.   VIF_TempFile = 1;
  13405.   VIF_Mismatch = 2;
  13406.   VIF_SrcOld = 4;
  13407.  
  13408.   VIF_DiffLang = 8;
  13409.   VIF_DiffCodepg = $10;
  13410.   VIF_DiffType = $20;
  13411.  
  13412.   VIF_WriteProt = $40;
  13413.   VIF_FileInUse = $80;
  13414.   VIF_OutOfSpace = $100;
  13415.   VIF_AccessViolation = $200;
  13416.   VIF_SharingViolation = $400;
  13417.   VIF_CannotCreate = $800;
  13418.   VIF_CannotDelete = $1000;
  13419.   VIF_CannotRename = $2000;
  13420.   VIF_CannotDeleteCur = $4000;
  13421.   VIF_OutOfMemory = $8000;
  13422.  
  13423.   VIF_CannotReadSrc = $10000;
  13424.   VIF_CannotReadDst = $20000;
  13425.  
  13426.   VIF_BuffTooSmall = $40000;
  13427.  
  13428. type
  13429.   PVSFixedFileInfo = ^TVSFixedFileInfo;
  13430.   TVSFixedFileInfo = packed record
  13431.     dwSignature: DWord;        { e.g. $feef04bd }
  13432.     dwStrucVersion: DWord;     { e.g. $00000042 = "0.42" }
  13433.     dwFileVersionMS: DWord;    { e.g. $00030075 = "3.75" }
  13434.     dwFileVersionLS: DWord;    { e.g. $00000031 = "0.31" }
  13435.     dwProductVersionMS: DWord; { e.g. $00030010 = "3.10" }
  13436.     dwProductVersionLS: DWord; { e.g. $00000031 = "0.31" }
  13437.     dwFileFlagsMask: DWord;    { = $3F for version "0.42" }
  13438.     dwFileFlags: DWord;        { e.g. VFF_Debug | VFF_Prerelease }
  13439.     dwFileOS: DWord;           { e.g. VOS_Dos_Windows16 }
  13440.     dwFileType: DWord;         { e.g. VFT_Driver }
  13441.     dwFileSubtype: DWord;      { e.g. VFT2_Drv_Keyboard }
  13442.     dwFileDateMS: DWord;       { e.g. 0 }
  13443.     dwFileDateLS: DWord;       { e.g. 0 }
  13444.   end;
  13445.  
  13446. function VerFindFile(uFlags: DWord; szFileName, szWinDir, szAppDir, szCurDir: PChar;
  13447.   var lpuCurDirLen: UInt; szDestDir: PChar; var lpuDestDirLen: UInt): DWord;
  13448. function VerInstallFile(uFlags: DWord;
  13449.   szSrcFileName, szDestFileName, szSrcDir, szDestDir, szCurDir, szTmpFile: PChar;
  13450.   var lpuTmpFileLen: UInt): DWord;
  13451.  
  13452. function GetFileVersionInfoSize(lptstrFilename: PChar; var lpdwHandle: DWord): DWord;
  13453. function GetFileVersionInfo(lptstrFilename: PChar; dwHandle, dwLen: DWord;
  13454.   lpData: Pointer): Bool;
  13455. function VerLanguageName(wLang: DWord; szLang: PChar; nSize: DWord): DWord;
  13456. function VerQueryValue(pBlock: Pointer; lpSubBlock: PChar;
  13457.   var lplpBuffer: Pointer; var puLen: UInt): Bool;
  13458.  
  13459. { Translated from WINREG.H }
  13460.  
  13461. { This module contains the function prototypes and constant, type and
  13462.    structure definitions for the Windows 32-Bit Registry API. }
  13463.  
  13464. const
  13465. { Reserved Key Handles. }
  13466.  
  13467.   HKey_Classes_Root     = $80000000;
  13468.   HKey_Current_User     = $80000001;
  13469.   HKey_Local_Machine    = $80000002;
  13470.   HKey_Users            = $80000003;
  13471.   HKey_Performance_Data = $80000004;
  13472.   HKey_Current_Config   = $80000005;
  13473.   HKey_Dyn_Data         = $80000006;
  13474.  
  13475.  
  13476.   Provider_Keeps_Value_Length = 1;
  13477.  
  13478. type
  13479.   PValContext = ^TValContext;
  13480.   TValContext = packed record
  13481.     valuelen: Integer;       { the total length of this value }
  13482.     value_context: Pointer;  { provider's context }
  13483.     val_buff_ptr: Pointer;   { where in the ouput buffer the value is }
  13484.   end;
  13485.  
  13486.  
  13487. type
  13488. { Provider supplied value/context.}
  13489.   PPValue = ^TPValue;
  13490.   TPValue = packed record
  13491.     pv_valuename: PChar;           { The value name pointer }
  13492.     pv_valuelen: Bool;
  13493.     pv_value_context: Pointer;
  13494.     pv_type: DWord;
  13495.   end;
  13496.  
  13497.   TFNQueryHandler = TFarProc;
  13498.   PFNQueryHandler = ^TFNQueryHandler;
  13499.  
  13500.   PProviderInfo = ^TProviderInfo;
  13501.   TProviderInfo = packed record
  13502.     pi_R0_1val: PFNQueryHandler;
  13503.     pi_R0_allvals: PFNQueryHandler;
  13504.     pi_R3_1val: PFNQueryHandler;
  13505.     pi_R3_allvals: PFNQueryHandler;
  13506.     pi_flags: DWord;              { capability flags (none defined yet). }
  13507.     pi_key_context: Pointer;
  13508.   end;
  13509.   TRegProvider = TProviderInfo;
  13510.   PProvider = PProviderInfo;
  13511.  
  13512.   PValueEnt = ^TValueEnt;
  13513.   TValueEnt = packed record
  13514.     ve_valuename: PChar;
  13515.     ve_valuelen: DWord;
  13516.     ve_valueptr: DWord;
  13517.     ve_type: DWord;
  13518.   end;
  13519.   TValEnt = TValueEnt;
  13520.   PValEnt = PValueEnt;
  13521.  
  13522.  
  13523. { Default values for parameters that do not exist in the Win 3.1
  13524.   compatible APIs. }
  13525.  
  13526. function RegConnectRegistry(lpMachineName: PChar; hKey: HKEY;
  13527.   var phkResult: HKEY): Longint;
  13528. function RegFlushKey(hKey: HKEY): Longint;
  13529. function RegGetKeySecurity(hKey: HKEY; SecurityInformation: SECURITY_INFORMATION;
  13530.   pSecurityDescriptor: PSecurityDescriptor; var lpcbSecurityDescriptor: DWord): Longint;
  13531. function RegLoadKey(hKey: HKEY; lpSubKey, lpFile: PChar): Longint;
  13532. function RegNotifyChangeKeyValue(hKey: HKEY; bWatchSubtree: Bool;
  13533.   dwNotifyFilter: DWord; hEvent: THandle; fAsynchronus: Bool): Longint;
  13534. function RegQueryMultipleValues(hKey: HKEY; var ValList;
  13535.   NumVals: DWord; lpValueBuf: PChar; var ldwTotsize: DWord): Longint;
  13536. function RegReplaceKey(hKey: HKEY; lpSubKey: PChar;
  13537.    lpNewFile: PChar; lpOldFile: PChar): Longint;
  13538. function RegRestoreKey(hKey: HKEY; lpFile: PChar; dwFlags: DWord): Longint;
  13539. function RegSaveKey(hKey: HKEY; lpFile: PChar;
  13540.   lpSecurityAttributes: PSecurityAttributes): Longint;
  13541. function RegSetKeySecurity(hKey: HKEY; SecurityInformation: SECURITY_INFORMATION;
  13542.   pSecurityDescriptor: PSECURITY_DESCRIPTOR): Longint;
  13543. function RegUnLoadKey(hKey: HKEY; lpSubKey: PChar): Longint;
  13544.  
  13545. { Remoteable System Shutdown APIs }
  13546.  
  13547. function InitiateSystemShutdown(lpMachineName, lpMessage: PChar;
  13548.   dwTimeout: DWord; bForceAppsClosed, bRebootAfterShutdown: Bool): Bool;
  13549. function AbortSystemShutdown(lpMachineName: PChar): Bool;
  13550.  
  13551. { Translated from WINNETWK.H }
  13552.  
  13553. const
  13554. { Network types }
  13555.  
  13556.   WNNC_Net_MsNet              = $00010000;
  13557.   WNNC_Net_LanMan             = $00020000;
  13558.   WNNC_Net_Netware            = $00030000;
  13559.   WNNC_Net_Vines              = $00040000;
  13560.   WNNC_Net_10Net              = $00050000;
  13561.   WNNC_Net_Locus              = $00060000;
  13562.   WNNC_Net_Sun_PC_NFS         = $00070000;
  13563.   WNNC_Net_LanStep            = $00080000;
  13564.   WNNC_Net_9Tiles             = $00090000;
  13565.   WNNC_Net_Lantastic          = $000A0000;
  13566.   WNNC_Net_AS400              = $000B0000;
  13567.   WNNC_Net_FTP_NFS            = $000C0000;
  13568.   WNNC_Net_Pathworks          = $000D0000;
  13569.   WNNC_Net_LifeNet            = $000E0000;
  13570.   WNNC_Net_PowerLan           = $000F0000;
  13571.   WNNC_Net_BWNFS              = $00100000;
  13572.   WNNC_Net_Cogent             = $00110000;
  13573.   WNNC_Net_Farallon           = $00120000;
  13574.   WNNC_Net_AppleTalk          = $00130000;
  13575.   WNNC_Net_InterGraph         = $00140000;
  13576.   WNNC_Net_SymfoNet           = $00150000;
  13577.   WNNC_Net_ClearCase          = $00160000;
  13578.  
  13579. { Network Resources. }
  13580.  
  13581.   Resource_Connected = 1;
  13582.   Resource_GlobalNet = 2;
  13583.   Resource_Remembered = 3;
  13584.   Resource_Recent = 4;
  13585.   Resource_Context = 5;
  13586.  
  13587.   ResourceType_Any = 0;
  13588.   ResourceType_Disk = 1;
  13589.   ResourceType_Print = 2;
  13590.   ResourceType_Reserved = 8;
  13591.   ResourceType_Unknown = $FFFFFFFF;
  13592.  
  13593.   ResourceUsage_Connectable = 1;
  13594.   ResourceUsage_Container = 2;
  13595.   ResourceUsage_NoLocalDevice = 4;
  13596.   ResourceUsage_Sibling = 8;
  13597.  
  13598.   ResourceUsage_Attached = $00000010;
  13599.   ResourceUsage_All = (ResourceUsage_Connectable or ResourceUsage_Container or ResourceUsage_Attached);
  13600.   ResourceUsage_Reserved = $80000000;
  13601.  
  13602.   ResourceDisplayType_Generic            = $00000000;
  13603.   ResourceDisplayType_Domain             = $00000001;
  13604.   ResourceDisplayType_Server             = $00000002;
  13605.   ResourceDisplayType_Share              = $00000003;
  13606.   ResourceDisplayType_File               = $00000004;
  13607.   ResourceDisplayType_Group              = $00000005;
  13608.   ResourceDisplayType_Network            = $00000006;
  13609.   ResourceDisplayType_Root               = $00000007;
  13610.   ResourceDisplayType_ShareAdmin         = $00000008;
  13611.   ResourceDisplayType_Directory          = $00000009;
  13612.   ResourceDisplayType_Tree               = $0000000A;
  13613.   ResourceDisplayType_NDSContainer       = $0000000B;
  13614.  
  13615. type
  13616.   PNetResource = ^TNetResource;
  13617.   TNetResource = packed record
  13618.     dwScope: DWord;
  13619.     dwType: DWord;
  13620.     dwDisplayType: DWord;
  13621.     dwUsage: DWord;
  13622.     lpLocalName: PChar;
  13623.     lpRemoteName: PChar;
  13624.     lpComment: PChar;
  13625.     lpProvider: PChar;
  13626.   end;
  13627.  
  13628. const
  13629. { Network Connections. }
  13630.  
  13631.   NetProperty_Persistent = 1;
  13632.  
  13633.   Connect_Update_Profile          = $00000001;
  13634.   Connect_Update_Recent           = $00000002;
  13635.   Connect_Temporary               = $00000004;
  13636.   Connect_Interactive             = $00000008;
  13637.   Connect_Prompt                  = $00000010;
  13638.   Connect_Need_Drive              = $00000020;
  13639.   Connect_RefCount                = $00000040;
  13640.   Connect_Redirect                = $00000080;
  13641.   Connect_LocalDrive              = $00000100;
  13642.   Connect_Current_Media           = $00000200;
  13643.   Connect_Deferred                = $00000400;
  13644.   Connect_Reserved                = $FF000000;
  13645.  
  13646. function WNetAddConnection(lpRemoteName, lpPassword, lpLocalName: PChar): DWord;
  13647. function WNetAddConnection2(var lpNetResource: TNetResource;
  13648.   lpPassword, lpUserName: PChar; dwFlags: DWord): DWord;
  13649. function WNetAddConnection3(hwndOwner: hWnd; var lpNetResource: TNetResource;
  13650.   lpPassword, lpUserName: PChar; dwFlags: DWord): DWord;
  13651. function WNetCancelConnection(lpName: PChar; fForce: Bool): DWord;
  13652. function WNetCancelConnection2(lpName: PChar; dwFlags: DWord; fForce: Bool): DWord;
  13653. function WNetGetConnection(lpLocalName: PChar;
  13654.   lpRemoteName: PChar; var lpnLength: DWord): DWord;
  13655. function WNetUseConnection(hwndOwner: hWnd;
  13656.   var lpNetResource: TNetResource; lpUserID: PChar;
  13657.   lpPassword: PChar; dwFlags: DWord; lpAccessName: PChar;
  13658.   var lpBufferSize: DWord; var lpResult: DWord): DWord;
  13659. function WNetSetConnection(lpName: PChar; dwProperties: DWord; pvValues: Pointer): DWord;
  13660.  
  13661. { Network Connection Dialogs. }
  13662.  
  13663. function WNetConnectionDialog(hWnd: hWnd; dwType: DWord): DWord;
  13664. function WNetDisconnectDialog(hWnd: hWnd; dwType: DWord): DWord;
  13665.  
  13666. type
  13667.   PConnectDlgStruct = ^TConnectDlgStruct;
  13668.   TConnectDlgStruct = packed record
  13669.     cbStructure: DWord;          { size of this structure in bytes }
  13670.     hwndOwner: hWnd;             { owner window for the dialog }
  13671.     lpConnRes: PNetResource;     { Requested Resource info    }
  13672.     dwFlags: DWord;              { flags (see below) }
  13673.     dwDevNum: DWord;             { number of devices connected to }
  13674.   end;
  13675.  
  13676. const
  13677.   ConnDlg_RO_Path = 1;    { Resource path should be read-only     }
  13678.   ConnDlg_Conn_Point = 2; { Netware -style movable connection point enabled  }
  13679.   ConnDlg_use_MRU = 4;    { Use MRU combobox   }
  13680.   ConnDlg_Hide_Box = 8;   { Hide persistent connect checkbox   }
  13681.  
  13682.   { NOTE:  Set at most ONE of the below flags.  If neither flag is set,
  13683.            then the persistence is set to whatever the user chose during
  13684.            a previous connection }
  13685.  
  13686.   ConnDlg_Persist = $10;       { Force persistent connection  }
  13687.   ConnDlg_not_Persist = $20;   { Force connection NOT persistent  }
  13688.  
  13689. function WNetConnectionDialog1(var lpConnDlgStruct: TConnectDlgStruct): DWord;
  13690.  
  13691. type
  13692.   PDiscDlgStruct = ^TDiscDlgStruct;
  13693.   TDiscDlgStruct = packed record
  13694.     cbStructure: DWord;       { size of this structure in bytes }
  13695.     hwndOwner: hWnd;          { owner window for the dialog }
  13696.     lpLocalName: PChar;       { local device name }
  13697.     lpRemoteName: PChar;      { network resource name }
  13698.     dwFlags: DWord;
  13699.   end;
  13700.  
  13701. const
  13702.   Disc_Update_Profile = 1;
  13703.   Disc_no_Force = $40;
  13704.  
  13705. function WNetDisconnectDialog1(var lpConnDlgStruct: TDiscDlgStruct): DWord;
  13706.  
  13707. { Network Browsing. }
  13708.  
  13709. function WNetOpenEnum(dwScope, dwType, dwUsage: DWord;
  13710.   lpNetResource: PNetResource; var lphEnum: THandle): DWord;
  13711. function WNetEnumResource(hEnum: THandle; var lpcCount: DWord;
  13712.   lpBuffer: Pointer; var lpBufferSize: DWord): DWord;
  13713. function WNetCloseEnum(hEnum: THandle): DWord;
  13714. function WNetGetResourceParent(lpNetResource: PNetResource;
  13715.   lpBuffer: Pointer; var cbBuffer: DWord): DWord;
  13716.  
  13717. const
  13718. { Universal Naming. }
  13719.  
  13720.   Universal_Name_Info_Level = 1;
  13721.   Remote_Name_Info_Level = 2;
  13722.  
  13723. type
  13724.   PUniversalNameInfo = ^TUniversalNameInfo;
  13725.   TUniversalNameInfo = packed record
  13726.     lpUniversalName: PChar;
  13727.   end;
  13728.  
  13729.   PRemoteNameInfo = ^TRemoteNameInfo;
  13730.   TRemoteNameInfo = packed record
  13731.     lpUniversalName: PChar;
  13732.     lpConnectionName: PChar;
  13733.     lpRemainingPath: PChar;
  13734.   end;
  13735.  
  13736. function WNetGetUniversalName(lpLocalPath: PChar; dwInfoLevel: DWord;
  13737.   lpBuffer: Pointer; var lpBufferSize: DWord): DWord;
  13738.  
  13739. { Authentication and Logon/Logoff }
  13740.  
  13741. function WNetGetUser(lpName: PChar; lpUserName: PChar; var lpnLength: DWord): DWord;
  13742.  
  13743. const
  13744.   WNFmt_MultiLine = 1;
  13745.   WNFmt_Abbreviated = 2;
  13746.   WNFmt_IneNum = $10;
  13747.   WNFmt_Connection = $20;
  13748.  
  13749. function WNetGetProviderName(dwNetType: DWord; lpProviderName: PChar;
  13750.   var lpBufferSize: DWord): DWord;
  13751.  
  13752. type
  13753.   PNetInfoStruct = ^TNetInfoStruct;
  13754.   TNetInfoStruct = record
  13755.     cbStructure: DWord;
  13756.     dwProviderVersion: DWord;
  13757.     dwStatus: DWord;
  13758.     dwCharacteristics: DWord;
  13759.     dwHandle: DWord;
  13760.     wNetType: Word;
  13761.     dwPrinters: DWord;
  13762.     dwDrives: DWord;
  13763.   end;
  13764.  
  13765. const
  13766.   NetInfo_DLL16 = 1;      { Provider running as 16 bit Winnet Driver  }
  13767.   NetInfo_DiskRed = 4;    { Provider requires disk redirections to connect  }
  13768.   NetInfo_PrinterRed = 8; { Provider requires printer redirections to connect  }
  13769.  
  13770. function WNetGetNetworkInformation(lpProvider: PChar;
  13771.   var lpNetInfoStruct: TNetInfoStruct): DWord;
  13772.  
  13773. type
  13774. { User Profiles }
  13775.   TFNGetProfilePath = TFarProc;
  13776.   TFNReconcileProfile = TFarProc;
  13777.  
  13778.  
  13779. const
  13780.   RP_Logon = 1;    { if set, do for logon, else for logoff }
  13781.   RP_IniFile = 2;  { if set, reconcile .INI file, else reg. hive }
  13782.  
  13783. type
  13784. { Policies }
  13785.  
  13786.   TFNProcessPolicies = TFarProc;
  13787.  
  13788. const
  13789.   PP_DisplayErrors = 1;  { if set, display error messages, else fail silently if error }
  13790.  
  13791. { Error handling }
  13792.  
  13793. function WNetGetLastError(var lpError: DWord; lpErrorBuf: PChar;
  13794.   nErrorBufSize: DWord; lpNameBuf: PChar; nNameBufSize: DWord): DWord;
  13795.  
  13796.  
  13797. const
  13798. { STATUS CODES }
  13799. { General }
  13800.  
  13801.   WN_Success = No_Error;
  13802.   WN_No_Error = No_Error;
  13803.   WN_not_Supported = Error_not_Supported;
  13804.   WN_Cancel = Error_Cancelled;
  13805.   WN_Retry = Error_Retry;
  13806.   WN_Net_Error = Error_Unexp_Net_Err;
  13807.   WN_MORE_DATA = Error_More_Data;
  13808.   WN_bad_Pointer = Error_Invalid_Address;
  13809.   WN_bad_Value = Error_Invalid_Parameter;
  13810.   WN_bad_User = Error_Bad_Username;
  13811.   WN_bad_Password = Error_Invalid_Password;
  13812.   WN_Access_Denied = Error_Access_Denied;
  13813.   WN_Function_Busy = Error_Busy;
  13814.   WN_Windows_Error = Error_Unexp_Net_Err;
  13815.   WN_out_of_Memory = Error_not_Enough_Memory;
  13816.   WN_no_Network = Error_no_Network;
  13817.   WN_Extended_Error = Error_Extended_Error;
  13818.   WN_bad_Level = Error_Invalid_Level;
  13819.   WN_bad_Handle = Error_Invalid_Handle;
  13820.   WN_not_Initializing = Error_Already_Initialized;
  13821.   WN_no_More_Devices = Error_no_More_Devices;
  13822.  
  13823. { Connection }
  13824.  
  13825.   WN_not_Connected = Error_Not_Connected;
  13826.   WN_Open_Files = Error_Open_Files;
  13827.   WN_Device_in_Use = Error_Device_in_Use;
  13828.   WN_bad_NetName = Error_Bad_Net_Name;
  13829.   WN_bad_LocalName = Error_bad_Device;
  13830.   WN_Already_Connected = Error_Already_Assigned;
  13831.   WN_Device_Error = Error_Gen_Failure;
  13832.   WN_Connection_Closed = Error_Connection_Unavail;
  13833.   WN_no_Net_or_bad_Path = Error_no_Net_or_bad_Path;
  13834.   WN_bad_Provider = Error_bad_Provider;
  13835.   WN_Cannot_Open_Profile = Error_Cannot_Open_Profile;
  13836.   WN_bad_Profile = Error_bad_Profile;
  13837.   WN_bad_Dev_Type = Error_bad_Dev_Type;
  13838.   WN_Device_Already_Remembered = Error_Device_Already_Remembered;
  13839.  
  13840. { Enumeration }
  13841.  
  13842.   WN_no_more_Entries = Error_no_more_Items;
  13843.   WN_not_Container = Error_not_Container;
  13844.  
  13845. { Authentication }
  13846.  
  13847.   WN_not_Authenticated = Error_not_Authenticated;
  13848.   WN_not_Logged_on = Error_not_Logged_on;
  13849.   WN_not_Validated = Error_no_Logon_Servers;
  13850.  
  13851. type
  13852. { For Shell }
  13853.   PNetConnectInfoStruct = ^TNetConnectInfoStruct;
  13854.   TNetConnectInfoStruct = packed record
  13855.     cbStructure: DWord;
  13856.     dwFlags: DWord;
  13857.     dwSpeed: DWord;
  13858.     dwDelay: DWord;
  13859.     dwOptDataSize: DWord;
  13860.   end;
  13861.  
  13862. const
  13863.   WnCon_ForNetCard = 1;
  13864.   WnCon_NotRouted = 2;
  13865.   WnCon_SlowLink = 4;
  13866.   WnCon_Dynamic = 8;
  13867.  
  13868. function MultinetGetConnectionPerformance(lpNetResource: PNetResource;
  13869.   lpNetConnectInfoStruc: PNetConnectInfoStruct): DWord;
  13870.  
  13871. { Translated from DDE.H }
  13872.  
  13873. const
  13874.   WM_DDE_First      = $03E0;
  13875.   WM_DDE_Initiate   = WM_DDE_First;
  13876.   WM_DDE_Terminate  = WM_DDE_First+1;
  13877.   WM_DDE_Advise     = WM_DDE_First+2;
  13878.   WM_DDE_Unadvise   = WM_DDE_First+3;
  13879.   WM_DDE_Ack        = WM_DDE_First+4;
  13880.   WM_DDE_Data       = WM_DDE_First+5;
  13881.   WM_DDE_Request    = WM_DDE_First+6;
  13882.   WM_DDE_Poke       = WM_DDE_First+7;
  13883.   WM_DDE_Execute    = WM_DDE_First+8;
  13884.   WM_DDE_Last       = WM_DDE_First+8;
  13885.  
  13886. { Constants used for a WM_DDE_Ack message sent in responce to a WM_DDE_Data
  13887.   WM_DDE_Request, WM_DDE_Poke, WM_DDE_Advise, or WM_DDE_Unadvise message.
  13888.   For example
  13889.     if lParam and dde_Ack <> 0 then ...
  13890. }
  13891.  
  13892. type
  13893.   PDDEAck = ^TDDEAck;
  13894.   TDDEAck = packed record
  13895. (*
  13896.     unsigned bAppReturnCode:8,
  13897.              reserved:6,
  13898.              fBusy:1,
  13899.              fAck:1;
  13900. *)
  13901.     Flags: Word;
  13902.   end;
  13903.  
  13904. const
  13905.   dde_AppReturnCode = $00FF;
  13906.   dde_Busy          = $4000;
  13907.   dde_Ack           = $8000;
  13908.  
  13909. { Record for the  WM_DDE_ADVISE Options parameter (LoWord(lParam)) }
  13910.  
  13911. type
  13912.   PDDEAdvise = ^TDDEAdvise;
  13913.   TDDEAdvise = packed record
  13914. (*
  13915.     unsigned reserved:14,
  13916.              fDeferUpd:1,
  13917.              fAckReq:1;
  13918. *)
  13919.     Flags: Word;
  13920.     cfFormat: SmallInt;
  13921.   end;
  13922.  
  13923. const
  13924.   dde_DeferUpd     = $4000;
  13925.   dde_AckReq       = $8000;
  13926.  
  13927. { Record for the hData parameter of a WM_DDE_DATA message (LoWord(lParam)).
  13928.   The actual size of this record depends on the size of the Value
  13929.   array. }
  13930.  
  13931. type
  13932.   PDDEData = ^TDDEData;
  13933.   TDDEData = packed record
  13934. (*  unsigned unused:12,
  13935.              fResponse:1,
  13936.              fRelease:1,
  13937.              reserved:1,
  13938.              fAckReq:1;
  13939. *)
  13940.     Flags: Word;
  13941.     cfFormat: SmallInt;
  13942.     Value: array[0..0] of Byte;
  13943.   end;
  13944.  
  13945. const
  13946.   dde_Response = $1000;
  13947.   dde_Release  = $2000;
  13948.  
  13949. { Record for the hData parameter of the WM_DDE_POKE record (LoWord(lParam)).
  13950.   The actual size of this record depends on the size of the Value array. }
  13951.  
  13952. type
  13953.   PDDEPoke = ^TDDEPoke;
  13954.   TDDEPoke = packed record
  13955. (*  unsigned unused:13,
  13956.              fRelease:1,
  13957.              fReserved:2;
  13958. *)
  13959.     Flags: Word;
  13960.     cfFormat: SmallInt;
  13961.     Value: array[0..0] of Byte;
  13962.   end;
  13963.  
  13964. { DDE Security }
  13965.  
  13966. function DdeSetQualityOfService(hWndClient: hWnd; const pqosNew: TSecurityQualityOfService;
  13967.   pqosPrev: PSecurityQualityOfService): Bool;
  13968. function ImpersonateDdeClientWindow(hWndClient: hWnd; hWndServer: hWnd): Bool;
  13969.  
  13970. const
  13971.   advapi32  = 'advapi32.dll';
  13972.   kernel32  = 'kernel32.dll';
  13973.   mpr       = 'mpr.dll';
  13974.   version   = 'version.dll';
  13975.   comctl32  = 'comctl32.dll';
  13976.   gdi32     = 'gdi32.dll';
  13977.   opengl32  = 'opengl32.dll';
  13978.   user32    = 'user32.dll';
  13979.   wintrust  = 'wintrust.dll';
  13980.  
  13981. {$ENDIF Open32}
  13982.  
  13983. {---------------[ Inline functions ]-----------------------------------------}
  13984.  
  13985. function PointToPoints(X,Y: SmallWord): Longint; inline;
  13986. begin
  13987.   Result := X or Y shl 16;
  13988. end;
  13989.  
  13990. function MakeROP4(Fore,Back: DWord): DWord; inline;
  13991. begin
  13992.   Result := ((Back shl 8) and $FF000000) or Fore;
  13993. end;
  13994.  
  13995. {---------------[ DAPIE specific ]-------------------------------------------}
  13996. {$IFDEF Open32}
  13997. function WinCallWinMain(ParamCount: Integer; CmdLine: PChar; FnMain: TFNMain; CmdShow: Integer): Integer;
  13998.  
  13999. { The following functions are used for translating data between the native }
  14000. { Presentation Manager format and the Developer API Extensions equivalents. }
  14001.  
  14002. type
  14003.   TXlateDir = (WinX2PM, PM2WinX);
  14004.  
  14005. { Use the GDI object type to specify the type of handle passing in }
  14006.  
  14007. function WinTranslateDevicePoints(DC: HDC; Wnd: hWnd; Point: PPoint; P4: Integer; P5: TXlateDir): Bool;
  14008. function WinTranslateDeviceRects(DC: HDC; Wnd: hWnd; Rect: PRect; P4: Integer; P5: TXlateDir): Bool;
  14009. function WinTranslateGraphicsObjectHandle(GDIObj: HGDIObj; P2: TXlateDir; P3: Integer): ULong;
  14010. function WinTranslateMnemonicString(Str: PChar; var DestStr: PChar; P3: Integer; P4: TXlateDir): ULong;
  14011. function WinQueryTranslateMode: DWord;
  14012. function WinSetTranslateMode(NewMode: DWord): Bool;
  14013. {$ENDIF Open32}
  14014.  
  14015. // In Delphi these are in messages.pas
  14016.  
  14017. const
  14018.   wm_Null             = $0000;
  14019.   wm_Create           = $0001;
  14020.   wm_Destroy          = $0002;
  14021.   wm_Move             = $0003;
  14022.   wm_Size             = $0005;
  14023.   wm_Activate         = $0006;
  14024.   wm_SetFocus         = $0007;
  14025.   wm_KillFocus        = $0008;
  14026.   wm_Enable           = $000A;
  14027.   wm_SetRedraw        = $000B;
  14028.   wm_SetText          = $000C;
  14029.   wm_GetText          = $000D;
  14030.   wm_GetTextLength    = $000E;
  14031.   wm_Paint            = $000F;
  14032.   wm_Close            = $0010;
  14033.   wm_QueryEndSession  = $0011;
  14034.   wm_Quit             = $0012;
  14035.   wm_QueryOpen        = $0013;
  14036.   wm_EraseBkgnd       = $0014;
  14037.   wm_SysColorChange   = $0015;
  14038.   wm_EndSession       = $0016;
  14039.   wm_SystemError      = $0017;
  14040.   wm_ShowWindow       = $0018;
  14041.   wm_CtlColor         = $0019;
  14042.   wm_WinIniChange     = $001A;
  14043.   wm_SettingChange = wm_WinIniChange;
  14044.   wm_DevModeChangE    = $001B;
  14045.   wm_ActivateApp      = $001C;
  14046.   wm_FontChange       = $001D;
  14047.   wm_TimeChange       = $001E;
  14048.   wm_CancelMode       = $001F;
  14049.   wm_SetCursor        = $0020;
  14050.   wm_MouseActivate    = $0021;
  14051.   wm_ChildActivate    = $0022;
  14052.   wm_QueueSync        = $0023;
  14053.   wm_GetMinMaxInfo    = $0024;
  14054.   wm_PaintIcon        = $0026;
  14055.   wm_IconEraseBkgnd   = $0027;
  14056.   wm_NextDlgCtl       = $0028;
  14057.   wm_SpoolerStatus    = $002A;
  14058.   wm_DrawItem         = $002B;
  14059.   wm_MeasureItem      = $002C;
  14060.   wm_DeleteItem       = $002D;
  14061.   wm_VKeyToItem       = $002E;
  14062.   wm_CharToItem       = $002F;
  14063.   wm_SetFont          = $0030;
  14064.   wm_GetFont          = $0031;
  14065.   wm_SetHotkey        = $0032;
  14066.   wm_GetHotkey        = $0033;
  14067.   wm_QueryDragIcon    = $0037;
  14068.   wm_CompareItem      = $0039;
  14069.   wm_Compacting       = $0041;
  14070.  
  14071.   wm_CommNotify       = $0044;    // obsolete in Win32
  14072.  
  14073.   wm_WindowPosChanging = $0046;
  14074.   wm_WindowPosChanged = $0047;
  14075.   wm_Power            = $0048;
  14076.  
  14077.   wm_CopyData         = $004A;
  14078.   wm_CancelJournal    = $004B;
  14079.   wm_Notify           = $004E;
  14080.   wm_InputLangChangeRequest = $0050;
  14081.   wm_InputLangChange  = $0051;
  14082.   wm_TCard            = $0052;
  14083.   wm_Help             = $0053;
  14084.   wm_UserChanged      = $0054;
  14085.   wm_NotifyFormat     = $0055;
  14086.  
  14087.   wm_ContextMenu      = $007B;
  14088.   wm_StyleChanging    = $007C;
  14089.   wm_StyleChanged     = $007D;
  14090.   wm_DisplayChange    = $007E;
  14091.   wm_GetIcon          = $007F;
  14092.   wm_SetIcon          = $0080;
  14093.  
  14094.   wm_NcCreate         = $0081;
  14095.   wm_NcDestroy        = $0082;
  14096.   wm_NcCalcSize       = $0083;
  14097.   wm_NcHitTest        = $0084;
  14098.   wm_NcPaint          = $0085;
  14099.   wm_NcActivate       = $0086;
  14100.   wm_GetDlgCode       = $0087;
  14101.   wm_NcMouseMove      = $00A0;
  14102.   wm_NcLButtonDown    = $00A1;
  14103.   wm_NcLButtonUp      = $00A2;
  14104.   wm_NcLButtonDblClk  = $00A3;
  14105.   wm_NcRButtonDown    = $00A4;
  14106.   wm_NcRButtonUp      = $00A5;
  14107.   wm_NcRButtonDblClk  = $00A6;
  14108.   wm_NcMButtonDown    = $00A7;
  14109.   wm_NcMButtonUp      = $00A8;
  14110.   wm_NcMButtonDblClk  = $00A9;
  14111.  
  14112.   wm_KeyFirst         = $0100;
  14113.   wm_KeyDown          = $0100;
  14114.   wm_KeyUp            = $0101;
  14115.   wm_Char             = $0102;
  14116.   wm_DeadChar         = $0103;
  14117.   wm_SysKeyDown       = $0104;
  14118.   wm_SysKeyUp         = $0105;
  14119.   wm_SysChar          = $0106;
  14120.   wm_SysDeadChar      = $0107;
  14121.   wm_KeyLast          = $0108;
  14122.  
  14123.   wm_InitDialog       = $0110;
  14124.   wm_Command          = $0111;
  14125.   wm_SysCommand       = $0112;
  14126.   wm_Timer            = $0113;
  14127.   wm_HScroll          = $0114;
  14128.   wm_VScroll          = $0115;
  14129.   wm_InitMenu         = $0116;
  14130.   wm_InitMenuPopup    = $0117;
  14131.   wm_MenuSelect       = $011F;
  14132.   wm_MenuChar         = $0120;
  14133.   wm_EnterIdle        = $0121;
  14134.  
  14135.   wm_CtlColorMsgbox   = $0132;
  14136.   wm_CtlColorEdit     = $0133;
  14137.   wm_CtlColorListbox  = $0134;
  14138.   wm_CtlColorBtn      = $0135;
  14139.   wm_CtlColorDlg      = $0136;
  14140.   wm_CtlColorScrollbar= $0137;
  14141.   wm_CtlColorStatic   = $0138;
  14142.  
  14143.   wm_MouseFirst       = $0200;
  14144.   wm_MouseMove        = $0200;
  14145.   wm_LButtonDown      = $0201;
  14146.   wm_LButtonUp        = $0202;
  14147.   wm_LButtonDblClk    = $0203;
  14148.   wm_RButtonDown      = $0204;
  14149.   wm_RButtonUp        = $0205;
  14150.   wm_RButtonDblClk    = $0206;
  14151.   wm_MButtonDown      = $0207;
  14152.   wm_MButtonUp        = $0208;
  14153.   wm_MButtonDblClk    = $0209;
  14154.   wm_MouseWheel       = $020A;
  14155.   wm_MouseLast        = $020A;
  14156.  
  14157.   wm_ParentNotify     = $0210;
  14158.   wm_EnterMenuLoop    = $0211;
  14159.   wm_ExitMenuLoop     = $0212;
  14160.   wm_NextMenu         = $0213;
  14161.  
  14162.   wm_Sizing           = 532;
  14163.   wm_CaptureChanged   = 533;
  14164.   wm_Moving           = 534;
  14165.   wm_PowerBroadcast   = 536;
  14166.   wm_DeviceChange     = 537;
  14167.  
  14168.   wm_IME_StartComposition        = $010D;
  14169.   wm_IME_EndComposition          = $010E;
  14170.   wm_IME_Composition             = $010F;
  14171.   wm_IME_KeyLast                 = $010F;
  14172.  
  14173.   wm_IME_SetContext              = $0281;
  14174.   wm_IME_Notify                  = $0282;
  14175.   wm_IME_Control                 = $0283;
  14176.   wm_IME_CompositionFull         = $0284;
  14177.   wm_IME_Select                  = $0285;
  14178.   wm_IME_Char                    = $0286;
  14179.  
  14180.   wm_IME_KeyDown                 = $0290;
  14181.   wm_IME_KeyUp                   = $0291;
  14182.  
  14183.   wm_MdiCreate        = $0220;
  14184.   wm_MdiDestroy       = $0221;
  14185.   wm_MdiActivate      = $0222;
  14186.   wm_MdiRestore       = $0223;
  14187.   wm_MdiNext          = $0224;
  14188.   wm_MdiMaximize      = $0225;
  14189.   wm_MdiTile          = $0226;
  14190.   wm_MdiCascade       = $0227;
  14191.   wm_MdiIconArrange   = $0228;
  14192.   wm_MdiGetActive     = $0229;
  14193.   wm_MdiSetMenu       = $0230;
  14194.  
  14195.   wm_EnterSizeMove    = $0231;
  14196.   wm_ExitSizeMove     = $0232;
  14197.   wm_DropFiles        = $0233;
  14198.   wm_MdiRefreshMenu   = $0234;
  14199.  
  14200.   wm_MouseHover       = $02A1;
  14201.   wm_MouseLeave       = $02A3;
  14202.  
  14203.   wm_Cut              = $0300;
  14204.   wm_Copy             = $0301;
  14205.   wm_Paste            = $0302;
  14206.   wm_Clear            = $0303;
  14207.   wm_Undo             = $0304;
  14208.   wm_RenderFormat     = $0305;
  14209.   wm_RenderAllFormats = $0306;
  14210.   wm_DestroyClipboard = $0307;
  14211.   wm_DrawClipboard    = $0308;
  14212.   wm_PaintClipboard   = $0309;
  14213.   wm_VScrollClipboard = $030A;
  14214.   wm_SizeClipboard    = $030B;
  14215.   wm_AskCbFormatName  = $030C;
  14216.   wm_ChangeCbChain    = $030D;
  14217.   wm_HScrollClipboard = $030E;
  14218.   wm_QueryNewPalette  = $030F;
  14219.   wm_PaletteIsChanging= $0310;
  14220.   wm_PaletteChanged   = $0311;
  14221.   wm_Hotkey           = $0312;
  14222.  
  14223.   wm_Print            = 791;
  14224.   wm_PrintClient      = 792;
  14225.  
  14226.   wm_HandHeldFirst    = 856;
  14227.   wm_HandHeldLast     = 863;
  14228.  
  14229.   wm_PenWinFirst      = $0380;
  14230.   wm_PenWinLast       = $038F;
  14231.  
  14232.   wm_Coalesce_First   = $0390;
  14233.   wm_Coalesce_Last    = $039F;
  14234.  
  14235.   wm_App = $8000;
  14236.  
  14237. // NOTE: All Message Numbers below $0400 are RESERVED
  14238.  
  14239. // Private Window Messages Start Here
  14240.  
  14241.   wm_User             = $0400; // but some are used! search for wm_User in this file
  14242.  
  14243. // Button Notification Codes
  14244.  
  14245. const
  14246.   bn_Pushed = bn_Hilite;
  14247.   bn_Unpushed = bn_Unhilite;
  14248.   bn_DblClk = bn_DoubleClicked;
  14249.   bn_SetFocus = 6;
  14250.   bn_KillFocus = 7;
  14251.  
  14252. // Button Control Messages
  14253. const
  14254.   bm_Click    = $00F5;
  14255.   bm_GetImage = $00F6;
  14256.   bm_SetImage = $00F7;
  14257.  
  14258. // Listbox messages
  14259.  
  14260. const
  14261.   lb_AddString            = $0180;
  14262.   lb_InsertString         = $0181;
  14263.   lb_DeleteString         = $0182;
  14264.   lb_SelItemRangeEx       = $0183;
  14265.   lb_ResetContent         = $0184;
  14266.   lb_SetSel               = $0185;
  14267.   lb_SetCurSel            = $0186;
  14268.   lb_GetSel               = $0187;
  14269.   lb_GetCurSel            = $0188;
  14270.   lb_GetText              = $0189;
  14271.   lb_GetTextLen           = $018A;
  14272.   lb_GetCount             = $018B;
  14273.   lb_SelectString         = $018C;
  14274.   lb_Dir                  = $018D;
  14275.   lb_GetTopIndex          = $018E;
  14276.   lb_FindString           = $018F;
  14277.   lb_GetSelCount          = $0190;
  14278.   lb_GetSelItems          = $0191;
  14279.   lb_SetTabStops          = $0192;
  14280.   lb_GetHorizontalExtent  = $0193;
  14281.   lb_SetHorizontalExtent  = $0194;
  14282.   lb_SetColumnWidth       = $0195;
  14283.   lb_AddFile              = $0196;
  14284.   lb_SetTopIndex          = $0197;
  14285.   lb_GetItemRect          = $0198;
  14286.   lb_GetItemData          = $0199;
  14287.   lb_SetItemData          = $019A;
  14288.   lb_SelItemRange         = $019B;
  14289.   lb_SetAnchorIndex       = $019C;
  14290.   lb_GetAnchorIndex       = $019D;
  14291.   lb_SetCaretIndex        = $019E;
  14292.   lb_GetCaretIndex        = $019F;
  14293.   lb_SetItemHeight        = $01A0;
  14294.   lb_GetItemHeight        = $01A1;
  14295.   lb_FindStringExact      = $01A2;
  14296.   lb_SetLocale            = $01A5;
  14297.   lb_GetLocale            = $01A6;
  14298.   lb_SetCount             = $01A7;
  14299.   lb_InitStorage          = $01A8;
  14300.   lb_ItemFromPoint        = $01A9;
  14301.   lb_MsgMax               = 432;
  14302.  
  14303. // Combo Box messages
  14304.  
  14305.   cb_GetEditSel            = $0140;
  14306.   cb_LimitText             = $0141;
  14307.   cb_SetEditSel            = $0142;
  14308.   cb_AddString             = $0143;
  14309.   cb_DeleteString          = $0144;
  14310.   cb_Dir                   = $0145;
  14311.   cb_GetCount              = $0146;
  14312.   cb_GetCurSel             = $0147;
  14313.   cb_GetLbText             = $0148;
  14314.   cb_GetLbTextLen          = $0149;
  14315.   cb_InsertString          = $014A;
  14316.   cb_ResetContent          = $014B;
  14317.   cb_FindString            = $014C;
  14318.   cb_SelectString          = $014D;
  14319.   cb_SetCurSel             = $014E;
  14320.   cb_ShowDropDown          = $014F;
  14321.   cb_GetItemData           = $0150;
  14322.   cb_SetItemData           = $0151;
  14323.   cb_GetDroppedControlRect = $0152;
  14324.   cb_SetItemHeight         = $0153;
  14325.   cb_GetItemHeight         = $0154;
  14326.   cb_SetExtendedUi         = $0155;
  14327.   cb_GetExtendedUi         = $0156;
  14328.   cb_GetDroppedState       = $0157;
  14329.   cb_FindStringExact       = $0158;
  14330.   cb_SetLocale             = 345;
  14331.   cb_GetLocale             = 346;
  14332.   cb_GetTopIndex           = 347;
  14333.   cb_SetTopIndex           = 348;
  14334.   cb_GetHorizontalExtent   = 349;
  14335.   cb_SetHorizontalExtent   = 350;
  14336.   cb_GetDroppedWidth       = 351;
  14337.   cb_SetDroppedWidth       = 352;
  14338.   cb_InitStorage           = 353;
  14339.   cb_MsgMax                = 354;
  14340.  
  14341. // Edit Control Messages
  14342.  
  14343. const
  14344.   em_GetSel              = $00B0;
  14345.   em_SetSel              = $00B1;
  14346.   em_GetRect             = $00B2;
  14347.   em_SetRect             = $00B3;
  14348.   em_SetRectNp           = $00B4;
  14349.   em_Scroll              = $00B5;
  14350.   em_LineScroll          = $00B6;
  14351.   em_ScrollCaret         = $00B7;
  14352.   em_GetModify           = $00B8;
  14353.   em_SetModify           = $00B9;
  14354.   em_GetLineCount        = $00BA;
  14355.   em_LineIndex           = $00BB;
  14356.   em_SetHandle           = $00BC;
  14357.   em_GetHandle           = $00BD;
  14358.   em_GetThumb            = $00BE;
  14359.   em_LineLength          = $00C1;
  14360.   em_ReplaceSel          = $00C2;
  14361.   em_GetLine             = $00C4;
  14362.   em_LimitText           = $00C5;
  14363.   em_CanUndo             = $00C6;
  14364.   em_Undo                = $00C7;
  14365.   em_FmtLines            = $00C8;
  14366.   em_LineFromChar        = $00C9;
  14367.   em_SetTabStops         = $00CB;
  14368.   em_SetPasswordChar     = $00CC;
  14369.   em_EmptyUndoBuffer     = $00CD;
  14370.   em_GetFirstVisibleLine = $00CE;
  14371.   em_SetReadOnly         = $00CF;
  14372.   em_SetWordBreakProc    = $00D0;
  14373.   em_GetWordBreakProc    = $00D1;
  14374.   em_GetPasswordChar     = $00D2;
  14375.   em_SetMargins          = 211;
  14376.   em_GetMargins          = 212;
  14377.   em_SetLimitText        = em_LimitText;    //win40 Name change
  14378.   em_GetLimitText        = 213;
  14379.   em_PosFromChar         = 214;
  14380.   em_CharFromPos         = 215;
  14381.  
  14382. // Scroll bar messages
  14383. const
  14384.   sbm_SetPos = 224;             // not in win3.1
  14385.   sbm_GetPos = 225;             // not in win3.1
  14386.   sbm_SetRange = 226;           // not in win3.1
  14387.   sbm_SetRangeRedraw = 230;     // not in win3.1
  14388.   sbm_GetRange = 227;           // not in win3.1
  14389.   sbm_Enable_Arrows = 228;      // not in win3.1
  14390.   sbm_SetScrollInfo = 233;
  14391.   sbm_GetScrollInfo = 234;
  14392.  
  14393. // Dialog messages }
  14394.  
  14395.   dm_GetDefId = (wm_User+0);    // That's what Microsoft means when talking about "standards"
  14396.   dm_SetDefId = (wm_User+1);
  14397.   dm_Reposition = (wm_User+2);
  14398.  
  14399.   psm_PageInfo = (wm_User+100);
  14400.   psm_SheetInfo = (wm_User+101);
  14401.  
  14402. type
  14403.  
  14404. // Generic window message record
  14405.  
  14406.   PMessage = ^TMessage;
  14407.   TMessage = record
  14408.     Msg: Longint;
  14409.     case Integer of
  14410.       0: (
  14411.         WParam: Longint;
  14412.         LParam: Longint;
  14413.         Result: Longint);
  14414.       1: (
  14415.         WParamLo: Word;
  14416.         WParamHi: Word;
  14417.         LParamLo: Word;
  14418.         LParamHi: Word;
  14419.         ResultLo: Word;
  14420.         ResultHi: Word);
  14421.   end;
  14422.  
  14423. // Common message format records
  14424.  
  14425.   TWMNoParams = record
  14426.     Msg: Longint;
  14427.     Unused: array[0..3] of Word;
  14428.     Result: Longint;
  14429.   end;
  14430.  
  14431.   TWMKey = record
  14432.     Msg: Longint;
  14433.     CharCode: Word;
  14434.     Unused: Word;
  14435.     KeyData: Longint;
  14436.     Result: Longint;
  14437.   end;
  14438.  
  14439.   TWMMouse = record
  14440.     Msg: Longint;
  14441.     Keys: Longint;
  14442.     case Integer of
  14443.       0: (
  14444.         XPos: Smallint;
  14445.         YPos: Smallint);
  14446.       1: (
  14447.         Pos: TSmallPoint;
  14448.         Result: Longint);
  14449.   end;
  14450.  
  14451.   TWMWindowPosMsg = record
  14452.     Msg: Longint;
  14453.     Unused: Integer;
  14454.     WindowPos: PWindowPos;
  14455.     Result: Longint;
  14456.   end;
  14457.  
  14458.   TWMScroll = record
  14459.     Msg: Longint;
  14460.     ScrollCode: Smallint; // sb_xxxx
  14461.     Pos: Smallint;
  14462.     ScrollBar: HWND;
  14463.     Result: Longint;
  14464.   end;
  14465.  
  14466. // Message records
  14467.  
  14468.   TWMActivate = record
  14469.     Msg: Longint;
  14470.     Active: Word; // wa_Inactive, wa_Active, wa_ClickActive
  14471.     Minimized: WordBool;
  14472.     ActiveWindow: HWND;
  14473.     Result: Longint;
  14474.   end;
  14475.  
  14476.   TWMActivateApp = record
  14477.     Msg: Longint;
  14478.     Active: Bool;
  14479.     ThreadId: Longint;
  14480.     Result: Longint;
  14481.   end;
  14482.  
  14483.   TWMAskCBFormatName = record
  14484.     Msg: Longint;
  14485.     NameLen: Word;
  14486.     Unused: Word;
  14487.     FormatName: PChar;
  14488.     Result: Longint;
  14489.   end;
  14490.  
  14491.   TWMCancelMode = TWMNoParams;
  14492.  
  14493.   TWMChangeCBChain = record
  14494.     Msg: Longint;
  14495.     Remove: HWND;
  14496.     Next: HWND;
  14497.     Result: Longint;
  14498.   end;
  14499.  
  14500.   TWMChar = TWMKey;
  14501.  
  14502.   TWMCharToItem = record
  14503.     Msg: Longint;
  14504.     Key: Word;
  14505.     CaretPos: Word;
  14506.     ListBox: HWND;
  14507.     Result: Longint;
  14508.   end;
  14509.  
  14510.   TWMChildActivate = TWMNoParams;
  14511.  
  14512.   TWMChooseFont_GetLogFont = record
  14513.     Msg: Longint;
  14514.     Unused: Longint;
  14515.     LogFont: PLogFont;
  14516.     Result: Longint;
  14517.   end;
  14518.  
  14519.   TWMClear = TWMNoParams;
  14520.   TWMClose = TWMNoParams;
  14521.  
  14522.   TWMCommand = record
  14523.     Msg: Longint;
  14524.     ItemID: Word;
  14525.     NotifyCode: Word;
  14526.     Ctl: HWND;
  14527.     Result: Longint;
  14528.   end;
  14529.  
  14530.   TWMCompacting = record
  14531.     Msg: Longint;
  14532.     CompactRatio: Longint;
  14533.     Unused: Longint;
  14534.     Result: Longint;
  14535.   end;
  14536.  
  14537.   TWMCompareItem = record
  14538.     Msg: Longint;
  14539.     Ctl: HWnd;
  14540.     CompareItemStruct: PCompareItemStruct;
  14541.     Result: Longint;
  14542.   end;
  14543.  
  14544.   TWMCreate = record
  14545.     Msg: Longint;
  14546.     Unused: Integer;
  14547.     CreateStruct: PCreateStruct;
  14548.     Result: Longint;
  14549.   end;
  14550.  
  14551.   TWMCtlColor = record
  14552.     Msg: Longint;
  14553.     ChildDC: HDC;
  14554.     ChildWnd: HWND;
  14555.     Result: Longint;
  14556.   end;
  14557.  
  14558.   TWMCtlColorBtn = TWMCtlColor;
  14559.   TWMCtlColorDlg = TWMCtlColor;
  14560.   TWMCtlColorEdit = TWMCtlColor;
  14561.   TWMCtlColorListbox = TWMCtlColor;
  14562.   TWMCtlColorMsgbox = TWMCtlColor;
  14563.   TWMCtlColorScrollbar = TWMCtlColor;
  14564.   TWMCtlColorStatic = TWMCtlColor;
  14565.  
  14566.   TWMCut = TWMNoParams;
  14567.  
  14568.   TWMDDE_Advise = record
  14569.     Msg: Longint;
  14570.     PostingApp: HWND;
  14571.     PackedVal: Longint;
  14572.     Result: Longint;
  14573.   end;
  14574.  
  14575.   TWMDDE_Data = record
  14576.     Msg: Longint;
  14577.     PostingApp: HWND;
  14578.     PackedVal: Longint;
  14579.     Result: Longint;
  14580.   end;
  14581.  
  14582.   TWMDDE_Execute = record
  14583.     Msg: Longint;
  14584.     PostingApp: HWND;
  14585.     Commands: THandle;
  14586.     Result: Longint;
  14587.   end;
  14588.  
  14589.   TWMDDE_Initiate = record
  14590.     Msg: Longint;
  14591.     PostingApp: HWND;
  14592.     App: Word;
  14593.     Topic: Word;
  14594.     Result: Longint;
  14595.   end;
  14596.  
  14597.   TWMDDE_Poke = record
  14598.     Msg: Longint;
  14599.     PostingApp: HWND;
  14600.     PackedVal: Longint;
  14601.     Result: Longint;
  14602.   end;
  14603.  
  14604.   TWMDDE_Request = record
  14605.     Msg: Longint;
  14606.     PostingApp: HWND;
  14607.     Format: Word;
  14608.     Item: Word;
  14609.     Result: Longint;
  14610.   end;
  14611.  
  14612.   TWMDDE_Terminate = record
  14613.     Msg: Longint;
  14614.     PostingApp: HWND;
  14615.     Unused: Longint;
  14616.     Result: Longint;
  14617.   end;
  14618.  
  14619.   TWMDDE_Unadvise = record
  14620.     Msg: Longint;
  14621.     PostingApp: HWND;
  14622.     Format: Word;
  14623.     Item: Word;
  14624.     Result: Longint;
  14625.   end;
  14626.  
  14627.   TWMDeadChar = TWMChar;
  14628.  
  14629.   TWMDeleteItem = record
  14630.     Msg: Longint;
  14631.     Ctl: HWND;
  14632.     DeleteItemStruct: PDeleteItemStruct;
  14633.     Result: Longint;
  14634.   end;
  14635.  
  14636.   TWMDestroy = TWMNoParams;
  14637.   TWMDestroyClipboard = TWMNoParams;
  14638.  
  14639.   TWMDevModeChange = record
  14640.     Msg: Longint;
  14641.     Unused: Integer;
  14642.     Device: PChar;
  14643.     Result: Longint;
  14644.   end;
  14645.  
  14646.   TWMDrawClipboard = TWMNoParams;
  14647.  
  14648.   TWMDrawItem = record
  14649.     Msg: Longint;
  14650.     Ctl: HWND;
  14651.     DrawItemStruct: PDrawItemStruct;
  14652.     Result: Longint;
  14653.   end;
  14654.  
  14655.   TWMDropFiles = record
  14656.     Msg: Longint;
  14657.     Drop: THANDLE;
  14658.     Unused: Longint;
  14659.     Result: Longint;
  14660.   end;
  14661.  
  14662.   TWMEnable = record
  14663.     Msg: Longint;
  14664.     Enabled: LongBool;
  14665.     Unused: Longint;
  14666.     Result: Longint;
  14667.   end;
  14668.  
  14669.   TWMEndSession = record
  14670.     Msg: Longint;
  14671.     EndSession: LongBool;
  14672.     Unused: Longint;
  14673.     Result: Longint;
  14674.   end;
  14675.  
  14676.   TWMEnterIdle = record
  14677.     Msg: Longint;
  14678.     Source: Longint; // Msgf_DialogBox, Msgf_Menu }
  14679.     IdleWnd: HWND;
  14680.     Result: Longint;
  14681.   end;
  14682.  
  14683.   TWMEnterMenuLoop = record
  14684.     Msg: Longint;
  14685.     IsTrackPopupMenu: LongBool;
  14686.     Unused: Longint;
  14687.     Result: Longint;
  14688.   end;
  14689.  
  14690.   TWMExitMenuLoop = TWMEnterMenuLoop;
  14691.  
  14692.   TWMEraseBkgnd = record
  14693.     Msg: Longint;
  14694.     DC: HDC;
  14695.     Unused: Longint;
  14696.     Result: Longint;
  14697.   end;
  14698.  
  14699.   TWMFontChange = TWMNoParams;
  14700.   TWMGetDlgCode = TWMNoParams;
  14701.   TWMGetFont = TWMNoParams;
  14702.  
  14703.   TWMGetIcon = record
  14704.     Msg: Longint;
  14705.     BigIcon: Longbool;
  14706.     Unused: Longint;
  14707.     Result: Longint;
  14708.   end;
  14709.  
  14710.   TWMGetHotKey = TWMNoParams;
  14711.  
  14712.   TWMGetMinMaxInfo = record
  14713.     Msg: Longint;
  14714.     Unused: Integer;
  14715.     MinMaxInfo: PMinMaxInfo;
  14716.     Result: Longint;
  14717.   end;
  14718.  
  14719.   TWMGetText = record
  14720.     Msg: Longint;
  14721.     TextMax: Integer;
  14722.     Text: PChar;
  14723.     Result: Longint;
  14724.   end;
  14725.  
  14726.   TWMGetTextLength = TWMNoParams;
  14727.  
  14728.   TWMHotKey = record
  14729.     Msg: Longint;
  14730.     HotKey: Longint;
  14731.     Unused: Longint;
  14732.     Result: Longint;
  14733.   end;
  14734.  
  14735.   TWMHScroll = TWMScroll;
  14736.  
  14737.   TWMHScrollClipboard = record
  14738.     Msg: Longint;
  14739.     Viewer: HWND;
  14740.     ScrollCode: Word; {sb_Bottom, sb_EndScroll, sb_LineDown, sb_LineUp,
  14741.                        sb_PageDown, SB_PageUp, sb_ThumbPosition,
  14742.                        sb_ThumbTrack, sb_Top }
  14743.     Pos: Word;
  14744.     Result: Longint;
  14745.   end;
  14746.  
  14747.   TWMIconEraseBkgnd = TWMEraseBkgnd;
  14748.  
  14749.   TWMInitDialog = record
  14750.     Msg: Longint;
  14751.     Focus: HWND;
  14752.     InitParam: Longint;
  14753.     Result: Longint;
  14754.   end;
  14755.  
  14756.   TWMInitMenu = record
  14757.     Msg: Longint;
  14758.     Menu: HMENU;
  14759.     Unused: Longint;
  14760.     Result: Longint;
  14761.   end;
  14762.  
  14763.   TWMInitMenuPopup = record
  14764.     Msg: Longint;
  14765.     MenuPopup: HMENU;
  14766.     Pos: Smallint;
  14767.     SystemMenu: WordBool;
  14768.     Result: Longint;
  14769.   end;
  14770.  
  14771.   TWMKeyDown = TWMKey;
  14772.   TWMKeyUp = TWMKey;
  14773.  
  14774.   TWMKillFocus = record
  14775.     Msg: Longint;
  14776.     FocusedWnd: HWND;
  14777.     Unused: Longint;
  14778.     Result: Longint;
  14779.   end;
  14780.  
  14781.   TWMLButtonDblClk = TWMMouse;
  14782.   TWMLButtonDown   = TWMMouse;
  14783.   TWMLButtonUp     = TWMMouse;
  14784.   TWMMButtonDblClk = TWMMouse;
  14785.   TWMMButtonDown   = TWMMouse;
  14786.   TWMMButtonUp     = TWMMouse;
  14787.  
  14788.   TWMMDIActivate = record
  14789.     Msg: Longint;
  14790.     case Integer of
  14791.       0: (
  14792.         ChildWnd: HWND);
  14793.       1: (
  14794.         DeactiveWnd: HWND;
  14795.         ActiveWnd: HWND;
  14796.         Result: Longint);
  14797.   end;
  14798.  
  14799.   TWMMDICascade = record
  14800.     Msg: Longint;
  14801.     Cascade: Longint; { 0, MdiTile_SkipDisabled }
  14802.     Unused: Longint;
  14803.     Result: Longint;
  14804.   end;
  14805.  
  14806.   TWMMDICreate = record
  14807.     Msg: Longint;
  14808.     Unused: Integer;
  14809.     MDICreateStruct: PMDICreateStruct;
  14810.     Result: Longint;
  14811.   end;
  14812.  
  14813.   TWMMDIDestroy = record
  14814.     Msg: Longint;
  14815.     Child: HWND;
  14816.     Unused: Longint;
  14817.     Result: Longint;
  14818.   end;
  14819.  
  14820.   TWMMDIGetActive = TWMNoParams;
  14821.   TWMMDIIconArrange = TWMNoParams;
  14822.  
  14823.   TWMMDIMaximize = record
  14824.     Msg: Longint;
  14825.     Maximize: HWND;
  14826.     Unused: Longint;
  14827.     Result: Longint;
  14828.   end;
  14829.  
  14830.   TWMMDINext = record
  14831.     Msg: Longint;
  14832.     Child: HWND;
  14833.     Next: Longint;
  14834.     Result: Longint;
  14835.   end;
  14836.  
  14837.   TWMMDIRefreshMenu = TWMNoParams;
  14838.  
  14839.   TWMMDIRestore = record
  14840.     Msg: Longint;
  14841.     IDChild: HWND;
  14842.     Unused: Longint;
  14843.     Result: Longint;
  14844.   end;
  14845.  
  14846.   TWMMDISetMenu = record
  14847.     Msg: Longint;
  14848.     MenuFrame: HMENU;
  14849.     MenuWindow: HMENU;
  14850.     Result: Longint;
  14851.   end;
  14852.  
  14853.   TWMMDITile = record
  14854.     Msg: Longint;
  14855.     Tile: Longint; { MdiTile_Horizontal, MdiTile_SkipDisable,
  14856.                      MdiTile_Vertical }
  14857.     Unused: Longint;
  14858.     Result: Longint;
  14859.   end;
  14860.  
  14861.   TWMMeasureItem = record
  14862.     Msg: Longint;
  14863.     IDCtl: HWnd;
  14864.     MeasureItemStruct: PMeasureItemStruct;
  14865.     Result: Longint;
  14866.   end;
  14867.  
  14868.   TWMMenuChar = record
  14869.     Msg: Longint;
  14870.     User: Char;
  14871.     Unused: Byte;
  14872.     MenuFlag: Word; { mf_Popup, mf_SysMenu }
  14873.     Menu: HMENU;
  14874.     Result: Longint;
  14875.   end;
  14876.  
  14877.   TWMMenuSelect = record
  14878.     Msg: Longint;
  14879.     IDItem: Word;
  14880.     MenuFlag: Word; { mf_Bitmap, mf_Checked, mf_Disabled, mf_Grayed,
  14881.                       mf_MouseSelect, mf_OwnerDraw, mf_Popup, mf_Separator,
  14882.                       mf_SysMenu }
  14883.     Menu: HMENU;
  14884.     Result: Longint;
  14885.   end;
  14886.  
  14887.   TWMMouseActivate = record
  14888.     Msg: Longint;
  14889.     TopLevel: HWND;
  14890.     HitTestCode: Word;
  14891.     MouseMsg: Word;
  14892.     Result: Longint;
  14893.   end;
  14894.  
  14895.   TWMMouseMove = TWMMouse;
  14896.  
  14897.   TWMMove = record
  14898.     Msg: Longint;
  14899.     Unused: Integer;
  14900.     case Integer of
  14901.       0: (
  14902.         XPos: Smallint;
  14903.         YPos: Smallint);
  14904.       1: (
  14905.         Pos: TSmallPoint;
  14906.         Result: Longint);
  14907.   end;
  14908.  
  14909.   TWMNCActivate = record
  14910.     Msg: Longint;
  14911.     Active: Bool;
  14912.     Unused: Longint;
  14913.     Result: Longint;
  14914.   end;
  14915.  
  14916.   TWMNCCreate = record
  14917.     Msg: Longint;
  14918.     Unused: Integer;
  14919.     CreateStruct: PCreateStruct;
  14920.     Result: Longint;
  14921.   end;
  14922.  
  14923.   TWMNCDestroy = TWMNoParams;
  14924.  
  14925.   TWMNCHitTest = record
  14926.     Msg: Longint;
  14927.     Unused: Longint;
  14928.     case Integer of
  14929.       0: (
  14930.         XPos: Smallint;
  14931.         YPos: Smallint);
  14932.       1: (
  14933.         Pos: TSmallPoint;
  14934.         Result: Longint);
  14935.   end;
  14936.  
  14937.   TWMNCHitMessage = record
  14938.     Msg: Longint;
  14939.     HitTest: Longint;
  14940.     XCursor: Smallint;
  14941.     YCursor: Smallint;
  14942.     Result: Longint;
  14943.   end;
  14944.  
  14945.   TWMNCLButtonDblClk = TWMNCHitMessage;
  14946.   TWMNCLButtonDown   = TWMNCHitMessage;
  14947.   TWMNCLButtonUp     = TWMNCHitMessage;
  14948.   TWMNCMButtonDblClk = TWMNCHitMessage;
  14949.   TWMNCMButtonDown   = TWMNCHitMessage;
  14950.   TWMNCMButtonUp     = TWMNCHitMessage;
  14951.   TWMNCMouseMove     = TWMNCHitMessage;
  14952.  
  14953.   TWMNCPaint = TWMNoParams;
  14954.  
  14955.   TWMNCRButtonDblClk = TWMNCHitMessage;
  14956.   TWMNCRButtonDown   = TWMNCHitMessage;
  14957.   TWMNCRButtonUp     = TWMNCHitMessage;
  14958.  
  14959.   TWMNextDlgCtl = record
  14960.     Msg: Longint;
  14961.     CtlFocus: Longint;
  14962.     Handle: WordBool;
  14963.     Unused: Word;
  14964.     Result: Longint;
  14965.   end;
  14966.  
  14967.   TWMNotify = record
  14968.     Msg: Cardinal;
  14969.     IDCtrl: Longint;
  14970.     NMHdr: PNMHdr;
  14971.     Result: Longint;
  14972.   end;
  14973.  
  14974.   TWMNotifyFormat = record
  14975.     Msg: Longint;
  14976.     From: HWND;
  14977.     Command: Longint;
  14978.     Result: Longint;
  14979.   end;
  14980.  
  14981.   TWMPaint = record
  14982.     Msg: Longint;
  14983.     DC: HDC;
  14984.     Unused: Longint;
  14985.     Result: Longint;
  14986.   end;
  14987.  
  14988.   TWMPaintClipboard = record
  14989.     Msg: Longint;
  14990.     Viewer: HWND;
  14991.     PaintStruct: THandle;
  14992.     Result: Longint;
  14993.   end;
  14994.  
  14995.   TWMPaintIcon = TWMNoParams;
  14996.  
  14997.   TWMPaletteChanged = record
  14998.     Msg: Longint;
  14999.     PalChg: HWND;
  15000.     Unused: Longint;
  15001.     Result: Longint;
  15002.   end;
  15003.  
  15004.   TWMPaletteIsChanging = record
  15005.     Msg: Longint;
  15006.     Realize: HWND;
  15007.     Unused: Longint;
  15008.     Result: Longint;
  15009.   end;
  15010.  
  15011.   TWMParentNotify = record
  15012.     Msg: Longint;
  15013.     case Event: Word of
  15014.       wm_Create, wm_Destroy: (
  15015.         ChildID: Word;
  15016.         ChildWnd: HWnd);
  15017.       wm_LButtonDown, wm_MButtonDown, wm_RButtonDown: (
  15018.         Value: Word;
  15019.         XPos: Smallint;
  15020.         YPos: Smallint);
  15021.       0: (
  15022.         Value1: Word;
  15023.         Value2: Longint;
  15024.         Result: Longint);
  15025.   end;
  15026.  
  15027.   TWMPaste = TWMNoParams;
  15028.  
  15029.   TWMPower = record
  15030.     Msg: Longint;
  15031.     PowerEvt: Longint; { pwr_SuspendRequest, pwr_SuspendResume,
  15032.                          pwr_CriticalResume }
  15033.     Unused: Longint;
  15034.     Result: Longint;
  15035.   end;
  15036.  
  15037.   TWMQueryDragIcon = TWMNoParams;
  15038.  
  15039.   TWMQueryEndSession = record
  15040.     Msg: Longint;
  15041.     Source: Longint;
  15042.     Unused: Longint;
  15043.     Result: Longint;
  15044.   end;
  15045.  
  15046.   TWMQueryNewPalette = TWMNoParams;
  15047.   TWMQueryOpen = TWMNoParams;
  15048.   TWMQueueSync = TWMNoParams;
  15049.  
  15050.   TWMQuit = record
  15051.     Msg: Longint;
  15052.     ExitCode: Longint;
  15053.     Unused: Longint;
  15054.     Result: Longint;
  15055.   end;
  15056.  
  15057.   TWMRButtonDblClk = TWMMouse;
  15058.   TWMRButtonDown = TWMMouse;
  15059.   TWMRButtonUp = TWMMouse;
  15060.  
  15061.   TWMRenderAllFormats = TWMNoParams;
  15062.  
  15063.   TWMRenderFormat = record
  15064.     Msg: Longint;
  15065.     Format: Longint;
  15066.     Unused: Longint;
  15067.     Result: Longint;
  15068.   end;
  15069.  
  15070.   TWMSetCursor = record
  15071.     Msg: Longint;
  15072.     CursorWnd: HWND;
  15073.     HitTest: Word;
  15074.     MouseMsg: Word;
  15075.     Result: Longint;
  15076.   end;
  15077.  
  15078.   TWMSetFocus = record
  15079.     Msg: Longint;
  15080.     FocusedWnd: HWND;
  15081.     Unused: Longint;
  15082.     Result: Longint;
  15083.   end;
  15084.  
  15085.   TWMSetFont = record
  15086.     Msg: Longint;
  15087.     Font: HFONT;
  15088.     Redraw: WordBool;
  15089.     Unused: Word;
  15090.     Result: Longint;
  15091.   end;
  15092.  
  15093.   TWMSetHotKey = record
  15094.     Msg: Longint;
  15095.     Key: Longint;
  15096.     Unused: Longint;
  15097.     Result: Longint;
  15098.   end;
  15099.  
  15100.   TWMSetIcon = record
  15101.     Msg: Longint;
  15102.     BigIcon: Longbool;
  15103.     Icon: HICON;
  15104.     Result: Longint;
  15105.   end;
  15106.  
  15107.   TWMSetRedraw = record
  15108.     Msg: Longint;
  15109.     Redraw: Longint;
  15110.     Unused: Longint;
  15111.     Result: Longint;
  15112.   end;
  15113.  
  15114.   TWMSetText = record
  15115.     Msg: Longint;
  15116.     Unused: Longint;
  15117.     Text: PChar;
  15118.     Result: Longint;
  15119.   end;
  15120.  
  15121.   TWMShowWindow = record
  15122.     Msg: Longint;
  15123.     Show: Bool;
  15124.     Status: Longint;
  15125.     Result: Longint;
  15126.   end;
  15127.  
  15128.   TWMSize = record
  15129.     Msg: Longint;
  15130.     SizeType: Longint; { Size_Maximized, Size_Minimized, Size_Restored,
  15131.                          Size_MaxHide, Size_MaxShow }
  15132.     Width: Word;
  15133.     Height: Word;
  15134.     Result: Longint;
  15135.   end;
  15136.  
  15137.   TWMSizeClipboard = record
  15138.     Msg: Longint;
  15139.     Viewer: HWND;
  15140.     RC: THandle;
  15141.     Result: Longint;
  15142.   end;
  15143.  
  15144.   TWMSpoolerStatus = record
  15145.     Msg: Longint;
  15146.     JobStatus: Longint;
  15147.     JobsLeft: Word;
  15148.     Unused: Word;
  15149.     Result: Longint;
  15150.   end;
  15151.  
  15152.   TWMSysChar = TWMKey;
  15153.   TWMSysColorChange = TWMNoParams;
  15154.  
  15155.   TWMSysCommand = record
  15156.     Msg: Longint;
  15157.     case CmdType: Longint of
  15158.       sc_Hotkey: (
  15159.         ActivateWnd: HWND);
  15160.       sc_KeyMenu: (
  15161.         Key: Word);
  15162.       sc_Close, sc_HScroll, sc_Maximize, sc_Minimize, sc_MouseMenu, sc_Move,
  15163.       sc_NextWindow, sc_PrevWindow, sc_Restore, sc_ScreenSave, sc_Size,
  15164.       sc_TaskList, sc_VScroll: (
  15165.         XPos: Smallint;
  15166.         YPos: Smallint;
  15167.         Result: Longint);
  15168.   end;
  15169.  
  15170.   TWMSysDeadChar = record
  15171.     Msg: Longint;
  15172.     CharCode: Word;
  15173.     Unused: Word;
  15174.     KeyData: Longint;
  15175.     Result: Longint;
  15176.   end;
  15177.  
  15178.   TWMSysKeyDown = TWMKey;
  15179.   TWMSysKeyUp = TWMKey;
  15180.  
  15181.   TWMSystemError = record
  15182.     Msg: Longint;
  15183.     ErrSpec: Word;
  15184.     Unused: Longint;
  15185.     Result: Longint;
  15186.   end;
  15187.  
  15188.   TWMTimeChange = TWMNoParams;
  15189.  
  15190.   TWMTimer = record
  15191.     Msg: Longint;
  15192.     TimerID: Longint;
  15193.     TimerProc: TFarProc;
  15194.     Result: Longint;
  15195.   end;
  15196.  
  15197.   TWMUndo = TWMNoParams;
  15198.  
  15199.   TWMVKeyToItem = TWMCharToItem;
  15200.  
  15201.   TWMVScroll = TWMScroll;
  15202.  
  15203.   TWMVScrollClipboard = record
  15204.     Msg: Longint;
  15205.     Viewer: HWND;
  15206.     ScollCode: Word;
  15207.     ThumbPos: Word;
  15208.     Result: Longint;
  15209.   end;
  15210.  
  15211.   TWMWindowPosChanged = TWMWindowPosMsg;
  15212.   TWMWindowPosChanging = TWMWindowPosMsg;
  15213.  
  15214.   TWMWinIniChange = record
  15215.     Msg: Longint;
  15216.     Unused: Integer;
  15217.     Section: PChar;
  15218.     Result: Longint;
  15219.   end;
  15220.  
  15221.   TWMDisplayChange = record
  15222.     Msg: Longint;
  15223.     BitsPerPixel: Integer;
  15224.     Width: Word;
  15225.     Height: Word;
  15226.   end;
  15227.  
  15228. {$IFNDEF Open32}
  15229.  
  15230.   TWMCopy = TWMNoParams;
  15231.  
  15232.   TWMCopyData = record
  15233.     Msg: Longint;
  15234.     From: HWND;
  15235.     CopyDataStruct: PCopyDataStruct;
  15236.     Result: Longint;
  15237.   end;
  15238.  
  15239.   TWMDDE_Ack = record
  15240.     Msg: Longint;
  15241.     PostingApp: HWND;
  15242.     case Word of
  15243.       wm_DDE_Initiate: (
  15244.         App: Word;
  15245.         Topic: Word;
  15246.         Result: Longint);
  15247.       wm_DDE_Execute {and all others}: (
  15248.         PackedVal: Longint);
  15249.   end;
  15250.  
  15251.   TWMNCCalcSize = record
  15252.     Msg: Longint;
  15253.     CalcValidRects: Bool;
  15254.     CalcSize_Params: PNCCalcSizeParams;
  15255.     Result: Longint;
  15256.   end;
  15257.  
  15258.   TWMStyleChange = record
  15259.     Msg: Longint;
  15260.     StyleType: Longint;
  15261.     StyleStruct: PStyleStruct;
  15262.     Result: Longint;
  15263.   end;
  15264.  
  15265.   TWMStyleChanged = TWMStyleChange;
  15266.   TWMStyleChanging = TWMStyleChange;
  15267.  
  15268.   TWMHelp = record
  15269.     Msg: Longint;
  15270.     Unused: Integer;
  15271.     HelpInfo: PHelpInfo;
  15272.     Result: Longint;
  15273.   end;
  15274.  
  15275. {$ENDIF}
  15276.  
  15277. implementation
  15278.  
  15279. function AbortDoc;                         external;
  15280. function AbortPath;                        external;
  15281. function AddAtom;                          external;
  15282. function AddFontResource;                  external;
  15283. function AdjustWindowRect;                 external;
  15284. function AdjustWindowRectEx;               external;
  15285. function AngleArc;                         external;
  15286. function AnimatePalette;                   external;
  15287. function AnsiLower;                        external;
  15288. function AnsiLowerBuff;                    external;
  15289. function AnsiNext;                         external;
  15290. function AnsiPrev;                         external;
  15291. function AnsiToOem;                        external;
  15292. function AnsiToOemBuff;                    external;
  15293. function AnsiUpper;                        external;
  15294. function AnsiUpperBuff;                    external;
  15295. function AppendMenu;                       external;
  15296. function Arc;                              external;
  15297. function ArcTo;                            external;
  15298. function ArrangeIconicWindows;             external;
  15299. function Beep;                             external;
  15300. function BeginDeferWindowPos;              external;
  15301. function BeginPaint;                       external;
  15302. function BeginPath;                        external;
  15303. function BitBlt;                           external;
  15304. function BringWindowToTop;                 external;
  15305. function CallMsgFilter;                    external;
  15306. function CallNextHookEx;                   external;
  15307. function CallWindowProc;                   external;
  15308. function ChangeClipboardChain;             external;
  15309. function CharLower;                        external;
  15310. function CharLowerBuff;                    external;
  15311. function CharNext;                         external;
  15312. function CharPrev;                         external;
  15313. function CharToOem;                        external;
  15314. function CharToOemBuff;                    external;
  15315. function CharUpper;                        external;
  15316. function CharUpperBuff;                    external;
  15317. function CheckDlgButton;                   external;
  15318. function CheckMenuItem;                    external;
  15319. function CheckRadioButton;                 external;
  15320. function ChildWindowFromPoint;             external;
  15321. function Chord;                            external;
  15322. function ClientToScreen;                   external;
  15323. function ClipCursor;                       external;
  15324. function CloseClipboard;                   external;
  15325. function CloseEnhMetaFile;                 external;
  15326. function CloseFigure;                      external;
  15327. function CloseHandle;                      external;
  15328. function ClosePrinter; external;
  15329. function CloseMetaFile;                    external;
  15330. function CloseWindow;                      external;
  15331. function CombineRgn;                       external;
  15332. function CompareFileTime;                  external;
  15333. function CopyCursor;                       external;
  15334. function CopyEnhMetaFile;                  external;
  15335. function CopyFile;                         external;
  15336. function CopyIcon;                         external;
  15337. function CopyMetaFile;                     external;
  15338. function CopyRect;                         external;
  15339. function CountClipboardFormats;            external;
  15340. function CreateAcceleratorTable;           external;
  15341. function CreateBitmap;                     external;
  15342. function CreateBitmapIndirect;             external;
  15343. function CreateBrushIndirect;              external;
  15344. function CreateCaret;                      external;
  15345. function CreateCompatibleBitmap;           external;
  15346. function CreateCompatibleDC;               external;
  15347. function CreateCursor;                     external;
  15348. function CreateDC;                         external;
  15349. function CreateDialogIndirectParam;        external;
  15350. function CreateDialogParam;                external;
  15351. function CreateDIBitmap;                   external;
  15352. function CreateDIBPatternBrushPt;          external;
  15353. function CreateDirectory;                  external;
  15354. function CreateEllipticRgn;                external;
  15355. function CreateEllipticRgnIndirect;        external;
  15356. function CreateEnhMetaFile;                external;
  15357. function CreateEvent;                      external;
  15358. function CreateFile;                       external;
  15359. function CreateFont;                       external;
  15360. function CreateFontIndirect;               external;
  15361. function CreateHalftonePalette;            external;
  15362. function CreateHatchBrush;                 external;
  15363. function CreateIC;                         external;
  15364. function CreateIcon;                       external;
  15365. function CreateIconFromResource;           external;
  15366. function CreateIconIndirect;               external;
  15367. function CreateMDIWindow;                  external;
  15368. function CreateMenu;                       external;
  15369. function CreateMetaFile;                   external;
  15370. function CreateMutex;                      external;
  15371. function CreatePalette;                    external;
  15372. function CreatePatternBrush;               external;
  15373. function CreatePen;                        external;
  15374. function CreatePenIndirect;                external;
  15375. function CreatePolygonRgn;                 external;
  15376. function CreatePolyPolygonRgn;             external;
  15377. function CreatePopupMenu;                  external;
  15378. function CreateProcess;                    external;
  15379. function CreateRectRgn;                    external;
  15380. function CreateRectRgnIndirect;            external;
  15381. function CreateRoundRectRgn;               external;
  15382. function CreateSemaphore;                  external;
  15383. function CreateSolidBrush;                 external;
  15384. function CreateThread;                     external;
  15385. function CreateWindowEx;                   external;
  15386. function DefDlgProc;                       external;
  15387. function DeferWindowPos;                   external;
  15388. function DefFrameProc;                     external;
  15389. function DefMDIChildProc;                  external;
  15390. function DefWindowProc;                    external;
  15391. function DeleteAtom;                       external;
  15392. procedure DeleteCriticalSection;           external;
  15393. function DeleteDC;                         external;
  15394. function DeleteEnhMetaFile;                external;
  15395. function DeleteFile;                       external;
  15396. function DeleteMenu;                       external;
  15397. function DeleteMetaFile;                   external;
  15398. function DeleteObject;                     external;
  15399. function DestroyAcceleratorTable;          external;
  15400. function DestroyCaret;                     external;
  15401. function DestroyCursor;                    external;
  15402. function DestroyIcon;                      external;
  15403. function DestroyMenu;                      external;
  15404. function DestroyWindow;                    external;
  15405. function DeviceCapabilities;               external;
  15406. function DialogBoxIndirectParam;           external;
  15407. function DialogBoxParam;                   external;
  15408. function DispatchMessage;                  external;
  15409. function DlgDirList;                       external;
  15410. function DlgDirListComboBox;               external;
  15411. function DlgDirSelectComboBoxEx;           external;
  15412. function DlgDirSelectEx;                   external;
  15413. function DllEntryPoint;                    external;
  15414. function DocumentProperties;               external;
  15415. function DosDateTimeToFileTime;            external;
  15416. function DPtoLP;                           external;
  15417. function DrawFocusRect;                    external;
  15418. function DrawIcon;                         external;
  15419. function DrawMenuBar;                      external;
  15420. function DrawText;                         external;
  15421. function DuplicateHandle;                  external;
  15422. function Ellipse;                          external;
  15423. function EmptyClipboard;                   external;
  15424. function EnableMenuItem;                   external;
  15425. function EnableScrollBar;                  external;
  15426. function EnableWindow;                     external;
  15427. function EndDeferWindowPos;                external;
  15428. function EndDialog;                        external;
  15429. function EndDoc;                           external;
  15430. function EndPage;                          external;
  15431. function EndPaint;                         external;
  15432. function EndPath;                          external;
  15433. procedure EnterCriticalSection;            external;
  15434. function EnumChildWindows;                 external;
  15435. function EnumClipboardFormats;             external;
  15436. function EnumEnhMetaFile;                  external;
  15437. function EnumFontFamilies;                 external;
  15438. function EnumFonts;                        external;
  15439. function EnumMetaFile;                     external;
  15440. function EnumObjects;                      external;
  15441. function EnumPrinters;                     external;
  15442. function EnumProps;                        external;
  15443. function EnumPropsEx;                      external;
  15444. function EnumThreadWindows;                external;
  15445. function EnumWindows;                      external;
  15446. function EqualRect;                        external;
  15447. function EqualRgn;                         external;
  15448. function Escape;                           external;
  15449. function ExcludeClipRect;                  external;
  15450. function ExcludeUpdateRgn;                 external;
  15451. procedure ExitProcess;                     external;
  15452. procedure ExitThread;                      external;
  15453. function ExitWindowsEx;                    external;
  15454. function ExtCreatePen;                     external;
  15455. function ExtCreateRegion;                  external;
  15456. function ExtFloodFill;                     external;
  15457. function ExtSelectClipRgn;                 external;
  15458. function ExtTextOut;                       external;
  15459. procedure FatalAppExit;                    external;
  15460. procedure FatalExit;                       external;
  15461. function FileTimeToDosDateTime;            external;
  15462. function FileTimeToLocalFileTime;          external;
  15463. function FileTimeToSystemTime;             external;
  15464. function FillPath;                         external;
  15465. function FillRect;                         external;
  15466. function FillRgn;                          external;
  15467. function FindAtom;                         external;
  15468. function FindClose;                        external;
  15469. function FindFirstFile;                    external;
  15470. function FindNextFile;                     external;
  15471. function FindResource;                     external;
  15472. function FindWindow;                       external;
  15473. function FlashWindow;                      external;
  15474. function FlattenPath;                      external;
  15475. function FloodFill;                        external;
  15476. function FlushFileBuffers;                 external;
  15477. function FrameRect;                        external;
  15478. function FrameRgn;                         external;
  15479. function FreeDDElParam;                    external;
  15480. function FreeLibrary;                      external;
  15481. function GdiFlush;                         external;
  15482. function GetACP;                           external;
  15483. function GetActiveWindow;                  external;
  15484. function GetArcDirection;                  external;
  15485. function GetAspectRatioFilterEx;           external;
  15486. function GetAtomName;                      external;
  15487. function GetBitmapBits;                    external;
  15488. function GetBitmapDimensionEx;             external;
  15489. function GetBkColor;                       external;
  15490. function GetBkMode;                        external;
  15491. function GetBoundsRect;                    external;
  15492. function GetBrushOrgEx;                    external;
  15493. function GetCapture;                       external;
  15494. function GetCaretBlinkTime;                external;
  15495. function GetCaretPos;                      external;
  15496. function GetCharABCWidths;                 external;
  15497. function GetCharWidth;                     external;
  15498. function GetClassInfo;                     external;
  15499. function GetClassLong;                     external;
  15500. function GetClassName;                     external;
  15501. function GetClassWord;                     external;
  15502. function GetClientRect;                    external;
  15503. function GetClipboardData;                 external;
  15504. function GetClipboardFormatName;           external;
  15505. function GetClipboardOwner;                external;
  15506. function GetClipboardViewer;               external;
  15507. function GetClipBox;                       external;
  15508. function GetClipCursor;                    external;
  15509. function GetClipRgn;                       external;
  15510. function GetCommandLine;                   external;
  15511. function GetCurrentDirectory;              external;
  15512. function GetCurrentObject;                 external;
  15513. function GetCurrentPositionEx;             external;
  15514. function GetCurrentProcess;                external;
  15515. function GetCurrentProcessId;              external;
  15516. function GetCurrentThread;                 external;
  15517. function GetCurrentThreadId;               external;
  15518. function GetCursor;                        external;
  15519. function GetCursorPos;                     external;
  15520. function GetDC;                            external;
  15521. function GetDCEx;                          external;
  15522. function GetDCOrgEx;                       external;
  15523. function GetDesktopWindow;                 external;
  15524. function GetDeviceCaps;                    external;
  15525. function GetDialogBaseUnits;               external;
  15526. function GetDIBits;                        external;
  15527. function GetDiskFreeSpace;                 external;
  15528. function GetDlgCtrlID;                     external;
  15529. function GetDlgItem;                       external;
  15530. function GetDlgItemInt;                    external;
  15531. function GetDlgItemText;                   external;
  15532. function GetDoubleClickTime;               external;
  15533. function GetDriveType;                     external;
  15534. function GetEnhMetaFile;                   external;
  15535. function GetEnhMetaFileBits;               external;
  15536. function GetEnhMetaFileHeader;             external;
  15537. function GetEnhMetaFilePaletteEntries;     external;
  15538. function GetEnvironmentStrings;            external;
  15539. function GetEnvironmentVariable;           external;
  15540. function GetExitCodeProcess;               external;
  15541. function GetExitCodeThread;                external;
  15542. function GetFileAttributes;                external;
  15543. function GetFileInformationByHandle;       external;
  15544. function GetFileSize;                      external;
  15545. function GetFileTime;                      external;
  15546. function GetFileType;                      external;
  15547. function GetFocus;                         external;
  15548. function GetForegroundWindow;              external;
  15549. function GetFullPathName;                  external;
  15550. function GetGraphicsMode;                  external;
  15551. function GetIconInfo;                      external;
  15552. function GetKerningPairs;                  external;
  15553. function GetKeyboardType;                  external;
  15554. function GetKeyNameText;                   external;
  15555. function GetKeyState;                      external;
  15556. function GetLastActivePopup;               external;
  15557. function GetLastError;                     external;
  15558. procedure GetLocalTime;                    external;
  15559. function GetLogicalDrives;                 external;
  15560. function GetLogicalDriveStrings;           external;
  15561. function GetMapMode;                       external;
  15562. function GetMenu;                          external;
  15563. function GetMenuCheckMarkDimensions;       external;
  15564. function GetMenuItemCount;                 external;
  15565. function GetMenuItemID;                    external;
  15566. function GetMenuState;                     external;
  15567. function GetMenuString;                    external;
  15568. function GetMessage;                       external;
  15569. function GetMessageExtraInfo;              external;
  15570. function GetMessagePos;                    external;
  15571. function GetMessageTime;                   external;
  15572. function GetMetaFile;                      external;
  15573. function GetMetaFileBitsEx;                external;
  15574. function GetMiterLimit;                    external;
  15575. function GetModuleFileName;                external;
  15576. function GetModuleHandle;                  external;
  15577. function GetNearestColor;                  external;
  15578. function GetNearestPaletteIndex;           external;
  15579. function GetNextDlgGroupItem;              external;
  15580. function GetNextDlgTabItem;                external;
  15581. function GetNextWindow;                    external;
  15582. function GetObject;                        external;
  15583. function GetObjectType;                    external;
  15584. function GetOEMCP;                         external;
  15585. function GetOpenClipboardWindow;           external;
  15586. function GetOutlineTextMetrics;            external;
  15587. function GetOverlappedResult;              external;
  15588. function GetPaletteEntries;                external;
  15589. function GetParent;                        external;
  15590. function GetPath;                          external;
  15591. function GetPixel;                         external;
  15592. function GetPolyFillMode;                  external;
  15593. function GetPriorityClass;                 external;
  15594. function GetPriorityClipboardFormat;       external;
  15595. function GetPrivateProfileInt;             external;
  15596. function GetPrivateProfileString;          external;
  15597. function GetProcAddress;                   external;
  15598. function GetProfileInt;                    external;
  15599. function GetProfileString;                 external;
  15600. function GetProp;                          external;
  15601. function GetQueueStatus;                   external;
  15602. function GetRasterizerCaps;                external;
  15603. function GetRegionData;                    external;
  15604. function GetRgnBox;                        external;
  15605. function GetROP2;                          external;
  15606. function GetScrollPos;                     external;
  15607. function GetScrollRange;                   external;
  15608. function GetStdHandle;                     external;
  15609. function GetStockObject;                   external;
  15610. function GetStretchBltMode;                external;
  15611. function GetSubMenu;                       external;
  15612. function GetSysColor;                      external;
  15613. function GetSystemDirectory;               external;
  15614. function GetSystemMenu;                    external;
  15615. function GetSystemMetrics;                 external;
  15616. function GetSystemPaletteEntries;          external;
  15617. function GetTabbedTextExtent;              external;
  15618. procedure GetSystemTime;                   external;
  15619. function GetTempFileName;                  external;
  15620. function GetTempPath;                      external;
  15621. function GetTextAlign;                     external;
  15622. function GetTextCharacterExtra;            external;
  15623. function GetTextColor;                     external;
  15624. function GetTextExtentPoint32;             external;
  15625. function GetTextExtentPoint;               external;
  15626. function GetTextFace;                      external;
  15627. function GetTextMetrics;                   external;
  15628. function GetThreadPriority;                external;
  15629. function GetTickCount;                     external;
  15630. function GetTimeZoneInformation;           external;
  15631. function GetTopWindow;                     external;
  15632. function GetUpdateRect;                    external;
  15633. function GetUpdateRgn;                     external;
  15634. function GetViewportExtEx;                 external;
  15635. function GetViewportOrgEx;                 external;
  15636. function GetVolumeInformation;             external;
  15637. function GetWindow;                        external;
  15638. function GetWindowDC;                      external;
  15639. function GetWindowExtEx;                   external;
  15640. function GetWindowLong;                    external;
  15641. function GetWindowOrgEx;                   external;
  15642. function GetWindowPlacement;               external;
  15643. function GetWindowRect;                    external;
  15644. function GetWindowsDirectory;              external;
  15645. function GetWindowText;                    external;
  15646. function GetWindowTextLength;              external;
  15647. function GetWindowThreadProcessId;         external;
  15648. function GetWindowWord;                    external;
  15649. function GetWinMetaFileBits;               external;
  15650. function GetWorldTransform;                external;
  15651. function GlobalAddAtom;                    external;
  15652. function GlobalAlloc;                      external;
  15653. function GlobalDeleteAtom;                 external;
  15654. function GlobalFindAtom;                   external;
  15655. function GlobalFlags;                      external;
  15656. function GlobalFree;                       external;
  15657. function GlobalGetAtomName;                external;
  15658. function GlobalHandle;                     external;
  15659. function GlobalLock;                       external;
  15660. procedure GlobalMemoryStatus;              external;
  15661. function GlobalReAlloc;                    external;
  15662. function GlobalSize;                       external;
  15663. function GlobalUnlock;                     external;
  15664. function HeapAlloc;                        external;
  15665. function HeapCreate;                       external;
  15666. function HeapDestroy;                      external;
  15667. function HeapFree;                         external;
  15668. function HeapReAlloc;                      external;
  15669. function HeapSize;                         external;
  15670. function HideCaret;                        external;
  15671. function HiliteMenuItem;                   external;
  15672. function InflateRect;                      external;
  15673. function InitAtomTable;                    external;
  15674. procedure InitializeCriticalSection;       external;
  15675. function InSendMessage;                    external;
  15676. function InsertMenu;                       external;
  15677. function InterlockedDecrement;             external;
  15678. function InterlockedExchange;              external;
  15679. function InterlockedIncrement;             external;
  15680. function IntersectClipRect;                external;
  15681. function IntersectRect;                    external;
  15682. function InvalidateRect;                   external;
  15683. function InvalidateRgn;                    external;
  15684. function InvertRect;                       external;
  15685. function InvertRgn;                        external;
  15686. function IsBadCodePtr;                     external;
  15687. function IsBadHugeReadPtr;                 external;
  15688. function IsBadHugeWritePtr;                external;
  15689. function IsBadReadPtr;                     external;
  15690. function IsBadStringPtr;                   external;
  15691. function IsBadWritePtr;                    external;
  15692. function IsCharAlpha;                      external;
  15693. function IsCharAlphaNumeric;               external;
  15694. function IsCharLower;                      external;
  15695. function IsCharUpper;                      external;
  15696. function IsChild;                          external;
  15697. function IsClipboardFormatAvailable;       external;
  15698. function IsDBCSLeadByte;                   external;
  15699. function IsDialogMessage;                  external;
  15700. function IsDlgButtonChecked;               external;
  15701. function IsIconic;                         external;
  15702. function IsMenu;                           external;
  15703. function IsRectEmpty;                      external;
  15704. function IsWindow;                         external;
  15705. function IsWindowEnabled;                  external;
  15706. function IsWindowVisible;                  external;
  15707. function IsZoomed;                         external;
  15708. function KillTimer;                        external;
  15709. procedure LeaveCriticalSection;            external;
  15710. function LineDDA;                          external;
  15711. function LineTo;                           external;
  15712. function LoadAccelerators;                 external;
  15713. function LoadBitmap;                       external;
  15714. function LoadCursor;                       external;
  15715. function LoadIcon;                         external;
  15716. function LoadLibrary;                      external;
  15717. function LoadMenu;                         external;
  15718. function LoadMenuIndirect;                 external;
  15719. function LoadModule;                       external;
  15720. function LoadResource;                     external;
  15721. function LoadString;                       external;
  15722. function LocalAlloc;                       external;
  15723. function LocalFileTimeToFileTime;          external;
  15724. function LocalFlags;                       external;
  15725. function LocalFree;                        external;
  15726. function LocalHandle;                      external;
  15727. function LocalLock;                        external;
  15728. function LocalReAlloc;                     external;
  15729. function LocalSize;                        external;
  15730. function LocalUnlock;                      external;
  15731. function LockFile;                         external;
  15732. function FreeResource;                     external;
  15733. function LockResource;                     external;
  15734. function LockWindowUpdate;                 external;
  15735. function LPtoDP;                           external;
  15736. function lstrcat;                          external;
  15737. function lstrcmp;                          external;
  15738. function lstrcmpi;                         external;
  15739. function lstrcpy;                          external;
  15740. function lstrlen;                          external;
  15741. function MapDialogRect;                    external;
  15742. function MapVirtualKey;                    external;
  15743. function MapWindowPoints;                  external;
  15744. function MaskBlt;                          external;
  15745. function MessageBeep;                      external;
  15746. function MessageBox;                       external;
  15747. function ModifyMenu;                       external;
  15748. function ModifyWorldTransform;             external;
  15749. function MoveFile;                         external;
  15750. function MoveToEx;                         external;
  15751. function MoveWindow;                       external;
  15752. function MsgWaitForMultipleObjects;        external;
  15753. function MulDiv;                           external;
  15754. function OemToAnsi;                        external;
  15755. function OemToAnsiBuff;                    external;
  15756. function OemToChar;                        external;
  15757. function OemToCharBuff;                    external;
  15758. function OffsetClipRgn;                    external;
  15759. function OffsetRect;                       external;
  15760. function OffsetRgn;                        external;
  15761. function OffsetViewportOrgEx;              external;
  15762. function OffsetWindowOrgEx;                external;
  15763. function OpenClipboard;                    external;
  15764. function OpenEvent;                        external;
  15765. function OpenFile;                         external;
  15766. function OpenMutex;                        external;
  15767. function OpenPrinter;                      external;
  15768. function OpenProcess;                      external;
  15769. function OpenSemaphore;                    external;
  15770. procedure OutputDebugString;               external;
  15771. function PackDDElParam;                    external;
  15772. function PaintRgn;                         external;
  15773. function PatBlt;                           external;
  15774. function PathToRegion;                     external;
  15775. function PeekMessage;                      external;
  15776. function Pie;                              external;
  15777. function PlayEnhMetaFile;                  external;
  15778. function PlayMetaFile;                     external;
  15779. function PlayMetaFileRecord;               external;
  15780. function PolyBezier;                       external;
  15781. function PolyBezierTo;                     external;
  15782. function PolyDraw;                         external;
  15783. function Polygon;                          external;
  15784. function Polyline;                         external;
  15785. function PolylineTo;                       external;
  15786. function PolyPolygon;                      external;
  15787. function PolyPolyline;                     external;
  15788. function PostMessage;                      external;
  15789. procedure PostQuitMessage;                 external;
  15790. function PostThreadMessage;                external;
  15791. function PtInRect;                         external;
  15792. function PtInRegion;                       external;
  15793. function PtVisible;                        external;
  15794. function PulseEvent;                       external;
  15795. function ReadFile;                         external;
  15796. function RealizePalette;                   external;
  15797. function Rectangle;                        external;
  15798. function RectInRegion;                     external;
  15799. function RectVisible;                      external;
  15800. function RedrawWindow;                     external;
  15801. function RegCloseKey;                      external;
  15802. function RegCreateKey;                     external;
  15803. function RegCreateKeyEx;                   external;
  15804. function RegDeleteKey;                     external;
  15805. function RegDeleteValue;                   external;
  15806. function RegEnumKey;                       external;
  15807. function RegEnumKeyEx;                     external;
  15808. function RegEnumValue;                     external;
  15809. function RegisterClass;                    external;
  15810. function RegisterClipboardFormat;          external;
  15811. function RegisterWindowMessage;            external;
  15812. function RegOpenKey;                       external;
  15813. function RegOpenKeyEx;                     external;
  15814. function RegQueryInfoKey;                  external;
  15815. function RegQueryValue;                    external;
  15816. function RegQueryValueEx;                  external;
  15817. function RegSetValue;                      external;
  15818. function RegSetValueEx;                    external;
  15819. function ReleaseCapture;                   external;
  15820. function ReleaseDC;                        external;
  15821. function ReleaseMutex;                     external;
  15822. function ReleaseSemaphore;                 external;
  15823. function RemoveDirectory;                  external;
  15824. function RemoveFontResource;               external;
  15825. function RemoveMenu;                       external;
  15826. function RemoveProp;                       external;
  15827. function ReplyMessage;                     external;
  15828. function ResetDC;                          external;
  15829. function ResetEvent;                       external;
  15830. function ResizePalette;                    external;
  15831. function RestoreDC;                        external;
  15832. function ResumeThread;                     external;
  15833. function ReuseDDElParam;                   external;
  15834. function RoundRect;                        external;
  15835. function SaveDC;                           external;
  15836. function ScaleViewportExtEx;               external;
  15837. function ScaleWindowExtEx;                 external;
  15838. function ScreenToClient;                   external;
  15839. function ScrollDC;                         external;
  15840. function ScrollWindow;                     external;
  15841. function ScrollWindowEx;                   external;
  15842. function SearchPath;                       external;
  15843. function SelectClipRgn;                    external;
  15844. function SelectObject;                     external;
  15845. function SelectPalette;                    external;
  15846. function SendDlgItemMessage;               external;
  15847. function SendMessage;                      external;
  15848. function SetActiveWindow;                  external;
  15849. function SetArcDirection;                  external;
  15850. function SetBitmapBits;                    external;
  15851. function SetBitmapDimensionEx;             external;
  15852. function SetBkColor;                       external;
  15853. function SetBkMode;                        external;
  15854. function SetBoundsRect;                    external;
  15855. function SetBrushOrgEx;                    external;
  15856. function SetCapture;                       external;
  15857. function SetCaretBlinkTime;                external;
  15858. function SetCaretPos;                      external;
  15859. function SetClassLong;                     external;
  15860. function SetClassWord;                     external;
  15861. function SetClipboardData;                 external;
  15862. function SetClipboardViewer;               external;
  15863. function SetCurrentDirectory;              external;
  15864. function SetCursor;                        external;
  15865. function SetCursorPos;                     external;
  15866. function SetDIBits;                        external;
  15867. function SetDIBitsToDevice;                external;
  15868. function SetDlgItemInt;                    external;
  15869. function SetDlgItemText;                   external;
  15870. function SetDoubleClickTime;               external;
  15871. function SetEndOfFile;                     external;
  15872. function SetEnhMetaFileBits;               external;
  15873. function SetEnvironmentVariable;           external;
  15874. function SetEvent;                         external;
  15875. function SetFileAttributes;                external;
  15876. function SetFilePointer;                   external;
  15877. function SetFileTime;                      external;
  15878. function SetFocus;                         external;
  15879. function SetForegroundWindow;              external;
  15880. function SetGraphicsMode;                  external;
  15881. function SetHandleCount;                   external;
  15882. procedure SetLastError;                    external;
  15883. function SetLocalTime;                     external;
  15884. function SetMapMode;                       external;
  15885. function SetMapperFlags;                   external;
  15886. function SetMenu;                          external;
  15887. function SetMenuItemBitmaps;               external;
  15888. function SetMetaFileBitsEx;                external;
  15889. function SetMiterLimit;                    external;
  15890. function SetPaletteEntries;                external;
  15891. function SetParent;                        external;
  15892. function SetPixel;                         external;
  15893. function SetPolyFillMode;                  external;
  15894. function SetPriorityClass;                 external;
  15895. function SetProp;                          external;
  15896. function SetRect;                          external;
  15897. function SetRectEmpty;                     external;
  15898. function SetRectRgn;                       external;
  15899. function SetROP2;                          external;
  15900. function SetScrollPos;                     external;
  15901. function SetScrollRange;                   external;
  15902. function SetStdHandle;                     external;
  15903. function SetStretchBltMode;                external;
  15904. function SetSysColors;                     external;
  15905. function SetSystemTime;                    external;
  15906. function SetTextAlign;                     external;
  15907. function SetTextCharacterExtra;            external;
  15908. function SetTextColor;                     external;
  15909. function SetTextJustification;             external;
  15910. function SetThreadPriority;                external;
  15911. function SetTimer;                         external;
  15912. function SetTimeZoneInformation;           external;
  15913. function SetViewportExtEx;                 external;
  15914. function SetViewportOrgEx;                 external;
  15915. function SetVolumeLabel;                   external;
  15916. function SetWindowExtEx;                   external;
  15917. function SetWindowLong;                    external;
  15918. function SetWindowOrgEx;                   external;
  15919. function SetWindowPlacement;               external;
  15920. function SetWindowPos;                     external;
  15921. function SetWindowsHookEx;                 external;
  15922. function SetWindowText;                    external;
  15923. function SetWindowWord;                    external;
  15924. function SetWinMetaFileBits;               external;
  15925. function SetWorldTransform;                external;
  15926. function ShowCaret;                        external;
  15927. function ShowCursor;                       external;
  15928. function ShowOwnedPopups;                  external;
  15929. function ShowScrollBar;                    external;
  15930. function ShowWindow;                       external;
  15931. function SizeofResource;                   external;
  15932. procedure Sleep;                           external;
  15933. function StartDoc;                         external;
  15934. function StartPage;                        external;
  15935. function StretchBlt;                       external;
  15936. function StretchDIBits;                    external;
  15937. function StrokeAndFillPath;                external;
  15938. function StrokePath;                       external;
  15939. function SubtractRect;                     external;
  15940. function SuspendThread;                    external;
  15941. function SwapMouseButton;                  external;
  15942. function SystemParametersInfo;             external;
  15943. function SystemTimeToFileTime;             external;
  15944. function SystemTimeToTzSpecificLocalTime;  external;
  15945. function TabbedTextOut;                    external;
  15946. function TerminateProcess;                 external;
  15947. function TerminateThread;                  external;
  15948. function TextOut;                          external;
  15949. function TlsAlloc;                         external;
  15950. function TlsFree;                          external;
  15951. function TlsGetValue;                      external;
  15952. function TlsSetValue;                      external;
  15953. function TrackPopupMenu;                   external;
  15954. function TranslateAccelerator;             external;
  15955. function TranslateMDISysAccel;             external;
  15956. function TranslateMessage;                 external;
  15957. function UnhookWindowsHookEx;              external;
  15958. function UnionRect;                        external;
  15959. function UnlockFile;                       external;
  15960. function UnpackDDElParam;                  external;
  15961. function UnrealizeObject;                  external;
  15962. function UnregisterClass;                  external;
  15963. function UpdateWindow;                     external;
  15964. function ValidateRect;                     external;
  15965. function ValidateRgn;                      external;
  15966. function VkKeyScan;                        external;
  15967. function WaitForMultipleObjects;           external;
  15968. function WaitForSingleObject;              external;
  15969. function WaitMessage;                      external;
  15970. function WidenPath;                        external;
  15971. function WindowFromDC;                     external;
  15972. function WindowFromPoint;                  external;
  15973. function WinExec;                          external;
  15974. function WinHelp;                          external;
  15975. function WinMain;                          external;
  15976. function WriteFile;                        external;
  15977. function WritePrivateProfileString;        external;
  15978. function WriteProfileString;               external;
  15979. function wsprintf;                         external;
  15980. function wvsprintf;                        external;
  15981. function _lclose;                          external;
  15982. function _lcreat;                          external;
  15983. function _llseek;                          external;
  15984. function _lopen;                           external;
  15985. function _lread;                           external;
  15986. function _lwrite;                          external;
  15987.  
  15988. {$IFDEF Open32}
  15989.  
  15990. function WinCallWinMain;                   external;
  15991. function WinQueryTranslateMode;            external;
  15992. function WinSetTranslateMode;              external;
  15993. function WinTranslateDevicePoints;         external;
  15994. function WinTranslateDeviceRects;          external;
  15995. function WinTranslateGraphicsObjectHandle; external;
  15996. function WinTranslateMnemonicString;       external;
  15997.  
  15998. {$ELSE}
  15999.  
  16000. function AbortSystemShutdown;           external;
  16001. function AccessCheck;                   external;
  16002. function AccessCheckAndAuditAlarm;      external;
  16003. function AddAccessAllowedAce;           external;
  16004. function AddAccessDeniedAce;            external;
  16005. function AddAce;                        external;
  16006. function AddAuditAccessAce;             external;
  16007. function AdjustTokenGroups;             external;
  16008. function AdjustTokenPrivileges;         external;
  16009. function AllocateAndInitializeSid;      external;
  16010. function AllocateLocallyUniqueId;       external;
  16011. function AreAllAccessesGranted;         external;
  16012. function AreAnyAccessesGranted;         external;
  16013. function BackupEventLog;                external;
  16014. function ClearEventLog;                 external;
  16015. function CloseEventLog;                 external;
  16016. function CopySid;                       external;
  16017. function CreatePrivateObjectSecurity;   external;
  16018. function CreateProcessAsUser;           external;
  16019. function DeleteAce;                     external;
  16020. function DeregisterEventSource;         external;
  16021. function DestroyPrivateObjectSecurity;  external;
  16022. function DuplicateToken;                external;
  16023. function EqualPrefixSid;                external;
  16024. function EqualSid;                      external;
  16025. function FindFirstFreeAce;              external;
  16026. function FreeSid;                       external;
  16027. function GetAce;                        external;
  16028. function GetAclInformation;             external;
  16029. function GetFileSecurity;               external;
  16030. function GetKernelObjectSecurity;       external;
  16031. function GetLengthSid;                  external;
  16032. function GetNumberOfEventLogRecords;    external;
  16033. function GetOldestEventLogRecord;       external;
  16034. function GetPrivateObjectSecurity;      external;
  16035. function GetSecurityDescriptorControl;  external;
  16036. function GetSecurityDescriptorDacl;     external;
  16037. function GetSecurityDescriptorGroup;    external;
  16038. function GetSecurityDescriptorLength;   external;
  16039. function GetSecurityDescriptorOwner;    external;
  16040. function GetSecurityDescriptorSacl;     external;
  16041. function GetSidIdentifierAuthority;     external;
  16042. function GetSidLengthRequired;          external;
  16043. function GetSidSubAuthority;            external;
  16044. function GetSidSubAuthorityCount;       external;
  16045. function GetTokenInformation;           external;
  16046. function GetUserName;                   external;
  16047. function ImpersonateLoggedOnUser;       external;
  16048. function ImpersonateNamedPipeClient;    external;
  16049. function ImpersonateSelf;               external;
  16050. function InitializeAcl;                 external;
  16051. function InitializeSecurityDescriptor;  external;
  16052. function InitializeSid;                 external;
  16053. function InitiateSystemShutdown;        external;
  16054. function IsTextUnicode;                 external;
  16055. function IsValidAcl;                    external;
  16056. function IsValidSecurityDescriptor;     external;
  16057. function IsValidSid;                    external;
  16058. function LogonUser;                     external;
  16059. function LookupAccountName;             external;
  16060. function LookupAccountSid;              external;
  16061. function LookupPrivilegeDisplayName;    external;
  16062. function LookupPrivilegeName;           external;
  16063. function LookupPrivilegeValue;          external;
  16064. function MakeAbsoluteSD;                external;
  16065. function MakeSelfRelativeSD;            external;
  16066. procedure MapGenericMask;               external;
  16067. function NotifyChangeEventLog;          external;
  16068. function ObjectCloseAuditAlarm;         external;
  16069. function ObjectOpenAuditAlarm;          external;
  16070. function ObjectPrivilegeAuditAlarm;     external;
  16071. function OpenBackupEventLog;            external;
  16072. function OpenEventLog;                  external;
  16073. function OpenProcessToken;              external;
  16074. function OpenThreadToken;               external;
  16075. function PrivilegeCheck;                external;
  16076. function PrivilegedServiceAuditAlarm;   external;
  16077. function ReadEventLog;                  external;
  16078. function RegConnectRegistry;            external;
  16079. function RegFlushKey;                   external;
  16080. function RegGetKeySecurity;             external;
  16081. function RegLoadKey;                    external;
  16082. function RegNotifyChangeKeyValue;       external;
  16083. function RegQueryMultipleValues;        external;
  16084. function RegReplaceKey;                 external;
  16085. function RegRestoreKey;                 external;
  16086. function RegSaveKey;                    external;
  16087. function RegSetKeySecurity;             external;
  16088. function RegUnLoadKey;                  external;
  16089. function RegisterEventSource;           external;
  16090. function ReportEvent;                   external;
  16091. function RevertToSelf;                  external;
  16092. function SetAclInformation;             external;
  16093. function SetFileSecurity;               external;
  16094. function SetKernelObjectSecurity;       external;
  16095. function SetPrivateObjectSecurity;      external;
  16096. function SetSecurityDescriptorDacl;     external;
  16097. function SetSecurityDescriptorGroup;    external;
  16098. function SetSecurityDescriptorOwner;    external;
  16099. function SetSecurityDescriptorSacl;     external;
  16100. function SetThreadToken;                external;
  16101. function SetTokenInformation;           external;
  16102.  
  16103. function AllocConsole;                  external;
  16104. function AreFileApisANSI;               external;
  16105. function BackupRead;                    external;
  16106. function BackupSeek;                    external;
  16107. function BackupWrite;                   external;
  16108. function BeginUpdateResource;           external;
  16109. function BuildCommDCB;                  external;
  16110. function BuildCommDCBAndTimeouts;       external;
  16111. function CallNamedPipe;                 external;
  16112. function ClearCommBreak;                external;
  16113. function ClearCommError;                external;
  16114. function CommConfigDialog;              external;
  16115. function CompareString;                 external;
  16116. function ConnectNamedPipe;              external;
  16117. function ContinueDebugEvent;            external;
  16118. function ConvertDefaultLocale;          external;
  16119. function CreateConsoleScreenBuffer;     external;
  16120. function CreateDirectoryEx;             external;
  16121. function CreateFileMapping;             external;
  16122. function CreateIoCompletionPort;        external;
  16123. function CreateMailslot;                external;
  16124. function CreateNamedPipe;               external;
  16125. function CreatePipe;                    external;
  16126. function CreateRemoteThread;            external;
  16127. function CreateTapePartition;           external;
  16128. function DebugActiveProcess;            external;
  16129. procedure DebugBreak;                   external;
  16130. function DefineDosDevice;               external;
  16131. function DeviceIoControl;               external;
  16132. function DisableThreadLibraryCalls;     external;
  16133. function DisconnectNamedPipe;           external;
  16134. function EndUpdateResource;             external;
  16135. function EnumCalendarInfo;              external;
  16136. function EnumDateFormats;               external;
  16137. function EnumResourceLanguages;         external;
  16138. function EnumResourceNames;             external;
  16139. function EnumResourceTypes;             external;
  16140. function EnumSystemCodePages;           external;
  16141. function EnumSystemLocales;             external;
  16142. function EnumTimeFormats;               external;
  16143. function EraseTape;                     external;
  16144. function EscapeCommFunction;            external;
  16145. function ExpandEnvironmentStrings;      external;
  16146. function FillConsoleOutputAttribute;    external;
  16147. function FillConsoleOutputCharacter;    external;
  16148. function FindCloseChangeNotification;   external;
  16149. function FindFirstChangeNotification;   external;
  16150. function FindNextChangeNotification;    external;
  16151. function FindResourceEx;                external;
  16152. function FlushConsoleInputBuffer;       external;
  16153. function FlushInstructionCache;         external;
  16154. function FlushViewOfFile;               external;
  16155. function FoldString;                    external;
  16156. function FormatMessage;                 external;
  16157. function FreeConsole;                   external;
  16158. function FreeEnvironmentStrings;        external;
  16159. procedure FreeLibraryAndExitThread;     external;
  16160. function GenerateConsoleCtrlEvent;      external;
  16161. function GetBinaryType;                 external;
  16162. function GetCPInfo;                     external;
  16163. function GetCommConfig;                 external;
  16164. function GetCommMask;                   external;
  16165. function GetCommModemStatus;            external;
  16166. function GetCommProperties;             external;
  16167. function GetCommState;                  external;
  16168. function GetCommTimeouts;               external;
  16169. function GetCompressedFileSize;         external;
  16170. function GetComputerName;               external;
  16171. function GetConsoleCP;                  external;
  16172. function GetConsoleCursorInfo;          external;
  16173. function GetConsoleMode;                external;
  16174. function GetConsoleOutputCP;            external;
  16175. function GetConsoleScreenBufferInfo;    external;
  16176. function GetConsoleTitle;               external;
  16177. function GetCurrencyFormat;             external;
  16178. function GetDateFormat;                 external;
  16179. function GetDefaultCommConfig;          external;
  16180. function GetHandleInformation;          external;
  16181. function GetLargestConsoleWindowSize;   external;
  16182. function GetLocaleInfo;                 external;
  16183. function GetMailslotInfo;               external;
  16184. function GetNamedPipeHandleState;       external;
  16185. function GetNamedPipeInfo;              external;
  16186. function GetNumberFormat;               external;
  16187. function GetNumberOfConsoleInputEvents; external;
  16188. function GetNumberOfConsoleMouseButtons;external;
  16189. function GetPrivateProfileSection;      external;
  16190. function GetPrivateProfileSectionNames; external;
  16191. function GetProcessAffinityMask;        external;
  16192. function SetProcessAffinityMask;        external;
  16193. function GetProcessHeap;                external;
  16194. function GetProcessHeaps;               external;
  16195. function GetProcessShutdownParameters;  external;
  16196. function GetProcessTimes;               external;
  16197. function GetProcessVersion;             external;
  16198. function GetProcessWorkingSetSize;      external;
  16199. function GetProfileSection;             external;
  16200. function GetQueuedCompletionStatus;     external;
  16201. function GetShortPathName;              external;
  16202. procedure GetStartupInfo;               external;
  16203. function GetStringTypeEx;               external;
  16204. function GetSystemDefaultLCID;          external;
  16205. function GetSystemDefaultLangID;        external;
  16206. procedure GetSystemInfo;                external;
  16207. function GetSystemPowerStatus;          external;
  16208. procedure GetSystemTimeAsFileTime;      external;
  16209. function GetSystemTimeAdjustment;       external;
  16210. function GetTapeParameters;             external;
  16211. function GetTapePosition;               external;
  16212. function GetTapeStatus;                 external;
  16213. function GetThreadContext;              external;
  16214. function GetThreadLocale;               external;
  16215. function GetThreadSelectorEntry;        external;
  16216. function GetThreadTimes;                external;
  16217. function GetTimeFormat;                 external;
  16218. function GetUserDefaultLCID;            external;
  16219. function GetUserDefaultLangID;          external;
  16220. function GetVersion;                    external;
  16221. function GetVersionEx;                  external;
  16222. function GlobalCompact;                 external;
  16223. procedure GlobalFix;                    external;
  16224. function GlobalUnWire;                  external;
  16225. procedure GlobalUnfix;                  external;
  16226. function GlobalWire;                    external;
  16227. function HeapCompact;                   external;
  16228. function HeapLock;                      external;
  16229. function HeapUnlock;                    external;
  16230. function HeapValidate;                  external;
  16231. function HeapWalk;                      external;
  16232. function IsDBCSLeadByteEx;              external;
  16233. function IsValidCodePage;               external;
  16234. function IsValidLocale;                 external;
  16235. function LCMapString;                   external;
  16236. function LoadLibraryEx;                 external;
  16237. function LocalCompact;                  external;
  16238. function LocalShrink;                   external;
  16239. function LockFileEx;                    external;
  16240. function MapViewOfFile;                 external;
  16241. function MapViewOfFileEx;               external;
  16242. function MoveFileEx;                    external;
  16243. function MultiByteToWideChar;           external;
  16244. function OpenFileMapping;               external;
  16245. function PeekConsoleInput;              external;
  16246. function PeekNamedPipe;                 external;
  16247. function PostQueuedCompletionStatus;    external;
  16248. function PrepareTape;                   external;
  16249. function PurgeComm;                     external;
  16250. function QueryDosDevice;                external;
  16251. function QueryPerformanceCounter;       external;
  16252. function QueryPerformanceFrequency;     external;
  16253. procedure RaiseException;               external;
  16254. function ReadConsole;                   external;
  16255. function ReadConsoleInput;              external;
  16256. function ReadConsoleOutput;             external;
  16257. function ReadConsoleOutputAttribute;    external;
  16258. function ReadConsoleOutputCharacter;    external;
  16259. function ReadFileEx;                    external;
  16260. function ReadProcessMemory;             external;
  16261. function ScrollConsoleScreenBuffer;     external;
  16262. function SetCommBreak;                  external;
  16263. function SetCommConfig;                 external;
  16264. function SetCommMask;                   external;
  16265. function SetCommState;                  external;
  16266. function SetCommTimeouts;               external;
  16267. function SetComputerName;               external;
  16268. function SetConsoleActiveScreenBuffer;  external;
  16269. function SetConsoleCP;                  external;
  16270. function SetConsoleCtrlHandler;         external;
  16271. function SetConsoleCursorInfo;          external;
  16272. function SetConsoleCursorPosition;      external;
  16273. function SetConsoleMode;                external;
  16274. function SetConsoleOutputCP;            external;
  16275. function SetConsoleScreenBufferSize;    external;
  16276. function SetConsoleTextAttribute;       external;
  16277. function SetConsoleTitle;               external;
  16278. function SetConsoleWindowInfo;          external;
  16279. function SetDefaultCommConfig;          external;
  16280. function SetErrorMode;                  external;
  16281. procedure SetFileApisToANSI;            external;
  16282. procedure SetFileApisToOEM;             external;
  16283. function SetHandleInformation;          external;
  16284. function SetLocaleInfo;                 external;
  16285. function SetMailslotInfo;               external;
  16286. function SetNamedPipeHandleState;       external;
  16287. function SetProcessShutdownParameters;  external;
  16288. function SetProcessWorkingSetSize;      external;
  16289. function SetSystemPowerState;           external;
  16290. function SetSystemTimeAdjustment;       external;
  16291. function SetTapeParameters;             external;
  16292. function SetTapePosition;               external;
  16293. function SetThreadAffinityMask;         external;
  16294. function SetThreadContext;              external;
  16295. function SetThreadLocale;               external;
  16296. function SetUnhandledExceptionFilter;   external;
  16297. function SetupComm;                     external;
  16298. function SleepEx;                       external;
  16299. function TransactNamedPipe;             external;
  16300. function TransmitCommChar;              external;
  16301. function UnhandledExceptionFilter;      external;
  16302. function UnlockFileEx;                  external;
  16303. function UnmapViewOfFile;               external;
  16304. function UpdateResource;                external;
  16305. function VerLanguageName;               external;
  16306. function VirtualAlloc;                  external;
  16307. function VirtualFree;                   external;
  16308. function VirtualLock;                   external;
  16309. function VirtualProtect;                external;
  16310. function VirtualProtectEx;              external;
  16311. function VirtualQuery;                  external;
  16312. function VirtualQueryEx;                external;
  16313. function VirtualUnlock;                 external;
  16314. function WaitCommEvent;                 external;
  16315. function WaitForDebugEvent;             external;
  16316. function WaitForMultipleObjectsEx;      external;
  16317. function WaitForSingleObjectEx;         external;
  16318. function WaitNamedPipe;                 external;
  16319. function WideCharToMultiByte;           external;
  16320. function WriteConsole;                  external;
  16321. function WriteConsoleInput;             external;
  16322. function WriteConsoleOutput;            external;
  16323. function WriteConsoleOutputAttribute;   external;
  16324. function WriteConsoleOutputCharacter;   external;
  16325. function WriteFileEx;                   external;
  16326. function WritePrivateProfileSection;    external;
  16327. function WriteProcessMemory;            external;
  16328. function WriteProfileSection;           external;
  16329. function WriteTapemark;                 external;
  16330. function _hread;                        external;
  16331. function _hwrite;                       external;
  16332. function lstrcpyn;                      external;
  16333.  
  16334. function MultinetGetConnectionPerformance;  external;
  16335. function WNetAddConnection2;            external;
  16336. function WNetAddConnection3;            external;
  16337. function WNetAddConnection;             external;
  16338. function WNetCancelConnection2;         external;
  16339. function WNetCancelConnection;          external;
  16340. function WNetCloseEnum;                 external;
  16341. function WNetConnectionDialog1;         external;
  16342. function WNetConnectionDialog;          external;
  16343. function WNetDisconnectDialog1;         external;
  16344. function WNetDisconnectDialog;          external;
  16345. function WNetEnumResource;              external;
  16346. function WNetGetConnection;             external;
  16347. function WNetGetLastError;              external;
  16348. function WNetGetNetworkInformation;     external;
  16349. function WNetGetProviderName;           external;
  16350. function WNetGetUniversalName;          external;
  16351. function WNetGetUser;                   external;
  16352. function WNetOpenEnum;                  external;
  16353. function WNetSetConnection;             external;
  16354. function WNetUseConnection;             external;
  16355.  
  16356. function GetFileVersionInfo;            external;
  16357. function GetFileVersionInfoSize;        external;
  16358. function VerFindFile;                   external;
  16359. function VerInstallFile;                external;
  16360. function VerQueryValue;                 external;
  16361.  
  16362. function GetPrivateProfileStruct;       external;
  16363. function WritePrivateProfileStruct;     external;
  16364.  
  16365. function CancelDC;                      external;
  16366. function CheckColorsInGamut;            external;
  16367. function ChoosePixelFormat;             external;
  16368. function ColorMatchToTarget;            external;
  16369. function CombineTransform;              external;
  16370. function CreateColorSpace;              external;
  16371. function CreateDIBPatternBrush;         external;
  16372. function CreateDIBSection;              external;
  16373. function CreateDiscardableBitmap;       external;
  16374. function CreateScalableFontResource;    external;
  16375. function DeleteColorSpace;              external;
  16376. function DescribePixelFormat;           external;
  16377. function DrawEscape;                    external;
  16378. function EnumFontFamiliesEx;            external;
  16379. function EnumICMProfiles;               external;
  16380. function ExtEscape;                     external;
  16381. function GdiComment;                    external;
  16382. function GetCharABCWidthsFloat;         external;
  16383. function GetCharWidth32;                external;
  16384. function GetCharWidthFloat;             external;
  16385. function GetCharacterPlacement;         external;
  16386. function GetColorSpace;                 external;
  16387. function GetDIBColorTable;              external;
  16388. function GetDeviceGammaRamp;            external;
  16389. function GetEnhMetaFileDescription;     external;
  16390. function GetFontData;                   external;
  16391. function GetFontLanguageInfo;           external;
  16392. function GetGlyphOutline;               external;
  16393. function GetICMProfile;                 external;
  16394. function GetLogColorSpace;              external;
  16395. function GetMetaRgn;                    external;
  16396. function GetPixelFormat;                external;
  16397. function GetSystemPaletteUse;           external;
  16398. function GetTextCharset;                external;
  16399. function GetTextCharsetInfo;            external;
  16400. function GetTextExtentExPoint;          external;
  16401. function PlayEnhMetaFileRecord;         external;
  16402. function PlgBlt;                        external;
  16403. function PolyTextOut;                   external;
  16404. function SelectClipPath;                external;
  16405. function SetAbortProc;                  external;
  16406. function SetColorSpace;                 external;
  16407. function SetDIBColorTable;              external;
  16408. function SetDeviceGammaRamp;            external;
  16409. function SetICMMode;                    external;
  16410. function SetICMProfile;                 external;
  16411. function SetMetaRgn;                    external;
  16412. function SetPixelFormat;                external;
  16413. function SetPixelV;                     external;
  16414. function SetSystemPaletteUse;           external;
  16415. function SwapBuffers;                   external;
  16416. function UpdateColors;                  external;
  16417.  
  16418. function wglCreateContext;              external;
  16419. function wglCopyContext;                external;
  16420. function wglCreateLayerContext;         external;
  16421. function wglDeleteContext;              external;
  16422. function wglGetCurrentContext;          external;
  16423. function wglGetCurrentDC;               external;
  16424. function wglMakeCurrent;                external;
  16425. function wglShareLists;                 external;
  16426. function wglUseFontBitmaps;             external;
  16427. function wglUseFontOutlines;            external;
  16428. function wglDescribeLayerPlane;         external;
  16429. function wglSetLayerPaletteEntries;     external;
  16430. function wglGetLayerPaletteEntries;     external;
  16431. function wglRealizeLayerPalette;        external;
  16432. function wglSwapLayerBuffers;           external;
  16433.  
  16434. function ActivateKeyboardLayout;        external;
  16435. function AnyPopup;                      external;
  16436. function AttachThreadInput;             external;
  16437. function BroadcastSystemMessage;        external;
  16438. function CascadeWindows;                external;
  16439. function ChangeDisplaySettings;         external;
  16440. function ChangeMenu;                    external;
  16441. function CharNextEx;                    external;
  16442. function CharPrevEx;                    external;
  16443. function CheckMenuRadioItem;            external;
  16444. function ChildWindowFromPointEx;        external;
  16445. function CloseDesktop;                  external;
  16446. function CloseWindowStation;            external;
  16447. function CopyAcceleratorTable;          external;
  16448. function CopyImage;                     external;
  16449. function CreateDesktop;                 external;
  16450. function CreateIconFromResourceEx;      external;
  16451. function CreateWindowStation;           external;
  16452. function DdeSetQualityOfService;        external;
  16453. function DragDetect;                    external;
  16454. function DragObject;                    external;
  16455. function DrawAnimatedRects;             external;
  16456. function DrawCaption;                   external;
  16457. function DrawEdge;                      external;
  16458. function DrawFrameControl;              external;
  16459. function DrawIconEx;                    external;
  16460. function DrawState;                     external;
  16461. function DrawTextEx;                    external;
  16462. function EnumDesktops;                  external;
  16463. function EnumDesktopWindows;            external;
  16464. function EnumDisplaySettings;           external;
  16465. function EnumWindowStations;            external;
  16466. function FindWindowEx;                  external;
  16467. function GetAsyncKeyState;              external;
  16468. function GetClassInfoEx;                external;
  16469. function GetInputState;                 external;
  16470. function GetKBCodePage;                 external;
  16471. function GetKeyboardLayout;             external;
  16472. function GetKeyboardLayoutList;         external;
  16473. function GetKeyboardLayoutName;         external;
  16474. function GetKeyboardState;              external;
  16475. function GetMenuContextHelpId;          external;
  16476. function GetMenuDefaultItem;            external;
  16477. function GetMenuItemInfo;               external;
  16478. function GetMenuItemRect;               external;
  16479. function GetProcessWindowStation;       external;
  16480. function GetScrollInfo;                 external;
  16481. function GetSysColorBrush;              external;
  16482. function GetThreadDesktop;              external;
  16483. function GetUserObjectInformation;      external;
  16484. function GetUserObjectSecurity;         external;
  16485. function GetWindowContextHelpId;        external;
  16486. function GetWindowRgn;                  external;
  16487. function GrayString;                    external;
  16488. function ImpersonateDdeClientWindow;    external;
  16489. function InsertMenuItem;                external;
  16490. function IsWindowUnicode;               external;
  16491. function LoadCursorFromFile;            external;
  16492. function LoadImage;                     external;
  16493. function LoadKeyboardLayout;            external;
  16494. function LookupIconIdFromDirectory;     external;
  16495. function LookupIconIdFromDirectoryEx;   external;
  16496. function MapVirtualKeyEx;               external;
  16497. function MenuItemFromPoint;             external;
  16498. function MessageBoxEx;                  external;
  16499. function MessageBoxIndirect;            external;
  16500. function OemKeyScan;                    external;
  16501. function OpenDesktop;                   external;
  16502. function OpenIcon;                      external;
  16503. function OpenInputDesktop;              external;
  16504. function OpenWindowStation;             external;
  16505. function PaintDesktop;                  external;
  16506. function RegisterClassEx;               external;
  16507. function RegisterHotKey;                external;
  16508. function SendMessageCallback;           external;
  16509. function SendMessageTimeout;            external;
  16510. function SendNotifyMessage;             external;
  16511. procedure SetDebugErrorLevel;           external;
  16512. function SetKeyboardState;              external;
  16513. procedure SetLastErrorEx;               external;
  16514. function SetMenuContextHelpId;          external;
  16515. function SetMenuDefaultItem;            external;
  16516. function SetMenuItemInfo;               external;
  16517. function SetMessageExtraInfo;           external;
  16518. function SetMessageQueue;               external;
  16519. function SetProcessWindowStation;       external;
  16520. function SetScrollInfo;                 external;
  16521. function SetSystemCursor;               external;
  16522. function SetThreadDesktop;              external;
  16523. function SetUserObjectInformation;      external;
  16524. function SetUserObjectSecurity;         external;
  16525. function SetWindowContextHelpId;        external;
  16526. function SetWindowsHook;                external;
  16527. function SetWindowRgn;                  external;
  16528. function ShowWindowAsync;               external;
  16529. function SwitchDesktop;                 external;
  16530. function TileWindows;                   external;
  16531. function ToAscii;                       external;
  16532. function ToAsciiEx;                     external;
  16533. function ToUnicode;                     external;
  16534. function ToUnicodeEx;                   external;
  16535. function TrackPopupMenuEx;              external;
  16536. function TranslateCharsetInfo;          external;
  16537. function UnhookWindowsHook;             external;
  16538. function UnloadKeyboardLayout;          external;
  16539. function UnregisterHotKey;              external;
  16540. function VkKeyScanEx;                   external;
  16541. function WaitForInputIdle;              external;
  16542. procedure keybd_event;                  external;
  16543. procedure mouse_event;                  external;
  16544. function VirtualAllocEx;                external;
  16545. function VirtualFreeEx;                 external;
  16546. function CreateFiber;                   external;
  16547. function DeleteFiber;                   external;
  16548. function ConvertThreadToFiber;          external;
  16549. function SwitchToFiber;                 external;
  16550. function SwitchToThread;                external;
  16551. function SetThreadIdealProcessor;       external;
  16552. function SetProcessPriorityBoost;       external;
  16553. function GetProcessPriorityBoost;       external;
  16554. function SetThreadPriorityBoost;        external;
  16555. function GetThreadPriorityBoost;        external;
  16556. function QueueUserAPC;                  external;
  16557. function TryEnterCriticalSection;       external;
  16558. function IsProcessorFeaturePresent;     external;
  16559. function SignalObjectAndWait;           external;
  16560. function CreateWaitableTimer;           external;
  16561. function OpenWaitableTimer;             external;
  16562. function SetWaitableTimer;              external;
  16563. function CancelWaitableTimer;           external;
  16564. function GetDiskFreeSpaceEx;            external;
  16565. function GetFileAttributesEx;           external;
  16566. function FindFirstFileEx;               external;
  16567. function CopyFileEx;                    external;
  16568. function CancelIo;                      external;
  16569. function ObjectDeleteAuditAlarm;        external;
  16570. function ReadDirectoryChanges;          external;
  16571. function DuplicateTokenEx;              external;
  16572. function GetCurrentHwProfile;           external;
  16573. function WinSubmitCertificate;          external;
  16574. function DeviceCapabilitiesEx;          external;
  16575. function GetEnhMetaFilePixelFormat;     external;
  16576. function TrackMouseEvent;               external;
  16577. function MsgWaitForMultipleObjectsEx;   external;
  16578. function ChangeDisplaySettingsEx;       external;
  16579. function WNetGetResourceParent;         external;
  16580. function GetStringTypeA;                external;
  16581.  
  16582. {$ENDIF Open32}
  16583.  
  16584. function GlobalAllocPtr(Flags: Integer; Bytes: Longint): Pointer;
  16585. begin
  16586.   Result := GlobalLock(GlobalAlloc(Flags, Bytes));
  16587. end;
  16588.  
  16589. function GlobalReAllocPtr(P: Pointer; Bytes: Longint; Flags: Integer): Pointer;
  16590. var
  16591.   Handle: THandle;
  16592. begin
  16593.   Handle := GlobalHandle(P);
  16594.   GlobalUnlock(Handle);
  16595.   Result := GlobalLock(GlobalReAlloc(Handle, Bytes, Flags));
  16596. end;
  16597.  
  16598. function GlobalFreePtr(P: Pointer): THandle;
  16599. var
  16600.   Handle: THandle;
  16601. begin
  16602.   Handle := GlobalHandle(P);
  16603.   GlobalUnlock(Handle);
  16604.   Result := GlobalFree(Handle);
  16605. end;
  16606.  
  16607. function TPointFromLong(L: Longint): TPoint;
  16608. begin
  16609.   Result.X := TSmallPoint(L).X;
  16610.   Result.Y := TSmallPoint(L).Y;
  16611. end;
  16612.  
  16613. function GetCurrentTime: Longint;
  16614. begin
  16615.   Result := GetTickCount;
  16616. end;
  16617.  
  16618. procedure ZeroMemory(Destination: Pointer; Length: DWord);
  16619. begin
  16620.   FillChar(Destination^, Length, 0);
  16621. end;
  16622.  
  16623. function GlobalDiscard(Handle: HGlobal): HGlobal;
  16624. begin
  16625.  Result := GlobalReAlloc(Handle, 0, gmem_Moveable);
  16626. end;
  16627.  
  16628. function LocalDiscard(Mem: HLocal): HLocal;
  16629. begin
  16630.  Result := LocalReAlloc(Mem, 0, lmem_Moveable);
  16631. end;
  16632.  
  16633. function UnlockResource(hResData: THandle): Bool;
  16634. begin
  16635.   Result := False;
  16636. end;
  16637.  
  16638. function Succeeded(Status: HResult): Bool;
  16639. begin
  16640.   Result := Status >= 0;
  16641. end;
  16642.  
  16643. function Failed(Status: HResult): Bool;
  16644. begin
  16645.   Result := Status < 0;
  16646. end;
  16647.  
  16648. function IsError(Status: HResult): Bool;
  16649. begin
  16650.   Result := (Status shr 31) = Severity_Error;
  16651. end;
  16652.  
  16653. function HResultCode(hr: HResult): Integer;
  16654. begin
  16655.   Result := hr and $0000FFFF;
  16656. end;
  16657.  
  16658. function HResultFacility(hr: HResult): Integer;
  16659. begin
  16660.   Result := (hr shr 16) and $00001FFF;
  16661. end;
  16662.  
  16663. function HResultSeverity(hr: HResult): Integer;
  16664. begin
  16665.   Result := (hr shr 31) and $00000001;
  16666. end;
  16667.  
  16668. function MakeResult(sev, fac, code: Integer): HResult;
  16669. begin
  16670.   Result := (sev shl 31) or (fac shl 16) or code;
  16671. end;
  16672.  
  16673. function HResultFromWin32(x: Integer): HResult;
  16674. begin
  16675.   Result := x;
  16676.   if Result <> 0 then
  16677.     Result := ((Result and $0000FFFF) or (FACILITY_WIN32 shl 16) or $80000000);
  16678. end;
  16679.  
  16680. function HResultFromNT(x: Integer): HResult;
  16681. begin
  16682.   Result := x or facility_NT_Bit;
  16683. end;
  16684.  
  16685. function GetCValue(cmyk: TColorRef): Byte;
  16686. begin
  16687.   Result := Byte(cmyk);
  16688. end;
  16689.  
  16690. function GetMValue(cmyk: TColorRef): Byte;
  16691. begin
  16692.   Result := Byte(cmyk shr 8);
  16693. end;
  16694.  
  16695. function GetYValue(cmyk: TColorRef): Byte;
  16696. begin
  16697.   Result := Byte(cmyk shr 16);
  16698. end;
  16699.  
  16700. function GetKValue(cmyk: TColorRef): Byte;
  16701. begin
  16702.   Result := Byte(cmyk shr 24);
  16703. end;
  16704.  
  16705. function CMYK(c, m, y, k: Byte): TColorRef;
  16706. begin
  16707.   Result := (c or (m shl 8) or (y shl 16) or (k shl 24));
  16708. end;
  16709.  
  16710. function RGB(r, g, b: Byte): TColorRef;
  16711. begin
  16712.   Result := (r or (g shl 8) or (b shl 16));
  16713. end;
  16714.  
  16715. function PaletteRGB(r, g, b: Byte): TColorRef;
  16716. begin
  16717.   Result := $02000000 or RGB(r,g,b);
  16718. end;
  16719.  
  16720. function PaletteIndex(i: Word): TColorRef;
  16721. begin
  16722.   Result := $01000000 or i;
  16723. end;
  16724.  
  16725. function GetRValue(rgb: DWord): Byte;
  16726. begin
  16727.   Result := Byte(rgb);
  16728. end;
  16729.  
  16730. function GetGValue(rgb: DWord): Byte;
  16731. begin
  16732.   Result := Byte(rgb shr 8);
  16733. end;
  16734.  
  16735. function GetBValue(rgb: DWord): Byte;
  16736. begin
  16737.   Result := Byte(rgb shr 16);
  16738. end;
  16739.  
  16740. function ExitWindows(Reserved: DWord; Code: UInt): Bool;
  16741. begin
  16742.   Result := ExitWindowsEx(ewx_LogOff, -1);
  16743. end;
  16744.  
  16745. function PostAppMessage(idThread: DWord; Msg: UInt; wParam: WParam; lParam: LParam): BOOL;
  16746. begin
  16747.   Result := PostThreadMessage(idThread, Msg, wParam, lParam)
  16748. end;
  16749.  
  16750. function CreateDialog(Instance: hInst; TemplateName: PChar; WndParent: hWnd; DialogFunc: TFNDlgProc): hWnd;
  16751. begin
  16752.   Result := CreateDialogParam(Instance, TemplateName, WndParent, DialogFunc, 0);
  16753. end;
  16754.  
  16755. function CreateDialogIndirect(Instance: HInst; const Template: TDlgTemplate; WndParent: HWnd; DialogFunc: TFNDlgProc): HWnd;
  16756. begin
  16757.   Result := CreateDialogIndirectParam(Instance, Template, WndParent, DialogFunc, 0);
  16758. end;
  16759.  
  16760. function DialogBox(Instance: HInst; Template: PChar; WndParent: HWnd; DialogFunc: TFNDlgProc): Integer;
  16761. begin
  16762.   Result := DialogBoxParam(Instance, Template, WndParent, DialogFunc, 0);
  16763. end;
  16764.  
  16765. function DialogBoxIndirect(Instance: hInst; const DlgTemplate: TDlgTemplate; WndParent: hWnd; DialogFunc: TFNDlgProc): Integer;
  16766. begin
  16767.   Result := DialogBoxIndirectParam(Instance, DlgTemplate, WndParent, DialogFunc, 0);
  16768. end;
  16769.  
  16770. function EnumTaskWindows(hTask: THandle; lpfn: TFarProc; lParam: LParam): Bool;
  16771. begin
  16772.   Result := EnumThreadWindows(DWord(hTask), lpfn, lParam);
  16773. end;
  16774.  
  16775. function GetWindowTask(hWnd: HWnd): THandle;
  16776. begin
  16777.   Result := THandle(GetWindowThreadProcessId(hWnd, nil));
  16778. end;
  16779.  
  16780. function CreateWindow(lpClassName: PChar; lpWindowName: PChar;
  16781.   dwStyle: DWord; X, Y, nWidth, nHeight: Integer; hWndParent: hWnd;
  16782.   hMenu: hMenu; hInstance: hInst; lpParam: Pointer): hWnd;
  16783. begin
  16784.   Result := CreateWindowEx(0, lpClassName, lpWindowName, dwStyle, X, Y,
  16785.     nWidth, nHeight, hWndParent, hMenu, HInstance, lpParam);
  16786. end;
  16787.  
  16788. function SmallPointToPoint(const P: TSmallPoint): TPoint; //inline;
  16789. begin
  16790.   Result.X := P.X;
  16791.   Result.Y := P.Y;
  16792. end;
  16793.  
  16794. function PointToSmallPoint(const P: TPoint): TSmallPoint; //inline;
  16795. begin
  16796.   Result.X := P.X;
  16797.   Result.Y := P.Y;
  16798. end;
  16799.  
  16800. end.
  16801.