home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1996 August / VPR9608A.BIN / del20try / install / data.z / WINDOWS.PAS < prev    next >
Pascal/Delphi Source File  |  1996-05-08  |  687KB  |  17,545 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {       Delphi Run-time Library                         }
  5. {       Windows 32bit API Interface Unit                }
  6. {                                                       }
  7. {       Copyright (c) 1996 Borland International        }
  8. {                                                       }
  9. {*******************************************************}
  10.  
  11. unit Windows;
  12.  
  13. {$A+,Z+}
  14.  
  15. interface
  16.  
  17. type
  18. { Translated from WINDEF.H }
  19.  
  20.   WCHAR = WideChar;
  21.   PWChar = PWideChar;
  22.  
  23.   LPSTR = PAnsiChar;
  24.   LPCSTR = PAnsiChar;
  25.   LPWSTR = PWideChar;
  26.   LPCWSTR = PWideChar;
  27.  
  28.   DWORD = Integer;
  29.   BOOL = LongBool;
  30.   PBOOL = ^BOOL;
  31.   PByte = ^Byte;
  32.   PINT = ^Integer;
  33.   PSingle = ^Single;
  34.   PWORD = ^Word;
  35.   PDWORD = ^DWORD;
  36.   LPDWORD = PDWORD;
  37.  
  38.   UCHAR = Byte;
  39.   PUCHAR = ^Byte;
  40.   SHORT = Smallint;
  41.   UINT = Integer;
  42.   PUINT = ^UINT;
  43.   ULONG = Longint;
  44.   PULONG = ^ULONG;
  45.   PLongint = ^Longint;
  46.   PInteger = ^Integer;
  47.  
  48.   LCID = DWORD;
  49.   LANGID = Word;
  50.  
  51.   THandle = Integer;
  52.   PHandle = ^THandle;
  53.  
  54. const
  55.   MAX_PATH = 260;
  56.  
  57.  
  58. { Translated from WINNT.H (only things needed for API calls) }
  59.  
  60. {line 182}
  61. type
  62.   LONGLONG = Comp;
  63.   PSID = Pointer;
  64.   PLargeInteger = ^TLargeInteger;
  65.   TLargeInteger = record
  66.     case Integer of
  67.     0: (
  68.       LowPart: DWORD;
  69.       HighPart: Longint);
  70.     1: (
  71.       QuadPart: LONGLONG);
  72.   end;
  73.  
  74. {line 446}
  75.   PListEntry = ^TListEntry;
  76.   TListEntry = record
  77.     Flink: PListEntry;
  78.     Blink: PListEntry;
  79.   end;
  80.  
  81. {line 510}
  82. (*
  83.  *  Language IDs.
  84.  *
  85.  *  The following two combinations of primary language ID and
  86.  *  sublanguage ID have special semantics:
  87.  *
  88.  *    Primary Language ID   Sublanguage ID      Result
  89.  *    -------------------   ---------------     ------------------------
  90.  *    LANG_NEUTRAL          SUBLANG_NEUTRAL     Language neutral
  91.  *    LANG_NEUTRAL          SUBLANG_DEFAULT     User default language
  92.  *    LANG_NEUTRAL          SUBLANG_SYS_DEFAULT System default language
  93.  *)
  94.  
  95. { Primary language IDs. }
  96. const
  97.   LANG_NEUTRAL                     = $00;
  98.  
  99.   LANG_BULGARIAN                   = $02;
  100.   LANG_CHINESE                     = $04;
  101.   LANG_CROATIAN                    = $1a;
  102.   LANG_CZECH                       = $05;
  103.   LANG_DANISH                      = $06;
  104.   LANG_DUTCH                       = $13;
  105.   LANG_ENGLISH                     = $09;
  106.   LANG_FINNISH                     = $0b;
  107.   LANG_FRENCH                      = $0c;
  108.   LANG_GERMAN                      = $07;
  109.   LANG_GREEK                       = $08;
  110.   LANG_HUNGARIAN                   = $0e;
  111.   LANG_ICELANDIC                   = $0f;
  112.   LANG_ITALIAN                     = $10;
  113.   LANG_JAPANESE                    = $11;
  114.   LANG_KOREAN                      = $12;
  115.   LANG_NORWEGIAN                   = $14;
  116.   LANG_POLISH                      = $15;
  117.   LANG_PORTUGUESE                  = $16;
  118.   LANG_ROMANIAN                    = $18;
  119.   LANG_RUSSIAN                     = $19;
  120.   LANG_SLOVAK                      = $1b;
  121.   LANG_SLOVENIAN                   = $24;
  122.   LANG_SPANISH                     = $0a;
  123.   LANG_SWEDISH                     = $1d;
  124.   LANG_TURKISH                     = $1f;
  125.  
  126. { Sublanguage IDs. }
  127.  
  128.   { The name immediately following SUBLANG_ dictates which primary
  129.     language ID that sublanguage ID can be combined with to form a
  130.     valid language ID. }
  131.  
  132.   SUBLANG_NEUTRAL                  = $00;    { language neutral }
  133.   SUBLANG_DEFAULT                  = $01;    { user default }
  134.   SUBLANG_SYS_DEFAULT              = $02;    { system default }
  135.  
  136.   SUBLANG_CHINESE_TRADITIONAL      = $01;    { Chinese (Taiwan) }
  137.   SUBLANG_CHINESE_SIMPLIFIED       = $02;    { Chinese (PR China) }
  138.   SUBLANG_CHINESE_HONGKONG         = $03;    { Chinese (Hong Kong) }
  139.   SUBLANG_CHINESE_SINGAPORE        = $04;    { Chinese (Singapore) }
  140.   SUBLANG_DUTCH                    = $01;    { Dutch }
  141.   SUBLANG_DUTCH_BELGIAN            = $02;    { Dutch (Belgian) }
  142.   SUBLANG_ENGLISH_US               = $01;    { English (USA) }
  143.   SUBLANG_ENGLISH_UK               = $02;    { English (UK) }
  144.   SUBLANG_ENGLISH_AUS              = $03;    { English (Australian) }
  145.   SUBLANG_ENGLISH_CAN              = $04;    { English (Canadian) }
  146.   SUBLANG_ENGLISH_NZ               = $05;    { English (New Zealand) }
  147.   SUBLANG_ENGLISH_EIRE             = $06;    { English (Irish) }
  148.   SUBLANG_FRENCH                   = $01;    { French }
  149.   SUBLANG_FRENCH_BELGIAN           = $02;    { French (Belgian) }
  150.   SUBLANG_FRENCH_CANADIAN          = $03;    { French (Canadian) }
  151.   SUBLANG_FRENCH_SWISS             = $04;    { French (Swiss) }
  152.   SUBLANG_GERMAN                   = $01;    { German }
  153.   SUBLANG_GERMAN_SWISS             = $02;    { German (Swiss) }
  154.   SUBLANG_GERMAN_AUSTRIAN          = $03;    { German (Austrian) }
  155.   SUBLANG_ITALIAN                  = $01;    { Italian }
  156.   SUBLANG_ITALIAN_SWISS            = $02;    { Italian (Swiss) }
  157.   SUBLANG_NORWEGIAN_BOKMAL         = $01;    { Norwegian (Bokmal) }
  158.   SUBLANG_NORWEGIAN_NYNORSK        = $02;    { Norwegian (Nynorsk) }
  159.   SUBLANG_PORTUGUESE               = $02;    { Portuguese }
  160.   SUBLANG_PORTUGUESE_BRAZILIAN     = $01;    { Portuguese (Brazilian) }
  161.   SUBLANG_SPANISH                  = $01;    { Spanish (Castilian) }
  162.   SUBLANG_SPANISH_MEXICAN          = $02;    { Spanish (Mexican) }
  163.   SUBLANG_SPANISH_MODERN           = $03;    { Spanish (Modern) }
  164.  
  165. { Sorting IDs. }
  166.  
  167.   SORT_DEFAULT                     = $0 ;    { sorting default }
  168.  
  169.   SORT_JAPANESE_XJIS               = $0 ;    { Japanese XJIS order }
  170.   SORT_JAPANESE_UNICODE            = $1 ;    { Japanese Unicode order }
  171.  
  172.   SORT_CHINESE_BIG5                = $0 ;    { Chinese BIG5 order }
  173.   SORT_CHINESE_UNICODE             = $1 ;    { Chinese Unicode order }
  174.  
  175.   SORT_KOREAN_KSC                  = $0 ;    { Korean KSC order }
  176.   SORT_KOREAN_UNICODE              = $1 ;    { Korean Unicode order }
  177.  
  178. (*
  179.  *  A language ID is a 16 bit value which is the combination of a
  180.  *  primary language ID and a secondary language ID.  The bits are
  181.  *  allocated as follows:
  182.  *
  183.  *       +-----------------------+-------------------------+
  184.  *       |     Sublanguage ID    |   Primary Language ID   |
  185.  *       +-----------------------+-------------------------+
  186.  *        15                   10 9                       0   bit
  187.  *
  188.  *
  189.  *
  190.  *  A locale ID is a 32 bit value which is the combination of a
  191.  *  language ID, a sort ID, and a reserved area.  The bits are
  192.  *  allocated as follows:
  193.  *
  194.  *       +-------------+---------+-------------------------+
  195.  *       |   Reserved  | Sort ID |      Language ID        |
  196.  *       +-------------+---------+-------------------------+
  197.  *        31         20 19     16 15                      0   bit
  198.  *
  199.  *)
  200.  
  201. { Default System and User IDs for language and locale. }
  202.  
  203.   LANG_SYSTEM_DEFAULT   = (SUBLANG_SYS_DEFAULT shl 10) or LANG_NEUTRAL;
  204.   LANG_USER_DEFAULT     = (SUBLANG_DEFAULT shl 10) or LANG_NEUTRAL;
  205.  
  206.   LOCALE_SYSTEM_DEFAULT = (SORT_DEFAULT shl 16) or LANG_SYSTEM_DEFAULT;
  207.   LOCALE_USER_DEFAULT   = (SORT_DEFAULT shl 16) or LANG_USER_DEFAULT;
  208.  
  209.  
  210. {line 485}
  211. const
  212.   MINCHAR = $80;
  213.   MAXCHAR = 127;
  214.   MINSHORT = $8000;
  215.   MAXSHORT = 32767;
  216.   MINLONG = $80000000;
  217.   MAXLONG = $7FFFFFFF;
  218.   MAXBYTE = 255;
  219.   MAXWORD = 65535;
  220.   MAXDWORD = $FFFFFFFF;
  221.  
  222. {line 724}
  223.   STATUS_WAIT_0                   = $00000000;
  224.   STATUS_ABANDONED_WAIT_0         = $00000080;
  225.   STATUS_USER_APC                 = $000000C0;
  226.   STATUS_TIMEOUT                  = $00000102;
  227.   STATUS_PENDING                  = $00000103;
  228.   STATUS_SEGMENT_NOTIFICATION     = $40000005;
  229.   STATUS_GUARD_PAGE_VIOLATION     = $80000001;
  230.   STATUS_DATATYPE_MISALIGNMENT    = $80000002;
  231.   STATUS_BREAKPOINT               = $80000003;
  232.   STATUS_SINGLE_STEP              = $80000004;
  233.   STATUS_ACCESS_VIOLATION         = $C0000005;
  234.   STATUS_IN_PAGE_ERROR            = $C0000006;
  235.   STATUS_NO_MEMORY                = $C0000017;
  236.   STATUS_ILLEGAL_INSTRUCTION      = $C000001D;
  237.   STATUS_NONCONTINUABLE_EXCEPTION = $C0000025;
  238.   STATUS_INVALID_DISPOSITION      = $C0000026;
  239.   STATUS_ARRAY_BOUNDS_EXCEEDED    = $C000008C;
  240.   STATUS_FLOAT_DENORMAL_OPERAND   = $C000008D;
  241.   STATUS_FLOAT_DIVIDE_BY_ZERO     = $C000008E;
  242.   STATUS_FLOAT_INEXACT_RESULT     = $C000008F;
  243.   STATUS_FLOAT_INVALID_OPERATION  = $C0000090;
  244.   STATUS_FLOAT_OVERFLOW           = $C0000091;
  245.   STATUS_FLOAT_STACK_CHECK        = $C0000092;
  246.   STATUS_FLOAT_UNDERFLOW          = $C0000093;
  247.   STATUS_INTEGER_DIVIDE_BY_ZERO   = $C0000094;
  248.   STATUS_INTEGER_OVERFLOW         = $C0000095;
  249.   STATUS_PRIVILEGED_INSTRUCTION   = $C0000096;
  250.   STATUS_STACK_OVERFLOW           = $C00000FD;
  251.   STATUS_CONTROL_C_EXIT           = $C000013A;
  252.  
  253.   MAXIMUM_WAIT_OBJECTS = 64;
  254.  
  255. {line 1160}
  256.   SIZE_OF_80387_REGISTERS = 80;
  257.  
  258.   { The following flags control the contents of the CONTEXT structure. }
  259.  
  260.   CONTEXT_i386 = $10000;     { this assumes that i386 and }
  261.   CONTEXT_i486 = $10000;     { i486 have identical context records }
  262.  
  263.   CONTEXT_CONTROL         = (CONTEXT_i386 or $00000001); { SS:SP, CS:IP, FLAGS, BP }
  264.   CONTEXT_INTEGER         = (CONTEXT_i386 or $00000002); { AX, BX, CX, DX, SI, DI }
  265.   CONTEXT_SEGMENTS        = (CONTEXT_i386 or $00000004); { DS, ES, FS, GS }
  266.   CONTEXT_FLOATING_POINT  = (CONTEXT_i386 or $00000008); { 387 state }
  267.   CONTEXT_DEBUG_REGISTERS = (CONTEXT_i386 or $00000010); { DB 0-3,6,7 }
  268.   CONTEXT_FULL = (CONTEXT_CONTROL or CONTEXT_INTEGER or CONTEXT_SEGMENTS);
  269.  
  270. type
  271.   PFloatingSaveArea = ^TFloatingSaveArea;
  272.   TFloatingSaveArea = record
  273.     ControlWord: DWORD;
  274.     StatusWord: DWORD;
  275.     TagWord: DWORD;
  276.     ErrorOffset: DWORD;
  277.     ErrorSelector: DWORD;
  278.     DataOffset: DWORD;
  279.     DataSelector: DWORD;
  280.     RegisterArea: array[0..SIZE_OF_80387_REGISTERS - 1] of Byte;
  281.     Cr0NpxState: DWORD;
  282.   end;
  283.  
  284. { This frame has a several purposes: 1) it is used as an argument to
  285.   NtContinue, 2) is is used to constuct a call frame for APC delivery,
  286.   and 3) it is used in the user level thread creation routines.
  287.   The layout of the record conforms to a standard call frame. }
  288.  
  289.   PContext = ^TContext;
  290.   TContext = record
  291.  
  292.   { The flags values within this flag control the contents of
  293.     a CONTEXT record.
  294.  
  295.     If the context record is used as an input parameter, then
  296.     for each portion of the context record controlled by a flag
  297.     whose value is set, it is assumed that that portion of the
  298.     context record contains valid context. If the context record
  299.     is being used to modify a threads context, then only that
  300.     portion of the threads context will be modified.
  301.  
  302.     If the context record is used as an IN OUT parameter to capture
  303.     the context of a thread, then only those portions of the thread's
  304.     context corresponding to set flags will be returned.
  305.  
  306.     The context record is never used as an OUT only parameter. }
  307.  
  308.     ContextFlags: DWORD;
  309.  
  310.   { This section is specified/returned if CONTEXT_DEBUG_REGISTERS is
  311.     set in ContextFlags.  Note that CONTEXT_DEBUG_REGISTERS is NOT
  312.     included in CONTEXT_FULL. }
  313.  
  314.     Dr0: DWORD;
  315.     Dr1: DWORD;
  316.     Dr2: DWORD;
  317.     Dr3: DWORD;
  318.     Dr6: DWORD;
  319.     Dr7: DWORD;
  320.  
  321.   { This section is specified/returned if the
  322.     ContextFlags word contians the flag CONTEXT_FLOATING_POINT. }
  323.  
  324.     FloatSave: TFloatingSaveArea;
  325.  
  326.   { This section is specified/returned if the
  327.     ContextFlags word contians the flag CONTEXT_SEGMENTS. }
  328.  
  329.     SegGs: DWORD;
  330.     SegFs: DWORD;
  331.     SegEs: DWORD;
  332.     SegDs: DWORD;
  333.  
  334.   { This section is specified/returned if the
  335.     ContextFlags word contians the flag CONTEXT_INTEGER. }
  336.  
  337.     Edi: DWORD;
  338.     Esi: DWORD;
  339.     Ebx: DWORD;
  340.     Edx: DWORD;
  341.     Ecx: DWORD;
  342.     Eax: DWORD;
  343.  
  344.   { This section is specified/returned if the
  345.     ContextFlags word contians the flag CONTEXT_CONTROL. }
  346.  
  347.     Ebp: DWORD;
  348.     Eip: DWORD;
  349.     SegCs: DWORD;
  350.     EFlags: DWORD;
  351.     Esp: DWORD;
  352.     SegSs: DWORD;
  353.   end;
  354.  
  355. const
  356.   { bitfield constants for Flags field of TLDTEntry }
  357.  
  358.   LDTF_BASEMID      = $FF000000;  {8}
  359.   LDTF_TYPE_8       = $00F80000;  {5}
  360.   LDTF_DPL          = $00060000;  {2}
  361.   LDTF_PRES         = $00010000;  {1}
  362.   LDTF_LIMITHI      = $0000F000;  {4}
  363.   LDTF_SYS          = $00000800;  {1}
  364.   LDTF_RESERVED_0   = $00000400;  {1}
  365.   LDTF_DEFAULT_BIG  = $00000200;  {1}
  366.   LDTF_GRANULARITY  = $00000100;  {1}
  367.   LDTF_BASEHI       = $000000FF;  {8}
  368.  
  369. {line 1293}
  370. type
  371.   PLDTEntry = ^TLDTEntry;
  372.   TLDTEntry = record
  373.     LimitLow: Word;
  374.     BaseLow: Word;
  375.     case Integer of
  376.       0: (
  377.         BaseMid: Byte;
  378.         Flags1: Byte;
  379.         Flags2: Byte;
  380.         BaseHi: Byte);
  381.       1: (
  382.         Flags: Longint);
  383.   end;
  384.  
  385. {line 1715}
  386. const
  387.   EXCEPTION_MAXIMUM_PARAMETERS = 15;
  388.  
  389. type
  390.   PExceptionRecord = ^TExceptionRecord;
  391.   TExceptionRecord = record
  392.     ExceptionCode: DWORD;
  393.     ExceptionFlags: DWORD;
  394.     ExceptionRecord: PExceptionRecord;
  395.     ExceptionAddress: Pointer;
  396.     NumberParameters: DWORD;
  397.     ExceptionInformation: array[0..EXCEPTION_MAXIMUM_PARAMETERS - 1] of DWORD;
  398.   end;
  399.  
  400.   TExceptionPointers = record
  401.     ExceptionRecord : PExceptionRecord;
  402.     ContextRecord : PContext;
  403.   end;
  404.  
  405. {line 1770}
  406. const
  407.   THREAD_BASE_PRIORITY_LOWRT = 15;  { value that gets a thread to LowRealtime-1 }
  408.   THREAD_BASE_PRIORITY_MAX = 2;     { maximum thread base priority boost }
  409.   THREAD_BASE_PRIORITY_MIN = -2;    { minimum thread base priority boost }
  410.   THREAD_BASE_PRIORITY_IDLE = -15;  { value that gets a thread to idle }
  411.  
  412. {line 1788}
  413. const
  414.   SYNCHRONIZE = $00100000;
  415.   STANDARD_RIGHTS_REQUIRED = $000F0000;
  416.   EVENT_MODIFY_STATE = $0002;
  417.   EVENT_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED or SYNCHRONIZE or $3);
  418.   MUTANT_QUERY_STATE = $0001;
  419.   MUTANT_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED or SYNCHRONIZE or
  420.     MUTANT_QUERY_STATE);
  421.  
  422. {line 1811}
  423. type
  424.   PMemoryBasicInformation = ^TMemoryBasicInformation;
  425.   TMemoryBasicInformation = record
  426.     BaseAddress : Pointer;
  427.     AllocationBase : Pointer;
  428.     AllocationProtect : DWORD;
  429.     RegionSize : DWORD;
  430.     State : DWORD;
  431.     Protect : DWORD;
  432.     Type_9 : DWORD;
  433.   end;
  434.  
  435. const
  436.   SECTION_QUERY = 1;
  437.   SECTION_MAP_WRITE = 2;
  438.   SECTION_MAP_READ = 4;
  439.   SECTION_MAP_EXECUTE = 8;
  440.   SECTION_EXTEND_SIZE = $10;
  441.   SECTION_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED or SECTION_QUERY or
  442.     SECTION_MAP_WRITE or SECTION_MAP_READ or SECTION_MAP_EXECUTE or SECTION_EXTEND_SIZE);
  443.  
  444.   PAGE_NOACCESS = 1;
  445.   PAGE_READONLY = 2;
  446.   PAGE_READWRITE = 4;
  447.   PAGE_WRITECOPY = 8;
  448.   PAGE_EXECUTE = $10;
  449.   PAGE_EXECUTE_READ = $20;
  450.   PAGE_EXECUTE_READWRITE = $40;
  451.   PAGE_EXECUTE_WRITECOPY = $80;
  452.   PAGE_GUARD = $100;
  453.   PAGE_NOCACHE = $200;
  454.   MEM_COMMIT = $1000;
  455.   MEM_RESERVE = $2000;
  456.   MEM_DECOMMIT = $4000;
  457.   MEM_RELEASE = $8000;
  458.   MEM_FREE = $10000;
  459.   MEM_PRIVATE = $20000;
  460.   MEM_MAPPED = $40000;
  461.   MEM_TOP_DOWN = $100000;
  462.   SEC_FILE = $800000;
  463.   SEC_IMAGE = $1000000;
  464.   SEC_RESERVE = $4000000;
  465.   SEC_COMMIT = $8000000;
  466.   SEC_NOCACHE = $10000000;
  467.   MEM_IMAGE = SEC_IMAGE;
  468.  
  469. {line 1915}
  470.   FILE_SHARE_READ               = $00000001;
  471.   FILE_SHARE_WRITE              = $00000002;
  472.   FILE_ATTRIBUTE_READONLY       = $00000001;
  473.   FILE_ATTRIBUTE_HIDDEN         = $00000002;
  474.   FILE_ATTRIBUTE_SYSTEM         = $00000004;
  475.   FILE_ATTRIBUTE_DIRECTORY      = $00000010;
  476.   FILE_ATTRIBUTE_ARCHIVE        = $00000020;
  477.   FILE_ATTRIBUTE_NORMAL         = $00000080;
  478.   FILE_ATTRIBUTE_TEMPORARY      = $00000100;
  479.   FILE_ATTRIBUTE_ATOMICWRITE    = $00000200;
  480.   FILE_ATTRIBUTE_XACTIONWRITE   = $00000400;
  481.   FILE_NOTIFY_CHANGE_FILE_NAME  = $00000001;
  482.   FILE_NOTIFY_CHANGE_DIR_NAME   = $00000002;
  483.   FILE_NOTIFY_CHANGE_ATTRIBUTES = $00000004;
  484.   FILE_NOTIFY_CHANGE_SIZE       = $00000008;
  485.   FILE_NOTIFY_CHANGE_LAST_WRITE = $00000010;
  486.   FILE_NOTIFY_CHANGE_SECURITY   = $00000100;
  487.   FILE_CASE_SENSITIVE_SEARCH = 1;
  488.   FILE_CASE_PRESERVED_NAMES = 2;
  489.   FILE_UNICODE_ON_DISK = 4;
  490.   FILE_PERSISTENT_ACLS = 8;
  491.   FILE_FILE_COMPRESSION = $10;
  492.   FILE_VOLUME_IS_COMPRESSED = $8000;
  493.  
  494. {line 1987}
  495. type
  496.   PSECURITY_DESCRIPTOR = Pointer;
  497.  
  498. {line 1987}
  499. type
  500.   ACCESS_MASK = DWORD;
  501.   PACCESS_MASK = ^ACCESS_MASK;
  502.  
  503. const
  504.   { The following are masks for the predefined standard access types }
  505.  
  506.   _DELETE                  = $00010000; { Renamed from DELETE }
  507.   READ_CONTROL             = $00020000;
  508.   WRITE_DAC                = $00040000;
  509.   WRITE_OWNER              = $00080000;
  510. { SYNCHRONIZE              = $00100000; defined above }
  511. { STANDARD_RIGHTS_REQUIRED = $000F0000; defined above }
  512.   STANDARD_RIGHTS_READ     = READ_CONTROL;
  513.   STANDARD_RIGHTS_WRITE    = READ_CONTROL;
  514.   STANDARD_RIGHTS_EXECUTE  = READ_CONTROL;
  515.   STANDARD_RIGHTS_ALL      = $001F0000;
  516.   SPECIFIC_RIGHTS_ALL      = $0000FFFF;
  517.   ACCESS_SYSTEM_SECURITY   = $01000000;
  518.   MAXIMUM_ALLOWED          = $02000000;
  519.   GENERIC_READ             = $80000000;
  520.   GENERIC_WRITE            = $40000000;
  521.   GENERIC_EXECUTE          = $20000000;
  522.   GENERIC_ALL              = $10000000;
  523.  
  524. type
  525.   { Define the generic mapping array.  This is used to denote the
  526.   { mapping of each generic access right to a specific access mask. }
  527.  
  528.   PGenericMapping = ^TGenericMapping;
  529.   TGenericMapping = record
  530.     GenericRead: ACCESS_MASK;
  531.     GenericWrite: ACCESS_MASK;
  532.     GenericExecute: ACCESS_MASK;
  533.     GenericAll: ACCESS_MASK;
  534.   end;
  535.  
  536. {line 2066}
  537.   PLUIDAndAttributes = ^TLUIDAndAttributes;
  538.   TLUIDAndAttributes = record
  539.     Luid: TLargeInteger;
  540.     Attributes: DWORD;
  541.   end;
  542.  
  543. {line 2106}
  544.   PSIDIdentifierAuthority = ^TSIDIdentifierAuthority;
  545.   TSIDIdentifierAuthority = record
  546.     Value: array[0..5] of Byte;
  547.   end;
  548.  
  549. {line 2128}
  550. const
  551.   SidTypeUser = 1;
  552.   SidTypeGroup = 2;
  553.   SidTypeDomain = 3;
  554.   SidTypeAlias = 4;
  555.   SidTypeWellKnownGroup = 5;
  556.   SidTypeDeletedAccount = 6;
  557.   SidTypeInvalid = 7;
  558.   SidTypeUnknown = 8;
  559. type
  560.   SID_NAME_USE = DWORD;
  561.  
  562.   PSIDAndAttributes = ^TSIDAndAttributes;
  563.   TSIDAndAttributes = record
  564.     Sid: PSID;
  565.     Attributes: DWORD;
  566.   end;
  567.  
  568. {line 2340}
  569.   PACL = ^TACL;
  570.   TACL = record
  571.     AclRevision: Byte;
  572.     Sbz1: Byte;
  573.     AclSize: Word;
  574.     AceCount: Word;
  575.     Sbz2: Word;
  576.   end;
  577.  
  578. {line 2484}
  579.   { The following declarations are used for setting and querying information
  580.     about and ACL.  First are the various information classes available to
  581.     the user. }
  582. const
  583.   AclRevisionInformation = 1;
  584.   AclSizeInformation = 2;
  585. type
  586.   ACL_INFORMATION_CLASS = DWORD;
  587.  
  588. {line 2518}
  589. { Security Descriptor and related data types. }
  590.  
  591. const
  592.   SECURITY_DESCRIPTOR_MIN_LENGTH = 20;
  593.   SE_OWNER_DEFAULTED = $0001;
  594.   SE_GROUP_DEFAULTED = $0002;
  595.   SE_DACL_PRESENT    = $0004;
  596.   SE_DACL_DEFAULTED  = $0008;
  597.   SE_SACL_PRESENT    = $0010;
  598.   SE_SACL_DEFAULTED  = $0020;
  599.   SE_SELF_RELATIVE   = $8000;
  600.  
  601. type
  602.   SECURITY_DESCRIPTOR_CONTROL = Word;
  603.   PSECURITY_DESCRIPTOR_CONTROL = ^WORD;
  604.  
  605.   { In general, this data structure should be treated opaquely
  606.     to ensure future compatibility. }
  607.  
  608.   PSecurityDescriptor = ^TSecurityDescriptor;
  609.   TSecurityDescriptor = record
  610.     Revision: Byte;
  611.     Sbz1: Byte;
  612.     Control: SECURITY_DESCRIPTOR_CONTROL;
  613.     Owner: PSID;
  614.     Group: PSID;
  615.     Sacl: PACL;
  616.     Dacl: PACL;
  617.   end;
  618.  
  619. {line 2682}
  620. { Privilege Related Data Structures }
  621.  
  622. const
  623.   { Privilege attributes }
  624.  
  625.   SE_PRIVILEGE_ENABLED_BY_DEFAULT = $00000001;
  626.   SE_PRIVILEGE_ENABLED            = $00000002;
  627.   SE_PRIVILEGE_USED_FOR_ACCESS    = $80000000;
  628.  
  629. {line 2700}
  630.   { Privilege Set Control flags }
  631.  
  632.   PRIVILEGE_SET_ALL_NECESSARY = 1;
  633.  
  634.   {  Privilege Set - This is defined for a privilege set of one.
  635.                    If more than one privilege is needed, then this structure
  636.                    will need to be allocated with more space.}
  637.   {  Note: don't change this structure without fixing the INITIAL_PRIVILEGE_SET}
  638.  
  639. type
  640.   PPrivilegeSet = ^TPrivilegeSet;
  641.   TPrivilegeSet = record
  642.     PrivilegeCount: DWORD;
  643.     Control: DWORD;
  644.     Privilege: array[0..0] of TLUIDAndAttributes;
  645.   end;
  646.  
  647. {line 2766}
  648.   TSecurityImpersonationLevel = (SecurityAnonymous,
  649.     SecurityIdentification, SecurityImpersonation, SecurityDelegation);
  650.  
  651. const
  652.   SECURITY_DYNAMIC_TRACKING = True;
  653.   SECURITY_STATIC_TRACKING  = False;
  654.  
  655. type
  656.   SECURITY_CONTEXT_TRACKING_MODE = Boolean;
  657.  
  658.   PSecurityQualityOfService = ^TSecurityQualityOfService;
  659.   TSecurityQualityOfService = packed record
  660.     Length: DWORD;
  661.     ImpersonationLevel: TSecurityImpersonationLevel;
  662.     ContextTrackingMode: SECURITY_CONTEXT_TRACKING_MODE;
  663.     EffectiveOnly: Boolean;
  664.   end;
  665.  
  666. {line 2876}
  667. const
  668.   TOKEN_ASSIGN_PRIMARY = $0001; 
  669.   TOKEN_DUPLICATE = $0002; 
  670.   TOKEN_IMPERSONATE = $0004; 
  671.   TOKEN_QUERY = $0008; 
  672.   TOKEN_QUERY_SOURCE = $0010; 
  673.   TOKEN_ADJUST_PRIVILEGES = $0020; 
  674.   TOKEN_ADJUST_GROUPS = $0040; 
  675.   TOKEN_ADJUST_DEFAULT = $0080; 
  676.   TOKEN_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED or TOKEN_ASSIGN_PRIMARY or
  677.     TOKEN_DUPLICATE or TOKEN_IMPERSONATE or TOKEN_QUERY or
  678.     TOKEN_QUERY_SOURCE or TOKEN_ADJUST_PRIVILEGES or TOKEN_ADJUST_GROUPS or
  679.     TOKEN_ADJUST_DEFAULT); 
  680.   TOKEN_READ = (STANDARD_RIGHTS_READ or TOKEN_QUERY); 
  681.   TOKEN_WRITE = (STANDARD_RIGHTS_WRITE or TOKEN_ADJUST_PRIVILEGES or
  682.     TOKEN_ADJUST_GROUPS or TOKEN_ADJUST_DEFAULT); 
  683.   TOKEN_EXECUTE = STANDARD_RIGHTS_EXECUTE;
  684.  
  685.   TokenUser = 1;
  686.   TokenGroups = 2;
  687.   TokenPrivileges = 3;
  688.   TokenOwner = 4;
  689.   TokenPrimaryGroup = 5;
  690.   TokenDefaultDacl = 6;
  691.   TokenSource = 7;
  692.   TokenType = 8;
  693.   TokenImpersonationLevel = 9;
  694.   TokenStatistics = 10;
  695. type
  696.   TOKEN_INFORMATION_CLASS = DWORD;
  697.  
  698. {line 2899}
  699.   PTokenGroups = ^TTokenGroups;
  700.   TTokenGroups = record
  701.     GroupCount: DWORD;
  702.     Groups: array[0..0] of TSIDAndAttributes;
  703.   end;
  704.  
  705.   PTokenPrivileges = ^TTokenPrivileges;
  706.   TTokenPrivileges = record
  707.     PrivilegeCount: DWORD;
  708.     Privileges: array[0..0] of TLUIDAndAttributes;
  709.   end;
  710.  
  711. {line 2961}
  712.   SECURITY_INFORMATION = DWORD;
  713.   PSECURITY_INFORMATION = ^DWORD;
  714. const
  715.   OWNER_SECURITY_INFORMATION =  $00000001;
  716.   GROUP_SECURITY_INFORMATION =  $00000002;
  717.   DACL_SECURITY_INFORMATION  =  $00000004;
  718.   SACL_SECURITY_INFORMATION  =  $00000008;
  719.  
  720. type
  721.   TThreadStartRoutine = function(lpThreadParameter: Pointer): Integer stdcall;
  722.  
  723. {line 4026}
  724. type
  725.   PRTLCriticalSection = ^TRTLCriticalSection;
  726.   PRTLCriticalSectionDebug = ^TRTLCriticalSectionDebug;
  727.   TRTLCriticalSectionDebug = record
  728.     Type_18: Word;
  729.     CreatorBackTraceIndex: Word;
  730.     CriticalSection: PRTLCriticalSection;
  731.     ProcessLocksList: TListEntry;
  732.     EntryCount: DWORD;
  733.     ContentionCount: DWORD;
  734.     Spare: array[0..1] of DWORD;
  735.   end;
  736.  
  737.  
  738.   TRTLCriticalSection = record
  739.     DebugInfo: PRTLCriticalSectionDebug;
  740.     LockCount: Longint;
  741.     RecursionCount: Longint;
  742.     OwningThread: THandle;
  743.     LockSemaphore: THandle;
  744.     Reserved: DWORD;
  745.   end;
  746.  
  747. const
  748.   RTL_CRITSECT_TYPE = 0;
  749.   RTL_RESOURCE_TYPE = 1;
  750.  
  751.  
  752.   DLL_PROCESS_ATTACH = 1;
  753.   DLL_THREAD_ATTACH = 2;
  754.   DLL_THREAD_DETACH = 3;
  755.   DLL_PROCESS_DETACH = 0;
  756.  
  757. {line 4320}
  758.  
  759. { Registry Specific Access Rights. }
  760.  
  761.   KEY_QUERY_VALUE    = $0001;
  762.   KEY_SET_VALUE      = $0002;
  763.   KEY_CREATE_SUB_KEY = $0004;
  764.   KEY_ENUMERATE_SUB_KEYS = $0008;
  765.   KEY_NOTIFY         = $0010;
  766.   KEY_CREATE_LINK    = $0020;
  767.  
  768.  
  769.   KEY_READ           = (STANDARD_RIGHTS_READ or
  770.                         KEY_QUERY_VALUE or
  771.                         KEY_ENUMERATE_SUB_KEYS or
  772.                         KEY_NOTIFY) and not
  773.                         SYNCHRONIZE;
  774.  
  775.  
  776.  
  777.   KEY_WRITE          = (STANDARD_RIGHTS_WRITE or
  778.                         KEY_SET_VALUE or
  779.                         KEY_CREATE_SUB_KEY) and not
  780.                         SYNCHRONIZE;
  781.  
  782.   KEY_EXECUTE        =  KEY_READ and not SYNCHRONIZE;
  783.  
  784.  
  785.   KEY_ALL_ACCESS     = (STANDARD_RIGHTS_ALL or
  786.                         KEY_QUERY_VALUE or
  787.                         KEY_SET_VALUE or
  788.                         KEY_CREATE_SUB_KEY or
  789.                         KEY_ENUMERATE_SUB_KEYS or
  790.                         KEY_NOTIFY or
  791.                         KEY_CREATE_LINK) and not
  792.                         SYNCHRONIZE;
  793.  
  794.   { Registry Open/Create Options }
  795.  
  796.   REG_OPTION_RESERVED     = ($00000000);    { Parameter is reserved }
  797.  
  798.   REG_OPTION_NON_VOLATILE = ($00000000);    { Key is preserved }
  799.                                             { when system is rebooted }
  800.  
  801.   REG_OPTION_VOLATILE     = ($00000001);    { Key is not preserved }
  802.                                             { when system is rebooted }
  803.  
  804.   REG_OPTION_CREATE_LINK  = ($00000002);    { Created key is a }
  805.                                             { symbolic link }
  806.  
  807.   REG_OPTION_BACKUP_RESTORE = ($00000004);  { open for backup or restore }
  808.                                             { special access rules }
  809.                                             { privilege required   }
  810.  
  811.   REG_LEGAL_OPTION  = (REG_OPTION_RESERVED or
  812.                        REG_OPTION_NON_VOLATILE or
  813.                        REG_OPTION_VOLATILE or
  814.                        REG_OPTION_CREATE_LINK or
  815.                        REG_OPTION_BACKUP_RESTORE);
  816.  
  817.   { Registry Key creation/open disposition }
  818.  
  819.   REG_CREATED_NEW_KEY     = ($00000001);    { New Registry Key created }
  820.   REG_OPENED_EXISTING_KEY = ($00000002);    { Existing Key opened }
  821.  
  822.   { Registry Key restore flags }
  823.  
  824.   REG_WHOLE_HIVE_VOLATILE = ($00000001);    { Restore whole hive volatile }
  825.   REG_REFRESH_HIVE        = ($00000002);    { Unwind changes to last flush }
  826.  
  827.   { Registry Notify filter values }
  828.  
  829.   REG_NOTIFY_CHANGE_NAME       = ($00000001); { Create or delete (child) }
  830.   REG_NOTIFY_CHANGE_ATTRIBUTES = ($00000002);
  831.   REG_NOTIFY_CHANGE_LAST_SET   = ($00000004); { time stamp }
  832.   REG_NOTIFY_CHANGE_SECURITY   = ($00000008);
  833.  
  834.   REG_LEGAL_CHANGE_FILTER = (REG_OPTION_RESERVED or
  835.                              REG_NOTIFY_CHANGE_NAME or
  836.                              REG_NOTIFY_CHANGE_ATTRIBUTES or
  837.                              REG_NOTIFY_CHANGE_LAST_SET or
  838.                              REG_NOTIFY_CHANGE_SECURITY);
  839.  
  840.   { Registry Predefined Value Types }
  841.  
  842.   REG_NONE                    = 0;
  843.   REG_SZ                      = 1;
  844.   REG_EXPAND_SZ               = 2;
  845.   REG_BINARY                  = 3;
  846.   REG_DWORD                   = 4;
  847.   REG_DWORD_LITTLE_ENDIAN     = 4;
  848.   REG_DWORD_BIG_ENDIAN        = 5;
  849.   REG_LINK                    = 6;
  850.   REG_MULTI_SZ                = 7;
  851.   REG_RESOURCE_LIST           = 8;
  852.   REG_FULL_RESOURCE_DESCRIPTOR = 9;
  853.   REG_RESOURCE_REQUIREMENTS_LIST = 10;
  854.  
  855. { END Translated from WINNT.H }
  856.  
  857. type
  858.   WPARAM = Longint;
  859.   LPARAM = Longint;
  860.   LRESULT = Longint;
  861.  
  862. function MakeWord(a, b: Byte): Word;
  863. function MakeLong(a, b: Word): Longint;
  864.  
  865. type
  866.   LOWORD = Word;
  867.  
  868. function HiWord(l: DWORD): Word;
  869.  
  870. type
  871.   LOBYTE = Byte;
  872.  
  873. function HiByte(W: Word): Byte;
  874.  
  875. type
  876. {$IFDEF STRICT}
  877. { Standard Handle Declarations }
  878. {   XXXX__ records are used to ensure the handle has a unique type that is }
  879. {   not compatible with other types.  }
  880.  
  881.   HWND__ = record
  882.     unused: BOOL;
  883.   end;
  884.   HWND = ^HWND__;
  885.   HHOOK__ = record
  886.     unused: BOOL;
  887.   end;
  888.   HHOOK = ^HHOOK__;
  889. {$ELSE}
  890.   HWND = Integer;
  891.   HHOOK = Integer;
  892. {$ENDIF}
  893.  
  894.   ATOM = Word;
  895.   TAtom = Word;
  896.  
  897.   HGLOBAL = THandle;
  898.   HLOCAL = THandle;
  899.   FARPROC = Pointer;
  900.   TFarProc = Pointer;
  901.   PROC_22 = Pointer;
  902.  
  903. {$IFDEF STRICT}
  904.   HGDIOBJ = Pointer;
  905.  
  906.   HACCEL__ = record
  907.     unused: BOOL;
  908.   end;
  909.   HACCEL = ^HACCEL__;
  910.   HBITMAP__ = record
  911.     unused: BOOL;
  912.   end;
  913.   HBITMAP = ^HBITMAP__;
  914.   HBRUSH__ = record
  915.     unused: BOOL;
  916.   end;
  917.   HBRUSH = ^HBRUSH__;
  918.   HCOLORSPACE__ = record
  919.     unused: BOOL;
  920.   end;
  921.   HCOLORSPACE = ^HCOLORSPACE__;
  922.   HDC__ = record
  923.     unused: BOOL;
  924.   end;
  925.   HDC = ^HDC__;
  926.   HGLRC__ = record
  927.     unused: BOOL;
  928.   end;
  929.   HGLRC = ^HGLRC__;              {OpenGL}
  930.   HDESK__ = record
  931.     unused: BOOL;
  932.   end;
  933.   HDESK = ^HDESK__;
  934.   HENHMETAFILE__ = record
  935.     unused: BOOL;
  936.   end;
  937.   HENHMETAFILE = ^HENHMETAFILE__;
  938.   HFONT__ = record
  939.     unused: BOOL;
  940.   end;
  941.   HFONT = ^HFONT__;
  942.   HICON__ = record
  943.     unused: BOOL;
  944.   end;
  945.   HICON = ^HICON__;
  946.   HMENU__ = record
  947.     unused: BOOL;
  948.   end;
  949.   HMENU = ^HMENU__;
  950.   HMETAFILE__ = record
  951.     unused: BOOL;
  952.   end;
  953.   HMETAFILE = ^HMETAFILE__;
  954.   HINSTANCE__ = record
  955.     unused: BOOL;
  956.   end;
  957.   HINST = ^HINSTANCE__;
  958.   HMODULE = HINST;              { HMODULEs can be used in place of HINSTs }
  959.   HPALETTE__ = record
  960.     unused: BOOL;
  961.   end;
  962.   HPALETTE = ^HPALETTE__;
  963.   HPEN__ = record
  964.     unused: BOOL;
  965.   end;
  966.   HPEN = ^HPEN__;
  967.   HRGN__ = record
  968.     unused: BOOL;
  969.   end;
  970.   HRGN = ^HRGN__;
  971.   HRSRC__ = record
  972.     unused: BOOL;
  973.   end;
  974.   HRSRC = ^HRSRC__;
  975.   HSTR__ = record
  976.     unused: BOOL;
  977.   end;
  978.   HSTR = ^HSTR__;
  979.   HTASK__ = record
  980.     unused: BOOL;
  981.   end;
  982.   HTASK = ^HTASK__;
  983.   HWINSTA__ = record
  984.     unused: BOOL;
  985.   end;
  986.   HWINSTA = ^HWINSTA__;
  987.   HKL__ = record
  988.     unused: BOOL;
  989.   end;
  990.   HKL = ^HKL__;
  991.  
  992. {$ELSE}
  993.  
  994.   HGDIOBJ = Integer;
  995.   HACCEL = Integer;
  996.   HBITMAP = Integer;
  997.   HBRUSH = Integer;
  998.   HCOLORSPACE = Integer;
  999.   HDC = Integer;
  1000.   HGLRC = Integer;
  1001.   HDESK = Integer;
  1002.   HENHMETAFILE = Integer;
  1003.   HFONT = Integer;
  1004.   HICON = Integer;
  1005.   HMENU = Integer;
  1006.   HMETAFILE = Integer;
  1007.   HINST = Integer;
  1008.   HMODULE = HINST;              { HMODULEs can be used in place of HINSTs }
  1009.   HPALETTE = Integer;
  1010.   HPEN = Integer;
  1011.   HRGN = Integer;
  1012.   HRSRC = Integer;
  1013.   HSTR = Integer;
  1014.   HTASK = Integer;
  1015.   HWINSTA = Integer;
  1016.   HKL = Integer;
  1017.  
  1018. {$ENDIF}
  1019.  
  1020.   HFILE = Integer;
  1021.   HCURSOR = HICON;              { HICONs & HCURSORs are polymorphic }
  1022.  
  1023.   COLORREF = DWORD;
  1024.   TColorRef = Longint;
  1025.  
  1026. const
  1027.   HFILE_ERROR = HFILE(-1);
  1028.  
  1029. type
  1030.   PPoint = ^TPoint;
  1031.   TPoint = record
  1032.     x: Longint;
  1033.     y: Longint;
  1034.   end;
  1035.  
  1036.   PRect = ^TRect;
  1037.   TRect = record
  1038.     case Integer of
  1039.       0: (Left, Top, Right, Bottom: Integer);
  1040.       1: (TopLeft, BottomRight: TPoint);
  1041.   end;
  1042.  
  1043.   PSize = ^TSize;
  1044.   TSize = record
  1045.     cx: Longint;
  1046.     cy: Longint;
  1047.   end;
  1048.  
  1049.   PSmallPoint = ^TSmallPoint;
  1050.   TSmallPoint = record
  1051.     x: SHORT;
  1052.     y: SHORT;
  1053.   end;
  1054.  
  1055. { Translated from WINBASE.H }
  1056.  
  1057. { Compatiblity functions and procedures }
  1058.  
  1059. function DefineHandleTable(Offset: Word): Bool;
  1060. procedure LimitEmsPages(Kbytes: Longint);
  1061. function SetSwapAreaSize(Size: Word): Longint;
  1062. procedure LockSegment(Segment: THandle);
  1063. procedure UnlockSegment(Segment: THandle);
  1064. function GetCurrentTime: Longint;
  1065. function Yield: Bool;
  1066.  
  1067. const
  1068.   INVALID_HANDLE_VALUE = -1;
  1069.   INVALID_FILE_SIZE = DWORD($FFFFFFFF);
  1070.  
  1071.   FILE_BEGIN = 0;
  1072.   FILE_CURRENT = 1;
  1073.   FILE_END = 2;
  1074.  
  1075.   TIME_ZONE_ID_INVALID = DWORD($FFFFFFFF);
  1076.  
  1077.   WAIT_FAILED  = DWORD($FFFFFFFF);
  1078.   WAIT_OBJECT_0 = ((STATUS_WAIT_0 ) + 0 );
  1079.  
  1080.   WAIT_ABANDONED = ((STATUS_ABANDONED_WAIT_0 ) + 0 );
  1081.   WAIT_ABANDONED_0 = ((STATUS_ABANDONED_WAIT_0 ) + 0 );
  1082.  
  1083.   WAIT_TIMEOUT = STATUS_TIMEOUT;
  1084.   WAIT_IO_COMPLETION = STATUS_USER_APC;
  1085.   STILL_ACTIVE = STATUS_PENDING;
  1086.   EXCEPTION_ACCESS_VIOLATION = STATUS_ACCESS_VIOLATION;
  1087.   EXCEPTION_DATATYPE_MISALIGNMENT = STATUS_DATATYPE_MISALIGNMENT;
  1088.   EXCEPTION_BREAKPOINT = STATUS_BREAKPOINT;
  1089.   EXCEPTION_SINGLE_STEP = STATUS_SINGLE_STEP;
  1090.   EXCEPTION_ARRAY_BOUNDS_EXCEEDED = STATUS_ARRAY_BOUNDS_EXCEEDED;
  1091.   EXCEPTION_FLT_DENORMAL_OPERAND = STATUS_FLOAT_DENORMAL_OPERAND;
  1092.   EXCEPTION_FLT_DIVIDE_BY_ZERO = STATUS_FLOAT_DIVIDE_BY_ZERO;
  1093.   EXCEPTION_FLT_INEXACT_RESULT = STATUS_FLOAT_INEXACT_RESULT;
  1094.   EXCEPTION_FLT_INVALID_OPERATION = STATUS_FLOAT_INVALID_OPERATION;
  1095.   EXCEPTION_FLT_OVERFLOW = STATUS_FLOAT_OVERFLOW;
  1096.   EXCEPTION_FLT_STACK_CHECK = STATUS_FLOAT_STACK_CHECK;
  1097.   EXCEPTION_FLT_UNDERFLOW = STATUS_FLOAT_UNDERFLOW;
  1098.   EXCEPTION_INT_DIVIDE_BY_ZERO = STATUS_INTEGER_DIVIDE_BY_ZERO;
  1099.   EXCEPTION_INT_OVERFLOW = STATUS_INTEGER_OVERFLOW;
  1100.   EXCEPTION_PRIV_INSTRUCTION = STATUS_PRIVILEGED_INSTRUCTION;
  1101.   EXCEPTION_IN_PAGE_ERROR = STATUS_IN_PAGE_ERROR;
  1102.   EXCEPTION_ILLEGAL_INSTRUCTION = STATUS_ILLEGAL_INSTRUCTION;
  1103.   EXCEPTION_NONCONTINUABLE_EXCEPTION = STATUS_NONCONTINUABLE_EXCEPTION;
  1104.   EXCEPTION_STACK_OVERFLOW = STATUS_STACK_OVERFLOW;
  1105.   EXCEPTION_INVALID_DISPOSITION = STATUS_INVALID_DISPOSITION;
  1106.   EXCEPTION_GUARD_PAGE = STATUS_GUARD_PAGE_VIOLATION;
  1107.   CONTROL_C_EXIT = STATUS_CONTROL_C_EXIT;
  1108.  
  1109. procedure MoveMemory(Destination: Pointer; Source: Pointer; Length: DWORD);
  1110. procedure CopyMemory(Destination: Pointer; Source: Pointer; Length: DWORD);
  1111. procedure FillMemory(Destination: Pointer; Length: DWORD; Fill: Byte);
  1112. procedure ZeroMemory(Destination: Pointer; Length: DWORD);
  1113.  
  1114. const
  1115.   { File creation flags must start at the high end since they }
  1116.   { are combined with the attributes}
  1117.  
  1118.   FILE_FLAG_WRITE_THROUGH = $80000000;
  1119.   FILE_FLAG_OVERLAPPED = $40000000;
  1120.   FILE_FLAG_NO_BUFFERING = $20000000;
  1121.   FILE_FLAG_RANDOM_ACCESS = $10000000;
  1122.   FILE_FLAG_SEQUENTIAL_SCAN = $8000000;
  1123.   FILE_FLAG_DELETE_ON_CLOSE = $4000000;
  1124.   FILE_FLAG_BACKUP_SEMANTICS = $2000000;
  1125.   FILE_FLAG_POSIX_SEMANTICS = $1000000;
  1126.  
  1127.   CREATE_NEW = 1;
  1128.   CREATE_ALWAYS = 2;
  1129.   OPEN_EXISTING = 3;
  1130.   OPEN_ALWAYS = 4;
  1131.   TRUNCATE_EXISTING = 5;
  1132.  
  1133.  
  1134. { Define the NamedPipe definitions}
  1135.  
  1136.   { Define the dwOpenMode values for CreateNamedPipe }
  1137.  
  1138.   PIPE_ACCESS_INBOUND = 1;
  1139.   PIPE_ACCESS_OUTBOUND = 2;
  1140.   PIPE_ACCESS_DUPLEX = 3;
  1141.  
  1142.   { Define the Named Pipe End flags for GetNamedPipeInfo }
  1143.  
  1144.   PIPE_CLIENT_END = 0;
  1145.   PIPE_SERVER_END = 1;
  1146.  
  1147.   { Define the dwPipeMode values for CreateNamedPipe }
  1148.  
  1149.   PIPE_WAIT = 0;
  1150.   PIPE_NOWAIT = 1;
  1151.   PIPE_READMODE_BYTE = 0;
  1152.   PIPE_READMODE_MESSAGE = 2;
  1153.   PIPE_TYPE_BYTE = 0;
  1154.   PIPE_TYPE_MESSAGE = 4;
  1155.  
  1156.   { Define the well known values for CreateNamedPipe nMaxInstances }
  1157.  
  1158.   PIPE_UNLIMITED_INSTANCES = 255;
  1159.  
  1160.   { Define the Security Quality of Service bits to be passed into CreateFile }
  1161.  
  1162.   SECURITY_ANONYMOUS = (Ord(SecurityAnonymous) shl 16);
  1163.   SECURITY_IDENTIFICATION = (Ord(SecurityIdentification) shl 16);
  1164.   SECURITY_IMPERSONATION = (Ord(SecurityImpersonation) shl 16);
  1165.   SECURITY_DELEGATION = (Ord(SecurityDelegation) shl 16);
  1166.  
  1167.   SECURITY_CONTEXT_TRACKING = $40000;
  1168.   SECURITY_EFFECTIVE_ONLY = $80000;
  1169.  
  1170.   SECURITY_SQOS_PRESENT = $100000;
  1171.   SECURITY_VALID_SQOS_FLAGS = $1F0000;
  1172.  
  1173. { File structures }
  1174.  
  1175. type
  1176.   POverlapped = ^TOverlapped;
  1177.   TOverlapped = record
  1178.     Internal: DWORD;
  1179.     InternalHigh: DWORD;
  1180.     Offset: DWORD;
  1181.     OffsetHigh: DWORD;
  1182.     hEvent: THandle;
  1183.   end;
  1184.  
  1185.   PSecurityAttributes = ^TSecurityAttributes;
  1186.   TSecurityAttributes = record
  1187.     nLength: DWORD;
  1188.     lpSecurityDescriptor: Pointer;
  1189.     bInheritHandle: BOOL;
  1190.   end;
  1191.  
  1192.   PProcessInformation = ^TProcessInformation;
  1193.   TProcessInformation = record
  1194.     hProcess: THandle;
  1195.     hThread: THandle;
  1196.     dwProcessId: DWORD;
  1197.     dwThreadId: DWORD;
  1198.   end;
  1199.  
  1200.   { File System time stamps are represented with the following structure: }
  1201.   PFileTime = ^TFileTime;
  1202.   TFileTime = record
  1203.     dwLowDateTime: DWORD;
  1204.     dwHighDateTime: DWORD;
  1205.   end;
  1206.  
  1207.   { System time is represented with the following structure: }
  1208.   PSystemTime = ^TSystemTime;
  1209.   TSystemTime = record
  1210.     wYear: Word;
  1211.     wMonth: Word;
  1212.     wDayOfWeek: Word;
  1213.     wDay: Word;
  1214.     wHour: Word;
  1215.     wMinute: Word;
  1216.     wSecond: Word;
  1217.     wMilliseconds: Word;
  1218.   end;
  1219.  
  1220. {$IFDEF STRICT}
  1221.   TFNThreadStartRoutine = function (lpThreadParameter: Pointer): DWORD stdcall;
  1222. {$ELSE}
  1223.   TFNThreadStartRoutine = TFarProc;
  1224. {$ENDIF}
  1225.  
  1226. const
  1227.   MUTEX_MODIFY_STATE = MUTANT_QUERY_STATE;
  1228.   MUTEX_ALL_ACCESS = MUTANT_ALL_ACCESS;
  1229.  
  1230.   { Serial provider type. }
  1231.  
  1232.   SP_SERIALCOMM = $00000001;
  1233.  
  1234.   { Provider SubTypes }
  1235.  
  1236.   PST_UNSPECIFIED = $00000000;
  1237.   PST_RS232 = $00000001;
  1238.   PST_PARALLELPORT = $00000002;
  1239.   PST_RS422 = $00000003;
  1240.   PST_RS423 = $00000004;
  1241.   PST_RS449 = $00000005;
  1242.   PST_MODEM = $00000006;
  1243.   PST_FAX = $00000021;
  1244.   PST_SCANNER = $00000022;
  1245.   PST_NETWORK_BRIDGE = $00000100;
  1246.   PST_LAT = $00000101;
  1247.   PST_TCPIP_TELNET = $00000102;
  1248.   PST_X25 = $00000103;
  1249.  
  1250.   { Provider capabilities flags. }
  1251.  
  1252.   PCF_DTRDSR = $0001;
  1253.   PCF_RTSCTS = $0002;
  1254.   PCF_RLSD = $0004;
  1255.   PCF_PARITY_CHECK = $0008;
  1256.   PCF_XONXOFF = $0010;
  1257.   PCF_SETXCHAR = $0020;
  1258.   PCF_TOTALTIMEOUTS = $0040;
  1259.   PCF_INTTIMEOUTS = $0080;
  1260.   PCF_SPECIALCHARS = $0100;
  1261.   PCF_16BITMODE = $0200;
  1262.  
  1263.   { Comm provider settable parameters. }
  1264.  
  1265.   SP_PARITY = $0001;
  1266.   SP_BAUD = $0002;
  1267.   SP_DATABITS = $0004;
  1268.   SP_STOPBITS = $0008;
  1269.   SP_HANDSHAKING = $0010;
  1270.   SP_PARITY_CHECK = $0020;
  1271.   SP_RLSD = $0040;
  1272.  
  1273.   { Settable baud rates in the provider. }
  1274.  
  1275.   BAUD_075 = $00000001;
  1276.   BAUD_110 = $00000002;
  1277.   BAUD_134_5 = $00000004;
  1278.   BAUD_150 = $00000008;
  1279.   BAUD_300 = $00000010;
  1280.   BAUD_600 = $00000020;
  1281.   BAUD_1200 = $00000040;
  1282.   BAUD_1800 = $00000080;
  1283.   BAUD_2400 = $00000100;
  1284.   BAUD_4800 = $00000200;
  1285.   BAUD_7200 = $00000400;
  1286.   BAUD_9600 = $00000800;
  1287.   BAUD_14400 = $00001000;
  1288.   BAUD_19200 = $00002000;
  1289.   BAUD_38400 = $00004000;
  1290.   BAUD_56K = $00008000;
  1291.   BAUD_128K = $00010000;
  1292.   BAUD_115200 = $00020000;
  1293.   BAUD_57600 = $00040000;
  1294.   BAUD_USER = $10000000;
  1295.  
  1296.   { Settable Data Bits }
  1297.  
  1298.   DATABITS_5 = $0001;
  1299.   DATABITS_6 = $0002;
  1300.   DATABITS_7 = $0004;
  1301.   DATABITS_8 = $0008;
  1302.   DATABITS_16 = $0010;
  1303.   DATABITS_16X = $0020;
  1304.  
  1305.   { Settable Stop and Parity bits. }
  1306.  
  1307.   STOPBITS_10 = $0001;
  1308.   STOPBITS_15 = $0002;
  1309.   STOPBITS_20 = $0004;
  1310.   PARITY_NONE = $0100;
  1311.   PARITY_ODD = $0200;
  1312.   PARITY_EVEN = $0400;
  1313.   PARITY_MARK = $0800;
  1314.   PARITY_SPACE = $1000;
  1315.  
  1316. type
  1317.   PCommProp = ^TCommProp;
  1318.   TCommProp = record
  1319.     wPacketLength: Word;
  1320.     wPacketVersion: Word;
  1321.     dwServiceMask: DWORD;
  1322.     dwReserved1: DWORD;
  1323.     dwMaxTxQueue: DWORD;
  1324.     dwMaxRxQueue: DWORD;
  1325.     dwMaxBaud: DWORD;
  1326.     dwProvSubType: DWORD;
  1327.     dwProvCapabilities: DWORD;
  1328.     dwSettableParams: DWORD;
  1329.     dwSettableBaud: DWORD;
  1330.     wSettableData: Word;
  1331.     wSettableStopParity: Word;
  1332.     dwCurrentTxQueue: DWORD;
  1333.     dwCurrentRxQueue: DWORD;
  1334.     dwProvSpec1: DWORD;
  1335.     dwProvSpec2: DWORD;
  1336.     wcProvChar: array[0..0] of WCHAR;
  1337.   end;
  1338.  
  1339.   { Set dwProvSpec1 to COMMPROP_INITIALIZED to indicate that wPacketLength
  1340.     is valid before a call to GetCommProperties(). }
  1341. const
  1342.   COMMPROP_INITIALIZED = $E73CF52E;
  1343.  
  1344. type
  1345.   TComStateFlag = (fCtlHold, fDsrHold, fRlsHold, fXoffHold, fXOffSent, fEof,
  1346.     fTxim);
  1347.   TComStateFlags = set of TComStateFlag;
  1348.   TComStat = record
  1349.     Flags: TComStateFlags;
  1350.     Reserved: array[0..2] of Byte;
  1351.     cbInQue: DWORD;
  1352.     cbOutQue: DWORD;
  1353.   end;
  1354.   PComStat = ^TComStat;
  1355.  
  1356. const
  1357.   { DTR Control Flow Values. }
  1358.   DTR_CONTROL_DISABLE = 0;
  1359.   DTR_CONTROL_ENABLE = 1;
  1360.   DTR_CONTROL_HANDSHAKE = 2;
  1361.  
  1362.   { RTS Control Flow Values}
  1363.   RTS_CONTROL_DISABLE = 0;
  1364.   RTS_CONTROL_ENABLE = 1;
  1365.   RTS_CONTROL_HANDSHAKE = 2;
  1366.   RTS_CONTROL_TOGGLE = 3;
  1367.  
  1368. type
  1369.   TDCB = packed record
  1370.     DCBlength: DWORD;
  1371.     BaudRate: DWORD;
  1372.     Flags: Longint;
  1373.     wReserved: Word;
  1374.     XonLim: Word;
  1375.     XoffLim: Word;
  1376.     ByteSize: Byte;
  1377.     Parity: Byte;
  1378.     StopBits: Byte;
  1379.     XonChar: CHAR;
  1380.     XoffChar: CHAR;
  1381.     ErrorChar: CHAR;
  1382.     EofChar: CHAR;
  1383.     EvtChar: CHAR;
  1384.     wReserved1: Word;
  1385.   end;
  1386.   PDCB = ^TDCB;
  1387.  
  1388.   PCommTimeouts = ^TCommTimeouts;
  1389.   TCommTimeouts = record
  1390.     ReadIntervalTimeout: DWORD;
  1391.     ReadTotalTimeoutMultiplier: DWORD;
  1392.     ReadTotalTimeoutConstant: DWORD;
  1393.     WriteTotalTimeoutMultiplier: DWORD;
  1394.     WriteTotalTimeoutConstant: DWORD;
  1395.   end;
  1396.  
  1397.   PCommConfig = ^TCommConfig;
  1398.   TCommConfig = record
  1399.     dwSize: DWORD;
  1400.     wVersion: Word;
  1401.     wReserved: Word;
  1402.     dcb: TDCB;
  1403.     dwProviderSubType: DWORD;
  1404.     dwProviderOffset: DWORD;
  1405.     dwProviderSize: DWORD;
  1406.     wcProviderData: array[0..0] of WCHAR;
  1407.   end;
  1408.  
  1409.   PSystemInfo = ^TSystemInfo;
  1410.   TSystemInfo = record
  1411.     case Integer of
  1412.       0: (
  1413.         dwOemId: DWORD);
  1414.       1: (
  1415.         wProcessorArchitecture: Word; 
  1416.         wReserved: Word; 
  1417.         dwPageSize: DWORD;
  1418.         lpMinimumApplicationAddress: Pointer;
  1419.         lpMaximumApplicationAddress: Pointer;
  1420.         dwActiveProcessorMask: DWORD;
  1421.         dwNumberOfProcessors: DWORD;
  1422.         dwProcessorType: DWORD;
  1423.         dwAllocationGranularity: DWORD;
  1424.         wProcessorLevel: Word;
  1425.         wProcessorRevision: Word);
  1426.   end;
  1427.  
  1428. function FreeModule(var hLibModule: HINST): BOOL;
  1429. function MakeProcInstance(Proc: FARPROC; Instance: THandle): FARPROC;
  1430. procedure FreeProcInstance(Proc: FARPROC);
  1431.  
  1432.  
  1433. const
  1434.   { Global Memory Flags }
  1435.  
  1436.   GMEM_FIXED = 0;
  1437.   GMEM_MOVEABLE = 2;
  1438.   GMEM_NOCOMPACT = $10;
  1439.   GMEM_NODISCARD = $20;
  1440.   GMEM_ZEROINIT = $40;
  1441.   GMEM_MODIFY = $80;
  1442.   GMEM_DISCARDABLE = $100;
  1443.   GMEM_NOT_BANKED = $1000;
  1444.   GMEM_SHARE = $2000;
  1445.   GMEM_DDESHARE = $2000;
  1446.   GMEM_NOTIFY = $4000;
  1447.   GMEM_LOWER = GMEM_NOT_BANKED;
  1448.   GMEM_VALID_FLAGS = 32626;
  1449.   GMEM_INVALID_HANDLE = $8000;
  1450.  
  1451.   GHND = GMEM_MOVEABLE or GMEM_ZEROINIT;
  1452.   GPTR = GMEM_FIXED or GMEM_ZEROINIT;
  1453.  
  1454. function GlobalLRUNewest(h: THandle): THandle;
  1455. function GlobalLRUOldest(h: THandle): THandle;
  1456. function GlobalDiscard(h: THandle): THandle;
  1457.  
  1458. function GlobalAllocPtr(Flags: Integer; Bytes: Longint): Pointer;
  1459. function GlobalReAllocPtr(P: Pointer; Bytes: Longint; Flags: Integer): Pointer;
  1460. function GlobalFreePtr(P: Pointer): THandle;
  1461.  
  1462. const
  1463.   { Flags returned by GlobalFlags (in addition to GMEM_DISCARDABLE) }
  1464.   GMEM_DISCARDED = $4000;
  1465.   GMEM_LOCKCOUNT = 255;
  1466.  
  1467. type
  1468.   PMemoryStatus = ^TMemoryStatus;
  1469.   TMemoryStatus = record
  1470.     dwLength: DWORD;
  1471.     dwMemoryLoad: DWORD;
  1472.     dwTotalPhys: DWORD;
  1473.     dwAvailPhys: DWORD;
  1474.     dwTotalPageFile: DWORD;
  1475.     dwAvailPageFile: DWORD;
  1476.     dwTotalVirtual: DWORD;
  1477.     dwAvailVirtual: DWORD;
  1478.   end;
  1479.  
  1480. const
  1481.   { Local Memory Flags }
  1482.  
  1483.   LMEM_FIXED = 0;
  1484.   LMEM_MOVEABLE = 2;
  1485.   LMEM_NOCOMPACT = $10;
  1486.   LMEM_NODISCARD = $20;
  1487.   LMEM_ZEROINIT = $40;
  1488.   LMEM_MODIFY = $80;
  1489.   LMEM_DISCARDABLE = $F00;
  1490.   LMEM_VALID_FLAGS = $F72;
  1491.   LMEM_INVALID_HANDLE = $8000;
  1492.  
  1493.   LHND = LMEM_MOVEABLE or LMEM_ZEROINIT;
  1494.   LPTR = LMEM_FIXED or LMEM_ZEROINIT;
  1495.  
  1496.   NONZEROLPTR = LMEM_FIXED;
  1497.  
  1498.  
  1499. function LocalDiscard(h: THandle): THandle;
  1500.  
  1501. const
  1502.   { Flags returned by LocalFlags (in addition to LMEM_DISCARDABLE) }
  1503.  
  1504.   LMEM_DISCARDED = $4000;
  1505.   LMEM_LOCKCOUNT = 255;
  1506.  
  1507.   { dwCreationFlag values }
  1508.  
  1509.   DEBUG_PROCESS = 1;
  1510.   DEBUG_ONLY_THIS_PROCESS = 2;
  1511.  
  1512.   CREATE_SUSPENDED = 4;
  1513.  
  1514.   DETACHED_PROCESS = 8;
  1515.  
  1516.   CREATE_NEW_CONSOLE = $10;
  1517.  
  1518.   NORMAL_PRIORITY_CLASS = $20;
  1519.   IDLE_PRIORITY_CLASS = $40;
  1520.   HIGH_PRIORITY_CLASS = $80;
  1521.   REALTIME_PRIORITY_CLASS = $100;
  1522.  
  1523.   CREATE_NEW_PROCESS_GROUP = $200;
  1524.   CREATE_UNICODE_ENVIRONMENT = $400;
  1525.  
  1526.   CREATE_SEPARATE_WOW_VDM = $800;
  1527.   CREATE_SHARED_WOW_VDM = $1000;
  1528.  
  1529.   CREATE_DEFAULT_ERROR_MODE = $4000000;
  1530.   CREATE_NO_WINDOW = $8000000;
  1531.  
  1532.   PROFILE_USER = $10000000;
  1533.   PROFILE_KERNEL = $20000000;
  1534.   PROFILE_SERVER = $40000000;
  1535.  
  1536.   THREAD_PRIORITY_LOWEST = THREAD_BASE_PRIORITY_MIN;
  1537.   THREAD_PRIORITY_BELOW_NORMAL = THREAD_PRIORITY_LOWEST + 1;
  1538.   THREAD_PRIORITY_NORMAL = 0;
  1539.   THREAD_PRIORITY_HIGHEST = THREAD_BASE_PRIORITY_MAX;
  1540.   THREAD_PRIORITY_ABOVE_NORMAL = THREAD_PRIORITY_HIGHEST - 1;
  1541.   THREAD_PRIORITY_ERROR_RETURN = MAXLONG;
  1542.  
  1543.   THREAD_PRIORITY_TIME_CRITICAL = THREAD_BASE_PRIORITY_LOWRT;
  1544.   THREAD_PRIORITY_IDLE = THREAD_BASE_PRIORITY_IDLE;
  1545.  
  1546. { Debug APIs }
  1547.  
  1548.   EXCEPTION_DEBUG_EVENT = 1;
  1549.   CREATE_THREAD_DEBUG_EVENT = 2;
  1550.   CREATE_PROCESS_DEBUG_EVENT = 3;
  1551.   EXIT_THREAD_DEBUG_EVENT = 4;
  1552.   EXIT_PROCESS_DEBUG_EVENT = 5;
  1553.   LOAD_DLL_DEBUG_EVENT = 6;
  1554.   UNLOAD_DLL_DEBUG_EVENT = 7;
  1555.   OUTPUT_DEBUG_STRING_EVENT = 8;
  1556.   RIP_EVENT = 9;
  1557.  
  1558. type
  1559.   PExceptionDebugInfo = ^TExceptionDebugInfo;
  1560.   TExceptionDebugInfo = record
  1561.     ExceptionRecord: TExceptionRecord;
  1562.     dwFirstChance: DWORD;
  1563.   end;
  1564.  
  1565.   PCreateThreadDebugInfo = ^TCreateThreadDebugInfo;
  1566.   TCreateThreadDebugInfo = record
  1567.     hThread: THandle;
  1568.     lpThreadLocalBase: Pointer;
  1569.     lpStartAddress: TFNThreadStartRoutine;
  1570.   end;
  1571.  
  1572.   PCreateProcessDebugInfo = ^TCreateProcessDebugInfo;
  1573.   TCreateProcessDebugInfo = record
  1574.     hFile: THandle;
  1575.     hProcess: THandle;
  1576.     hThread: THandle;
  1577.     lpBaseOfImage: Pointer;
  1578.     dwDebugInfoFileOffset: DWORD;
  1579.     nDebugInfoSize: DWORD;
  1580.     lpThreadLocalBase: Pointer;
  1581.     lpStartAddress: TFNThreadStartRoutine;
  1582.     lpImageName: Pointer;
  1583.     fUnicode: Word;
  1584.   end;
  1585.  
  1586.   PExitThreadDebugInfo = ^TExitThreadDebugInfo;
  1587.   TExitThreadDebugInfo = record
  1588.     dwExitCode: DWORD;
  1589.   end;
  1590.  
  1591.   PExitProcessDebugInfo = ^TExitProcessDebugInfo;
  1592.   TExitProcessDebugInfo = record
  1593.     dwExitCode: DWORD;
  1594.   end;
  1595.  
  1596.   PLoadDLLDebugInfo = ^TLoadDLLDebugInfo;
  1597.   TLoadDLLDebugInfo = record
  1598.     hFile: THandle;
  1599.     lpBaseOfDll: Pointer;
  1600.     dwDebugInfoFileOffset: DWORD;
  1601.     nDebugInfoSize: DWORD;
  1602.     lpImageName: Pointer;
  1603.     fUnicode: Word;
  1604.   end;
  1605.  
  1606.   PUnloadDLLDebugInfo = ^TUnloadDLLDebugInfo;
  1607.   TUnloadDLLDebugInfo = record
  1608.     lpBaseOfDll: Pointer;
  1609.   end;
  1610.  
  1611.   POutputDebugStringInfo = ^TOutputDebugStringInfo;
  1612.   TOutputDebugStringInfo = record
  1613.     lpDebugStringData: LPSTR;
  1614.     fUnicode: Word;
  1615.     nDebugStringLength: Word;
  1616.   end;
  1617.  
  1618.   PRIPInfo = ^TRIPInfo;
  1619.   TRIPInfo = record
  1620.     dwError: DWORD;
  1621.     dwType: DWORD;
  1622.   end;
  1623.  
  1624.   PDebugEvent = ^TDebugEvent;
  1625.   TDebugEvent = record
  1626.     dwDebugEventCode: DWORD;
  1627.     dwProcessId: DWORD;
  1628.     dwThreadId: DWORD;
  1629.     case Integer of
  1630.       0: (Exception: TExceptionDebugInfo);
  1631.       1: (CreateThread: TCreateThreadDebugInfo);
  1632.       2: (CreateProcessInfo: TCreateProcessDebugInfo);
  1633.       3: (ExitThread: TExitThreadDebugInfo);
  1634.       4: (ExitProcess: TExitThreadDebugInfo);
  1635.       5: (LoadDll: TLoadDLLDebugInfo);
  1636.       6: (UnloadDll: TUnloadDLLDebugInfo);
  1637.       7: (DebugString: TOutputDebugStringInfo);
  1638.       8: (RipInfo: TRIPInfo);
  1639.   end;
  1640.  
  1641. const
  1642.   DRIVE_UNKNOWN = 0;
  1643.   DRIVE_NO_ROOT_DIR = 1;
  1644.   DRIVE_REMOVABLE = 2;
  1645.   DRIVE_FIXED = 3;
  1646.   DRIVE_REMOTE = 4;
  1647.   DRIVE_CDROM = 5;
  1648.   DRIVE_RAMDISK = 6;
  1649.  
  1650. function GetFreeSpace(w: Word): DWORD;
  1651.  
  1652. const
  1653.   FILE_TYPE_UNKNOWN = 0;
  1654.   FILE_TYPE_DISK = 1;
  1655.   FILE_TYPE_CHAR = 2;
  1656.   FILE_TYPE_PIPE = 3;
  1657.   FILE_TYPE_REMOTE = $8000;
  1658.  
  1659.   STD_INPUT_HANDLE = DWORD(-10);
  1660.   STD_OUTPUT_HANDLE = DWORD(-11);
  1661.   STD_ERROR_HANDLE = DWORD(-12);
  1662.  
  1663.   NOPARITY = 0;
  1664.   ODDPARITY = 1;
  1665.   EVENPARITY = 2;
  1666.   MARKPARITY = 3;
  1667.   SPACEPARITY = 4;
  1668.  
  1669.   ONESTOPBIT = 0;
  1670.   ONE5STOPBITS = 1;
  1671.   TWOSTOPBITS = 2;
  1672.  
  1673.   IGNORE = 0;               { Ignore signal }
  1674.   INFINITE = $FFFFFFFF;     { Infinite timeout }
  1675.  
  1676.   { Baud rates at which the communication device operates }
  1677.  
  1678.   CBR_110 = 110;
  1679.   CBR_300 = 300;
  1680.   CBR_600 = 600;
  1681.   CBR_1200 = 1200;
  1682.   CBR_2400 = 2400;
  1683.   CBR_4800 = 4800;
  1684.   CBR_9600 = 9600;
  1685.   CBR_14400 = 14400;
  1686.   CBR_19200 = 19200;
  1687.   CBR_38400 = 38400;
  1688.   CBR_56000 = 56000;
  1689.   CBR_57600 = 57600;
  1690.   CBR_115200 = $1C200;
  1691.   CBR_128000 = $1F400;
  1692.   CBR_256000 = $3E800;
  1693.  
  1694.   { Error Flags }
  1695.  
  1696.   CE_RXOVER = 1;        { Receive Queue overflow }
  1697.   CE_OVERRUN = 2;       { Receive Overrun Error }
  1698.   CE_RXPARITY = 4;      { Receive Parity Error }
  1699.   CE_FRAME = 8;         { Receive Framing error }
  1700.   CE_BREAK = $10;       { Break Detected }
  1701.   CE_TXFULL = $100;     { TX Queue is full }
  1702.   CE_PTO = $200;        { LPTx Timeout }
  1703.   CE_IOE = $400;        { LPTx I/O Error }
  1704.   CE_DNS = $800;        { LPTx Device not selected }
  1705.   CE_OOP = $1000;       { LPTx Out-Of-Paper }
  1706.   CE_MODE = $8000;      { Requested mode unsupported }
  1707.  
  1708.   IE_BADID = -1;        { Invalid or unsupported id }
  1709.   IE_OPEN = -2;         { Device Already Open }
  1710.   IE_NOPEN = -3;        { Device Not Open }
  1711.   IE_MEMORY = -4;       { Unable to allocate queues }
  1712.   IE_DEFAULT = -5;      { Error in default parameters }
  1713.   IE_HARDWARE = -10;    { Hardware Not Present }
  1714.   IE_BYTESIZE = -11;    { Illegal Byte Size }
  1715.   IE_BAUDRATE = -12;    { Unsupported BaudRate }
  1716.  
  1717.   { Events }
  1718.  
  1719.   EV_RXCHAR = 1;        { Any Character received }
  1720.   EV_RXFLAG = 2;        { Received certain character }
  1721.   EV_TXEMPTY = 4;       { Transmitt Queue Empty }
  1722.   EV_CTS = 8;           { CTS changed state }
  1723.   EV_DSR = $10;         { DSR changed state }
  1724.   EV_RLSD = $20;        { RLSD changed state }
  1725.   EV_BREAK = $40;       { BREAK received }
  1726.   EV_ERR = $80;         { Line status error occurred }
  1727.   EV_RING = $100;       { Ring signal detected }
  1728.   EV_PERR = $200;       { Printer error occured }
  1729.   EV_RX80FULL = $400;   { Receive buffer is 80 percent full }
  1730.   EV_EVENT1 = $800;     { Provider specific event 1 }
  1731.   EV_EVENT2 = $1000;    { Provider specific event 2 }
  1732.  
  1733.   { Escape functions }
  1734.  
  1735.   SETXOFF = 1;    { Simulate XOFF received }
  1736.   SETXON = 2;     { Simulate XON received }
  1737.   SETRTS = 3;     { Set RTS high }
  1738.   CLRRTS = 4;     { Set RTS low }
  1739.   SETDTR = 5;     { Set DTR high }
  1740.   CLRDTR = 6;     { Set DTR low }
  1741.   RESETDEV = 7;   { Reset device if possible }
  1742.   SETBREAK = 8;   { Set the device break line. }
  1743.   CLRBREAK = 9;   { Clear the device break line. }
  1744.  
  1745.   { PURGE function flags. }
  1746.  
  1747.   PURGE_TXABORT = 1;     { Kill the pending/current writes to the comm port. }
  1748.   PURGE_RXABORT = 2;     { Kill the pending/current reads to the comm port. }
  1749.   PURGE_TXCLEAR = 4;     { Kill the transmit queue if there. }
  1750.   PURGE_RXCLEAR = 8;     { Kill the typeahead buffer if there. }
  1751.  
  1752.   LPTx = $80;     { Set if ID is for LPT device }
  1753.  
  1754.   { Modem Status Flags }
  1755.  
  1756.   MS_CTS_ON = DWORD($0010);
  1757.   MS_DSR_ON = DWORD($0020);
  1758.   MS_RING_ON = DWORD($0040);
  1759.   MS_RLSD_ON = DWORD($0080);
  1760.  
  1761.   { WaitSoundState() Constants }
  1762.  
  1763.   S_QUEUEEMPTY = 0;
  1764.   S_THRESHOLD = 1;
  1765.   S_ALLTHRESHOLD = 2;
  1766.  
  1767.   { Accent Modes }
  1768.  
  1769.   S_NORMAL = 0;
  1770.   S_LEGATO = 1;
  1771.   S_STACCATO = 2;
  1772.  
  1773.   { SetSoundNoise() Sources }
  1774.  
  1775.   S_PERIOD512 = 0;     { Freq = N/512 high pitch, less coarse hiss }
  1776.   S_PERIOD1024 = 1;    { Freq = N/1024 }
  1777.   S_PERIOD2048 = 2;    { Freq = N/2048 low pitch, more coarse hiss }
  1778.   S_PERIODVOICE = 3;   { Source is frequency from voice channel (3) }
  1779.   S_WHITE512 = 4;      { Freq = N/512 high pitch, less coarse hiss }
  1780.   S_WHITE1024 = 5;     { Freq = N/1024 }
  1781.   S_WHITE2048 = 6;     { Freq = N/2048 low pitch, more coarse hiss }
  1782.   S_WHITEVOICE = 7;    { Source is frequency from voice channel (3) }
  1783.  
  1784.   S_SERDVNA = -1;     { Device not available  }
  1785.   S_SEROFM = -2;      { Out of memory }
  1786.   S_SERMACT = -3;     { Music active }
  1787.   S_SERQFUL = -4;     { Queue full }
  1788.   S_SERBDNT = -5;     { Invalid note }
  1789.   S_SERDLN = -6;      { Invalid note length }
  1790.   S_SERDCC = -7;      { Invalid note count }
  1791.   S_SERDTP = -8;      { Invalid tempo }
  1792.   S_SERDVL = -9;      { Invalid volume }
  1793.   S_SERDMD = -10;     { Invalid mode }
  1794.   S_SERDSH = -11;     { Invalid shape }
  1795.   S_SERDPT = -12;     { Invalid pitch }
  1796.   S_SERDFQ = -13;     { Invalid frequency }
  1797.   S_SERDDR = -14;     { Invalid duration }
  1798.   S_SERDSR = -15;     { Invalid source }
  1799.   S_SERDST = -16;     { Invalid state }
  1800.  
  1801.   NMPWAIT_WAIT_FOREVER = $FFFFFFFF;
  1802.   NMPWAIT_NOWAIT = 1;
  1803.   NMPWAIT_USE_DEFAULT_WAIT = 0;
  1804.  
  1805.   FS_CASE_IS_PRESERVED = FILE_CASE_PRESERVED_NAMES;
  1806.   FS_CASE_SENSITIVE = FILE_CASE_SENSITIVE_SEARCH;
  1807.   FS_UNICODE_STORED_ON_DISK = FILE_UNICODE_ON_DISK;
  1808.   FS_PERSISTENT_ACLS = FILE_PERSISTENT_ACLS;
  1809.   FS_VOL_IS_COMPRESSED = FILE_VOLUME_IS_COMPRESSED;
  1810.   FS_FILE_COMPRESSION = FILE_FILE_COMPRESSION;
  1811.  
  1812.   FILE_MAP_COPY = SECTION_QUERY;
  1813.   FILE_MAP_WRITE = SECTION_MAP_WRITE;
  1814.   FILE_MAP_READ = SECTION_MAP_READ;
  1815.   FILE_MAP_ALL_ACCESS = SECTION_ALL_ACCESS;
  1816.  
  1817.   OF_READ = 0;
  1818.   OF_WRITE = 1;
  1819.   OF_READWRITE = 2;
  1820.   OF_SHARE_COMPAT = 0;
  1821.   OF_SHARE_EXCLUSIVE = $10;
  1822.   OF_SHARE_DENY_WRITE = $20;
  1823.   OF_SHARE_DENY_READ = 48;
  1824.   OF_SHARE_DENY_NONE = $40;
  1825.   OF_PARSE = $100;
  1826.   OF_DELETE = $200;
  1827.   OF_VERIFY = $400;
  1828.   OF_CANCEL = $800;
  1829.   OF_CREATE = $1000;
  1830.   OF_PROMPT = $2000;
  1831.   OF_EXIST = $4000;
  1832.   OF_REOPEN = $8000;
  1833.  
  1834.   OFS_MAXPATHNAME = 128;
  1835. type
  1836.   POFStruct = ^TOFStruct;
  1837.   TOFStruct = record
  1838.     cBytes: Byte;
  1839.     fFixedDisk: Byte;
  1840.     nErrCode: Word;
  1841.     Reserved1: Word;
  1842.     Reserved2: Word;
  1843.     szPathName: array[0..OFS_MAXPATHNAME-1] of CHAR;
  1844.   end;
  1845.  
  1846. function InterlockedIncrement(var Addend: Integer): Integer; stdcall;
  1847. function InterlockedDecrement(var Addend: Integer): Integer; stdcall;
  1848. function InterlockedExchange(var Target: Integer; Value: Integer): Integer; stdcall;
  1849.  
  1850. function FreeResource(hResData: HGLOBAL): BOOL; stdcall;
  1851. function LockResource(hResData: HGLOBAL): Pointer; stdcall;
  1852. function UnlockResource(hResData: THandle): BOOL;
  1853.  
  1854. const
  1855.   MAXINTATOM = $C000;
  1856.   INVALID_ATOM = 0;
  1857.  
  1858. type
  1859.   MakeIntAtomA = PAnsiChar;
  1860.   MakeIntAtomW = PWideChar;
  1861.   MakeIntAtom = MakeIntAtomA;
  1862.  
  1863. function FreeLibrary(hLibModule: HMODULE): BOOL; stdcall;
  1864. procedure FreeLibraryAndExitThread(hLibModule: HMODULE; dwExitCode: DWORD); stdcall;
  1865. function DisableThreadLibraryCalls(hLibModule: HMODULE): BOOL; stdcall;
  1866. function GetProcAddress(hModule: HMODULE; lpProcName: LPCSTR): FARPROC; stdcall;
  1867. function GetVersion: DWORD; stdcall;
  1868. function GlobalAlloc(uFlags: UINT; dwBytes: DWORD): HGLOBAL; stdcall;
  1869. function GlobalReAlloc(hMem: HGLOBAL; dwBytes: DWORD; uFlags: UINT): HGLOBAL; stdcall;
  1870. function GlobalSize(hMem: HGLOBAL): DWORD; stdcall;
  1871. function GlobalFlags(hMem: HGLOBAL): UINT; stdcall;
  1872. function GlobalLock(hMem: HGLOBAL): Pointer; stdcall;
  1873. function GlobalHandle(Mem: Pointer): HGLOBAL; stdcall;
  1874. function GlobalUnlock(hMem: HGLOBAL): BOOL; stdcall;
  1875. function GlobalFree(hMem: HGLOBAL): HGLOBAL; stdcall;
  1876. function GlobalCompact(dwMinFree: DWORD): UINT; stdcall;
  1877. procedure GlobalFix(hMem: HGLOBAL); stdcall;
  1878. procedure GlobalUnfix(hMem: HGLOBAL); stdcall;
  1879. function GlobalWire(hMem: HGLOBAL): Pointer; stdcall;
  1880. function GlobalUnWire(hMem: HGLOBAL): BOOL; stdcall;
  1881. procedure GlobalMemoryStatus(var lpBuffer: TMemoryStatus); stdcall;
  1882. function LocalAlloc(uFlags, uBytes: UINT): HLOCAL; stdcall;
  1883. function LocalReAlloc(hMem: HLOCAL; uBytes, uFlags: UINT): HLOCAL; stdcall;
  1884. function LocalLock(hMem: HLOCAL): Pointer; stdcall;
  1885. function LocalUnlock(hMem: HLOCAL): BOOL; stdcall;
  1886. function LocalSize(hMem: HLOCAL): UINT; stdcall;
  1887. function LocalFlags(hMem: HLOCAL): UINT; stdcall;
  1888. function LocalFree(hMem: HLOCAL): HLOCAL; stdcall;
  1889. function LocalShrink(hMem: HLOCAL; cbNewSize: UINT): UINT; stdcall;
  1890. function LocalCompact(uMinFree: UINT): UINT; stdcall;
  1891. function FlushInstructionCache(hProcess: THandle;
  1892.   const lpBaseAddress: Pointer; dwSize: DWORD): BOOL; stdcall;
  1893. function VirtualAlloc(lpvAddress: Pointer;
  1894.   dwSize, flAllocationType, flProtect: DWORD): Pointer; stdcall;
  1895. function VirtualFree(lpAddress: Pointer; dwSize, dwFreeType: DWORD): BOOL; stdcall;
  1896. function VirtualProtect(lpAddress: Pointer; dwSize, flNewProtect: DWORD;
  1897.   lpflOldProtect: Pointer): BOOL; stdcall;
  1898. function VirtualQuery(lpAddress: Pointer;
  1899.   var lpBuffer: TMemoryBasicInformation; dwLength: DWORD): DWORD; stdcall;
  1900. function VirtualProtectEx(hProcess: THandle; lpAddress: Pointer;
  1901.   dwSize, flNewProtect: DWORD; lpflOldProtect: Pointer): BOOL; stdcall;
  1902. function VirtualQueryEx(hProcess: THandle; lpAddress: Pointer;
  1903.   var lpBuffer: TMemoryBasicInformation; dwLength: DWORD): DWORD; stdcall;
  1904. function HeapCreate(flOptions, dwInitialSize, dwMaximumSize: DWORD): THandle; stdcall;
  1905. function HeapDestroy(hHeap: THandle): BOOL; stdcall;
  1906. function HeapAlloc(hHeap: THandle; dwFlags, dwBytes: DWORD): Pointer; stdcall;
  1907. function HeapReAlloc(hHeap: THandle; dwFlags: DWORD; lpMem: Pointer; dwBytes: DWORD): Pointer; stdcall;
  1908. function HeapFree(hHeap: THandle; dwFlags: DWORD; lpMem: Pointer): BOOL; stdcall;
  1909. function HeapSize(hHeap: THandle; dwFlags: DWORD; lpMem: Pointer): DWORD; stdcall;
  1910. function HeapValidate(hHeap: THandle; dwFlags: DWORD; lpMem: Pointer): BOOL; stdcall;
  1911. function HeapCompact(hHeap: THandle; dwFlags: DWORD): UINT; stdcall;
  1912. function GetProcessHeap: THandle; stdcall;
  1913. function GetProcessHeaps(NumberOfHeaps: DWORD; var ProcessHeaps: THandle): DWORD; stdcall;
  1914.  
  1915. type
  1916.   PProcessHeapEntry = ^TProcessHeapEntry;
  1917.   TProcessHeapEntry = record
  1918.     lpData: Pointer;
  1919.     cbData: DWORD;
  1920.     cbOverhead: Byte;
  1921.     iRegionIndex: Byte;
  1922.     wFlags: Word;
  1923.     case Integer of
  1924.       0: (
  1925.         hMem: THandle);
  1926.       1: (
  1927.         dwCommittedSize: DWORD;
  1928.         dwUnCommittedSize: DWORD;
  1929.         lpFirstBlock: Pointer;
  1930.         lpLastBlock: Pointer);
  1931.   end;
  1932.  
  1933. const
  1934.   PROCESS_HEAP_REGION = 1;
  1935.   PROCESS_HEAP_UNCOMMITTED_RANGE = 2;
  1936.   PROCESS_HEAP_ENTRY_BUSY = 4;
  1937.   PROCESS_HEAP_ENTRY_MOVEABLE = $10;
  1938.   PROCESS_HEAP_ENTRY_DDESHARE = $20;
  1939.  
  1940. function HeapLock(hHeap: THandle): BOOL; stdcall;
  1941. function HeapUnlock(hHeap: THandle): BOOL; stdcall;
  1942. function HeapWalk(hHeap: THandle; var lpEntry: TProcessHeapEntry): BOOL; stdcall;
  1943.  
  1944.  
  1945. { GetBinaryType return values.}
  1946.  
  1947. const
  1948.   SCS_32BIT_BINARY = 0;
  1949.   SCS_DOS_BINARY = 1;
  1950.   SCS_WOW_BINARY = 2;
  1951.   SCS_PIF_BINARY = 3;
  1952.   SCS_POSIX_BINARY = 4;
  1953.   SCS_OS216_BINARY = 5;
  1954.  
  1955. function GetBinaryTypeA(lpApplicationName: PAnsiChar; var lpBinaryType: DWORD): BOOL; stdcall;
  1956. function GetBinaryTypeW(lpApplicationName: PWideChar; var lpBinaryType: DWORD): BOOL; stdcall;
  1957. function GetBinaryType(lpApplicationName: PChar; var lpBinaryType: DWORD): BOOL; stdcall;
  1958. function GetShortPathNameA(lpszLongPath: PAnsiChar; lpszShortPath: PAnsiChar;
  1959.   cchBuffer: DWORD): DWORD; stdcall;
  1960. function GetShortPathNameW(lpszLongPath: PWideChar; lpszShortPath: PWideChar;
  1961.   cchBuffer: DWORD): DWORD; stdcall;
  1962. function GetShortPathName(lpszLongPath: PChar; lpszShortPath: PChar;
  1963.   cchBuffer: DWORD): DWORD; stdcall;
  1964. function GetProcessAffinityMask(hProcess: THandle;
  1965.   var lpProcessAffinityMask, lpSystemAffinityMask: DWORD): BOOL; stdcall;
  1966. function GetProcessTimes(hProcess: THandle;
  1967.   var lpCreationTime, lpExitTime, lpKernelTime, lpUserTime: TFileTime): BOOL; stdcall;
  1968. function GetProcessWorkingSetSize(hProcess: THandle;
  1969.   var lpMinimumWorkingSetSize, lpMaximumWorkingSetSize: DWORD): BOOL; stdcall;
  1970. function SetProcessWorkingSetSize(hProcess: THandle;
  1971.   dwMinimumWorkingSetSize, dwMaximumWorkingSetSize: DWORD): BOOL; stdcall;
  1972. function OpenProcess(dwDesiredAccess: DWORD; bInheritHandle: BOOL; dwProcessId: DWORD): THandle; stdcall;
  1973. function GetCurrentProcess: THandle; stdcall;
  1974. function GetCurrentProcessId: DWORD; stdcall;
  1975. procedure ExitProcess(uExitCode: UINT); stdcall;
  1976. function TerminateProcess(hProcess: THandle; uExitCode: UINT): BOOL; stdcall;
  1977. function GetExitCodeProcess(hProcess: THandle; var lpExitCode: DWORD): BOOL; stdcall;
  1978. procedure FatalExit(ExitCode: Integer); stdcall;
  1979. function GetEnvironmentStringsA: PAnsiChar; stdcall;
  1980. function GetEnvironmentStringsW: PWideChar; stdcall;
  1981. function GetEnvironmentStrings: PChar; stdcall;
  1982. function FreeEnvironmentStringsA(p1: PAnsiChar): BOOL; stdcall;
  1983. function FreeEnvironmentStringsW(p1: PWideChar): BOOL; stdcall;
  1984. function FreeEnvironmentStrings(p1: PChar): BOOL; stdcall;
  1985. procedure RaiseException(dwExceptionCode, dwExceptionFlags, nNumberOfArguments: DWORD;
  1986.   const lpArguments: DWORD); stdcall;
  1987. function UnhandledExceptionFilter(const ExceptionInfo: TExceptionPointers): Longint; stdcall;
  1988.  
  1989. type
  1990. {$IFDEF STRICT}
  1991.   TFNTopLevelExceptionFilter = function (const ExceptionInfo: TExceptionPointers): Longint stdcall;
  1992. {$ELSE}
  1993.   TFNTopLevelExceptionFilter = TFarProc;
  1994. {$ENDIF}
  1995.  
  1996. function SetUnhandledExceptionFilter(lpTopLevelExceptionFilter: TFNTopLevelExceptionFilter):
  1997.   TFNTopLevelExceptionFilter; stdcall;
  1998. function CreateThread(lpThreadAttributes: Pointer;
  1999.   dwStackSize: DWORD; lpStartAddress: TFNThreadStartRoutine;
  2000.   lpParameter: Pointer; dwCreationFlags: DWORD; var lpThreadId: DWORD): THandle; stdcall;
  2001. function CreateRemoteThread(hProcess: THandle; lpThreadAttributes: Pointer;
  2002.   dwStackSize: DWORD; lpStartAddress: TFNThreadStartRoutine; lpParameter: Pointer;
  2003.   dwCreationFlags: DWORD; var lpThreadId: DWORD): THandle; stdcall;
  2004. function GetCurrentThread: THandle; stdcall;
  2005. function GetCurrentThreadId: DWORD; stdcall;
  2006. function SetThreadAffinityMask(hThread: THandle; dwThreadAffinityMask: DWORD): DWORD; stdcall;
  2007. function SetThreadPriority(hThread: THandle; nPriority: Integer): BOOL; stdcall;
  2008. function GetThreadPriority(hThread: THandle): Integer; stdcall;
  2009. function GetThreadTimes(hThread: THandle;
  2010.   var lpCreationTime, lpExitTime, lpKernelTime, lpUserTime: TFileTime): BOOL; stdcall;
  2011. procedure ExitThread(dwExitCode: DWORD); stdcall;
  2012. function TerminateThread(hThread: THandle; dwExitCode: DWORD): BOOL; stdcall;
  2013. function GetExitCodeThread(hThread: THandle; var lpExitCode: DWORD): BOOL; stdcall;
  2014. function GetThreadSelectorEntry(hThread: THandle; dwSelector: DWORD;
  2015.   var lpSelectorEntry: TLDTEntry): BOOL; stdcall;
  2016. function GetLastError: DWORD; stdcall;
  2017. procedure SetLastError(dwErrCode: DWORD); stdcall;
  2018. function GetOverlappedResult(hFile: THandle; const lpOverlapped: TOverlapped;
  2019.   var lpNumberOfBytesTransferred: DWORD; bWait: BOOL): BOOL; stdcall;
  2020. function CreateIoCompletionPort(FileHandle, ExistingCompletionPort: THandle;
  2021.   CompletionKey, NumberOfConcurrentThreads: DWORD): THandle; stdcall;
  2022. function GetQueuedCompletionStatus(CompletionPort: THandle;
  2023.   var lpNumberOfBytesTransferred, lpCompletionKey: DWORD;
  2024.   var lpOverlapped: POverlapped; dwMilliseconds: DWORD): BOOL; stdcall;
  2025. function PostQueuedCompletionStatus(CompletionPort: THandle; dwNumberOfBytesTransferred: DWORD;
  2026.   dwCompletionKey: DWORD; lpOverlapped: POverlapped): BOOL; stdcall;
  2027.  
  2028. const
  2029.   SEM_FAILCRITICALERRORS = 1;
  2030.   SEM_NOGPFAULTERRORBOX = 2;
  2031.   SEM_NOALIGNMENTFAULTEXCEPT = 4;
  2032.   SEM_NOOPENFILEERRORBOX = $8000;
  2033.  
  2034. function SetErrorMode(uMode: UINT): UINT; stdcall;
  2035. function ReadProcessMemory(hProcess: THandle; const lpBaseAddress: Pointer; lpBuffer: Pointer;
  2036.   nSize: DWORD; var lpNumberOfBytesRead: DWORD): BOOL; stdcall;
  2037. function WriteProcessMemory(hProcess: THandle; const lpBaseAddress: Pointer; lpBuffer: Pointer;
  2038.   nSize: DWORD; var lpNumberOfBytesWritten: DWORD): BOOL; stdcall;
  2039. function GetThreadContext(hThread: THandle; var lpContext: TContext): BOOL; stdcall;
  2040. function SetThreadContext(hThread: THandle; const lpContext: TContext): BOOL; stdcall;
  2041. function SuspendThread(hThread: THandle): DWORD; stdcall;
  2042. function ResumeThread(hThread: THandle): DWORD; stdcall;
  2043. procedure DebugBreak; stdcall;
  2044. function WaitForDebugEvent(var lpDebugEvent: TDebugEvent; dwMilliseconds: DWORD): BOOL; stdcall;
  2045. function ContinueDebugEvent(dwProcessId, dwThreadId, dwContinueStatus: DWORD): BOOL; stdcall;
  2046. function DebugActiveProcess(dwProcessId: DWORD): BOOL; stdcall;
  2047. procedure InitializeCriticalSection(var lpCriticalSection: TRTLCriticalSection); stdcall;
  2048. procedure EnterCriticalSection(var lpCriticalSection: TRTLCriticalSection); stdcall;
  2049. procedure LeaveCriticalSection(var lpCriticalSection: TRTLCriticalSection); stdcall;
  2050. procedure DeleteCriticalSection(var lpCriticalSection: TRTLCriticalSection); stdcall;
  2051. function SetEvent(hEvent: THandle): BOOL; stdcall;
  2052. function ResetEvent(hEvent: THandle): BOOL; stdcall;
  2053. function PulseEvent(hEvent: THandle): BOOL; stdcall;
  2054. function ReleaseSemaphore(hSemaphore: THandle; lReleaseCount: Longint;
  2055.   lpPreviousCount: Pointer): BOOL; stdcall;
  2056. function ReleaseMutex(hMutex: THandle): BOOL; stdcall;
  2057. function WaitForSingleObject(hHandle: THandle; dwMilliseconds: DWORD): DWORD; stdcall;
  2058.  
  2059. type
  2060.   TWOHandleArray = array[0..MAXIMUM_WAIT_OBJECTS - 1] of THandle;
  2061.   PWOHandleArray = ^TWOHandleArray;
  2062.  
  2063. function WaitForMultipleObjects(nCount: DWORD; lpHandles: PWOHandleArray;
  2064.   bWaitAll: BOOL; dwMilliseconds: DWORD): DWORD; stdcall;
  2065. procedure Sleep(dwMilliseconds: DWORD); stdcall;
  2066. function LoadResource(hModule: HINST; hResInfo: HRSRC): HGLOBAL; stdcall;
  2067. function SizeofResource(hModule: HINST; hResInfo: HRSRC): DWORD; stdcall;
  2068. function GlobalDeleteAtom(nAtom: ATOM): ATOM; stdcall;
  2069. function InitAtomTable(nSize: DWORD): BOOL; stdcall;
  2070. function DeleteAtom(nAtom: ATOM): ATOM; stdcall;
  2071. function SetHandleCount(uNumber: UINT): UINT; stdcall;
  2072. function GetLogicalDrives: DWORD; stdcall;
  2073. function LockFile(hFile: THandle; dwFileOffsetLow, dwFileOffsetHigh: DWORD;
  2074.   nNumberOfBytesToLockLow, nNumberOfBytesToLockHigh: DWORD): BOOL; stdcall;
  2075. function UnlockFile(hFile: THandle; dwFileOffsetLow, dwFileOffsetHigh: DWORD;
  2076.   nNumberOfBytesToUnlockLow, nNumberOfBytesToUnlockHigh: DWORD): BOOL; stdcall;
  2077. function LockFileEx(hFile: THandle; dwFlags, dwReserved: DWORD;
  2078.   nNumberOfBytesToLockLow, nNumberOfBytesToLockHigh: DWORD;
  2079.   const lpOverlapped: TOverlapped): BOOL; stdcall;
  2080.  
  2081. const
  2082.   LOCKFILE_FAIL_IMMEDIATELY = 1;
  2083.   LOCKFILE_EXCLUSIVE_LOCK = 2;
  2084.  
  2085. function UnlockFileEx(hFile: THandle; dwReserved, nNumberOfBytesToUnlockLow: DWORD;
  2086.   nNumberOfBytesToUnlockHigh: DWORD; const lpOverlapped: TOverlapped): BOOL; stdcall;
  2087.  
  2088. type
  2089.   PByHandleFileInformation = ^TByHandleFileInformation;
  2090.   TByHandleFileInformation = record
  2091.     dwFileAttributes: DWORD;
  2092.     ftCreationTime: TFileTime;
  2093.     ftLastAccessTime: TFileTime;
  2094.     ftLastWriteTime: TFileTime;
  2095.     dwVolumeSerialNumber: DWORD;
  2096.     nFileSizeHigh: DWORD;
  2097.     nFileSizeLow: DWORD;
  2098.     nNumberOfLinks: DWORD;
  2099.     nFileIndexHigh: DWORD;
  2100.     nFileIndexLow: DWORD;
  2101.   end;
  2102.  
  2103. function GetFileInformationByHandle(hFile: THandle;
  2104.   var lpFileInformation: TByHandleFileInformation): BOOL; stdcall;
  2105. function GetFileType(hFile: THandle): DWORD; stdcall;
  2106. function GetFileSize(hFile: THandle; lpFileSizeHigh: Pointer): DWORD; stdcall;
  2107. function GetStdHandle(nStdHandle: DWORD): THandle; stdcall;
  2108. function SetStdHandle(nStdHandle: DWORD; hHandle: THandle): BOOL; stdcall;
  2109. function WriteFile(hFile: THandle; const Buffer; nNumberOfBytesToWrite: DWORD;
  2110.   var lpNumberOfBytesWritten: DWORD; lpOverlapped: POverlapped): BOOL; stdcall;
  2111. function ReadFile(hFile: THandle; var Buffer; nNumberOfBytesToRead: DWORD;
  2112.   var lpNumberOfBytesRead: DWORD; lpOverlapped: POverlapped): BOOL; stdcall;
  2113. function FlushFileBuffers(hFile: THandle): BOOL; stdcall;
  2114. function DeviceIoControl(hDevice: THandle; dwIoControlCode: DWORD; lpInBuffer: Pointer;
  2115.   nInBufferSize: DWORD; lpOutBuffer: Pointer; nOutBufferSize: DWORD;
  2116.   var lpBytesReturned: DWORD; lpOverlapped: POverlapped): BOOL; stdcall;
  2117. function SetEndOfFile(hFile: THandle): BOOL; stdcall;
  2118. function SetFilePointer(hFile: THandle; lDistanceToMove: Longint;
  2119.   lpDistanceToMoveHigh: Pointer; dwMoveMethod: DWORD): DWORD; stdcall;
  2120. function FindClose(hFindFile: THandle): BOOL; stdcall;
  2121. function GetFileTime(hFile: THandle;
  2122.   lpCreationTime, lpLastAccessTime, lpLastWriteTime: PFileTime): BOOL; stdcall;
  2123. function SetFileTime(hFile: THandle;
  2124.   lpCreationTime, lpLastAccessTime, lpLastWriteTime: PFileTime): BOOL; stdcall;
  2125. function CloseHandle(hObject: THandle): BOOL; stdcall;
  2126. function DuplicateHandle(hSourceProcessHandle, hSourceHandle, hTargetProcessHandle: THandle;
  2127.   lpTargetHandle: PHandle; dwDesiredAccess: DWORD;
  2128.   bInheritHandle: BOOL; dwOptions: DWORD): BOOL; stdcall;
  2129. function GetHandleInformation(hObject: THandle; var lpdwFlags: DWORD): BOOL; stdcall;
  2130. function SetHandleInformation(hObject: THandle; dwMask: DWORD; dwFlags: DWORD): BOOL; stdcall;
  2131.  
  2132. const
  2133.   HANDLE_FLAG_INHERIT = 1;
  2134.   HANDLE_FLAG_PROTECT_FROM_CLOSE = 2;
  2135.   HINSTANCE_ERROR = $20;
  2136.  
  2137. function LoadModule(lpModuleName: LPCSTR; lpParameterBlock: Pointer): DWORD; stdcall;
  2138. function WinExec(lpCmdLine: LPCSTR; uCmdShow: UINT): UINT; stdcall;
  2139. function ClearCommBreak(hFile: THandle): BOOL; stdcall;
  2140. function ClearCommError(hFile: THandle; var lpErrors: DWORD; lpStat: PComStat): BOOL; stdcall;
  2141. function SetupComm(hFile: THandle; dwInQueue, dwOutQueue: DWORD): BOOL; stdcall;
  2142. function EscapeCommFunction(hFile: THandle; dwFunc: DWORD): BOOL; stdcall;
  2143. function GetCommConfig(hCommDev: THandle; var lpCC: TCommConfig; var lpdwSize: DWORD): BOOL; stdcall;
  2144. function GetCommMask(hFile: THandle; var lpEvtMask: DWORD): BOOL; stdcall;
  2145. function GetCommProperties(hFile: THandle; var lpCommProp: TCommProp): BOOL; stdcall;
  2146. function GetCommModemStatus(hFile: THandle; var lpModemStat: DWORD): BOOL; stdcall;
  2147. function GetCommState(hFile: THandle; var lpDCB: TDCB): BOOL; stdcall;
  2148. function GetCommTimeouts(hFile: THandle; var lpCommTimeouts: TCommTimeouts): BOOL; stdcall;
  2149. function PurgeComm(hFile: THandle; dwFlags: DWORD): BOOL; stdcall;
  2150. function SetCommBreak(hFile: THandle): BOOL; stdcall;
  2151. function SetCommConfig(hCommDev: THandle; const lpCC: TCommConfig; dwSize: DWORD): BOOL; stdcall;
  2152. function SetCommMask(hFile: THandle; dwEvtMask: DWORD): BOOL; stdcall;
  2153. function SetCommState(hFile: THandle; const lpDCB: TDCB): BOOL; stdcall;
  2154. function SetCommTimeouts(hFile: THandle; const lpCommTimeouts: TCommTimeouts): BOOL; stdcall;
  2155. function TransmitCommChar(hFile: THandle; cChar: CHAR): BOOL; stdcall;
  2156. function WaitCommEvent(hFile: THandle; var lpEvtMask: DWORD; lpOverlapped: POverlapped): BOOL; stdcall;
  2157. function SetTapePosition(hDevice: THandle; dwPositionMethod, dwPartition: DWORD;
  2158.   dwOffsetLow, dwOffsetHigh: DWORD; bImmediate: BOOL): DWORD; stdcall;
  2159. function GetTapePosition(hDevice: THandle; dwPositionType: DWORD;
  2160.   var lpdwPartition, lpdwOffsetLow: DWORD; lpdwOffsetHigh: Pointer): DWORD; stdcall;
  2161. function PrepareTape(hDevice: THandle; dwOperation: DWORD; bImmediate: BOOL): DWORD; stdcall;
  2162. function EraseTape(hDevice: THandle; dwEraseType: DWORD; bImmediate: BOOL): DWORD; stdcall;
  2163. function CreateTapePartition(hDevice: THandle; dwPartitionMethod, dwCount, dwSize: DWORD): DWORD; stdcall;
  2164. function WriteTapemark(hDevice: THandle;
  2165.   dwTapemarkType, dwTapemarkCount: DWORD; bImmediate: BOOL): DWORD; stdcall;
  2166. function GetTapeStatus(hDevice: THandle): DWORD; stdcall;
  2167. function GetTapeParameters(hDevice: THandle; dwOperation: DWORD;
  2168.   var lpdwSize: DWORD; lpTapeInformation: Pointer): DWORD; stdcall;
  2169.  
  2170. const
  2171.   GET_TAPE_MEDIA_INFORMATION = 0;
  2172.   GET_TAPE_DRIVE_INFORMATION = 1;
  2173.  
  2174. function SetTapeParameters(hDevice: THandle; dwOperation: DWORD;
  2175.   lpTapeInformation: Pointer): DWORD; stdcall;
  2176.  
  2177. const
  2178.   SET_TAPE_MEDIA_INFORMATION = 0;
  2179.   SET_TAPE_DRIVE_INFORMATION = 1;
  2180.  
  2181. function Beep(dwFreq, dwDuration: DWORD): BOOL; stdcall;
  2182. function MulDiv(nNumber, nNumerator, nDenominator: Integer): Integer; stdcall;
  2183. procedure GetSystemTime(var lpSystemTime: TSystemTime); stdcall;
  2184. procedure GetSystemTimeAsFileTime(var lpSystemTimeAsFileTime: TFileTime); stdcall;
  2185. function SetSystemTime(const lpSystemTime: TSystemTime): BOOL; stdcall;
  2186. procedure GetLocalTime(var lpSystemTime: TSystemTime); stdcall;
  2187. function SetLocalTime(const lpSystemTime: TSystemTime): BOOL; stdcall;
  2188. procedure GetSystemInfo(var lpSystemInfo: TSystemInfo); stdcall;
  2189.  
  2190. type
  2191.   PTimeZoneInformation = ^TTimeZoneInformation;
  2192.   TTimeZoneInformation = record
  2193.     Bias: Longint;
  2194.     StandardName: array[0..31] of WCHAR;
  2195.     StandardDate: TSystemTime;
  2196.     StandardBias: Longint;
  2197.     DaylightName: array[0..31] of WCHAR;
  2198.     DaylightDate: TSystemTime;
  2199.     DaylightBias: Longint;
  2200.   end;
  2201.  
  2202. function SystemTimeToTzSpecificLocalTime(lpTimeZoneInformation: PTimeZoneInformation;
  2203.   var lpUniversalTime, lpLocalTime: TSystemTime): BOOL; stdcall;
  2204. function GetTimeZoneInformation(var lpTimeZoneInformation: TTimeZoneInformation): DWORD; stdcall;
  2205. function SetTimeZoneInformation(const lpTimeZoneInformation: TTimeZoneInformation): BOOL; stdcall;
  2206.  
  2207. { Routines to convert back and forth between system time and file time }
  2208.  
  2209. function SystemTimeToFileTime(const lpSystemTime: TSystemTime; var lpFileTime: TFileTime): BOOL; stdcall;
  2210. function FileTimeToLocalFileTime(const lpFileTime: TFileTime; var lpLocalFileTime: TFileTime): BOOL; stdcall;
  2211. function LocalFileTimeToFileTime(const lpLocalFileTime: TFileTime; var lpFileTime: TFileTime): BOOL; stdcall;
  2212. function FileTimeToSystemTime(const lpFileTime: TFileTime; var lpSystemTime: TSystemTime): BOOL; stdcall;
  2213. function CompareFileTime(const lpFileTime1, lpFileTime2: TFileTime): Longint; stdcall;
  2214. function FileTimeToDosDateTime(const lpFileTime: TFileTime;
  2215.   var lpFatDate, lpFatTime: Word): BOOL; stdcall;
  2216. function DosDateTimeToFileTime(wFatDate, wFatTime: Word; var lpFileTime: TFileTime): BOOL; stdcall;
  2217. function GetTickCount: DWORD; stdcall;
  2218. function SetSystemTimeAdjustment(dwTimeAdjustment: DWORD; bTimeAdjustmentDisabled: BOOL): BOOL; stdcall;
  2219. function GetSystemTimeAdjustment(var lpTimeAdjustment, lpTimeIncrement: DWORD;
  2220.   var lpTimeAdjustmentDisabled: BOOL): BOOL; stdcall;
  2221. function FormatMessageA(dwFlags: DWORD; lpSource: Pointer; dwMessageId: DWORD; dwLanguageId: DWORD;
  2222.   lpBuffer: PAnsiChar; nSize: DWORD; Arguments: Pointer): DWORD; stdcall;
  2223. function FormatMessageW(dwFlags: DWORD; lpSource: Pointer; dwMessageId: DWORD; dwLanguageId: DWORD;
  2224.   lpBuffer: PWideChar; nSize: DWORD; Arguments: Pointer): DWORD; stdcall;
  2225. function FormatMessage(dwFlags: DWORD; lpSource: Pointer; dwMessageId: DWORD; dwLanguageId: DWORD;
  2226.   lpBuffer: PChar; nSize: DWORD; Arguments: Pointer): DWORD; stdcall;
  2227.  
  2228. const
  2229.   FORMAT_MESSAGE_ALLOCATE_BUFFER = $100;
  2230.   FORMAT_MESSAGE_IGNORE_INSERTS = $200;
  2231.   FORMAT_MESSAGE_FROM_STRING = $400;
  2232.   FORMAT_MESSAGE_FROM_HMODULE = $800;
  2233.   FORMAT_MESSAGE_FROM_SYSTEM = $1000;
  2234.   FORMAT_MESSAGE_ARGUMENT_ARRAY = $2000;
  2235.   FORMAT_MESSAGE_MAX_WIDTH_MASK = 255;
  2236.  
  2237. function CreatePipe(var hReadPipe, hWritePipe: THandle;
  2238.   lpPipeAttributes: PSecurityAttributes; nSize: DWORD): BOOL; stdcall;
  2239. function ConnectNamedPipe(hNamedPipe: THandle; lpOverlapped: POverlapped): BOOL; stdcall;
  2240. function DisconnectNamedPipe(hNamedPipe: THandle): BOOL; stdcall;
  2241. function SetNamedPipeHandleState(hNamedPipe: THandle; var lpMode: DWORD;
  2242.   lpMaxCollectionCount, lpCollectDataTimeout: Pointer): BOOL; stdcall;
  2243. function GetNamedPipeInfo(hNamedPipe: THandle; var lpFlags: DWORD;
  2244.   lpOutBufferSize, lpInBufferSize, lpMaxInstances: Pointer): BOOL; stdcall;
  2245. function PeekNamedPipe(hNamedPipe: THandle; lpBuffer: Pointer; nBufferSize: DWORD;
  2246.   lpBytesRead, lpTotalBytesAvail, lpBytesLeftThisMessage: Pointer): BOOL; stdcall;
  2247. function TransactNamedPipe(hNamedPipe: THandle; lpInBuffer: Pointer; nInBufferSize: DWORD;
  2248.   lpOutBuffer: Pointer; nOutBufferSize: DWORD; var lpBytesRead: DWORD;
  2249.   lpOverlapped: POverlapped): BOOL; stdcall;
  2250.  
  2251. function CreateMailslotA(lpName: PAnsiChar; nMaxMessageSize: DWORD;
  2252.   lReadTimeout: DWORD; lpSecurityAttributes: PSecurityAttributes): THandle; stdcall;
  2253. function CreateMailslotW(lpName: PWideChar; nMaxMessageSize: DWORD;
  2254.   lReadTimeout: DWORD; lpSecurityAttributes: PSecurityAttributes): THandle; stdcall;
  2255. function CreateMailslot(lpName: PChar; nMaxMessageSize: DWORD;
  2256.   lReadTimeout: DWORD; lpSecurityAttributes: PSecurityAttributes): THandle; stdcall;
  2257. function GetMailslotInfo(hMailslot: THandle; lpMaxMessageSize: Pointer;
  2258.   var lpNextSize: DWORD; lpMessageCount, lpReadTimeout: Pointer): BOOL; stdcall;
  2259. function SetMailslotInfo(hMailslot: THandle; lReadTimeout: DWORD): BOOL; stdcall;
  2260. function MapViewOfFile(hFileMappingObject: THandle; dwDesiredAccess: DWORD;
  2261.   dwFileOffsetHigh, dwFileOffsetLow, dwNumberOfBytesToMap: DWORD): Pointer; stdcall;
  2262. function FlushViewOfFile(const lpBaseAddress: Pointer; dwNumberOfBytesToFlush: DWORD): BOOL; stdcall;
  2263. function UnmapViewOfFile(lpBaseAddress: Pointer): BOOL; stdcall;
  2264.  
  2265. { _l Compat Functions }
  2266.  
  2267. function lstrcmpA(lpString1, lpString2: PAnsiChar): Integer; stdcall;
  2268. function lstrcmpW(lpString1, lpString2: PWideChar): Integer; stdcall;
  2269. function lstrcmp(lpString1, lpString2: PChar): Integer; stdcall;
  2270. function lstrcmpiA(lpString1, lpString2: PAnsiChar): Integer; stdcall;
  2271. function lstrcmpiW(lpString1, lpString2: PWideChar): Integer; stdcall;
  2272. function lstrcmpi(lpString1, lpString2: PChar): Integer; stdcall;
  2273. function lstrcpynA(lpString1, lpString2: PAnsiChar; iMaxLength: Integer): PAnsiChar; stdcall;
  2274. function lstrcpynW(lpString1, lpString2: PWideChar; iMaxLength: Integer): PWideChar; stdcall;
  2275. function lstrcpyn(lpString1, lpString2: PChar; iMaxLength: Integer): PChar; stdcall;
  2276. function lstrcpyA(lpString1, lpString2: PAnsiChar): PAnsiChar; stdcall;
  2277. function lstrcpyW(lpString1, lpString2: PWideChar): PWideChar; stdcall;
  2278. function lstrcpy(lpString1, lpString2: PChar): PChar; stdcall;
  2279. function lstrcatA(lpString1, lpString2: PAnsiChar): PAnsiChar; stdcall;
  2280. function lstrcatW(lpString1, lpString2: PWideChar): PWideChar; stdcall;
  2281. function lstrcat(lpString1, lpString2: PChar): PChar; stdcall;
  2282. function lstrlenA(lpString: PAnsiChar): Integer; stdcall;
  2283. function lstrlenW(lpString: PWideChar): Integer; stdcall;
  2284. function lstrlen(lpString: PChar): Integer; stdcall;
  2285.  
  2286. function OpenFile(const lpFileName: LPCSTR; var lpReOpenBuff: TOFStruct; uStyle: UINT): HFILE; stdcall;
  2287. function _lopen(const lpPathName: LPCSTR; iReadWrite: Integer): HFILE; stdcall;
  2288. function _lcreat(const lpPathName: LPCSTR; iAttribute: Integer): HFILE; stdcall;
  2289. function _lread(hFile: HFILE; lpBuffer: Pointer; uBytes: UINT): UINT; stdcall;
  2290. function _lwrite(hFile: HFILE; const lpBuffer: LPCSTR; uBytes: UINT): UINT; stdcall;
  2291. function _hread(hFile: HFILE; lpBuffer: Pointer; lBytes: Longint): Longint; stdcall;
  2292. function _hwrite(hFile: HFILE; lpBuffer: LPCSTR; lBytes: Longint): Longint; stdcall;
  2293. function _lclose(hFile: HFILE): HFILE; stdcall;
  2294. function _llseek(hFile: HFILE; lOffset: Longint; iOrigin: Integer): Longint; stdcall;
  2295. function IsTextUnicode(lpBuffer: Pointer; cb: Integer; lpi: PINT): BOOL; stdcall;
  2296. function TlsAlloc: DWORD; stdcall;
  2297.  
  2298. const
  2299.   TLS_OUT_OF_INDEXES = DWORD($FFFFFFFF);
  2300.  
  2301. function TlsGetValue(dwTlsIndex: DWORD): Pointer; stdcall;
  2302. function TlsSetValue(dwTlsIndex: DWORD; lpTlsValue: Pointer): BOOL; stdcall;
  2303. function TlsFree(dwTlsIndex: DWORD): BOOL; stdcall;
  2304. function SleepEx(dwMilliseconds: DWORD; bAlertable: BOOL): DWORD; stdcall;
  2305. function WaitForSingleObjectEx(hHandle: THandle; dwMilliseconds: DWORD; bAlertable: BOOL): DWORD; stdcall;
  2306. function WaitForMultipleObjectsEx(nCount: DWORD; lpHandles: PWOHandleArray;
  2307.   bWaitAll: BOOL; dwMilliseconds: DWORD; bAlertable: BOOL): DWORD; stdcall;
  2308. function ReadFileEx(hFile: THandle; lpBuffer: Pointer; nNumberOfBytesToRead: DWORD;
  2309.   lpOverlapped: POverlapped; lpCompletionRoutine: FARPROC): BOOL; stdcall;
  2310. function WriteFileEx(hFile: THandle; lpBuffer: Pointer; nNumberOfBytesToWrite: DWORD;
  2311.   const lpOverlapped: TOverlapped; lpCompletionRoutine: FARPROC): BOOL; stdcall;
  2312. function BackupRead(hFile: THandle; lpBuffer: PByte; nNumberOfBytesToRead: DWORD;
  2313.   var lpNumberOfBytesRead: DWORD; bAbort: BOOL;
  2314.   bProcessSecurity: BOOL; var lpContext: Pointer): BOOL; stdcall;
  2315. function BackupSeek(hFile: THandle; dwLowBytesToSeek, dwHighBytesToSeek: DWORD;
  2316.   var lpdwLowByteSeeked, lpdwHighByteSeeked: DWORD; lpContext: Pointer): BOOL; stdcall;
  2317. function BackupWrite(hFile: THandle; lpBuffer: PByte; nNumberOfBytesToWrite: DWORD;
  2318.   var lpNumberOfBytesWritten: DWORD; bAbort, bProcessSecurity: BOOL; var lpContext: Pointer): BOOL; stdcall;
  2319.  
  2320. type
  2321.   PWIN32StreamID = ^TWIN32StreamID;
  2322.   TWIN32StreamID = record
  2323.     dwStreamId: DWORD;
  2324.     dwStreamAttributes: DWORD;
  2325.     Size: TLargeInteger;
  2326.     dwStreamNameSize: DWORD;
  2327.     cStreamName: array[0..0] of WCHAR;
  2328.   end;
  2329.  
  2330. const
  2331.   { Stream IDs }
  2332.   BACKUP_INVALID = 0;
  2333.   BACKUP_DATA = 1;
  2334.   BACKUP_EA_DATA = 2;
  2335.   BACKUP_SECURITY_DATA = 3;
  2336.   BACKUP_ALTERNATE_DATA = 4;
  2337.   BACKUP_LINK = 5;
  2338.   BACKUP_PROPERTY_DATA = 6;
  2339.  
  2340.   { Stream Attributes}
  2341.   STREAM_NORMAL_ATTRIBUTE = 0;
  2342.   STREAM_MODIFIED_WHEN_READ = 1;
  2343.   STREAM_CONTAINS_SECURITY = 2;
  2344.   STREAM_CONTAINS_PROPERTIES = 4;
  2345.  
  2346.   { Dual Mode API below this line. Dual Mode Structures also included. }
  2347.   STARTF_USESHOWWINDOW = 1;
  2348.   STARTF_USESIZE = 2;
  2349.   STARTF_USEPOSITION = 4;
  2350.   STARTF_USECOUNTCHARS = 8;
  2351.   STARTF_USEFILLATTRIBUTE = $10;
  2352.   STARTF_RUNFULLSCREEN = $20;  { ignored for non-x86 platforms }
  2353.   STARTF_FORCEONFEEDBACK = $40;
  2354.   STARTF_FORCEOFFFEEDBACK = $80;
  2355.   STARTF_USESTDHANDLES = $100;
  2356.   STARTF_USEHOTKEY = $200;
  2357.  
  2358. type
  2359.   PStartupInfo = ^TStartupInfo;
  2360.   TStartupInfo = record
  2361.     cb: DWORD;
  2362.     lpReserved: Pointer;
  2363.     lpDesktop: Pointer;
  2364.     lpTitle: Pointer;
  2365.     dwX: DWORD;
  2366.     dwY: DWORD;
  2367.     dwXSize: DWORD;
  2368.     dwYSize: DWORD;
  2369.     dwXCountChars: DWORD;
  2370.     dwYCountChars: DWORD;
  2371.     dwFillAttribute: DWORD;
  2372.     dwFlags: DWORD;
  2373.     wShowWindow: Word;
  2374.     cbReserved2: Word;
  2375.     lpReserved2: PByte;
  2376.     hStdInput: THandle;
  2377.     hStdOutput: THandle;
  2378.     hStdError: THandle;
  2379.   end;
  2380.  
  2381. const
  2382.   SHUTDOWN_NORETRY = 1;
  2383.  
  2384. type
  2385.   PWin32FindDataA = ^TWin32FindDataA;
  2386.   PWin32FindDataW = ^TWin32FindDataW;
  2387.   PWin32FindData = PWin32FindDataA;
  2388.   TWin32FindDataA = record
  2389.     dwFileAttributes: DWORD;
  2390.     ftCreationTime: TFileTime;
  2391.     ftLastAccessTime: TFileTime;
  2392.     ftLastWriteTime: TFileTime;
  2393.     nFileSizeHigh: DWORD;
  2394.     nFileSizeLow: DWORD;
  2395.     dwReserved0: DWORD;
  2396.     dwReserved1: DWORD;
  2397.     cFileName: array[0..MAX_PATH - 1] of AnsiChar;
  2398.     cAlternateFileName: array[0..13] of AnsiChar;
  2399.   end;
  2400.   TWin32FindDataW = record
  2401.     dwFileAttributes: DWORD;
  2402.     ftCreationTime: TFileTime;
  2403.     ftLastAccessTime: TFileTime;
  2404.     ftLastWriteTime: TFileTime;
  2405.     nFileSizeHigh: DWORD;
  2406.     nFileSizeLow: DWORD;
  2407.     dwReserved0: DWORD;
  2408.     dwReserved1: DWORD;
  2409.     cFileName: array[0..MAX_PATH - 1] of WideChar;
  2410.     cAlternateFileName: array[0..13] of WideChar;
  2411.   end;
  2412.   TWin32FindData = TWin32FindDataA;
  2413.  
  2414. function CreateMutexA(lpMutexAttributes: PSecurityAttributes;
  2415.   bInitialOwner: BOOL; lpName: PAnsiChar): THandle; stdcall;
  2416. function CreateMutexW(lpMutexAttributes: PSecurityAttributes;
  2417.   bInitialOwner: BOOL; lpName: PWideChar): THandle; stdcall;
  2418. function CreateMutex(lpMutexAttributes: PSecurityAttributes;
  2419.   bInitialOwner: BOOL; lpName: PChar): THandle; stdcall;
  2420. function OpenMutexA(dwDesiredAccess: DWORD; bInheritHandle: BOOL; lpName: PAnsiChar): THandle; stdcall;
  2421. function OpenMutexW(dwDesiredAccess: DWORD; bInheritHandle: BOOL; lpName: PWideChar): THandle; stdcall;
  2422. function OpenMutex(dwDesiredAccess: DWORD; bInheritHandle: BOOL; lpName: PChar): THandle; stdcall;
  2423. function CreateEventA(lpEventAttributes: PSecurityAttributes;
  2424.   bManualReset, bInitialState: BOOL; lpName: PAnsiChar): THandle; stdcall;
  2425. function CreateEventW(lpEventAttributes: PSecurityAttributes;
  2426.   bManualReset, bInitialState: BOOL; lpName: PWideChar): THandle; stdcall;
  2427. function CreateEvent(lpEventAttributes: PSecurityAttributes;
  2428.   bManualReset, bInitialState: BOOL; lpName: PChar): THandle; stdcall;
  2429. function OpenEventA(dwDesiredAccess: DWORD; bInheritHandle: BOOL; lpName: PAnsiChar): THandle; stdcall;
  2430. function OpenEventW(dwDesiredAccess: DWORD; bInheritHandle: BOOL; lpName: PWideChar): THandle; stdcall;
  2431. function OpenEvent(dwDesiredAccess: DWORD; bInheritHandle: BOOL; lpName: PChar): THandle; stdcall;
  2432. function CreateSemaphoreA(lpSemaphoreAttributes: PSecurityAttributes;
  2433.   lInitialCount, lMaximumCount: Longint; lpName: PAnsiChar): THandle; stdcall;
  2434. function CreateSemaphoreW(lpSemaphoreAttributes: PSecurityAttributes;
  2435.   lInitialCount, lMaximumCount: Longint; lpName: PWideChar): THandle; stdcall;
  2436. function CreateSemaphore(lpSemaphoreAttributes: PSecurityAttributes;
  2437.   lInitialCount, lMaximumCount: Longint; lpName: PChar): THandle; stdcall;
  2438. function OpenSemaphoreA(dwDesiredAccess: DWORD; bInheritHandle: BOOL; lpName: PAnsiChar): THandle; stdcall;
  2439. function OpenSemaphoreW(dwDesiredAccess: DWORD; bInheritHandle: BOOL; lpName: PWideChar): THandle; stdcall;
  2440. function OpenSemaphore(dwDesiredAccess: DWORD; bInheritHandle: BOOL; lpName: PChar): THandle; stdcall;
  2441. function CreateFileMappingA(hFile: THandle; lpFileMappingAttributes: PSecurityAttributes;
  2442.   flProtect, dwMaximumSizeHigh, dwMaximumSizeLow: DWORD; lpName: PAnsiChar): THandle; stdcall;
  2443. function CreateFileMappingW(hFile: THandle; lpFileMappingAttributes: PSecurityAttributes;
  2444.   flProtect, dwMaximumSizeHigh, dwMaximumSizeLow: DWORD; lpName: PWideChar): THandle; stdcall;
  2445. function CreateFileMapping(hFile: THandle; lpFileMappingAttributes: PSecurityAttributes;
  2446.   flProtect, dwMaximumSizeHigh, dwMaximumSizeLow: DWORD; lpName: PChar): THandle; stdcall;
  2447. function OpenFileMappingA(dwDesiredAccess: DWORD; bInheritHandle: BOOL; lpName: PAnsiChar): THandle; stdcall;
  2448. function OpenFileMappingW(dwDesiredAccess: DWORD; bInheritHandle: BOOL; lpName: PWideChar): THandle; stdcall;
  2449. function OpenFileMapping(dwDesiredAccess: DWORD; bInheritHandle: BOOL; lpName: PChar): THandle; stdcall;
  2450. function GetLogicalDriveStringsA(nBufferLength: DWORD; lpBuffer: PAnsiChar): DWORD; stdcall;
  2451. function GetLogicalDriveStringsW(nBufferLength: DWORD; lpBuffer: PAnsiChar): DWORD; stdcall;
  2452. function GetLogicalDriveStrings(nBufferLength: DWORD; lpBuffer: PAnsiChar): DWORD; stdcall;
  2453. function LoadLibraryA(lpLibFileName: PAnsiChar): HMODULE; stdcall;
  2454. function LoadLibraryW(lpLibFileName: PWideChar): HMODULE; stdcall;
  2455. function LoadLibrary(lpLibFileName: PChar): HMODULE; stdcall;
  2456. function LoadLibraryExA(lpLibFileName: PAnsiChar; hFile: THandle; dwFlags: DWORD): HMODULE; stdcall;
  2457. function LoadLibraryExW(lpLibFileName: PWideChar; hFile: THandle; dwFlags: DWORD): HMODULE; stdcall;
  2458. function LoadLibraryEx(lpLibFileName: PChar; hFile: THandle; dwFlags: DWORD): HMODULE; stdcall;
  2459.  
  2460. const
  2461.   DONT_RESOLVE_DLL_REFERENCES = 1;
  2462.   LOAD_LIBRARY_AS_DATAFILE = 2;
  2463.   LOAD_WITH_ALTERED_SEARCH_PATH = 8;
  2464.  
  2465. function GetModuleFileNameA(hModule: HINST; lpFilename: PAnsiChar; nSize: DWORD): DWORD; stdcall;
  2466. function GetModuleFileNameW(hModule: HINST; lpFilename: PWideChar; nSize: DWORD): DWORD; stdcall;
  2467. function GetModuleFileName(hModule: HINST; lpFilename: PChar; nSize: DWORD): DWORD; stdcall;
  2468. function GetModuleHandleA(lpModuleName: PAnsiChar): HMODULE; stdcall;
  2469. function GetModuleHandleW(lpModuleName: PWideChar): HMODULE; stdcall;
  2470. function GetModuleHandle(lpModuleName: PChar): HMODULE; stdcall;
  2471. function CreateProcessA(lpApplicationName: PAnsiChar; lpCommandLine: PAnsiChar;
  2472.   lpProcessAttributes, lpThreadAttributes: PSecurityAttributes;
  2473.   bInheritHandles: BOOL; dwCreationFlags: DWORD; lpEnvironment: Pointer;
  2474.   lpCurrentDirectory: PAnsiChar; const lpStartupInfo: TStartupInfo;
  2475.   var lpProcessInformation: TProcessInformation): BOOL; stdcall;
  2476. function CreateProcessW(lpApplicationName: PWideChar; lpCommandLine: PWideChar;
  2477.   lpProcessAttributes, lpThreadAttributes: PSecurityAttributes;
  2478.   bInheritHandles: BOOL; dwCreationFlags: DWORD; lpEnvironment: Pointer;
  2479.   lpCurrentDirectory: PWideChar; const lpStartupInfo: TStartupInfo;
  2480.   var lpProcessInformation: TProcessInformation): BOOL; stdcall;
  2481. function CreateProcess(lpApplicationName: PChar; lpCommandLine: PChar;
  2482.   lpProcessAttributes, lpThreadAttributes: PSecurityAttributes;
  2483.   bInheritHandles: BOOL; dwCreationFlags: DWORD; lpEnvironment: Pointer;
  2484.   lpCurrentDirectory: PChar; const lpStartupInfo: TStartupInfo;
  2485.   var lpProcessInformation: TProcessInformation): BOOL; stdcall;
  2486. function SetProcessShutdownParameters(dwLevel, dwFlags: DWORD): BOOL; stdcall;
  2487. function GetProcessShutdownParameters(var lpdwLevel, lpdwFlags: DWORD): BOOL; stdcall;
  2488. function GetProcessVersion(ProcessId: DWORD): DWORD; stdcall;
  2489. procedure FatalAppExitA(uAction: UINT; lpMessageText: PAnsiChar); stdcall;
  2490. procedure FatalAppExitW(uAction: UINT; lpMessageText: PWideChar); stdcall;
  2491. procedure FatalAppExit(uAction: UINT; lpMessageText: PChar); stdcall;
  2492. procedure GetStartupInfoA(var lpStartupInfo: TStartupInfo); stdcall;
  2493. procedure GetStartupInfoW(var lpStartupInfo: TStartupInfo); stdcall;
  2494. procedure GetStartupInfo(var lpStartupInfo: TStartupInfo); stdcall;
  2495. function GetCommandLineA: PAnsiChar; stdcall;
  2496. function GetCommandLineW: PWideChar; stdcall;
  2497. function GetCommandLine: PChar; stdcall;
  2498. function GetEnvironmentVariableA(lpName: PAnsiChar; lpBuffer: PAnsiChar; nSize: DWORD): DWORD; stdcall;
  2499. function GetEnvironmentVariableW(lpName: PWideChar; lpBuffer: PWideChar; nSize: DWORD): DWORD; stdcall;
  2500. function GetEnvironmentVariable(lpName: PChar; lpBuffer: PChar; nSize: DWORD): DWORD; stdcall;
  2501. function SetEnvironmentVariableA(lpName, lpValue: PAnsiChar): BOOL; stdcall;
  2502. function SetEnvironmentVariableW(lpName, lpValue: PWideChar): BOOL; stdcall;
  2503. function SetEnvironmentVariable(lpName, lpValue: PChar): BOOL; stdcall;
  2504. function ExpandEnvironmentStringsA(lpSrc: PAnsiChar; lpDst: PAnsiChar; nSize: DWORD): DWORD; stdcall;
  2505. function ExpandEnvironmentStringsW(lpSrc: PWideChar; lpDst: PWideChar; nSize: DWORD): DWORD; stdcall;
  2506. function ExpandEnvironmentStrings(lpSrc: PChar; lpDst: PChar; nSize: DWORD): DWORD; stdcall;
  2507. procedure OutputDebugStringA(lpOutputString: PAnsiChar); stdcall;
  2508. procedure OutputDebugStringW(lpOutputString: PWideChar); stdcall;
  2509. procedure OutputDebugString(lpOutputString: PChar); stdcall;
  2510. function FindResourceA(hModule: HMODULE; lpName, lpType: PAnsiChar): HRSRC; stdcall;
  2511. function FindResourceW(hModule: HMODULE; lpName, lpType: PWideChar): HRSRC; stdcall;
  2512. function FindResource(hModule: HMODULE; lpName, lpType: PChar): HRSRC; stdcall;
  2513. function FindResourceExA(hModule: HMODULE; lpType, lpName: PAnsiChar; wLanguage: Word): HRSRC; stdcall;
  2514. function FindResourceExW(hModule: HMODULE; lpType, lpName: PWideChar; wLanguage: Word): HRSRC; stdcall;
  2515. function FindResourceEx(hModule: HMODULE; lpType, lpName: PChar; wLanguage: Word): HRSRC; stdcall;
  2516.  
  2517. type
  2518.   ENUMRESTYPEPROC = FARPROC;
  2519.   ENUMRESNAMEPROC = FARPROC;
  2520.   ENUMRESLANGPROC = FARPROC;
  2521.  
  2522. function EnumResourceTypesA(hModule: HMODULE; lpEnumFunc: ENUMRESTYPEPROC;
  2523.   lParam: Longint): BOOL; stdcall;
  2524. function EnumResourceTypesW(hModule: HMODULE; lpEnumFunc: ENUMRESTYPEPROC;
  2525.   lParam: Longint): BOOL; stdcall;
  2526. function EnumResourceTypes(hModule: HMODULE; lpEnumFunc: ENUMRESTYPEPROC;
  2527.   lParam: Longint): BOOL; stdcall;
  2528. function EnumResourceNamesA(hModule: HMODULE; lpType: PAnsiChar;
  2529.   lpEnumFunc: ENUMRESNAMEPROC; lParam: Longint): BOOL; stdcall;
  2530. function EnumResourceNamesW(hModule: HMODULE; lpType: PWideChar;
  2531.   lpEnumFunc: ENUMRESNAMEPROC; lParam: Longint): BOOL; stdcall;
  2532. function EnumResourceNames(hModule: HMODULE; lpType: PChar;
  2533.   lpEnumFunc: ENUMRESNAMEPROC; lParam: Longint): BOOL; stdcall;
  2534. function EnumResourceLanguagesA(hModule: HMODULE; lpType, lpName: PAnsiChar;
  2535.   lpEnumFunc: ENUMRESLANGPROC; lParam: Longint): BOOL; stdcall;
  2536. function EnumResourceLanguagesW(hModule: HMODULE; lpType, lpName: PWideChar;
  2537.   lpEnumFunc: ENUMRESLANGPROC; lParam: Longint): BOOL; stdcall;
  2538. function EnumResourceLanguages(hModule: HMODULE; lpType, lpName: PChar;
  2539.   lpEnumFunc: ENUMRESLANGPROC; lParam: Longint): BOOL; stdcall;
  2540. function BeginUpdateResourceA(pFileName: PAnsiChar; bDeleteExistingResources: BOOL): THandle; stdcall;
  2541. function BeginUpdateResourceW(pFileName: PWideChar; bDeleteExistingResources: BOOL): THandle; stdcall;
  2542. function BeginUpdateResource(pFileName: PChar; bDeleteExistingResources: BOOL): THandle; stdcall;
  2543. function UpdateResourceA(hUpdate: THandle; lpType, lpName: PAnsiChar;
  2544.   wLanguage: Word; lpData: Pointer; cbData: DWORD): BOOL; stdcall;
  2545. function UpdateResourceW(hUpdate: THandle; lpType, lpName: PWideChar;
  2546.   wLanguage: Word; lpData: Pointer; cbData: DWORD): BOOL; stdcall;
  2547. function UpdateResource(hUpdate: THandle; lpType, lpName: PChar;
  2548.   wLanguage: Word; lpData: Pointer; cbData: DWORD): BOOL; stdcall;
  2549. function EndUpdateResourceA(hUpdate: THandle; fDiscard: BOOL): BOOL; stdcall;
  2550. function EndUpdateResourceW(hUpdate: THandle; fDiscard: BOOL): BOOL; stdcall;
  2551. function EndUpdateResource(hUpdate: THandle; fDiscard: BOOL): BOOL; stdcall;
  2552. function GlobalAddAtomA(lpString: PAnsiChar): ATOM; stdcall;
  2553. function GlobalAddAtomW(lpString: PWideChar): ATOM; stdcall;
  2554. function GlobalAddAtom(lpString: PChar): ATOM; stdcall;
  2555. function GlobalFindAtomA(lpString: PAnsiChar): ATOM; stdcall;
  2556. function GlobalFindAtomW(lpString: PWideChar): ATOM; stdcall;
  2557. function GlobalFindAtom(lpString: PChar): ATOM; stdcall;
  2558. function GlobalGetAtomNameA(nAtom: ATOM; lpBuffer: PAnsiChar; nSize: Integer): UINT; stdcall;
  2559. function GlobalGetAtomNameW(nAtom: ATOM; lpBuffer: PWideChar; nSize: Integer): UINT; stdcall;
  2560. function GlobalGetAtomName(nAtom: ATOM; lpBuffer: PChar; nSize: Integer): UINT; stdcall;
  2561. function AddAtomA(lpString: PAnsiChar): ATOM; stdcall;
  2562. function AddAtomW(lpString: PWideChar): ATOM; stdcall;
  2563. function AddAtom(lpString: PChar): ATOM; stdcall;
  2564. function FindAtomA(lpString: PAnsiChar): ATOM; stdcall;
  2565. function FindAtomW(lpString: PWideChar): ATOM; stdcall;
  2566. function FindAtom(lpString: PChar): ATOM; stdcall;
  2567. function GetAtomNameA(nAtom: ATOM; lpBuffer: PAnsiChar; nSize: Integer): UINT; stdcall;
  2568. function GetAtomNameW(nAtom: ATOM; lpBuffer: PWideChar; nSize: Integer): UINT; stdcall;
  2569. function GetAtomName(nAtom: ATOM; lpBuffer: PChar; nSize: Integer): UINT; stdcall;
  2570. function GetProfileIntA(lpAppName, lpKeyName: PAnsiChar; nDefault: Integer): UINT; stdcall;
  2571. function GetProfileIntW(lpAppName, lpKeyName: PWideChar; nDefault: Integer): UINT; stdcall;
  2572. function GetProfileInt(lpAppName, lpKeyName: PChar; nDefault: Integer): UINT; stdcall;
  2573. function GetProfileStringA(lpAppName, lpKeyName, lpDefault: PAnsiChar;
  2574.   lpReturnedString: PAnsiChar; nSize: DWORD): DWORD; stdcall;
  2575. function GetProfileStringW(lpAppName, lpKeyName, lpDefault: PWideChar;
  2576.   lpReturnedString: PWideChar; nSize: DWORD): DWORD; stdcall;
  2577. function GetProfileString(lpAppName, lpKeyName, lpDefault: PChar;
  2578.   lpReturnedString: PChar; nSize: DWORD): DWORD; stdcall;
  2579. function WriteProfileStringA(lpAppName, lpKeyName, lpString: PAnsiChar): BOOL; stdcall;
  2580. function WriteProfileStringW(lpAppName, lpKeyName, lpString: PWideChar): BOOL; stdcall;
  2581. function WriteProfileString(lpAppName, lpKeyName, lpString: PChar): BOOL; stdcall;
  2582. function GetProfileSectionA(lpAppName: PAnsiChar; lpReturnedString: PAnsiChar; nSize: DWORD): DWORD; stdcall;
  2583. function GetProfileSectionW(lpAppName: PWideChar; lpReturnedString: PWideChar; nSize: DWORD): DWORD; stdcall;
  2584. function GetProfileSection(lpAppName: PChar; lpReturnedString: PChar; nSize: DWORD): DWORD; stdcall;
  2585. function WriteProfileSectionA(lpAppName, lpString: PAnsiChar): BOOL; stdcall;
  2586. function WriteProfileSectionW(lpAppName, lpString: PWideChar): BOOL; stdcall;
  2587. function WriteProfileSection(lpAppName, lpString: PChar): BOOL; stdcall;
  2588. function GetPrivateProfileIntA(lpAppName, lpKeyName: PAnsiChar;
  2589.   nDefault: Integer; lpFileName: PAnsiChar): UINT; stdcall;
  2590. function GetPrivateProfileIntW(lpAppName, lpKeyName: PWideChar;
  2591.   nDefault: Integer; lpFileName: PWideChar): UINT; stdcall;
  2592. function GetPrivateProfileInt(lpAppName, lpKeyName: PChar;
  2593.   nDefault: Integer; lpFileName: PChar): UINT; stdcall;
  2594. function GetPrivateProfileStringA(lpAppName, lpKeyName, lpDefault: PAnsiChar;
  2595.   lpReturnedString: PAnsiChar; nSize: DWORD; lpFileName: PAnsiChar): DWORD; stdcall;
  2596. function GetPrivateProfileStringW(lpAppName, lpKeyName, lpDefault: PWideChar;
  2597.   lpReturnedString: PWideChar; nSize: DWORD; lpFileName: PWideChar): DWORD; stdcall;
  2598. function GetPrivateProfileString(lpAppName, lpKeyName, lpDefault: PChar;
  2599.   lpReturnedString: PChar; nSize: DWORD; lpFileName: PChar): DWORD; stdcall;
  2600. function WritePrivateProfileStringA(lpAppName, lpKeyName, lpString, lpFileName: PAnsiChar): BOOL; stdcall;
  2601. function WritePrivateProfileStringW(lpAppName, lpKeyName, lpString, lpFileName: PWideChar): BOOL; stdcall;
  2602. function WritePrivateProfileString(lpAppName, lpKeyName, lpString, lpFileName: PChar): BOOL; stdcall;
  2603. function GetPrivateProfileSectionA(lpAppName: PAnsiChar;
  2604.   lpReturnedString: PAnsiChar; nSize: DWORD; lpFileName: PAnsiChar): DWORD; stdcall;
  2605. function GetPrivateProfileSectionW(lpAppName: PWideChar;
  2606.   lpReturnedString: PWideChar; nSize: DWORD; lpFileName: PWideChar): DWORD; stdcall;
  2607. function GetPrivateProfileSection(lpAppName: PChar;
  2608.   lpReturnedString: PChar; nSize: DWORD; lpFileName: PChar): DWORD; stdcall;
  2609. function WritePrivateProfileSectionA(lpAppName, lpString, lpFileName: PAnsiChar): BOOL; stdcall;
  2610. function WritePrivateProfileSectionW(lpAppName, lpString, lpFileName: PWideChar): BOOL; stdcall;
  2611. function WritePrivateProfileSection(lpAppName, lpString, lpFileName: PChar): BOOL; stdcall;
  2612. function GetPrivateProfileSectionNamesA(lpszReturnBuffer: PAnsiChar; nSize: DWORD; lpFileName: PAnsiChar): DWORD; stdcall;
  2613. function GetPrivateProfileSectionNamesW(lpszReturnBuffer: PWideChar; nSize: DWORD; lpFileName: PWideChar): DWORD; stdcall;
  2614. function GetPrivateProfileSectionNames(lpszReturnBuffer: PChar; nSize: DWORD; lpFileName: PChar): DWORD; stdcall;
  2615. function GetPrivateProfileStructA(lpszSection, lpszKey: PAnsiChar;
  2616.   lpStruct: Pointer; uSizeStruct: UINT; szFile: PAnsiChar): BOOL; stdcall;
  2617. function GetPrivateProfileStructW(lpszSection, lpszKey: PWideChar;
  2618.   lpStruct: Pointer; uSizeStruct: UINT; szFile: PWideChar): BOOL; stdcall;
  2619. function GetPrivateProfileStruct(lpszSection, lpszKey: PChar;
  2620.   lpStruct: Pointer; uSizeStruct: UINT; szFile: PChar): BOOL; stdcall;
  2621. function WritePrivateProfileStructA(lpszSection, lpszKey: PAnsiChar;
  2622.   lpStruct: Pointer; uSizeStruct: UINT; szFile: PAnsiChar): BOOL; stdcall;
  2623. function WritePrivateProfileStructW(lpszSection, lpszKey: PWideChar;
  2624.   lpStruct: Pointer; uSizeStruct: UINT; szFile: PWideChar): BOOL; stdcall;
  2625. function WritePrivateProfileStruct(lpszSection, lpszKey: PChar;
  2626.   lpStruct: Pointer; uSizeStruct: UINT; szFile: PChar): BOOL; stdcall;
  2627. function GetDriveTypeA(lpRootPathName: PAnsiChar): UINT; stdcall;
  2628. function GetDriveTypeW(lpRootPathName: PWideChar): UINT; stdcall;
  2629. function GetDriveType(lpRootPathName: PChar): UINT; stdcall;
  2630. function GetSystemDirectoryA(lpBuffer: PAnsiChar; uSize: UINT): UINT; stdcall;
  2631. function GetSystemDirectoryW(lpBuffer: PWideChar; uSize: UINT): UINT; stdcall;
  2632. function GetSystemDirectory(lpBuffer: PChar; uSize: UINT): UINT; stdcall;
  2633. function GetTempPathA(nBufferLength: DWORD; lpBuffer: PAnsiChar): DWORD; stdcall;
  2634. function GetTempPathW(nBufferLength: DWORD; lpBuffer: PWideChar): DWORD; stdcall;
  2635. function GetTempPath(nBufferLength: DWORD; lpBuffer: PChar): DWORD; stdcall;
  2636. function GetTempFileNameA(lpPathName, lpPrefixString: PAnsiChar;
  2637.   uUnique: UINT; lpTempFileName: PAnsiChar): UINT; stdcall;
  2638. function GetTempFileNameW(lpPathName, lpPrefixString: PWideChar;
  2639.   uUnique: UINT; lpTempFileName: PWideChar): UINT; stdcall;
  2640. function GetTempFileName(lpPathName, lpPrefixString: PChar;
  2641.   uUnique: UINT; lpTempFileName: PChar): UINT; stdcall;
  2642. function GetWindowsDirectoryA(lpBuffer: PAnsiChar; uSize: UINT): UINT; stdcall;
  2643. function GetWindowsDirectoryW(lpBuffer: PWideChar; uSize: UINT): UINT; stdcall;
  2644. function GetWindowsDirectory(lpBuffer: PChar; uSize: UINT): UINT; stdcall;
  2645. function SetCurrentDirectoryA(lpPathName: PAnsiChar): BOOL; stdcall;
  2646. function SetCurrentDirectoryW(lpPathName: PWideChar): BOOL; stdcall;
  2647. function SetCurrentDirectory(lpPathName: PChar): BOOL; stdcall;
  2648. function GetCurrentDirectoryA(nBufferLength: DWORD; lpBuffer: PAnsiChar): DWORD; stdcall;
  2649. function GetCurrentDirectoryW(nBufferLength: DWORD; lpBuffer: PWideChar): DWORD; stdcall;
  2650. function GetCurrentDirectory(nBufferLength: DWORD; lpBuffer: PChar): DWORD; stdcall;
  2651. function GetDiskFreeSpaceA(lpRootPathName: PAnsiChar;
  2652.   var lpSectorsPerCluster, lpBytesPerSector, lpNumberOfFreeClusters, lpTotalNumberOfClusters: DWORD): BOOL; stdcall;
  2653. function GetDiskFreeSpaceW(lpRootPathName: PWideChar;
  2654.   var lpSectorsPerCluster, lpBytesPerSector, lpNumberOfFreeClusters, lpTotalNumberOfClusters: DWORD): BOOL; stdcall;
  2655. function GetDiskFreeSpace(lpRootPathName: PChar;
  2656.   var lpSectorsPerCluster, lpBytesPerSector, lpNumberOfFreeClusters, lpTotalNumberOfClusters: DWORD): BOOL; stdcall;
  2657. function CreateDirectoryA(lpPathName: PAnsiChar;
  2658.   lpSecurityAttributes: PSecurityAttributes): BOOL; stdcall;
  2659. function CreateDirectoryW(lpPathName: PWideChar;
  2660.   lpSecurityAttributes: PSecurityAttributes): BOOL; stdcall;
  2661. function CreateDirectory(lpPathName: PChar;
  2662.   lpSecurityAttributes: PSecurityAttributes): BOOL; stdcall;
  2663. function CreateDirectoryExA(lpTemplateDirectory, lpNewDirectory: PAnsiChar;
  2664.   lpSecurityAttributes: PSecurityAttributes): BOOL; stdcall;
  2665. function CreateDirectoryExW(lpTemplateDirectory, lpNewDirectory: PWideChar;
  2666.   lpSecurityAttributes: PSecurityAttributes): BOOL; stdcall;
  2667. function CreateDirectoryEx(lpTemplateDirectory, lpNewDirectory: PChar;
  2668.   lpSecurityAttributes: PSecurityAttributes): BOOL; stdcall;
  2669. function RemoveDirectoryA(lpPathName: PAnsiChar): BOOL; stdcall;
  2670. function RemoveDirectoryW(lpPathName: PWideChar): BOOL; stdcall;
  2671. function RemoveDirectory(lpPathName: PChar): BOOL; stdcall;
  2672. function GetFullPathNameA(lpFileName: PAnsiChar; nBufferLength: DWORD;
  2673.   lpBuffer: PAnsiChar; var lpFilePart: PAnsiChar): DWORD; stdcall;
  2674. function GetFullPathNameW(lpFileName: PWideChar; nBufferLength: DWORD;
  2675.   lpBuffer: PWideChar; var lpFilePart: PWideChar): DWORD; stdcall;
  2676. function GetFullPathName(lpFileName: PChar; nBufferLength: DWORD;
  2677.   lpBuffer: PChar; var lpFilePart: PChar): DWORD; stdcall;
  2678.  
  2679. const
  2680.   DDD_RAW_TARGET_PATH = 1;
  2681.   DDD_REMOVE_DEFINITION = 2;
  2682.   DDD_EXACT_MATCH_ON_REMOVE = 4;
  2683.  
  2684. function DefineDosDeviceA(dwFlags: DWORD; lpDeviceName, lpTargetPath: PAnsiChar): BOOL; stdcall;
  2685. function DefineDosDeviceW(dwFlags: DWORD; lpDeviceName, lpTargetPath: PWideChar): BOOL; stdcall;
  2686. function DefineDosDevice(dwFlags: DWORD; lpDeviceName, lpTargetPath: PChar): BOOL; stdcall;
  2687. function QueryDosDeviceA(lpDeviceName: PAnsiChar;
  2688.   lpTargetPath: PAnsiChar; ucchMax: DWORD): DWORD; stdcall;
  2689. function QueryDosDeviceW(lpDeviceName: PWideChar;
  2690.   lpTargetPath: PWideChar; ucchMax: DWORD): DWORD; stdcall;
  2691. function QueryDosDevice(lpDeviceName: PChar;
  2692.   lpTargetPath: PChar; ucchMax: DWORD): DWORD; stdcall;
  2693. function CreateFileA(lpFileName: PAnsiChar; dwDesiredAccess, dwShareMode: Integer;
  2694.   lpSecurityAttributes: PSecurityAttributes; dwCreationDisposition, dwFlagsAndAttributes: DWORD;
  2695.   hTemplateFile: THandle): THandle; stdcall;
  2696. function CreateFileW(lpFileName: PWideChar; dwDesiredAccess, dwShareMode: Integer;
  2697.   lpSecurityAttributes: PSecurityAttributes; dwCreationDisposition, dwFlagsAndAttributes: DWORD;
  2698.   hTemplateFile: THandle): THandle; stdcall;
  2699. function CreateFile(lpFileName: PChar; dwDesiredAccess, dwShareMode: Integer;
  2700.   lpSecurityAttributes: PSecurityAttributes; dwCreationDisposition, dwFlagsAndAttributes: DWORD;
  2701.   hTemplateFile: THandle): THandle; stdcall;
  2702. function SetFileAttributesA(lpFileName: PAnsiChar; dwFileAttributes: DWORD): BOOL; stdcall;
  2703. function SetFileAttributesW(lpFileName: PWideChar; dwFileAttributes: DWORD): BOOL; stdcall;
  2704. function SetFileAttributes(lpFileName: PChar; dwFileAttributes: DWORD): BOOL; stdcall;
  2705. function GetFileAttributesA(lpFileName: PAnsiChar): DWORD; stdcall;
  2706. function GetFileAttributesW(lpFileName: PWideChar): DWORD; stdcall;
  2707. function GetFileAttributes(lpFileName: PChar): DWORD; stdcall;
  2708. function GetCompressedFileSizeA(lpFileName: PAnsiChar; lpFileSizeHigh: PDWORD): DWORD; stdcall;
  2709. function GetCompressedFileSizeW(lpFileName: PWideChar; lpFileSizeHigh: PDWORD): DWORD; stdcall;
  2710. function GetCompressedFileSize(lpFileName: PChar; lpFileSizeHigh: PDWORD): DWORD; stdcall;
  2711. function DeleteFileA(lpFileName: PAnsiChar): BOOL; stdcall;
  2712. function DeleteFileW(lpFileName: PWideChar): BOOL; stdcall;
  2713. function DeleteFile(lpFileName: PChar): BOOL; stdcall;
  2714. function FindFirstFileA(lpFileName: PAnsiChar; var lpFindFileData: TWIN32FindDataA): THandle; stdcall;
  2715. function FindFirstFileW(lpFileName: PWideChar; var lpFindFileData: TWIN32FindDataW): THandle; stdcall;
  2716. function FindFirstFile(lpFileName: PChar; var lpFindFileData: TWIN32FindData): THandle; stdcall;
  2717. function FindNextFileA(hFindFile: THandle; var lpFindFileData: TWIN32FindDataA): BOOL; stdcall;
  2718. function FindNextFileW(hFindFile: THandle; var lpFindFileData: TWIN32FindDataW): BOOL; stdcall;
  2719. function FindNextFile(hFindFile: THandle; var lpFindFileData: TWIN32FindData): BOOL; stdcall;
  2720. function SearchPathA(lpPath, lpFileName, lpExtension: PAnsiChar;
  2721.   nBufferLength: DWORD; lpBuffer: PAnsiChar; const lpFilePart: PAnsiChar): DWORD; stdcall;
  2722. function SearchPathW(lpPath, lpFileName, lpExtension: PWideChar;
  2723.   nBufferLength: DWORD; lpBuffer: PWideChar; const lpFilePart: PWideChar): DWORD; stdcall;
  2724. function SearchPath(lpPath, lpFileName, lpExtension: PChar;
  2725.   nBufferLength: DWORD; lpBuffer: PChar; const lpFilePart: PChar): DWORD; stdcall;
  2726. function CopyFileA(lpExistingFileName, lpNewFileName: PAnsiChar; bFailIfExists: BOOL): BOOL; stdcall;
  2727. function CopyFileW(lpExistingFileName, lpNewFileName: PWideChar; bFailIfExists: BOOL): BOOL; stdcall;
  2728. function CopyFile(lpExistingFileName, lpNewFileName: PChar; bFailIfExists: BOOL): BOOL; stdcall;
  2729. function MoveFileA(lpExistingFileName, lpNewFileName: PAnsiChar): BOOL; stdcall;
  2730. function MoveFileW(lpExistingFileName, lpNewFileName: PWideChar): BOOL; stdcall;
  2731. function MoveFile(lpExistingFileName, lpNewFileName: PChar): BOOL; stdcall;
  2732. function MoveFileExA(lpExistingFileName, lpNewFileName: PAnsiChar; dwFlags: DWORD): BOOL; stdcall;
  2733. function MoveFileExW(lpExistingFileName, lpNewFileName: PWideChar; dwFlags: DWORD): BOOL; stdcall;
  2734. function MoveFileEx(lpExistingFileName, lpNewFileName: PChar; dwFlags: DWORD): BOOL; stdcall;
  2735.  
  2736. const
  2737.   MOVEFILE_REPLACE_EXISTING = 1;
  2738.   MOVEFILE_COPY_ALLOWED = 2;
  2739.   MOVEFILE_DELAY_UNTIL_REBOOT = 4;
  2740.  
  2741. function CreateNamedPipeA(lpName: PAnsiChar;
  2742.   dwOpenMode, dwPipeMode, nMaxInstances, nOutBufferSize, nInBufferSize, nDefaultTimeOut: DWORD;
  2743.   lpSecurityAttributes: PSecurityAttributes): THandle; stdcall;
  2744. function CreateNamedPipeW(lpName: PWideChar;
  2745.   dwOpenMode, dwPipeMode, nMaxInstances, nOutBufferSize, nInBufferSize, nDefaultTimeOut: DWORD;
  2746.   lpSecurityAttributes: PSecurityAttributes): THandle; stdcall;
  2747. function CreateNamedPipe(lpName: PChar;
  2748.   dwOpenMode, dwPipeMode, nMaxInstances, nOutBufferSize, nInBufferSize, nDefaultTimeOut: DWORD;
  2749.   lpSecurityAttributes: PSecurityAttributes): THandle; stdcall;
  2750. function GetNamedPipeHandleStateA(hNamedPipe: THandle;
  2751.   lpState, lpCurInstances, lpMaxCollectionCount, lpCollectDataTimeout: PDWORD;
  2752.   lpUserName: PAnsiChar; nMaxUserNameSize: DWORD): BOOL; stdcall;
  2753. function GetNamedPipeHandleStateW(hNamedPipe: THandle;
  2754.   lpState, lpCurInstances, lpMaxCollectionCount, lpCollectDataTimeout: PDWORD;
  2755.   lpUserName: PWideChar; nMaxUserNameSize: DWORD): BOOL; stdcall;
  2756. function GetNamedPipeHandleState(hNamedPipe: THandle;
  2757.   lpState, lpCurInstances, lpMaxCollectionCount, lpCollectDataTimeout: PDWORD;
  2758.   lpUserName: PChar; nMaxUserNameSize: DWORD): BOOL; stdcall;
  2759. function CallNamedPipeA(lpNamedPipeName: PAnsiChar; lpInBuffer: Pointer;
  2760.   nInBufferSize: DWORD; lpOutBuffer: Pointer; nOutBufferSize: DWORD;
  2761.   var lpBytesRead: DWORD; nTimeOut: DWORD): BOOL; stdcall;
  2762. function CallNamedPipeW(lpNamedPipeName: PWideChar; lpInBuffer: Pointer;
  2763.   nInBufferSize: DWORD; lpOutBuffer: Pointer; nOutBufferSize: DWORD;
  2764.   var lpBytesRead: DWORD; nTimeOut: DWORD): BOOL; stdcall;
  2765. function CallNamedPipe(lpNamedPipeName: PChar; lpInBuffer: Pointer;
  2766.   nInBufferSize: DWORD; lpOutBuffer: Pointer; nOutBufferSize: DWORD;
  2767.   var lpBytesRead: DWORD; nTimeOut: DWORD): BOOL; stdcall;
  2768. function WaitNamedPipeA(lpNamedPipeName: PAnsiChar; nTimeOut: DWORD): BOOL; stdcall;
  2769. function WaitNamedPipeW(lpNamedPipeName: PWideChar; nTimeOut: DWORD): BOOL; stdcall;
  2770. function WaitNamedPipe(lpNamedPipeName: PChar; nTimeOut: DWORD): BOOL; stdcall;
  2771. function SetVolumeLabelA(lpRootPathName: PAnsiChar; lpVolumeName: PAnsiChar): BOOL; stdcall;
  2772. function SetVolumeLabelW(lpRootPathName: PWideChar; lpVolumeName: PAnsiChar): BOOL; stdcall;
  2773. function SetVolumeLabel(lpRootPathName: PChar; lpVolumeName: PAnsiChar): BOOL; stdcall;
  2774. procedure SetFileApisToOEM; stdcall;
  2775. procedure SetFileApisToANSI; stdcall;
  2776. function AreFileApisANSI: BOOL; stdcall;
  2777. function GetVolumeInformationA(lpRootPathName: PAnsiChar;
  2778.   lpVolumeNameBuffer: PAnsiChar; nVolumeNameSize: DWORD; lpVolumeSerialNumber: PDWORD;
  2779.   var lpMaximumComponentLength, lpFileSystemFlags: DWORD;
  2780.   lpFileSystemNameBuffer: PAnsiChar; nFileSystemNameSize: DWORD): BOOL; stdcall;
  2781. function GetVolumeInformationW(lpRootPathName: PWideChar;
  2782.   lpVolumeNameBuffer: PWideChar; nVolumeNameSize: DWORD; lpVolumeSerialNumber: PDWORD;
  2783.   var lpMaximumComponentLength, lpFileSystemFlags: DWORD;
  2784.   lpFileSystemNameBuffer: PWideChar; nFileSystemNameSize: DWORD): BOOL; stdcall;
  2785. function GetVolumeInformation(lpRootPathName: PChar;
  2786.   lpVolumeNameBuffer: PChar; nVolumeNameSize: DWORD; lpVolumeSerialNumber: PDWORD;
  2787.   var lpMaximumComponentLength, lpFileSystemFlags: DWORD;
  2788.   lpFileSystemNameBuffer: PChar; nFileSystemNameSize: DWORD): BOOL; stdcall;
  2789.  
  2790. { Event logging APIs }
  2791.  
  2792. function ClearEventLogA(hEventLog: THandle; lpBackupFileName: PAnsiChar): BOOL; stdcall;
  2793. function ClearEventLogW(hEventLog: THandle; lpBackupFileName: PWideChar): BOOL; stdcall;
  2794. function ClearEventLog(hEventLog: THandle; lpBackupFileName: PChar): BOOL; stdcall;
  2795. function BackupEventLogA(hEventLog: THandle; lpBackupFileName: PAnsiChar): BOOL; stdcall;
  2796. function BackupEventLogW(hEventLog: THandle; lpBackupFileName: PWideChar): BOOL; stdcall;
  2797. function BackupEventLog(hEventLog: THandle; lpBackupFileName: PChar): BOOL; stdcall;
  2798. function CloseEventLog(hEventLog: THandle): BOOL; stdcall;
  2799. function DeregisterEventSource(hEventLog: THandle): BOOL; stdcall;
  2800. function NotifyChangeEventLog(hEventLog, hEvent: THandle): BOOL; stdcall;
  2801. function GetNumberOfEventLogRecords(hEventLog: THandle; var NumberOfRecords: DWORD): BOOL; stdcall;
  2802. function GetOldestEventLogRecord(hEventLog: THandle; var OldestRecord: DWORD): BOOL; stdcall;
  2803. function OpenEventLogA(lpUNCServerName, lpSourceName: PAnsiChar): THandle; stdcall;
  2804. function OpenEventLogW(lpUNCServerName, lpSourceName: PWideChar): THandle; stdcall;
  2805. function OpenEventLog(lpUNCServerName, lpSourceName: PChar): THandle; stdcall;
  2806. function RegisterEventSourceA(lpUNCServerName, lpSourceName: PAnsiChar): THandle; stdcall;
  2807. function RegisterEventSourceW(lpUNCServerName, lpSourceName: PWideChar): THandle; stdcall;
  2808. function RegisterEventSource(lpUNCServerName, lpSourceName: PChar): THandle; stdcall;
  2809. function OpenBackupEventLogA(lpUNCServerName, lpFileName: PAnsiChar): THandle; stdcall;
  2810. function OpenBackupEventLogW(lpUNCServerName, lpFileName: PWideChar): THandle; stdcall;
  2811. function OpenBackupEventLog(lpUNCServerName, lpFileName: PChar): THandle; stdcall;
  2812. function ReadEventLogA(hEventLog: THandle; dwReadFlags, dwRecordOffset: DWORD;
  2813.   lpBuffer: Pointer; nNumberOfBytesToRead: DWORD;
  2814.   var pnBytesRead, pnMinNumberOfBytesNeeded: DWORD): BOOL; stdcall;
  2815. function ReadEventLogW(hEventLog: THandle; dwReadFlags, dwRecordOffset: DWORD;
  2816.   lpBuffer: Pointer; nNumberOfBytesToRead: DWORD;
  2817.   var pnBytesRead, pnMinNumberOfBytesNeeded: DWORD): BOOL; stdcall;
  2818. function ReadEventLog(hEventLog: THandle; dwReadFlags, dwRecordOffset: DWORD;
  2819.   lpBuffer: Pointer; nNumberOfBytesToRead: DWORD;
  2820.   var pnBytesRead, pnMinNumberOfBytesNeeded: DWORD): BOOL; stdcall;
  2821. function ReportEventA(hEventLog: THandle; wType, wCategory: Word;
  2822.   dwEventID: DWORD; lpUserSid: Pointer; wNumStrings: Word;
  2823.   dwDataSize: DWORD; var lpStrings: PAnsiChar; lpRawData: Pointer): BOOL; stdcall;
  2824. function ReportEventW(hEventLog: THandle; wType, wCategory: Word;
  2825.   dwEventID: DWORD; lpUserSid: Pointer; wNumStrings: Word;
  2826.   dwDataSize: DWORD; var lpStrings: PWideChar; lpRawData: Pointer): BOOL; stdcall;
  2827. function ReportEvent(hEventLog: THandle; wType, wCategory: Word;
  2828.   dwEventID: DWORD; lpUserSid: Pointer; wNumStrings: Word;
  2829.   dwDataSize: DWORD; var lpStrings: PChar; lpRawData: Pointer): BOOL; stdcall;
  2830.  
  2831. { Security APIs }
  2832.  
  2833. function DuplicateToken(ExistingTokenHandle: THandle;
  2834.   ImpersonationLevel: TSecurityImpersonationLevel; DuplicateTokenHandle: PHandle): BOOL; stdcall;
  2835. function GetKernelObjectSecurity(Handle: THandle; RequestedInformation: SECURITY_INFORMATION;
  2836.   pSecurityDescriptor: PSecurityDescriptor; nLength: DWORD;
  2837.   var lpnLengthNeeded: DWORD): BOOL; stdcall;
  2838. function ImpersonateNamedPipeClient(hNamedPipe: THandle): BOOL; stdcall;
  2839. function ImpersonateSelf(ImpersonationLevel: TSecurityImpersonationLevel): BOOL; stdcall;
  2840. function RevertToSelf: BOOL; stdcall;
  2841. function SetThreadToken(Thread: PHandle; Token: THandle): BOOL; stdcall;
  2842. function AccessCheck(pSecurityDescriptor: PSecurityDescriptor;
  2843.   ClientToken: THandle; DesiredAccess: DWORD; const GenericMapping: TGenericMapping;
  2844.   var PrivilegeSet: TPrivilegeSet; var PrivilegeSetLength: DWORD;
  2845.   var GrantedAccess: DWORD; var AccessStatus: BOOL): BOOL; stdcall;
  2846. function OpenProcessToken(ProcessHandle: THandle; DesiredAccess: DWORD;
  2847.   TokenHandle: PHandle): BOOL; stdcall;
  2848. function OpenThreadToken(ThreadHandle: THandle; DesiredAccess: DWORD;
  2849.   OpenAsSelf: BOOL; TokenHandle: PHandle): BOOL; stdcall;
  2850. function GetTokenInformation(TokenHandle: THandle;
  2851.   TokenInformationClass: TOKEN_INFORMATION_CLASS; TokenInformation: Pointer;
  2852.   TokenInformationLength: DWORD; var ReturnLength: DWORD): BOOL; stdcall;
  2853. function SetTokenInformation(TokenHandle: THandle;
  2854.   TokenInformationClass: TOKEN_INFORMATION_CLASS; TokenInformation: Pointer;
  2855.   TokenInformationLength: DWORD): BOOL; stdcall;
  2856. function AdjustTokenPrivileges(TokenHandle: THandle; DisableAllPrivileges: BOOL;
  2857.   const NewState: TTokenPrivileges; BufferLength: DWORD;
  2858.   var PreviousState: TTokenPrivileges; var ReturnLength: DWORD): BOOL; stdcall;
  2859. function AdjustTokenGroups(TokenHandle: THandle; ResetToDefault: BOOL;
  2860.   const NewState: TTokenGroups; BufferLength: DWORD;
  2861.   var PreviousState: TTokenGroups; var ReturnLength: DWORD): BOOL; stdcall;
  2862. function PrivilegeCheck(ClientToken: THandle; const RequiredPrivileges: TPrivilegeSet;
  2863.   var pfResult: BOOL): BOOL; stdcall;
  2864. function AccessCheckAndAuditAlarmA(SubsystemName: PAnsiChar;
  2865.   HandleId: Pointer; ObjectTypeName, ObjectName: PAnsiChar;
  2866.   SecurityDescriptor: PSecurityDescriptor; DesiredAccess: DWORD;
  2867.   const GenericMapping: TGenericMapping;  ObjectCreation: BOOL;
  2868.   var GrantedAccess: DWORD; var AccessStatus, pfGenerateOnClose: BOOL): BOOL; stdcall;
  2869. function AccessCheckAndAuditAlarmW(SubsystemName: PWideChar;
  2870.   HandleId: Pointer; ObjectTypeName, ObjectName: PWideChar;
  2871.   SecurityDescriptor: PSecurityDescriptor; DesiredAccess: DWORD;
  2872.   const GenericMapping: TGenericMapping;  ObjectCreation: BOOL;
  2873.   var GrantedAccess: DWORD; var AccessStatus, pfGenerateOnClose: BOOL): BOOL; stdcall;
  2874. function AccessCheckAndAuditAlarm(SubsystemName: PChar;
  2875.   HandleId: Pointer; ObjectTypeName, ObjectName: PChar;
  2876.   SecurityDescriptor: PSecurityDescriptor; DesiredAccess: DWORD;
  2877.   const GenericMapping: TGenericMapping;  ObjectCreation: BOOL;
  2878.   var GrantedAccess: DWORD; var AccessStatus, pfGenerateOnClose: BOOL): BOOL; stdcall;
  2879. function ObjectOpenAuditAlarmA(SubsystemName: PAnsiChar; HandleId: Pointer;
  2880.   ObjectTypeName: PAnsiChar; ObjectName: PAnsiChar; pSecurityDescriptor: PSecurityDescriptor;
  2881.   ClientToken: THandle; DesiredAccess, GrantedAccess: DWORD;
  2882.   var Privileges: TPrivilegeSet; ObjectCreation, AccessGranted: BOOL;
  2883.   var GenerateOnClose: BOOL): BOOL; stdcall;
  2884. function ObjectOpenAuditAlarmW(SubsystemName: PWideChar; HandleId: Pointer;
  2885.   ObjectTypeName: PWideChar; ObjectName: PWideChar; pSecurityDescriptor: PSecurityDescriptor;
  2886.   ClientToken: THandle; DesiredAccess, GrantedAccess: DWORD;
  2887.   var Privileges: TPrivilegeSet; ObjectCreation, AccessGranted: BOOL;
  2888.   var GenerateOnClose: BOOL): BOOL; stdcall;
  2889. function ObjectOpenAuditAlarm(SubsystemName: PChar; HandleId: Pointer;
  2890.   ObjectTypeName: PChar; ObjectName: PChar; pSecurityDescriptor: PSecurityDescriptor;
  2891.   ClientToken: THandle; DesiredAccess, GrantedAccess: DWORD;
  2892.   var Privileges: TPrivilegeSet; ObjectCreation, AccessGranted: BOOL;
  2893.   var GenerateOnClose: BOOL): BOOL; stdcall;
  2894. function ObjectPrivilegeAuditAlarmA(SubsystemName: PAnsiChar;
  2895.   HandleId: Pointer; ClientToken: THandle; DesiredAccess: DWORD;
  2896.   var Privileges: TPrivilegeSet; AccessGranted: BOOL): BOOL; stdcall;
  2897. function ObjectPrivilegeAuditAlarmW(SubsystemName: PWideChar;
  2898.   HandleId: Pointer; ClientToken: THandle; DesiredAccess: DWORD;
  2899.   var Privileges: TPrivilegeSet; AccessGranted: BOOL): BOOL; stdcall;
  2900. function ObjectPrivilegeAuditAlarm(SubsystemName: PChar;
  2901.   HandleId: Pointer; ClientToken: THandle; DesiredAccess: DWORD;
  2902.   var Privileges: TPrivilegeSet; AccessGranted: BOOL): BOOL; stdcall;
  2903. function ObjectCloseAuditAlarmA(SubsystemName: PAnsiChar;
  2904.   HandleId: Pointer; GenerateOnClose: BOOL): BOOL; stdcall;
  2905. function ObjectCloseAuditAlarmW(SubsystemName: PWideChar;
  2906.   HandleId: Pointer; GenerateOnClose: BOOL): BOOL; stdcall;
  2907. function ObjectCloseAuditAlarm(SubsystemName: PChar;
  2908.   HandleId: Pointer; GenerateOnClose: BOOL): BOOL; stdcall;
  2909. function PrivilegedServiceAuditAlarmA(SubsystemName, ServiceName: PAnsiChar;
  2910.   ClientToken: THandle; var Privileges: TPrivilegeSet; AccessGranted: BOOL): BOOL; stdcall;
  2911. function PrivilegedServiceAuditAlarmW(SubsystemName, ServiceName: PWideChar;
  2912.   ClientToken: THandle; var Privileges: TPrivilegeSet; AccessGranted: BOOL): BOOL; stdcall;
  2913. function PrivilegedServiceAuditAlarm(SubsystemName, ServiceName: PChar;
  2914.   ClientToken: THandle; var Privileges: TPrivilegeSet; AccessGranted: BOOL): BOOL; stdcall;
  2915. function IsValidSid(pSid: Pointer): BOOL; stdcall;
  2916. function EqualSid(pSid1, pSid2: Pointer): BOOL; stdcall;
  2917. function EqualPrefixSid(pSid1, pSid2: Pointer): BOOL; stdcall;
  2918. function GetSidLengthRequired(nSubAuthorityCount: UCHAR): DWORD; stdcall;
  2919. function AllocateAndInitializeSid(const pIdentifierAuthority: TSIDIdentifierAuthority;
  2920.   nSubAuthorityCount: Byte; nSubAuthority0, nSubAuthority1: DWORD;
  2921.   nSubAuthority2, nSubAuthority3, nSubAuthority4: DWORD;
  2922.   nSubAuthority5, nSubAuthority6, nSubAuthority7: DWORD;
  2923.   var pSid: Pointer): BOOL; stdcall;
  2924. function FreeSid(pSid: Pointer): Pointer; stdcall;
  2925. function InitializeSid(Sid: Pointer; const pIdentifierAuthority: TSIDIdentifierAuthority;
  2926.   nSubAuthorityCount: Byte): BOOL; stdcall;
  2927. function GetSidIdentifierAuthority(pSid: Pointer): PSIDIdentifierAuthority; stdcall;
  2928. function GetSidSubAuthority(pSid: Pointer; nSubAuthority: DWORD): PDWORD; stdcall;
  2929. function GetSidSubAuthorityCount(pSid: Pointer): PUCHAR; stdcall;
  2930. function GetLengthSid(pSid: Pointer): DWORD; stdcall;
  2931. function CopySid(nDestinationSidLength: DWORD;
  2932.   pDestinationSid, pSourceSid: Pointer): BOOL; stdcall;
  2933. function AreAllAccessesGranted(GrantedAccess, DesiredAccess: DWORD): BOOL; stdcall;
  2934. function AreAnyAccessesGranted(GrantedAccess, DesiredAccess: DWORD): BOOL; stdcall;
  2935. procedure MapGenericMask(var AccessMask: DWORD; const GenericMapping: TGenericMapping); stdcall;
  2936. function IsValidAcl(const pAcl: TACL): BOOL; stdcall;
  2937. function InitializeAcl(var pAcl: TACL; nAclLength, dwAclRevision: DWORD): BOOL; stdcall;
  2938. function GetAclInformation(const pAcl: TACL; pAclInformation: Pointer;
  2939.   nAclInformationLength: DWORD; dwAclInformationClass: ACL_INFORMATION_CLASS): BOOL; stdcall;
  2940. function SetAclInformation(var pAcl: TACL; pAclInformation: Pointer;
  2941.   nAclInformationLength: DWORD; dwAclInformationClass: ACL_INFORMATION_CLASS): BOOL; stdcall;
  2942. function AddAce(var pAcl: TACL; dwAceRevision, dwStartingAceIndex: DWORD; pAceList: Pointer;
  2943.   nAceListLength: DWORD): BOOL; stdcall;
  2944. function DeleteAce(var pAcl: TACL; dwAceIndex: DWORD): BOOL; stdcall;
  2945. function GetAce(const pAcl: TACL; dwAceIndex: DWORD; var pAce: Pointer): BOOL; stdcall;
  2946. function AddAccessAllowedAce(var pAcl: TACL; dwAceRevision: DWORD;
  2947.   AccessMask: DWORD; pSid: PSID): BOOL; stdcall;
  2948. function AddAccessDeniedAce(var pAcl: TACL; dwAceRevision: DWORD;
  2949.   AccessMask: DWORD; pSid: PSID): BOOL; stdcall;
  2950. function AddAuditAccessAce(var pAcl: TACL; dwAceRevision: DWORD;
  2951.   dwAccessMask: DWORD; pSid: Pointer; bAuditSuccess, bAuditFailure: BOOL): BOOL; stdcall;
  2952. function FindFirstFreeAce(var pAcl: TACL; var pAce: Pointer): BOOL; stdcall;
  2953. function InitializeSecurityDescriptor(pSecurityDescriptor: PSecurityDescriptor;
  2954.   dwRevision: DWORD): BOOL; stdcall;
  2955. function IsValidSecurityDescriptor(pSecurityDescriptor: PSecurityDescriptor): BOOL; stdcall;
  2956. function GetSecurityDescriptorLength(pSecurityDescriptor: PSecurityDescriptor): DWORD; stdcall;
  2957. function GetSecurityDescriptorControl(pSecurityDescriptor: PSecurityDescriptor;
  2958.   var pControl: SECURITY_DESCRIPTOR_CONTROL; var lpdwRevision: DWORD): BOOL; stdcall;
  2959. function SetSecurityDescriptorDacl(pSecurityDescriptor: PSecurityDescriptor;
  2960.   bDaclPresent: BOOL; pDacl: PACL; bDaclDefaulted: BOOL): BOOL; stdcall;
  2961. function GetSecurityDescriptorDacl(pSecurityDescriptor: PSecurityDescriptor;
  2962.   var lpbDaclPresent: BOOL; var pDacl: PACL; var lpbDaclDefaulted: BOOL): BOOL; stdcall;
  2963. function SetSecurityDescriptorSacl(pSecurityDescriptor: PSecurityDescriptor;
  2964.   bSaclPresent: BOOL; pSacl: PACL; bSaclDefaulted: BOOL): BOOL; stdcall;
  2965. function GetSecurityDescriptorSacl(pSecurityDescriptor: PSecurityDescriptor;
  2966.   var lpbSaclPresent: BOOL; var pSacl: PACL; var lpbSaclDefaulted: BOOL): BOOL; stdcall;
  2967. function SetSecurityDescriptorOwner(pSecurityDescriptor: PSecurityDescriptor;
  2968.   pOwner: PSID; bOwnerDefaulted: BOOL): BOOL; stdcall;
  2969. function GetSecurityDescriptorOwner(pSecurityDescriptor: PSecurityDescriptor;
  2970.   var pOwner: PSID; var lpbOwnerDefaulted: BOOL): BOOL; stdcall;
  2971. function SetSecurityDescriptorGroup(pSecurityDescriptor: PSecurityDescriptor;
  2972.   pGroup: PSID; bGroupDefaulted: BOOL): BOOL; stdcall;
  2973. function GetSecurityDescriptorGroup(pSecurityDescriptor: PSecurityDescriptor;
  2974.   var pGroup: PSID; var lpbGroupDefaulted: BOOL): BOOL; stdcall;
  2975. function CreatePrivateObjectSecurity(ParentDescriptor, CreatorDescriptor: PSecurityDescriptor;
  2976.   var NewDescriptor: PSecurityDescriptor; IsDirectoryObject: BOOL;
  2977.   Token: THandle; const GenericMapping: TGenericMapping): BOOL; stdcall;
  2978. function SetPrivateObjectSecurity(SecurityInformation: SECURITY_INFORMATION;
  2979.   ModificationDescriptor: PSecurityDescriptor; var ObjectsSecurityDescriptor: PSecurityDescriptor;
  2980.   const GenericMapping: TGenericMapping; Token: THandle): BOOL; stdcall;
  2981. function GetPrivateObjectSecurity(ObjectDescriptor: PSecurityDescriptor;
  2982.   SecurityInformation: SECURITY_INFORMATION; ResultantDescriptor: PSecurityDescriptor;
  2983.   DescriptorLength: DWORD; var ReturnLength: DWORD): BOOL; stdcall;
  2984. function DestroyPrivateObjectSecurity(var ObjectDescriptor: PSecurityDescriptor): BOOL; stdcall;
  2985. function MakeSelfRelativeSD(pAbsoluteSecurityDescriptor: PSecurityDescriptor;
  2986.   pSelfRelativeSecurityDescriptor: PSecurityDescriptor; var lpdwBufferLength: DWORD): BOOL; stdcall;
  2987. function MakeAbsoluteSD(pSelfRelativeSecurityDescriptor: PSecurityDescriptor;
  2988.   pAbsoluteSecurityDescriptor: PSecurityDescriptor; var lpdwAbsoluteSecurityDescriptorSi: DWORD;
  2989.   var pDacl: TACL; var lpdwDaclSize: DWORD; var pSacl: TACL;
  2990.   var lpdwSaclSize: DWORD; pOwner: PSID; var lpdwOwnerSize: DWORD;
  2991.   pPrimaryGroup: Pointer; var lpdwPrimaryGroupSize: DWORD): BOOL; stdcall;
  2992.  
  2993. function SetFileSecurityA(lpFileName: PAnsiChar; SecurityInformation: SECURITY_INFORMATION;
  2994.   pSecurityDescriptor: PSecurityDescriptor): BOOL; stdcall;
  2995. function SetFileSecurityW(lpFileName: PWideChar; SecurityInformation: SECURITY_INFORMATION;
  2996.   pSecurityDescriptor: PSecurityDescriptor): BOOL; stdcall;
  2997. function SetFileSecurity(lpFileName: PChar; SecurityInformation: SECURITY_INFORMATION;
  2998.   pSecurityDescriptor: PSecurityDescriptor): BOOL; stdcall;
  2999. function GetFileSecurityA(lpFileName: PAnsiChar; RequestedInformation: SECURITY_INFORMATION;
  3000.   pSecurityDescriptor: PSecurityDescriptor; nLength: DWORD; var lpnLengthNeeded: DWORD): BOOL; stdcall;
  3001. function GetFileSecurityW(lpFileName: PWideChar; RequestedInformation: SECURITY_INFORMATION;
  3002.   pSecurityDescriptor: PSecurityDescriptor; nLength: DWORD; var lpnLengthNeeded: DWORD): BOOL; stdcall;
  3003. function GetFileSecurity(lpFileName: PChar; RequestedInformation: SECURITY_INFORMATION;
  3004.   pSecurityDescriptor: PSecurityDescriptor; nLength: DWORD; var lpnLengthNeeded: DWORD): BOOL; stdcall;
  3005. function SetKernelObjectSecurity(Handle: THandle; SecurityInformation: SECURITY_INFORMATION;
  3006.   SecurityDescriptor: PSecurityDescriptor): BOOL; stdcall;
  3007. function FindFirstChangeNotificationA(lpPathName: PAnsiChar;
  3008.   bWatchSubtree: BOOL; dwNotifyFilter: DWORD): THandle; stdcall;
  3009. function FindFirstChangeNotificationW(lpPathName: PWideChar;
  3010.   bWatchSubtree: BOOL; dwNotifyFilter: DWORD): THandle; stdcall;
  3011. function FindFirstChangeNotification(lpPathName: PChar;
  3012.   bWatchSubtree: BOOL; dwNotifyFilter: DWORD): THandle; stdcall;
  3013. function FindNextChangeNotification(hChangeHandle: THandle): BOOL; stdcall;
  3014. function FindCloseChangeNotification(hChangeHandle: THandle): BOOL; stdcall;
  3015. function VirtualLock(lpAddress: Pointer; dwSize: DWORD): BOOL; stdcall;
  3016. function VirtualUnlock(lpAddress: Pointer; dwSize: DWORD): BOOL; stdcall;
  3017. function MapViewOfFileEx(hFileMappingObject: THandle;
  3018.   dwDesiredAccess, dwFileOffsetHigh, dwFileOffsetLow, dwNumberOfBytesToMap: DWORD;
  3019.   lpBaseAddress: Pointer): Pointer; stdcall;
  3020. function SetPriorityClass(hProcess: THandle; dwPriorityClass: DWORD): BOOL; stdcall;
  3021. function GetPriorityClass(hProcess: THandle): DWORD; stdcall;
  3022. function IsBadReadPtr(lp: Pointer; ucb: UINT): BOOL; stdcall;
  3023. function IsBadWritePtr(lp: Pointer; ucb: UINT): BOOL; stdcall;
  3024. function IsBadHugeReadPtr(lp: Pointer; ucb: UINT): BOOL; stdcall;
  3025. function IsBadHugeWritePtr(lp: Pointer; ucb: UINT): BOOL; stdcall;
  3026. function IsBadCodePtr(lpfn: FARPROC): BOOL; stdcall;
  3027. function IsBadStringPtrA(lpsz: PAnsiChar; ucchMax: UINT): BOOL; stdcall;
  3028. function IsBadStringPtrW(lpsz: PWideChar; ucchMax: UINT): BOOL; stdcall;
  3029. function IsBadStringPtr(lpsz: PChar; ucchMax: UINT): BOOL; stdcall;
  3030. function LookupAccountSidA(lpSystemName: PAnsiChar; Sid: PSID;
  3031.   Name: PAnsiChar; var cbName: DWORD; ReferencedDomainName: PAnsiChar;
  3032.   var cbReferencedDomainName: DWORD; var peUse: SID_NAME_USE): BOOL; stdcall;
  3033. function LookupAccountSidW(lpSystemName: PWideChar; Sid: PSID;
  3034.   Name: PWideChar; var cbName: DWORD; ReferencedDomainName: PWideChar;
  3035.   var cbReferencedDomainName: DWORD; var peUse: SID_NAME_USE): BOOL; stdcall;
  3036. function LookupAccountSid(lpSystemName: PChar; Sid: PSID;
  3037.   Name: PChar; var cbName: DWORD; ReferencedDomainName: PChar;
  3038.   var cbReferencedDomainName: DWORD; var peUse: SID_NAME_USE): BOOL; stdcall;
  3039. function LookupAccountNameA(lpSystemName, lpAccountName: PAnsiChar;
  3040.   Sid: PSID; var cbSid: DWORD; ReferencedDomainName: PAnsiChar;
  3041.   var cbReferencedDomainName: DWORD; var peUse: SID_NAME_USE): BOOL; stdcall;
  3042. function LookupAccountNameW(lpSystemName, lpAccountName: PWideChar;
  3043.   Sid: PSID; var cbSid: DWORD; ReferencedDomainName: PWideChar;
  3044.   var cbReferencedDomainName: DWORD; var peUse: SID_NAME_USE): BOOL; stdcall;
  3045. function LookupAccountName(lpSystemName, lpAccountName: PChar;
  3046.   Sid: PSID; var cbSid: DWORD; ReferencedDomainName: PChar;
  3047.   var cbReferencedDomainName: DWORD; var peUse: SID_NAME_USE): BOOL; stdcall;
  3048. function LookupPrivilegeValueA(lpSystemName, lpName: PAnsiChar;
  3049.   var lpLuid: TLargeInteger): BOOL; stdcall;
  3050. function LookupPrivilegeValueW(lpSystemName, lpName: PWideChar;
  3051.   var lpLuid: TLargeInteger): BOOL; stdcall;
  3052. function LookupPrivilegeValue(lpSystemName, lpName: PChar;
  3053.   var lpLuid: TLargeInteger): BOOL; stdcall;
  3054. function LookupPrivilegeNameA(lpSystemName: PAnsiChar;
  3055.   var lpLuid: TLargeInteger; lpName: PAnsiChar; var cbName: DWORD): BOOL; stdcall;
  3056. function LookupPrivilegeNameW(lpSystemName: PWideChar;
  3057.   var lpLuid: TLargeInteger; lpName: PWideChar; var cbName: DWORD): BOOL; stdcall;
  3058. function LookupPrivilegeName(lpSystemName: PChar;
  3059.   var lpLuid: TLargeInteger; lpName: PChar; var cbName: DWORD): BOOL; stdcall;
  3060. function LookupPrivilegeDisplayNameA(lpSystemName, lpName: PAnsiChar;
  3061.   lpDisplayName: PAnsiChar; var cbDisplayName, lpLanguageId: DWORD): BOOL; stdcall;
  3062. function LookupPrivilegeDisplayNameW(lpSystemName, lpName: PAnsiChar;
  3063.   lpDisplayName: PWideChar; var cbDisplayName, lpLanguageId: DWORD): BOOL; stdcall;
  3064. function LookupPrivilegeDisplayName(lpSystemName, lpName: PAnsiChar;
  3065.   lpDisplayName: PChar; var cbDisplayName, lpLanguageId: DWORD): BOOL; stdcall;
  3066. function AllocateLocallyUniqueId(var Luid: TLargeInteger): BOOL; stdcall;
  3067. function BuildCommDCBA(lpDef: PAnsiChar; var lpDCB: TDCB): BOOL; stdcall;
  3068. function BuildCommDCBW(lpDef: PWideChar; var lpDCB: TDCB): BOOL; stdcall;
  3069. function BuildCommDCB(lpDef: PChar; var lpDCB: TDCB): BOOL; stdcall;
  3070. function BuildCommDCBAndTimeoutsA(lpDef: PAnsiChar; var lpDCB: TDCB;
  3071.   var lpCommTimeouts: TCommTimeouts): BOOL; stdcall;
  3072. function BuildCommDCBAndTimeoutsW(lpDef: PWideChar; var lpDCB: TDCB;
  3073.   var lpCommTimeouts: TCommTimeouts): BOOL; stdcall;
  3074. function BuildCommDCBAndTimeouts(lpDef: PChar; var lpDCB: TDCB;
  3075.   var lpCommTimeouts: TCommTimeouts): BOOL; stdcall;
  3076. function CommConfigDialogA(lpszName: PAnsiChar; hWnd: HWND; var lpCC: TCommConfig): BOOL; stdcall;
  3077. function CommConfigDialogW(lpszName: PWideChar; hWnd: HWND; var lpCC: TCommConfig): BOOL; stdcall;
  3078. function CommConfigDialog(lpszName: PChar; hWnd: HWND; var lpCC: TCommConfig): BOOL; stdcall;
  3079. function GetDefaultCommConfigA(lpszName: PAnsiChar;
  3080.   var lpCC: TCommConfig; var lpdwSize: DWORD): BOOL; stdcall;
  3081. function GetDefaultCommConfigW(lpszName: PWideChar;
  3082.   var lpCC: TCommConfig; var lpdwSize: DWORD): BOOL; stdcall;
  3083. function GetDefaultCommConfig(lpszName: PChar;
  3084.   var lpCC: TCommConfig; var lpdwSize: DWORD): BOOL; stdcall;
  3085. function SetDefaultCommConfigA(lpszName: PAnsiChar; lpCC: PCommConfig; dwSize: DWORD): BOOL; stdcall;
  3086. function SetDefaultCommConfigW(lpszName: PWideChar; lpCC: PCommConfig; dwSize: DWORD): BOOL; stdcall;
  3087. function SetDefaultCommConfig(lpszName: PChar; lpCC: PCommConfig; dwSize: DWORD): BOOL; stdcall;
  3088.  
  3089. const
  3090.   MAX_COMPUTERNAME_LENGTH = 15;
  3091.  
  3092. function GetComputerNameA(lpBuffer: PAnsiChar; var nSize: DWORD): BOOL; stdcall;
  3093. function GetComputerNameW(lpBuffer: PWideChar; var nSize: DWORD): BOOL; stdcall;
  3094. function GetComputerName(lpBuffer: PChar; var nSize: DWORD): BOOL; stdcall;
  3095. function SetComputerNameA(lpComputerName: PAnsiChar): BOOL; stdcall;
  3096. function SetComputerNameW(lpComputerName: PWideChar): BOOL; stdcall;
  3097. function SetComputerName(lpComputerName: PChar): BOOL; stdcall;
  3098. function GetUserNameA(lpBuffer: PAnsiChar; var nSize: DWORD): BOOL; stdcall;
  3099. function GetUserNameW(lpBuffer: PWideChar; var nSize: DWORD): BOOL; stdcall;
  3100. function GetUserName(lpBuffer: PChar; var nSize: DWORD): BOOL; stdcall;
  3101.  
  3102. { Logon Support APIs }
  3103.  
  3104. const
  3105.   LOGON32_LOGON_INTERACTIVE = 2;
  3106.   LOGON32_LOGON_BATCH = 4;
  3107.   LOGON32_LOGON_SERVICE = 5;
  3108.  
  3109.   LOGON32_PROVIDER_DEFAULT = 0;
  3110.   LOGON32_PROVIDER_WINNT35 = 1;
  3111.  
  3112. function LogonUserA(lpszUsername, lpszDomain, lpszPassword: PAnsiChar;
  3113.   dwLogonType, dwLogonProvider: DWORD; var phToken: THandle): BOOL; stdcall;
  3114. function LogonUserW(lpszUsername, lpszDomain, lpszPassword: PWideChar;
  3115.   dwLogonType, dwLogonProvider: DWORD; var phToken: THandle): BOOL; stdcall;
  3116. function LogonUser(lpszUsername, lpszDomain, lpszPassword: PChar;
  3117.   dwLogonType, dwLogonProvider: DWORD; var phToken: THandle): BOOL; stdcall;
  3118. function ImpersonateLoggedOnUser(hToken: THandle): BOOL; stdcall;
  3119. function CreateProcessAsUserA(hToken: THandle; lpApplicationName: PAnsiChar;
  3120.   lpCommandLine: PAnsiChar; lpProcessAttributes: PSecurityAttributes;
  3121.   lpThreadAttributes: PSecurityAttributes; bInheritHandles: BOOL;
  3122.   dwCreationFlags: DWORD; lpEnvironment: Pointer; lpCurrentDirectory: PAnsiChar;
  3123.   const lpStartupInfo: TStartupInfo; var lpProcessInformation: TProcessInformation): BOOL; stdcall;
  3124. function CreateProcessAsUserW(hToken: THandle; lpApplicationName: PWideChar;
  3125.   lpCommandLine: PWideChar; lpProcessAttributes: PSecurityAttributes;
  3126.   lpThreadAttributes: PSecurityAttributes; bInheritHandles: BOOL;
  3127.   dwCreationFlags: DWORD; lpEnvironment: Pointer; lpCurrentDirectory: PWideChar;
  3128.   const lpStartupInfo: TStartupInfo; var lpProcessInformation: TProcessInformation): BOOL; stdcall;
  3129. function CreateProcessAsUser(hToken: THandle; lpApplicationName: PChar;
  3130.   lpCommandLine: PChar; lpProcessAttributes: PSecurityAttributes;
  3131.   lpThreadAttributes: PSecurityAttributes; bInheritHandles: BOOL;
  3132.   dwCreationFlags: DWORD; lpEnvironment: Pointer; lpCurrentDirectory: PChar;
  3133.   const lpStartupInfo: TStartupInfo; var lpProcessInformation: TProcessInformation): BOOL; stdcall;
  3134.  
  3135. { Performance counter API's }
  3136.  
  3137. function QueryPerformanceCounter(var lpPerformanceCount: TLargeInteger): BOOL; stdcall;
  3138. function QueryPerformanceFrequency(var lpFrequency: TLargeInteger): BOOL; stdcall;
  3139.  
  3140. type
  3141.   POSVersionInfoA = ^TOSVersionInfoA;
  3142.   POSVersionInfoW = ^TOSVersionInfoW;
  3143.   POSVersionInfo = POSVersionInfoA;
  3144.   TOSVersionInfoA = record
  3145.     dwOSVersionInfoSize: DWORD;
  3146.     dwMajorVersion: DWORD;
  3147.     dwMinorVersion: DWORD;
  3148.     dwBuildNumber: DWORD;
  3149.     dwPlatformId: DWORD;
  3150.     szCSDVersion: array[0..127] of AnsiChar; { Maintenance string for PSS usage }
  3151.   end;
  3152.   TOSVersionInfoW = record
  3153.     dwOSVersionInfoSize: DWORD;
  3154.     dwMajorVersion: DWORD;
  3155.     dwMinorVersion: DWORD;
  3156.     dwBuildNumber: DWORD;
  3157.     dwPlatformId: DWORD;
  3158.     szCSDVersion: array[0..127] of WideChar; { Maintenance string for PSS usage }
  3159.   end;
  3160.   TOSVersionInfo = TOSVersionInfoA;
  3161.  
  3162. { dwPlatformId defines }
  3163. const
  3164.   VER_PLATFORM_WIN32s = 0;
  3165.   VER_PLATFORM_WIN32_WINDOWS = 1;
  3166.   VER_PLATFORM_WIN32_NT = 2;
  3167.  
  3168. function GetVersionExA(var lpVersionInformation: TOSVersionInfo): BOOL; stdcall;
  3169. function GetVersionExW(var lpVersionInformation: TOSVersionInfo): BOOL; stdcall;
  3170. function GetVersionEx(var lpVersionInformation: TOSVersionInfo): BOOL; stdcall;
  3171.  
  3172. { DOS and OS/2 Compatible Error Code definitions returned by the Win32 Base
  3173.   API functions. }
  3174.  
  3175.  
  3176. { Translated from WINERROR.H }
  3177. { Error code definitions for the Win32 API functions }
  3178.  
  3179. (*
  3180.   Values are 32 bit values layed out as follows:
  3181.    3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
  3182.    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
  3183.   +---+-+-+-----------------------+-------------------------------+
  3184.   |Sev|C|R|     Facility          |               Code            |
  3185.   +---+-+-+-----------------------+-------------------------------+
  3186.  
  3187.   where
  3188.       Sev - is the severity code
  3189.           00 - Success
  3190.           01 - Informational
  3191.           10 - Warning
  3192.           11 - Error
  3193.  
  3194.       C - is the Customer code flag
  3195.       R - is a reserved bit
  3196.       Facility - is the facility code
  3197.       Code - is the facility's status code
  3198. *)
  3199.  
  3200. { Define the facility codes }
  3201.  
  3202. const
  3203.   FACILITY_WINDOWS = 8;
  3204.   FACILITY_STORAGE = 3;
  3205.   FACILITY_RPC = 1;
  3206.   FACILITY_WIN32 = 7;
  3207.   FACILITY_CONTROL = 10;
  3208.   FACILITY_NULL = 0;
  3209.   FACILITY_ITF = 4;
  3210.   FACILITY_DISPATCH = 2;
  3211.  
  3212.  
  3213. { Define the severity codes }
  3214.  
  3215.   { The operation completed successfully. }
  3216.   ERROR_SUCCESS = 0;
  3217.   NO_ERROR = 0;   { dderror }
  3218.  
  3219.   { Incorrect function. }
  3220.   ERROR_INVALID_FUNCTION = 1;   { dderror }
  3221.  
  3222.   { The system cannot find the file specified. }
  3223.   ERROR_FILE_NOT_FOUND = 2;
  3224.  
  3225.   { The system cannot find the path specified. }
  3226.   ERROR_PATH_NOT_FOUND = 3;
  3227.  
  3228.   { The system cannot open the file. }
  3229.   ERROR_TOO_MANY_OPEN_FILES = 4;
  3230.  
  3231.   { Access is denied. }
  3232.   ERROR_ACCESS_DENIED = 5;
  3233.  
  3234.   { The handle is invalid. }
  3235.   ERROR_INVALID_HANDLE = 6;
  3236.  
  3237.   { The storage control blocks were destroyed. }
  3238.   ERROR_ARENA_TRASHED = 7;
  3239.  
  3240.   { Not enough storage is available to process this command. }
  3241.   ERROR_NOT_ENOUGH_MEMORY = 8;   { dderror }
  3242.  
  3243.   { The storage control block address is invalid. }
  3244.   ERROR_INVALID_BLOCK = 9;
  3245.  
  3246.   { The environment is incorrect. }
  3247.   ERROR_BAD_ENVIRONMENT = 10;
  3248.  
  3249.   { An attempt was made to load a program with an incorrect format. }
  3250.   ERROR_BAD_FORMAT = 11;
  3251.  
  3252.   { The access code is invalid. }
  3253.   ERROR_INVALID_ACCESS = 12;
  3254.  
  3255.   { The data is invalid. }
  3256.   ERROR_INVALID_DATA = 13;
  3257.  
  3258.   { Not enough storage is available to complete this operation. }
  3259.   ERROR_OUTOFMEMORY = 14;
  3260.  
  3261.   { The system cannot find the drive specified. }
  3262.   ERROR_INVALID_DRIVE = 15;
  3263.  
  3264.   { The directory cannot be removed. }
  3265.   ERROR_CURRENT_DIRECTORY = $10;
  3266.  
  3267.   { The system cannot move the file }
  3268.   { to a different disk drive. }
  3269.   ERROR_NOT_SAME_DEVICE = 17;
  3270.  
  3271.   { There are no more files. }
  3272.   ERROR_NO_MORE_FILES = 18;
  3273.  
  3274.   { The media is write protected. }
  3275.   ERROR_WRITE_PROTECT = 19;
  3276.  
  3277.   { The system cannot find the device specified. }
  3278.   ERROR_BAD_UNIT = 20;
  3279.  
  3280.   { The device is not ready. }
  3281.   ERROR_NOT_READY = 21;
  3282.  
  3283.   { The device does not recognize the command. }
  3284.   ERROR_BAD_COMMAND = 22;
  3285.  
  3286.   { Data error (cyclic redundancy check) }
  3287.   ERROR_CRC = 23;
  3288.  
  3289.   { The program issued a command but the command length is incorrect. }
  3290.   ERROR_BAD_LENGTH = 24;
  3291.  
  3292.   { The drive cannot locate a specific area or track on the disk. }
  3293.   ERROR_SEEK = 25;
  3294.  
  3295.   { The specified disk or diskette cannot be accessed. }
  3296.   ERROR_NOT_DOS_DISK = 26;
  3297.  
  3298.   { The drive cannot find the sector requested. }
  3299.   ERROR_SECTOR_NOT_FOUND = 27;
  3300.  
  3301.   { The printer is out of paper. }
  3302.   ERROR_OUT_OF_PAPER = 28;
  3303.  
  3304.   { The system cannot write to the specified device. }
  3305.   ERROR_WRITE_FAULT = 29;
  3306.  
  3307.   { The system cannot read from the specified device. }
  3308.   ERROR_READ_FAULT = 30;
  3309.  
  3310.   { A device attached to the system is not functioning. }
  3311.   ERROR_GEN_FAILURE = 31;
  3312.  
  3313.   { The process cannot access the file because it is being used by another process. }
  3314.   ERROR_SHARING_VIOLATION = $20;
  3315.  
  3316.   { The process cannot access the file because }
  3317.   { another process has locked a portion of the file. }
  3318.   ERROR_LOCK_VIOLATION = 33;
  3319.  
  3320.   { The wrong diskette is in the drive. Insert %2 (Volume Serial Number: %3) }
  3321.   { into drive %1. }
  3322.   ERROR_WRONG_DISK = 34;
  3323.  
  3324.   { Too many files opened for sharing. }
  3325.   ERROR_SHARING_BUFFER_EXCEEDED = 36;
  3326.  
  3327.   { Reached end of file. }
  3328.   ERROR_HANDLE_EOF = 38;
  3329.  
  3330.   { The disk is full. }
  3331.   ERROR_HANDLE_DISK_FULL = 39;
  3332.  
  3333.   { The network request is not supported. }
  3334.   ERROR_NOT_SUPPORTED = 50;
  3335.  
  3336.   { The remote computer is not available. }
  3337.   ERROR_REM_NOT_LIST = 51;
  3338.  
  3339.   { A duplicate name exists on the network. }
  3340.   ERROR_DUP_NAME = 52;
  3341.  
  3342.   { The network path was not found. }
  3343.   ERROR_BAD_NETPATH = 53;
  3344.  
  3345.   { The network is busy. }
  3346.   ERROR_NETWORK_BUSY = 54;
  3347.  
  3348.   { The specified network resource or device is no longer }
  3349.   { available. }
  3350.   ERROR_DEV_NOT_EXIST = 55;   { dderror }
  3351.  
  3352.   { The network BIOS command limit has been reached. }
  3353.   ERROR_TOO_MANY_CMDS = 56;
  3354.  
  3355.   { A network adapter hardware error occurred. }
  3356.   ERROR_ADAP_HDW_ERR = 57;
  3357.  
  3358.   { The specified server cannot perform the requested }
  3359.   { operation. }
  3360.   ERROR_BAD_NET_RESP = 58;
  3361.  
  3362.   { An unexpected network error occurred. }
  3363.   ERROR_UNEXP_NET_ERR = 59;
  3364.  
  3365.   { The remote adapter is not compatible. }
  3366.   ERROR_BAD_REM_ADAP = 60;
  3367.  
  3368.   { The printer queue is full. }
  3369.   ERROR_PRINTQ_FULL = 61;
  3370.  
  3371.   { Space to store the file waiting to be printed is }
  3372.   { not available on the server. }
  3373.   ERROR_NO_SPOOL_SPACE = 62;
  3374.  
  3375.   { Your file waiting to be printed was deleted. }
  3376.   ERROR_PRINT_CANCELLED = 63;
  3377.  
  3378.   { The specified network name is no longer available. }
  3379.   ERROR_NETNAME_DELETED = $40;
  3380.  
  3381.   { Network access is denied. }
  3382.   ERROR_NETWORK_ACCESS_DENIED = 65;
  3383.  
  3384.   { The network resource type is not correct. }
  3385.   ERROR_BAD_DEV_TYPE = 66;
  3386.  
  3387.   { The network name cannot be found. }
  3388.   ERROR_BAD_NET_NAME = 67;
  3389.  
  3390.   { The name limit for the local computer network }
  3391.   { adapter card was exceeded. }
  3392.   ERROR_TOO_MANY_NAMES = 68;
  3393.  
  3394.   { The network BIOS session limit was exceeded. }
  3395.   ERROR_TOO_MANY_SESS = 69;
  3396.  
  3397.   { The remote server has been paused or is in the }
  3398.   { process of being started. }
  3399.   ERROR_SHARING_PAUSED = 70;
  3400.  
  3401.   { No more connections can be made to this remote computer at this time }
  3402.   { because there are already as many connections as the computer can accept. }
  3403.   ERROR_REQ_NOT_ACCEP = 71;
  3404.  
  3405.   { The specified printer or disk device has been paused. }
  3406.   ERROR_REDIR_PAUSED = 72;
  3407.  
  3408.   { The file exists. }
  3409.   ERROR_FILE_EXISTS = 80;
  3410.  
  3411.   { The directory or file cannot be created. }
  3412.   ERROR_CANNOT_MAKE = 82;
  3413.  
  3414.   { Fail on INT 24 }
  3415.   ERROR_FAIL_I24 = 83;
  3416.  
  3417.   { Storage to process this request is not available. }
  3418.   ERROR_OUT_OF_STRUCTURES = 84;
  3419.  
  3420.   { The local device name is already in use. }
  3421.   ERROR_ALREADY_ASSIGNED = 85;
  3422.  
  3423.   { The specified network password is not correct. }
  3424.   ERROR_INVALID_PASSWORD = 86;
  3425.  
  3426.   { The parameter is incorrect. }
  3427.   ERROR_INVALID_PARAMETER = 87;   { dderror }
  3428.  
  3429.   { A write fault occurred on the network. }
  3430.   ERROR_NET_WRITE_FAULT = 88;
  3431.  
  3432.   { The system cannot start another process at }
  3433.   { this time. }
  3434.   ERROR_NO_PROC_SLOTS = 89;
  3435.  
  3436.   { Cannot create another system semaphore. }
  3437.   ERROR_TOO_MANY_SEMAPHORES = 100;
  3438.  
  3439.   { The exclusive semaphore is owned by another process. }
  3440.   ERROR_EXCL_SEM_ALREADY_OWNED = 101;
  3441.  
  3442.   { The semaphore is set and cannot be closed. }
  3443.   ERROR_SEM_IS_SET = 102;
  3444.  
  3445.   { The semaphore cannot be set again. }
  3446.   ERROR_TOO_MANY_SEM_REQUESTS = 103;
  3447.  
  3448.   { Cannot request exclusive semaphores at interrupt time. }
  3449.   ERROR_INVALID_AT_INTERRUPT_TIME = 104;
  3450.  
  3451.   { The previous ownership of this semaphore has ended. }
  3452.   ERROR_SEM_OWNER_DIED = 105;
  3453.  
  3454.   { Insert the diskette for drive %1. }
  3455.   ERROR_SEM_USER_LIMIT = 106;
  3456.  
  3457.   { Program stopped because alternate diskette was not inserted. }
  3458.   ERROR_DISK_CHANGE = 107;
  3459.  
  3460.   { The disk is in use or locked by }
  3461.   { another process. }
  3462.   ERROR_DRIVE_LOCKED = 108;
  3463.  
  3464.   { The pipe has been ended. }
  3465.   ERROR_BROKEN_PIPE = 109;
  3466.  
  3467.   { The system cannot open the device or file specified. }
  3468.   ERROR_OPEN_FAILED = 110;
  3469.  
  3470.   { The file name is too long. }
  3471.   ERROR_BUFFER_OVERFLOW = 111;
  3472.  
  3473.   { There is not enough space on the disk. }
  3474.   ERROR_DISK_FULL = 112;
  3475.  
  3476.   { No more internal file identifiers available. }
  3477.   ERROR_NO_MORE_SEARCH_HANDLES = 113;
  3478.  
  3479.   { The target internal file identifier is incorrect. }
  3480.   ERROR_INVALID_TARGET_HANDLE = 114;
  3481.  
  3482.   { The IOCTL call made by the application program is not correct. }
  3483.   ERROR_INVALID_CATEGORY = 117;
  3484.  
  3485.   { The verify-on-write switch parameter value is not correct. }
  3486.   ERROR_INVALID_VERIFY_SWITCH = 118;
  3487.  
  3488.   { The system does not support the command requested. }
  3489.   ERROR_BAD_DRIVER_LEVEL = 119;
  3490.  
  3491.   { This function is only valid in Windows NT mode. }
  3492.   ERROR_CALL_NOT_IMPLEMENTED = 120;
  3493.  
  3494.   { The semaphore timeout period has expired. }
  3495.   ERROR_SEM_TIMEOUT = 121;
  3496.  
  3497.   { The data area passed to a system call is too small. }
  3498.   ERROR_INSUFFICIENT_BUFFER = 122;   { dderror }
  3499.  
  3500.   { The filename, directory name, or volume label syntax is incorrect. }
  3501.   ERROR_INVALID_NAME = 123;
  3502.  
  3503.   { The system call level is not correct. }
  3504.   ERROR_INVALID_LEVEL = 124;
  3505.  
  3506.   { The disk has no volume label. }
  3507.   ERROR_NO_VOLUME_LABEL = 125;
  3508.  
  3509.   { The specified module could not be found. }
  3510.   ERROR_MOD_NOT_FOUND = 126;
  3511.  
  3512.   { The specified procedure could not be found. }
  3513.   ERROR_PROC_NOT_FOUND = 127;
  3514.  
  3515.   { There are no child processes to wait for. }
  3516.   ERROR_WAIT_NO_CHILDREN = $80;
  3517.  
  3518.   { The %1 application cannot be run in Windows NT mode. }
  3519.   ERROR_CHILD_NOT_COMPLETE = 129;
  3520.  
  3521.   { Attempt to use a file handle to an open disk partition for an }
  3522.   { operation other than raw disk I/O. }
  3523.   ERROR_DIRECT_ACCESS_HANDLE = 130;
  3524.  
  3525.   { An attempt was made to move the file pointer before the beginning of the file. }
  3526.   ERROR_NEGATIVE_SEEK = 131;
  3527.  
  3528.   { The file pointer cannot be set on the specified device or file. }
  3529.   ERROR_SEEK_ON_DEVICE = 132;
  3530.  
  3531.   { A JOIN or SUBST command }
  3532.   { cannot be used for a drive that }
  3533.   { contains previously joined drives. }
  3534.   ERROR_IS_JOIN_TARGET = 133;
  3535.  
  3536.   { An attempt was made to use a }
  3537.   { JOIN or SUBST command on a drive that has }
  3538.   { already been joined. }
  3539.   ERROR_IS_JOINED = 134;
  3540.  
  3541.   { An attempt was made to use a }
  3542.   { JOIN or SUBST command on a drive that has }
  3543.   { already been substituted. }
  3544.   ERROR_IS_SUBSTED = 135;
  3545.  
  3546.   { The system tried to delete }
  3547.   { the JOIN of a drive that is not joined. }
  3548.   ERROR_NOT_JOINED = 136;
  3549.  
  3550.   { The system tried to delete the }
  3551.   { substitution of a drive that is not substituted. }
  3552.   ERROR_NOT_SUBSTED = 137;
  3553.  
  3554.   { The system tried to join a drive to a directory on a joined drive. }
  3555.   ERROR_JOIN_TO_JOIN = 138;
  3556.  
  3557.   { The system tried to substitute a drive to a directory on a substituted drive. }
  3558.   ERROR_SUBST_TO_SUBST = 139;
  3559.  
  3560.   { The system tried to join a drive to a directory on a substituted drive. }
  3561.   ERROR_JOIN_TO_SUBST = 140;
  3562.  
  3563.   { The system tried to SUBST a drive to a directory on a joined drive. }
  3564.   ERROR_SUBST_TO_JOIN = 141;
  3565.  
  3566.   { The system cannot perform a JOIN or SUBST at this time. }
  3567.   ERROR_BUSY_DRIVE = 142;
  3568.  
  3569.   { The system cannot join or substitute a }
  3570.   { drive to or for a directory on the same drive. }
  3571.   ERROR_SAME_DRIVE = 143;
  3572.  
  3573.   { The directory is not a subdirectory of the root directory. }
  3574.   ERROR_DIR_NOT_ROOT = 144;
  3575.  
  3576.   { The directory is not empty. }
  3577.   ERROR_DIR_NOT_EMPTY = 145;
  3578.  
  3579.   { The path specified is being used in a substitute. }
  3580.   ERROR_IS_SUBST_PATH = 146;
  3581.  
  3582.   { Not enough resources are available to process this command. }
  3583.   ERROR_IS_JOIN_PATH = 147;
  3584.  
  3585.   { The path specified cannot be used at this time. }
  3586.   ERROR_PATH_BUSY = 148;
  3587.  
  3588.   { An attempt was made to join or substitute a drive for which a directory }
  3589.   { on the drive is the target of a previous substitute. }
  3590.   ERROR_IS_SUBST_TARGET = 149;
  3591.  
  3592.   { System trace information was not specified in your }
  3593.   { CONFIG.SYS file, or tracing is disallowed. }
  3594.   ERROR_SYSTEM_TRACE = 150;
  3595.  
  3596.   { The number of specified semaphore events for }
  3597.   { DosMuxSemWait is not correct. }
  3598.   ERROR_INVALID_EVENT_COUNT = 151;
  3599.  
  3600.   { DosMuxSemWait did not execute; too many semaphores }
  3601.   { are already set. }
  3602.   ERROR_TOO_MANY_MUXWAITERS = 152;
  3603.  
  3604.   { The DosMuxSemWait list is not correct. }
  3605.   ERROR_INVALID_LIST_FORMAT = 153;
  3606.  
  3607.   { The volume label you entered exceeds the }
  3608.   { 11 character limit.  The first 11 characters were written }
  3609.   { to disk.  Any characters that exceeded the 11 character limit }
  3610.   { were automatically deleted. }
  3611.   ERROR_LABEL_TOO_LONG = 154;
  3612.  
  3613.   { Cannot create another thread. }
  3614.   ERROR_TOO_MANY_TCBS = 155;
  3615.  
  3616.   { The recipient process has refused the signal. }
  3617.   ERROR_SIGNAL_REFUSED = 156;
  3618.  
  3619.   { The segment is already discarded and cannot be locked. }
  3620.   ERROR_DISCARDED = 157;
  3621.  
  3622.   { The segment is already unlocked. }
  3623.   ERROR_NOT_LOCKED = 158;
  3624.  
  3625.   { The address for the thread ID is not correct. }
  3626.   ERROR_BAD_THREADID_ADDR = 159;
  3627.  
  3628.   { The argument string passed to DosExecPgm is not correct. }
  3629.   ERROR_BAD_ARGUMENTS = 160;
  3630.  
  3631.   { The specified path is invalid. }
  3632.   ERROR_BAD_PATHNAME = 161;
  3633.  
  3634.   { A signal is already pending. }
  3635.   ERROR_SIGNAL_PENDING = 162;
  3636.  
  3637.   { No more threads can be created in the system. }
  3638.   ERROR_MAX_THRDS_REACHED = 164;
  3639.  
  3640.   { Unable to lock a region of a file. }
  3641.   ERROR_LOCK_FAILED = 167;
  3642.  
  3643.   { The requested resource is in use. }
  3644.   ERROR_BUSY = 170;
  3645.  
  3646.   { A lock request was not outstanding for the supplied cancel region. }
  3647.   ERROR_CANCEL_VIOLATION = 173;
  3648.  
  3649.   { The file system does not support atomic changes to the lock type. }
  3650.   ERROR_ATOMIC_LOCKS_NOT_SUPPORTED = 174;
  3651.  
  3652.   { The system detected a segment number that was not correct. }
  3653.   ERROR_INVALID_SEGMENT_NUMBER = 180;
  3654.  
  3655.   { The operating system cannot run %1. }
  3656.   ERROR_INVALID_ORDINAL = 182;
  3657.  
  3658.   { Cannot create a file when that file already exists. }
  3659.   ERROR_ALREADY_EXISTS = 183;
  3660.  
  3661.   { The flag passed is not correct. }
  3662.   ERROR_INVALID_FLAG_NUMBER = 186;
  3663.  
  3664.   { The specified system semaphore name was not found. }
  3665.   ERROR_SEM_NOT_FOUND = 187;
  3666.  
  3667.   { The operating system cannot run %1. }
  3668.   ERROR_INVALID_STARTING_CODESEG = 188;
  3669.  
  3670.   { The operating system cannot run %1. }
  3671.   ERROR_INVALID_STACKSEG = 189;
  3672.  
  3673.   { The operating system cannot run %1. }
  3674.   ERROR_INVALID_MODULETYPE = 190;
  3675.  
  3676.   { Cannot run %1 in Windows NT mode. }
  3677.   ERROR_INVALID_EXE_SIGNATURE = 191;
  3678.  
  3679.   { The operating system cannot run %1. }
  3680.   ERROR_EXE_MARKED_INVALID = 192;
  3681.  
  3682.   { %1 is not a valid Windows NT application. }
  3683.   ERROR_BAD_EXE_FORMAT = 193;
  3684.  
  3685.   { The operating system cannot run %1. }
  3686.   ERROR_ITERATED_DATA_EXCEEDS_64k = 194;
  3687.  
  3688.   { The operating system cannot run %1. }
  3689.   ERROR_INVALID_MINALLOCSIZE = 195;
  3690.  
  3691.   { The operating system cannot run this application program. }
  3692.   ERROR_DYNLINK_FROM_INVALID_RING = 196;
  3693.  
  3694.   { The operating system is not presently configured to run this application. }
  3695.   ERROR_IOPL_NOT_ENABLED = 197;
  3696.  
  3697.   { The operating system cannot run %1. }
  3698.   ERROR_INVALID_SEGDPL = 198;
  3699.  
  3700.   { The operating system cannot run this }
  3701.   { application program. }
  3702.   ERROR_AUTODATASEG_EXCEEDS_64k = 199;
  3703.  
  3704.   { The code segment cannot be greater than or equal to 64KB. }
  3705.   ERROR_RING2SEG_MUST_BE_MOVABLE = 200;
  3706.  
  3707.   { The operating system cannot run %1. }
  3708.   ERROR_RELOC_CHAIN_XEEDS_SEGLIM = 201;
  3709.  
  3710.   { The operating system cannot run %1. }
  3711.   ERROR_INFLOOP_IN_RELOC_CHAIN = 202;
  3712.  
  3713.   { The system could not find the environment option that was entered. }
  3714.   ERROR_ENVVAR_NOT_FOUND = 203;
  3715.  
  3716.   { No process in the command subtree has a signal handler. }
  3717.   ERROR_NO_SIGNAL_SENT = 205;
  3718.  
  3719.   { The filename or extension is too long. }
  3720.   ERROR_FILENAME_EXCED_RANGE = 206;
  3721.  
  3722.   { The ring 2 stack is in use. }
  3723.   ERROR_RING2_STACK_IN_USE = 207;
  3724.  
  3725.   { The global filename characters, * or ?, are entered }
  3726.   { incorrectly or too many global filename characters are specified. }
  3727.   ERROR_META_EXPANSION_TOO_LONG = 208;
  3728.  
  3729.   { The signal being posted is not correct. }
  3730.   ERROR_INVALID_SIGNAL_NUMBER = 209;
  3731.  
  3732.   { The signal handler cannot be set. }
  3733.   ERROR_THREAD_1_INACTIVE = 210;
  3734.  
  3735.   { The segment is locked and cannot be reallocated. }
  3736.   ERROR_LOCKED = 212;
  3737.  
  3738.   { Too many dynamic link modules are attached to this }
  3739.   { program or dynamic link module. }
  3740.   ERROR_TOO_MANY_MODULES = 214;
  3741.  
  3742.   { Can't nest calls to LoadModule. }
  3743.   ERROR_NESTING_NOT_ALLOWED = 215;
  3744.  
  3745.   { The pipe state is invalid. }
  3746.   ERROR_BAD_PIPE = 230;
  3747.  
  3748.   { All pipe instances are busy. }
  3749.   ERROR_PIPE_BUSY = 231;
  3750.  
  3751.   { The pipe is being closed. }
  3752.   ERROR_NO_DATA = 232;
  3753.  
  3754.   { No process is on the other end of the pipe. }
  3755.   ERROR_PIPE_NOT_CONNECTED = 233;
  3756.  
  3757.   { More data is available. }
  3758.   ERROR_MORE_DATA = 234;   { dderror }
  3759.  
  3760.   { The session was cancelled. }
  3761.   ERROR_VC_DISCONNECTED = 240;
  3762.  
  3763.   { The specified extended attribute name was invalid. }
  3764.   ERROR_INVALID_EA_NAME = 254;
  3765.  
  3766.   { The extended attributes are inconsistent. }
  3767.   ERROR_EA_LIST_INCONSISTENT = 255;
  3768.  
  3769.   { No more data is available. }
  3770.   ERROR_NO_MORE_ITEMS = 259;
  3771.  
  3772.   { The Copy API cannot be used. }
  3773.   ERROR_CANNOT_COPY = 266;
  3774.  
  3775.   { The directory name is invalid. }
  3776.   ERROR_DIRECTORY = 267;
  3777.  
  3778.   { The extended attributes did not fit in the buffer. }
  3779.   ERROR_EAS_DIDNT_FIT = 275;
  3780.  
  3781.   { The extended attribute file on the mounted file system is corrupt. }
  3782.   ERROR_EA_FILE_CORRUPT = 276;
  3783.  
  3784.   { The extended attribute table file is full. }
  3785.   ERROR_EA_TABLE_FULL = 277;
  3786.  
  3787.   { The specified extended attribute handle is invalid. }
  3788.   ERROR_INVALID_EA_HANDLE = 278;
  3789.  
  3790.   { The mounted file system does not support extended attributes. }
  3791.   ERROR_EAS_NOT_SUPPORTED = 282;
  3792.  
  3793.   { Attempt to release mutex not owned by caller. }
  3794.   ERROR_NOT_OWNER = 288;
  3795.  
  3796.   { Too many posts were made to a semaphore. }
  3797.   ERROR_TOO_MANY_POSTS = 298;
  3798.  
  3799.   { Only part of a Read/WriteProcessMemory request was completed. }
  3800.   ERROR_PARTIAL_COPY = 299;
  3801.  
  3802.   { The system cannot find message for message number $%1 }
  3803.   { in message file for %2. }
  3804.   ERROR_MR_MID_NOT_FOUND = 317;
  3805.  
  3806.   { Attempt to access invalid address. }
  3807.   ERROR_INVALID_ADDRESS = 487;
  3808.  
  3809.   { Arithmetic result exceeded 32 bits. }
  3810.   ERROR_ARITHMETIC_OVERFLOW = 534;
  3811.  
  3812.   { There is a process on other end of the pipe. }
  3813.   ERROR_PIPE_CONNECTED = 535;
  3814.  
  3815.   { Waiting for a process to open the other end of the pipe. }
  3816.   ERROR_PIPE_LISTENING = 536;
  3817.  
  3818.   { Access to the extended attribute was denied. }
  3819.   ERROR_EA_ACCESS_DENIED = 994;
  3820.  
  3821.   { The I/O operation has been aborted because of either a thread exit }
  3822.   { or an application request. }
  3823.   ERROR_OPERATION_ABORTED = 995;
  3824.  
  3825.   { Overlapped I/O event is not in a signalled state. }
  3826.   ERROR_IO_INCOMPLETE = 996;
  3827.  
  3828.   { Overlapped I/O operation is in progress. }
  3829.   ERROR_IO_PENDING = 997;   { dderror }
  3830.  
  3831.   { Invalid access to memory location. }
  3832.   ERROR_NOACCESS = 998;
  3833.  
  3834.   { Error performing inpage operation. }
  3835.   ERROR_SWAPERROR = 999;
  3836.  
  3837.   { Recursion too deep, stack overflowed. }
  3838.   ERROR_STACK_OVERFLOW = 1001;
  3839.  
  3840.   { The window cannot act on the sent message. }
  3841.   ERROR_INVALID_MESSAGE = 1002;
  3842.  
  3843.   { Cannot complete this function. }
  3844.   ERROR_CAN_NOT_COMPLETE = 1003;
  3845.  
  3846.   { Invalid flags. }
  3847.   ERROR_INVALID_FLAGS = 1004;
  3848.  
  3849.   { The volume does not contain a recognized file system. }
  3850.   { Please make sure that all required file system drivers are loaded and that the }
  3851.   { volume is not corrupt. }
  3852.   ERROR_UNRECOGNIZED_VOLUME = 1005;
  3853.  
  3854.   { The volume for a file has been externally altered such that the }
  3855.   { opened file is no longer valid. }
  3856.   ERROR_FILE_INVALID = 1006;
  3857.  
  3858.   { The requested operation cannot be performed in full-screen mode. }
  3859.   ERROR_FULLSCREEN_MODE = 1007;
  3860.  
  3861.   { An attempt was made to reference a token that does not exist. }
  3862.   ERROR_NO_TOKEN = 1008;
  3863.  
  3864.   { The configuration registry database is corrupt. }
  3865.   ERROR_BADDB = 1009;
  3866.  
  3867.   { The configuration registry key is invalid. }
  3868.   ERROR_BADKEY = 1010;
  3869.  
  3870.   { The configuration registry key could not be opened. }
  3871.   ERROR_CANTOPEN = 1011;
  3872.  
  3873.   { The configuration registry key could not be read. }
  3874.   ERROR_CANTREAD = 1012;
  3875.  
  3876.   { The configuration registry key could not be written. }
  3877.   ERROR_CANTWRITE = 1013;
  3878.  
  3879.   { One of the files in the Registry database had to be recovered }
  3880.   { by use of a log or alternate copy.  The recovery was successful. }
  3881.   ERROR_REGISTRY_RECOVERED = 1014;
  3882.  
  3883.   { The Registry is corrupt. The structure of one of the files that contains }
  3884.   { Registry data is corrupt, or the system's image of the file in memory }
  3885.   { is corrupt, or the file could not be recovered because the alternate }
  3886.   { copy or log was absent or corrupt. }
  3887.   ERROR_REGISTRY_CORRUPT = 1015;
  3888.  
  3889.   { An I/O operation initiated by the Registry failed unrecoverably. }
  3890.   { The Registry could not read in, or write out, or flush, one of the files }
  3891.   { that contain the system's image of the Registry. }
  3892.   ERROR_REGISTRY_IO_FAILED = 1016;
  3893.  
  3894.   { The system has attempted to load or restore a file into the Registry, but the }
  3895.   { specified file is not in a Registry file format. }
  3896.   ERROR_NOT_REGISTRY_FILE = 1017;
  3897.  
  3898.   { Illegal operation attempted on a Registry key which has been marked for deletion. }
  3899.   ERROR_KEY_DELETED = 1018;
  3900.  
  3901.   { System could not allocate the required space in a Registry log. }
  3902.   ERROR_NO_LOG_SPACE = 1019;
  3903.  
  3904.   { Cannot create a symbolic link in a Registry key that already }
  3905.   { has subkeys or values. }
  3906.   ERROR_KEY_HAS_CHILDREN = 1020;
  3907.  
  3908.   { Cannot create a stable subkey under a volatile parent key. }
  3909.   ERROR_CHILD_MUST_BE_VOLATILE = 1021;
  3910.  
  3911.   { A notify change request is being completed and the information }
  3912.   { is not being returned in the caller's buffer. The caller now }
  3913.   { needs to enumerate the files to find the changes. }
  3914.   ERROR_NOTIFY_ENUM_DIR = 1022;
  3915.  
  3916.   { A stop control has been sent to a service which other running services }
  3917.   { are dependent on. }
  3918.   ERROR_DEPENDENT_SERVICES_RUNNING = 1051;
  3919.  
  3920.   { The requested control is not valid for this service }
  3921.   ERROR_INVALID_SERVICE_CONTROL = 1052;
  3922.  
  3923.   { The service did not respond to the start or control request in a timely }
  3924.   { fashion. }
  3925.   ERROR_SERVICE_REQUEST_TIMEOUT = 1053;
  3926.  
  3927.   { A thread could not be created for the service. }
  3928.   ERROR_SERVICE_NO_THREAD = 1054;
  3929.  
  3930.   { The service database is locked. }
  3931.   ERROR_SERVICE_DATABASE_LOCKED = 1055;
  3932.  
  3933.   { An instance of the service is already running. }
  3934.   ERROR_SERVICE_ALREADY_RUNNING = 1056;
  3935.  
  3936.   { The account name is invalid or does not exist. }
  3937.   ERROR_INVALID_SERVICE_ACCOUNT = 1057;
  3938.  
  3939.   { The specified service is disabled and cannot be started. }
  3940.   ERROR_SERVICE_DISABLED = 1058;
  3941.  
  3942.   { Circular service dependency was specified. }
  3943.   ERROR_CIRCULAR_DEPENDENCY = 1059;
  3944.  
  3945.   { The specified service does not exist as an installed service. }
  3946.   ERROR_SERVICE_DOES_NOT_EXIST = 1060;
  3947.  
  3948.   { The service cannot accept control messages at this time. }
  3949.   ERROR_SERVICE_CANNOT_ACCEPT_CTRL = 1061;
  3950.  
  3951.   { The service has not been started. }
  3952.   ERROR_SERVICE_NOT_ACTIVE = 1062;
  3953.  
  3954.   { The service process could not connect to the service controller. }
  3955.   ERROR_FAILED_SERVICE_CONTROLLER_ = 1063;
  3956.  
  3957.   { An exception occurred in the service when handling the control request. }
  3958.   ERROR_EXCEPTION_IN_SERVICE = 1064;
  3959.  
  3960.   { The database specified does not exist. }
  3961.   ERROR_DATABASE_DOES_NOT_EXIST = 1065;
  3962.  
  3963.   { The service has returned a service-specific error code. }
  3964.   ERROR_SERVICE_SPECIFIC_ERROR = 1066;
  3965.  
  3966.   { The process terminated unexpectedly. }
  3967.   ERROR_PROCESS_ABORTED = 1067;
  3968.  
  3969.   { The dependency service or group failed to start. }
  3970.   ERROR_SERVICE_DEPENDENCY_FAIL = 1068;
  3971.  
  3972.   { The service did not start due to a logon failure. }
  3973.   ERROR_SERVICE_LOGON_FAILED = 1069;
  3974.  
  3975.   { After starting, the service hung in a start-pending state. }
  3976.   ERROR_SERVICE_START_HANG = 1070;
  3977.  
  3978.   { The specified service database lock is invalid. }
  3979.   ERROR_INVALID_SERVICE_LOCK = 1071;
  3980.  
  3981.   { The specified service has been marked for deletion. }
  3982.   ERROR_SERVICE_MARKED_FOR_DELETE = 1072;
  3983.  
  3984.   { The specified service already exists. }
  3985.   ERROR_SERVICE_EXISTS = 1073;
  3986.  
  3987.   { The system is currently running with the last-known-good configuration. }
  3988.   ERROR_ALREADY_RUNNING_LKG = 1074;
  3989.  
  3990.   { The dependency service does not exist or has been marked for }
  3991.   { deletion. }
  3992.   ERROR_SERVICE_DEPENDENCY_DELETED = 1075;
  3993.  
  3994.   { The current boot has already been accepted for use as the }
  3995.   { last-known-good control set. }
  3996.   ERROR_BOOT_ALREADY_ACCEPTED = 1076;
  3997.  
  3998.   { No attempts to start the service have been made since the last boot. }
  3999.   ERROR_SERVICE_NEVER_STARTED = 1077;
  4000.  
  4001.   { The name is already in use as either a service name or a service display }
  4002.   { name. }
  4003.   ERROR_DUPLICATE_SERVICE_NAME = 1078;
  4004.  
  4005.   { The physical end of the tape has been reached. }
  4006.   ERROR_END_OF_MEDIA = 1100;
  4007.  
  4008.   { A tape access reached a filemark. }
  4009.   ERROR_FILEMARK_DETECTED = 1101;
  4010.  
  4011.   { Beginning of tape or partition was encountered. }
  4012.   ERROR_BEGINNING_OF_MEDIA = 1102;
  4013.  
  4014.   { A tape access reached the end of a set of files. }
  4015.   ERROR_SETMARK_DETECTED = 1103;
  4016.  
  4017.   { No more data is on the tape. }
  4018.   ERROR_NO_DATA_DETECTED = 1104;
  4019.  
  4020.   { Tape could not be partitioned. }
  4021.   ERROR_PARTITION_FAILURE = 1105;
  4022.  
  4023.   { When accessing a new tape of a multivolume partition, the current }
  4024.   { blocksize is incorrect. }
  4025.   ERROR_INVALID_BLOCK_LENGTH = 1106;
  4026.  
  4027.   { Tape partition information could not be found when loading a tape. }
  4028.   ERROR_DEVICE_NOT_PARTITIONED = 1107;
  4029.  
  4030.   { Unable to lock the media eject mechanism. }
  4031.   ERROR_UNABLE_TO_LOCK_MEDIA = 1108;
  4032.  
  4033.   { Unable to unload the media. }
  4034.   ERROR_UNABLE_TO_UNLOAD_MEDIA = 1109;
  4035.  
  4036.   { Media in drive may have changed. }
  4037.   ERROR_MEDIA_CHANGED = 1110;
  4038.  
  4039.   { The I/O bus was reset. }
  4040.   ERROR_BUS_RESET = 1111;
  4041.  
  4042.   { No media in drive. }
  4043.   ERROR_NO_MEDIA_IN_DRIVE = 1112;
  4044.  
  4045.   { No mapping for the Unicode character exists in the target multi-byte code page. }
  4046.   ERROR_NO_UNICODE_TRANSLATION = 1113;
  4047.  
  4048.   { A dynamic link library (DLL) initialization routine failed. }
  4049.   ERROR_DLL_INIT_FAILED = 1114;
  4050.  
  4051.   { A system shutdown is in progress. }
  4052.   ERROR_SHUTDOWN_IN_PROGRESS = 1115;
  4053.  
  4054.   { Unable to abort the system shutdown because no shutdown was in progress. }
  4055.   ERROR_NO_SHUTDOWN_IN_PROGRESS = 1116;
  4056.  
  4057.   { The request could not be performed because of an I/O device error. }
  4058.   ERROR_IO_DEVICE = 1117;
  4059.  
  4060.   { No serial device was successfully initialized.  The serial driver will unload. }
  4061.   ERROR_SERIAL_NO_DEVICE = 1118;
  4062.  
  4063.   { Unable to open a device that was sharing an interrupt request (IRQ) }
  4064.   { with other devices. At least one other device that uses that IRQ }
  4065.   { was already opened. }
  4066.   ERROR_IRQ_BUSY = 1119;
  4067.  
  4068.   { A serial I/O operation was completed by another write to the serial port. }
  4069.   { (The IOCTL_SERIAL_XOFF_COUNTER reached zero.) }
  4070.   ERROR_MORE_WRITES = 1120;
  4071.  
  4072.   { A serial I/O operation completed because the time-out period expired. }
  4073.   { (The IOCTL_SERIAL_XOFF_COUNTER did not reach zero.) }
  4074.   ERROR_COUNTER_TIMEOUT = 1121;
  4075.  
  4076.   { No ID address mark was found on the floppy disk. }
  4077.   ERROR_FLOPPY_ID_MARK_NOT_FOUND = 1122;
  4078.  
  4079.   { Mismatch between the floppy disk sector ID field and the floppy disk }
  4080.   { controller track address. }
  4081.   ERROR_FLOPPY_WRONG_CYLINDER = 1123;
  4082.  
  4083.   { The floppy disk controller reported an error that is not recognized }
  4084.   { by the floppy disk driver. }
  4085.   ERROR_FLOPPY_UNKNOWN_ERROR = 1124;
  4086.  
  4087.   { The floppy disk controller returned inconsistent results in its registers. }
  4088.   ERROR_FLOPPY_BAD_REGISTERS = 1125;
  4089.  
  4090.   { While accessing the hard disk, a recalibrate operation failed, even after retries. }
  4091.   ERROR_DISK_RECALIBRATE_FAILED = 1126;
  4092.  
  4093.   { While accessing the hard disk, a disk operation failed even after retries. }
  4094.   ERROR_DISK_OPERATION_FAILED = 1127;
  4095.  
  4096.   { While accessing the hard disk, a disk controller reset was needed, but }
  4097.   { even that failed. }
  4098.   ERROR_DISK_RESET_FAILED = 1128;
  4099.  
  4100.   { Physical end of tape encountered. }
  4101.   ERROR_EOM_OVERFLOW = 1129;
  4102.  
  4103.   { Not enough server storage is available to process this command. }
  4104.   ERROR_NOT_ENOUGH_SERVER_MEMORY = 1130;
  4105.  
  4106.   { A potential deadlock condition has been detected. }
  4107.   ERROR_POSSIBLE_DEADLOCK = 1131;
  4108.  
  4109.   { The base address or the file offset specified does not have the proper }
  4110.   { alignment. }
  4111.   ERROR_MAPPED_ALIGNMENT = 1132;
  4112.  
  4113.   { An attempt to change the system power state was vetoed by another }
  4114.   { application or driver. }
  4115.   ERROR_SET_POWER_STATE_VETOED = 1140;
  4116.  
  4117.   { The system BIOS failed an attempt to change the system power state. }
  4118.   ERROR_SET_POWER_STATE_FAILED = 1141;
  4119.  
  4120.   { The specified program requires a newer version of Windows. }
  4121.   ERROR_OLD_WIN_VERSION = 1150;
  4122.  
  4123.   { The specified program is not a Windows or MS-DOS program. }
  4124.   ERROR_APP_WRONG_OS = 1151;
  4125.  
  4126.   { Cannot start more than one instance of the specified program. }
  4127.   ERROR_SINGLE_INSTANCE_APP = 1152;
  4128.  
  4129.   { Cannot start more than one instance of the specified program. }
  4130.   ERROR_RMODE_APP = 1153;
  4131.  
  4132.   { One of the library files needed to run this application is damaged. }
  4133.   ERROR_INVALID_DLL = 1154;
  4134.  
  4135.   { No application is associated with the specified file for this operation. }
  4136.   ERROR_NO_ASSOCIATION = 1155;
  4137.  
  4138.   { An error occurred in sending the command to the application. }
  4139.   ERROR_DDE_FAIL = 1156;
  4140.  
  4141.   { One of the library files needed to run this application cannot be found. }
  4142.   ERROR_DLL_NOT_FOUND = 1157;
  4143.  
  4144.  
  4145. { Winnet32 Status Codes }
  4146.  
  4147.   { The specified username is invalid. }
  4148.   ERROR_BAD_USERNAME = 2202;
  4149.  
  4150.   { This network connection does not exist. }
  4151.   ERROR_NOT_CONNECTED = 2250;
  4152.  
  4153.   { This network connection has files open or requests pending. }
  4154.   ERROR_OPEN_FILES = 2401;
  4155.  
  4156.   { Active connections still exist. }
  4157.   ERROR_ACTIVE_CONNECTIONS = 2402;
  4158.  
  4159.   { The device is in use by an active process and cannot be disconnected. }
  4160.   ERROR_DEVICE_IN_USE = 2404;
  4161.  
  4162.   { The specified device name is invalid. }
  4163.   ERROR_BAD_DEVICE = 1200;
  4164.  
  4165.   { The device is not currently connected but it is a remembered connection. }
  4166.   ERROR_CONNECTION_UNAVAIL = 1201;
  4167.  
  4168.   { An attempt was made to remember a device that had previously been remembered. }
  4169.   ERROR_DEVICE_ALREADY_REMEMBERED = 1202;
  4170.  
  4171.   { No network provider accepted the given network path. }
  4172.   ERROR_NO_NET_OR_BAD_PATH = 1203;
  4173.  
  4174.   { The specified network provider name is invalid. }
  4175.   ERROR_BAD_PROVIDER = 1204;
  4176.  
  4177.   { Unable to open the network connection profile. }
  4178.   ERROR_CANNOT_OPEN_PROFILE = 1205;
  4179.  
  4180.   { The network connection profile is corrupt. }
  4181.   ERROR_BAD_PROFILE = 1206;
  4182.  
  4183.   { Cannot enumerate a non-container. }
  4184.   ERROR_NOT_CONTAINER = 1207;
  4185.  
  4186.   { An extended error has occurred. }
  4187.   ERROR_EXTENDED_ERROR = 1208;
  4188.  
  4189.   { The format of the specified group name is invalid. }
  4190.   ERROR_INVALID_GROUPNAME = 1209;
  4191.  
  4192.   { The format of the specified computer name is invalid. }
  4193.   ERROR_INVALID_COMPUTERNAME = 1210;
  4194.  
  4195.   { The format of the specified event name is invalid. }
  4196.   ERROR_INVALID_EVENTNAME = 1211;
  4197.  
  4198.   { The format of the specified domain name is invalid. }
  4199.   ERROR_INVALID_DOMAINNAME = 1212;
  4200.  
  4201.   { The format of the specified service name is invalid. }
  4202.   ERROR_INVALID_SERVICENAME = 1213;
  4203.  
  4204.   { The format of the specified network name is invalid. }
  4205.   ERROR_INVALID_NETNAME = 1214;
  4206.  
  4207.   { The format of the specified share name is invalid. }
  4208.   ERROR_INVALID_SHARENAME = 1215;
  4209.  
  4210.   { The format of the specified password is invalid. }
  4211.   ERROR_INVALID_PASSWORDNAME = 1216;
  4212.  
  4213.   { The format of the specified message name is invalid. }
  4214.   ERROR_INVALID_MESSAGENAME = 1217;
  4215.  
  4216.   { The format of the specified message destination is invalid. }
  4217.   ERROR_INVALID_MESSAGEDEST = 1218;
  4218.  
  4219.   { The credentials supplied conflict with an existing set of credentials. }
  4220.   ERROR_SESSION_CREDENTIAL_CONFLIC = 1219;
  4221.  
  4222.   { An attempt was made to establish a session to a network server, but there }
  4223.   { are already too many sessions established to that server. }
  4224.   ERROR_REMOTE_SESSION_LIMIT_EXCEE = 1220;
  4225.  
  4226.   { The workgroup or domain name is already in use by another computer on the }
  4227.   { network. }
  4228.   ERROR_DUP_DOMAINNAME = 1221;
  4229.  
  4230.   { The network is not present or not started. }
  4231.   ERROR_NO_NETWORK = 1222;
  4232.  
  4233.   { The operation was cancelled by the user. }
  4234.   ERROR_CANCELLED = 1223;
  4235.  
  4236.   { The requested operation cannot be performed on a file with a user mapped section open. }
  4237.   ERROR_USER_MAPPED_FILE = 1224;
  4238.  
  4239.   { The remote system refused the network connection. }
  4240.   ERROR_CONNECTION_REFUSED = 1225;
  4241.  
  4242.   { The network connection was gracefully closed. }
  4243.   ERROR_GRACEFUL_DISCONNECT = 1226;
  4244.  
  4245.   { The network transport endpoint already has an address associated with it. }
  4246.   ERROR_ADDRESS_ALREADY_ASSOCIATED = 1227;
  4247.  
  4248.   { An address has not yet been associated with the network endpoint. }
  4249.   ERROR_ADDRESS_NOT_ASSOCIATED = 1228;
  4250.  
  4251.   { An operation was attempted on a non-existent network connection. }
  4252.   ERROR_CONNECTION_INVALID = 1229;
  4253.  
  4254.   { An invalid operation was attempted on an active network connection. }
  4255.   ERROR_CONNECTION_ACTIVE = 1230;
  4256.  
  4257.   { The remote network is not reachable by the transport. }
  4258.   ERROR_NETWORK_UNREACHABLE = 1231;
  4259.  
  4260.   { The remote system is not reachable by the transport. }
  4261.   ERROR_HOST_UNREACHABLE = 1232;
  4262.  
  4263.   { The remote system does not support the transport protocol. }
  4264.   ERROR_PROTOCOL_UNREACHABLE = 1233;
  4265.  
  4266.   { No service is operating at the destination network endpoint }
  4267.   { on the remote system. }
  4268.   ERROR_PORT_UNREACHABLE = 1234;
  4269.  
  4270.   { The request was aborted. }
  4271.   ERROR_REQUEST_ABORTED = 1235;
  4272.  
  4273.   { The network connection was aborted by the local system. }
  4274.   ERROR_CONNECTION_ABORTED = 1236;
  4275.  
  4276.   { The operation could not be completed.  A retry should be performed. }
  4277.   ERROR_RETRY = 1237;
  4278.  
  4279.   { A connection to the server could not be made because the limit on the number of }
  4280.   { concurrent connections for this account has been reached. }
  4281.   ERROR_CONNECTION_COUNT_LIMIT = 1238;
  4282.  
  4283.   { Attempting to login during an unauthorized time of day for this account. }
  4284.   ERROR_LOGIN_TIME_RESTRICTION = 1239;
  4285.  
  4286.   { The account is not authorized to login from this station. }
  4287.   ERROR_LOGIN_WKSTA_RESTRICTION = 1240;
  4288.  
  4289.   { The network address could not be used for the operation requested. }
  4290.   ERROR_INCORRECT_ADDRESS = 1241;
  4291.  
  4292.   { The service is already registered. }
  4293.   ERROR_ALREADY_REGISTERED = 1242;
  4294.  
  4295.   { The specified service does not exist. }
  4296.   ERROR_SERVICE_NOT_FOUND = 1243;
  4297.  
  4298.   { The operation being requested was not performed because the user }
  4299.   { has not been authenticated. }
  4300.   ERROR_NOT_AUTHENTICATED = 1244;
  4301.  
  4302.   { The operation being requested was not performed because the user }
  4303.   { has not logged on to the network. }
  4304.   { The specified service does not exist. }
  4305.   ERROR_NOT_LOGGED_ON = 1245;
  4306.  
  4307.   { Return that wants caller to continue with work in progress. }
  4308.   ERROR_CONTINUE = 1246;
  4309.  
  4310.   { An attempt was made to perform an initialization operation when }
  4311.   { initialization has already been completed. }
  4312.   ERROR_ALREADY_INITIALIZED = 1247;
  4313.  
  4314.   { No more local devices. }
  4315.   ERROR_NO_MORE_DEVICES = 1248;
  4316.  
  4317.  
  4318. { Security Status Codes }
  4319.  
  4320.   { Not all privileges referenced are assigned to the caller. }
  4321.   ERROR_NOT_ALL_ASSIGNED = 1300;
  4322.  
  4323.   { Some mapping between account names and security IDs was not done. }
  4324.   ERROR_SOME_NOT_MAPPED = 1301;
  4325.  
  4326.   { No system quota limits are specifically set for this account. }
  4327.   ERROR_NO_QUOTAS_FOR_ACCOUNT = 1302;
  4328.  
  4329.   { No encryption key is available.  A well-known encryption key was returned. }
  4330.   ERROR_LOCAL_USER_SESSION_KEY = 1303;
  4331.  
  4332.   { The NT password is too complex to be converted to a LAN Manager }
  4333.   { password.  The LAN Manager password returned is a NULL string. }
  4334.   ERROR_NULL_LM_PASSWORD = 1304;
  4335.  
  4336.   { The revision level is unknown. }
  4337.   ERROR_UNKNOWN_REVISION = 1305;
  4338.  
  4339.   { Indicates two revision levels are incompatible. }
  4340.   ERROR_REVISION_MISMATCH = 1306;
  4341.  
  4342.   { This security ID may not be assigned as the owner of this object. }
  4343.   ERROR_INVALID_OWNER = 1307;
  4344.  
  4345.   { This security ID may not be assigned as the primary group of an object. }
  4346.   ERROR_INVALID_PRIMARY_GROUP = 1308;
  4347.  
  4348.   { An attempt has been made to operate on an impersonation token }
  4349.  
  4350.   { by a thread that is not currently impersonating a client. }
  4351.   ERROR_NO_IMPERSONATION_TOKEN = 1309;
  4352.  
  4353.   { The group may not be disabled. }
  4354.   ERROR_CANT_DISABLE_MANDATORY = 1310;
  4355.  
  4356.   { There are currently no logon servers available to service the logon }
  4357.   { request. }
  4358.   ERROR_NO_LOGON_SERVERS = 1311;
  4359.  
  4360.   {  A specified logon session does not exist.  It may already have }
  4361.   {  been terminated. }
  4362.   ERROR_NO_SUCH_LOGON_SESSION = 1312;
  4363.  
  4364.   {  A specified privilege does not exist. }
  4365.   ERROR_NO_SUCH_PRIVILEGE = 1313;
  4366.  
  4367.   {  A required privilege is not held by the client. }
  4368.   ERROR_PRIVILEGE_NOT_HELD = 1314;
  4369.  
  4370.   { The name provided is not a properly formed account name. }
  4371.   ERROR_INVALID_ACCOUNT_NAME = 1315;
  4372.  
  4373.   { The specified user already exists. }
  4374.   ERROR_USER_EXISTS = 1316;
  4375.  
  4376.   { The specified user does not exist. }
  4377.   ERROR_NO_SUCH_USER = 1317;
  4378.  
  4379.   { The specified group already exists. }
  4380.   ERROR_GROUP_EXISTS = 1318;
  4381.  
  4382.   { The specified group does not exist. }
  4383.   ERROR_NO_SUCH_GROUP = 1319;
  4384.  
  4385.   { Either the specified user account is already a member of the specified }
  4386.   { group, or the specified group cannot be deleted because it contains }
  4387.   { a member. }
  4388.   ERROR_MEMBER_IN_GROUP = 1320;
  4389.  
  4390.   { The specified user account is not a member of the specified group account. }
  4391.   ERROR_MEMBER_NOT_IN_GROUP = 1321;
  4392.  
  4393.   { The last remaining administration account cannot be disabled }
  4394.   { or deleted. }
  4395.   ERROR_LAST_ADMIN = 1322;
  4396.  
  4397.   { Unable to update the password.  The value provided as the current }
  4398.   { password is incorrect. }
  4399.   ERROR_WRONG_PASSWORD = 1323;
  4400.  
  4401.   { Unable to update the password.  The value provided for the new password }
  4402.   { contains values that are not allowed in passwords. }
  4403.   ERROR_ILL_FORMED_PASSWORD = 1324;
  4404.  
  4405.   { Unable to update the password because a password update rule has been }
  4406.   { violated. }
  4407.   ERROR_PASSWORD_RESTRICTION = 1325;
  4408.  
  4409.   { Logon failure: unknown user name or bad password. }
  4410.   ERROR_LOGON_FAILURE = 1326;
  4411.  
  4412.   { Logon failure: user account restriction. }
  4413.   ERROR_ACCOUNT_RESTRICTION = 1327;
  4414.  
  4415.   { Logon failure: account logon time restriction violation. }
  4416.   ERROR_INVALID_LOGON_HOURS = 1328;
  4417.  
  4418.   { Logon failure: user not allowed to log on to this computer. }
  4419.   ERROR_INVALID_WORKSTATION = 1329;
  4420.  
  4421.   { Logon failure: the specified account password has expired. }
  4422.   ERROR_PASSWORD_EXPIRED = 1330;
  4423.  
  4424.   { Logon failure: account currently disabled. }
  4425.   ERROR_ACCOUNT_DISABLED = 1331;
  4426.  
  4427.   { No mapping between account names and security IDs was done. }
  4428.   ERROR_NONE_MAPPED = 1332;
  4429.  
  4430.   { Too many local user identifiers (LUIDs) were requested at one time. }
  4431.   ERROR_TOO_MANY_LUIDS_REQUESTED = 1333;
  4432.  
  4433.   { No more local user identifiers (LUIDs) are available. }
  4434.   ERROR_LUIDS_EXHAUSTED = 1334;
  4435.  
  4436.   { The subauthority part of a security ID is invalid for this particular use. }
  4437.   ERROR_INVALID_SUB_AUTHORITY = 1335;
  4438.  
  4439.   { The access control list (ACL) structure is invalid. }
  4440.   ERROR_INVALID_ACL = 1336;
  4441.  
  4442.   { The security ID structure is invalid. }
  4443.   ERROR_INVALID_SID = 1337;
  4444.  
  4445.   { The security descriptor structure is invalid. }
  4446.   ERROR_INVALID_SECURITY_DESCR = 1338;
  4447.  
  4448.   { The inherited access control list (ACL) or access control entry (ACE) }
  4449.   { could not be built. }
  4450.   ERROR_BAD_INHERITANCE_ACL = 1340;
  4451.  
  4452.   { The server is currently disabled. }
  4453.   ERROR_SERVER_DISABLED = 1341;
  4454.  
  4455.   { The server is currently enabled. }
  4456.   ERROR_SERVER_NOT_DISABLED = 1342;
  4457.  
  4458.   { The value provided was an invalid value for an identifier authority. }
  4459.   ERROR_INVALID_ID_AUTHORITY = 1343;
  4460.  
  4461.   { No more memory is available for security information updates. }
  4462.   ERROR_ALLOTTED_SPACE_EXCEEDED = 1344;
  4463.  
  4464.   { The specified attributes are invalid, or incompatible with the }
  4465.  
  4466.   { attributes for the group as a whole. }
  4467.   ERROR_INVALID_GROUP_ATTRIBUTES = 1345;
  4468.  
  4469.   { Either a required impersonation level was not provided, or the }
  4470.   { provided impersonation level is invalid. }
  4471.   ERROR_BAD_IMPERSONATION_LEVEL = 1346;
  4472.  
  4473.   { Cannot open an anonymous level security token. }
  4474.   ERROR_CANT_OPEN_ANONYMOUS = 1347;
  4475.  
  4476.   { The validation information class requested was invalid. }
  4477.   ERROR_BAD_VALIDATION_CLASS = 1348;
  4478.  
  4479.   { The type of the token is inappropriate for its attempted use. }
  4480.   ERROR_BAD_TOKEN_TYPE = 1349;
  4481.  
  4482.   { Unable to perform a security operation on an object }
  4483.   { which has no associated security. }
  4484.   ERROR_NO_SECURITY_ON_OBJECT = 1350;
  4485.  
  4486.   { Indicates a Windows NT Server could not be contacted or that }
  4487.   { objects within the domain are protected such that necessary }
  4488.   { information could not be retrieved. }
  4489.   ERROR_CANT_ACCESS_DOMAIN_INFO = 1351;
  4490.  
  4491.   { The security account manager (SAM) or local security }
  4492.   { authority (LSA) server was in the wrong state to perform }
  4493.   { the security operation. }
  4494.   ERROR_INVALID_SERVER_STATE = 1352;
  4495.  
  4496.   { The domain was in the wrong state to perform the security operation. }
  4497.   ERROR_INVALID_DOMAIN_STATE = 1353;
  4498.  
  4499.   { This operation is only allowed for the Primary Domain Controller of the domain. }
  4500.   ERROR_INVALID_DOMAIN_ROLE = 1354;
  4501.  
  4502.   { The specified domain did not exist. }
  4503.   ERROR_NO_SUCH_DOMAIN = 1355;
  4504.  
  4505.   { The specified domain already exists. }
  4506.   ERROR_DOMAIN_EXISTS = 1356;
  4507.  
  4508.   { An attempt was made to exceed the limit on the number of domains per server. }
  4509.   ERROR_DOMAIN_LIMIT_EXCEEDED = 1357;
  4510.  
  4511.   { Unable to complete the requested operation because of either a }
  4512.   { catastrophic media failure or a data structure corruption on the disk. }
  4513.   ERROR_INTERNAL_DB_CORRUPTION = 1358;
  4514.  
  4515.   { The security account database contains an internal inconsistency. }
  4516.   ERROR_INTERNAL_ERROR = 1359;
  4517.  
  4518.   { Generic access types were contained in an access mask which should }
  4519.   { already be mapped to non-generic types. }
  4520.   ERROR_GENERIC_NOT_MAPPED = 1360;
  4521.  
  4522.   { A security descriptor is not in the right format (absolute or self-relative). }
  4523.   ERROR_BAD_DESCRIPTOR_FORMAT = 1361;
  4524.  
  4525.   { The requested action is restricted for use by logon processes }
  4526.   { only.  The calling process has not registered as a logon process. }
  4527.   ERROR_NOT_LOGON_PROCESS = 1362;
  4528.  
  4529.   { Cannot start a new logon session with an ID that is already in use. }
  4530.   ERROR_LOGON_SESSION_EXISTS = 1363;
  4531.  
  4532.   { A specified authentication package is unknown. }
  4533.   ERROR_NO_SUCH_PACKAGE = 1364;
  4534.  
  4535.   { The logon session is not in a state that is consistent with the }
  4536.   { requested operation. }
  4537.   ERROR_BAD_LOGON_SESSION_STATE = 1365;
  4538.  
  4539.   { The logon session ID is already in use. }
  4540.   ERROR_LOGON_SESSION_COLLISION = 1366;
  4541.  
  4542.   { A logon request contained an invalid logon type value. }
  4543.   ERROR_INVALID_LOGON_TYPE = 1367;
  4544.  
  4545.   { Unable to impersonate via a named pipe until data has been read }
  4546.   { from that pipe. }
  4547.   ERROR_CANNOT_IMPERSONATE = 1368;
  4548.  
  4549.   { The transaction state of a Registry subtree is incompatible with the }
  4550.   { requested operation. }
  4551.   ERROR_RXACT_INVALID_STATE = 1369;
  4552.  
  4553.   { An internal security database corruption has been encountered. }
  4554.   ERROR_RXACT_COMMIT_FAILURE = 1370;
  4555.  
  4556.   { Cannot perform this operation on built-in accounts. }
  4557.   ERROR_SPECIAL_ACCOUNT = 1371;
  4558.  
  4559.   { Cannot perform this operation on this built-in special group. }
  4560.   ERROR_SPECIAL_GROUP = 1372;
  4561.  
  4562.   { Cannot perform this operation on this built-in special user. }
  4563.   ERROR_SPECIAL_USER = 1373;
  4564.  
  4565.   { The user cannot be removed from a group because the group }
  4566.   { is currently the user's primary group. }
  4567.   ERROR_MEMBERS_PRIMARY_GROUP = 1374;
  4568.  
  4569.   { The token is already in use as a primary token. }
  4570.   ERROR_TOKEN_ALREADY_IN_USE = 1375;
  4571.  
  4572.   { The specified local group does not exist. }
  4573.   ERROR_NO_SUCH_ALIAS = 1376;
  4574.  
  4575.   { The specified account name is not a member of the local group. }
  4576.   ERROR_MEMBER_NOT_IN_ALIAS = 1377;
  4577.  
  4578.   { The specified account name is already a member of the local group. }
  4579.   ERROR_MEMBER_IN_ALIAS = 1378;
  4580.  
  4581.   { The specified local group already exists. }
  4582.   ERROR_ALIAS_EXISTS = 1379;
  4583.  
  4584.   { Logon failure: the user has not been granted the requested }
  4585.   { logon type at this computer. }
  4586.   ERROR_LOGON_NOT_GRANTED = 1380;
  4587.  
  4588.   { The maximum number of secrets that may be stored in a single system has been }
  4589.   { exceeded. }
  4590.   ERROR_TOO_MANY_SECRETS = 1381;
  4591.  
  4592.   { The length of a secret exceeds the maximum length allowed. }
  4593.   ERROR_SECRET_TOO_LONG = 1382;
  4594.  
  4595.   { The local security authority database contains an internal inconsistency. }
  4596.   ERROR_INTERNAL_DB_ERROR = 1383;
  4597.  
  4598.   { During a logon attempt, the user's security context accumulated too many }
  4599.   { security IDs. }
  4600.   ERROR_TOO_MANY_CONTEXT_IDS = 1384;
  4601.  
  4602.   { Logon failure: the user has not been granted the requested logon type }
  4603.   { at this computer. }
  4604.   ERROR_LOGON_TYPE_NOT_GRANTED = 1385;
  4605.  
  4606.   { A cross-encrypted password is necessary to change a user password. }
  4607.   ERROR_NT_CROSS_ENCRYPTION_REQUIR = 1386;
  4608.  
  4609.   { A new member could not be added to a local group because the member does }
  4610.   { not exist. }
  4611.   ERROR_NO_SUCH_MEMBER = 1387;
  4612.  
  4613.   { A new member could not be added to a local group because the member has the }
  4614.   { wrong account type. }
  4615.   ERROR_INVALID_MEMBER = 1388;
  4616.  
  4617.   { Too many security IDs have been specified. }
  4618.   ERROR_TOO_MANY_SIDS = 1389;
  4619.  
  4620.   { A cross-encrypted password is necessary to change this user password. }
  4621.   ERROR_LM_CROSS_ENCRYPTION_REQUIR = 1390;
  4622.  
  4623.   { Indicates an TACL contains no inheritable components }
  4624.   ERROR_NO_INHERITANCE = 1391;
  4625.  
  4626.   { The file or directory is corrupt and non-readable. }
  4627.   ERROR_FILE_CORRUPT = 1392;
  4628.  
  4629.   { The disk structure is corrupt and non-readable. }
  4630.   ERROR_DISK_CORRUPT = 1393;
  4631.  
  4632.   { There is no user session key for the specified logon session. }
  4633.   ERROR_NO_USER_SESSION_KEY = 1394;
  4634.  
  4635.   { The service being accessed is licensed for a particular number of connections. }
  4636.   { No more connections can be made to the service at this time }
  4637.   { because there are already as many connections as the service can accept. }
  4638.   ERROR_LICENSE_QUOTA_EXCEEDED = 1395;
  4639.  
  4640.  
  4641. { WinUser Error Codes }
  4642.  
  4643.   { Invalid window handle. }
  4644.   ERROR_INVALID_WINDOW_HANDLE = 1400;
  4645.  
  4646.   { Invalid menu handle. }
  4647.   ERROR_INVALID_MENU_HANDLE = 1401;
  4648.  
  4649.   { Invalid cursor handle. }
  4650.   ERROR_INVALID_CURSOR_HANDLE = 1402;
  4651.  
  4652.   { Invalid accelerator table handle. }
  4653.   ERROR_INVALID_ACCEL_HANDLE = 1403;
  4654.  
  4655.   { Invalid hook handle. }
  4656.   ERROR_INVALID_HOOK_HANDLE = 1404;
  4657.  
  4658.   { Invalid handle to a multiple-window position structure. }
  4659.   ERROR_INVALID_DWP_HANDLE = 1405;
  4660.  
  4661.   { Cannot create a top-level child window. }
  4662.   ERROR_TLW_WITH_WSCHILD = 1406;
  4663.  
  4664.   { Cannot find window class. }
  4665.   ERROR_CANNOT_FIND_WND_CLASS = 1407;
  4666.  
  4667.   { Invalid window, belongs to other thread. }
  4668.   ERROR_WINDOW_OF_OTHER_THREAD = 1408;
  4669.  
  4670.   { Hot key is already registered. }
  4671.   ERROR_HOTKEY_ALREADY_REGISTERED = 1409;
  4672.  
  4673.   { Class already exists. }
  4674.   ERROR_CLASS_ALREADY_EXISTS = 1410;
  4675.  
  4676.   { Class does not exist. }
  4677.   ERROR_CLASS_DOES_NOT_EXIST = 1411;
  4678.  
  4679.   { Class still has open windows. }
  4680.   ERROR_CLASS_HAS_WINDOWS = 1412;
  4681.  
  4682.   { Invalid index. }
  4683.   ERROR_INVALID_INDEX = 1413;
  4684.  
  4685.   { Invalid icon handle. }
  4686.   ERROR_INVALID_ICON_HANDLE = 1414;
  4687.  
  4688.   { Using private DIALOG window words. }
  4689.   ERROR_PRIVATE_DIALOG_INDEX = 1415;
  4690.  
  4691.   { The listbox identifier was not found. }
  4692.   ERROR_LISTBOX_ID_NOT_FOUND = 1416;
  4693.  
  4694.   { No wildcards were found. }
  4695.   ERROR_NO_WILDCARD_CHARACTERS = 1417;
  4696.  
  4697.   { Thread does not have a clipboard open. }
  4698.   ERROR_CLIPBOARD_NOT_OPEN = 1418;
  4699.  
  4700.   { Hot key is not registered. }
  4701.   ERROR_HOTKEY_NOT_REGISTERED = 1419;
  4702.  
  4703.   { The window is not a valid dialog window. }
  4704.   ERROR_WINDOW_NOT_DIALOG = 1420;
  4705.  
  4706.   { Control ID not found. }
  4707.   ERROR_CONTROL_ID_NOT_FOUND = 1421;
  4708.  
  4709.   { Invalid message for a combo box because it does not have an edit control. }
  4710.   ERROR_INVALID_COMBOBOX_MESSAGE = 1422;
  4711.  
  4712.   { The window is not a combo box. }
  4713.   ERROR_WINDOW_NOT_COMBOBOX = 1423;
  4714.  
  4715.   { Height must be less than 256. }
  4716.   ERROR_INVALID_EDIT_HEIGHT = 1424;
  4717.  
  4718.   { Invalid device context (DC) handle. }
  4719.   ERROR_DC_NOT_FOUND = 1425;
  4720.  
  4721.   { Invalid hook procedure type. }
  4722.   ERROR_INVALID_HOOK_FILTER = 1426;
  4723.  
  4724.   { Invalid hook procedure. }
  4725.   ERROR_INVALID_FILTER_PROC = 1427;
  4726.  
  4727.   { Cannot set non-local hook without a module handle. }
  4728.   ERROR_HOOK_NEEDS_HMOD = 1428;
  4729.  
  4730.   { This hook procedure can only be set globally. }
  4731.   ERROR_GLOBAL_ONLY_HOOK = 1429;
  4732.  
  4733.   { The journal hook procedure is already installed. }
  4734.   ERROR_JOURNAL_HOOK_SET = 1430;
  4735.  
  4736.   { The hook procedure is not installed. }
  4737.   ERROR_HOOK_NOT_INSTALLED = 1431;
  4738.  
  4739.   { Invalid message for single-selection listbox. }
  4740.   ERROR_INVALID_LB_MESSAGE = 1432;
  4741.  
  4742.   { LB_SETCOUNT sent to non-lazy listbox. }
  4743.   ERROR_SETCOUNT_ON_BAD_LB = 1433;
  4744.  
  4745.   { This list box does not support tab stops. }
  4746.   ERROR_LB_WITHOUT_TABSTOPS = 1434;
  4747.  
  4748.   { Cannot destroy object created by another thread. }
  4749.   ERROR_DESTROY_OBJECT_OF_OTHER_TH = 1435;
  4750.  
  4751.   { Child windows cannot have menus. }
  4752.   ERROR_CHILD_WINDOW_MENU = 1436;
  4753.  
  4754.   { The window does not have a system menu. }
  4755.   ERROR_NO_SYSTEM_MENU = 1437;
  4756.  
  4757.   { Invalid message box style. }
  4758.   ERROR_INVALID_MSGBOX_STYLE = 1438;
  4759.  
  4760.   { Invalid system-wide (SPI_*) parameter. }
  4761.   ERROR_INVALID_SPI_VALUE = 1439;
  4762.  
  4763.   { Screen already locked. }
  4764.   ERROR_SCREEN_ALREADY_LOCKED = 1440;
  4765.  
  4766.   { All handles to windows in a multiple-window position structure must }
  4767.   { have the same parent. }
  4768.   ERROR_HWNDS_HAVE_DIFF_PARENT = 1441;
  4769.  
  4770.   { The window is not a child window. }
  4771.   ERROR_NOT_CHILD_WINDOW = 1442;
  4772.  
  4773.   { Invalid GW_* command. }
  4774.   ERROR_INVALID_GW_COMMAND = 1443;
  4775.  
  4776.   { Invalid thread identifier. }
  4777.   ERROR_INVALID_THREAD_ID = 1444;
  4778.  
  4779.   { Cannot process a message from a window that is not a multiple document }
  4780.   { interface (MDI) window. }
  4781.   ERROR_NON_MDICHILD_WINDOW = 1445;
  4782.  
  4783.   { Popup menu already active. }
  4784.   ERROR_POPUP_ALREADY_ACTIVE = 1446;
  4785.  
  4786.   { The window does not have scroll bars. }
  4787.   ERROR_NO_SCROLLBARS = 1447;
  4788.  
  4789.   { Scroll bar range cannot be greater than $7FFF. }
  4790.   ERROR_INVALID_SCROLLBAR_RANGE = 1448;
  4791.  
  4792.   { Cannot show or remove the window in the way specified. }
  4793.   ERROR_INVALID_SHOWWIN_COMMAND = 1449;
  4794.  
  4795.  
  4796. { Eventlog Status Codes }
  4797.  
  4798.   { The event log file is corrupt. }
  4799.   ERROR_EVENTLOG_FILE_CORRUPT = 1500;
  4800.  
  4801.   { No event log file could be opened, so the event logging service did not start. }
  4802.   ERROR_EVENTLOG_CANT_START = 1501;
  4803.  
  4804.   { The event log file is full. }
  4805.   ERROR_LOG_FILE_FULL = 1502;
  4806.  
  4807.   { The event log file has changed between reads. }
  4808.   ERROR_EVENTLOG_FILE_CHANGED = 1503;
  4809.  
  4810.  
  4811. { RPC Status Codes }
  4812.  
  4813.   { The string binding is invalid. }
  4814.   RPC_S_INVALID_STRING_BINDING = 1700;
  4815.  
  4816.   { The binding handle is not the correct type. }
  4817.   RPC_S_WRONG_KIND_OF_BINDING = 1701;
  4818.  
  4819.   { The binding handle is invalid. }
  4820.   RPC_S_INVALID_BINDING = 1702;
  4821.  
  4822.   { The RPC protocol sequence is not supported. }
  4823.   RPC_S_PROTSEQ_NOT_SUPPORTED = 1703;
  4824.  
  4825.   { The RPC protocol sequence is invalid. }
  4826.   RPC_S_INVALID_RPC_PROTSEQ = 1704;
  4827.  
  4828.   { The string universal unique identifier (UUID) is invalid. }
  4829.   RPC_S_INVALID_STRING_UUID = 1705;
  4830.  
  4831.   { The endpoint format is invalid. }
  4832.   RPC_S_INVALID_ENDPOINT_FORMAT = 1706;
  4833.  
  4834.   { The network address is invalid. }
  4835.   RPC_S_INVALID_NET_ADDR = 1707;
  4836.  
  4837.   { No endpoint was found. }
  4838.   RPC_S_NO_ENDPOINT_FOUND = 1708;
  4839.  
  4840.   { The timeout value is invalid. }
  4841.   RPC_S_INVALID_TIMEOUT = 1709;
  4842.  
  4843.   { The object universal unique identifier (UUID) was not found. }
  4844.   RPC_S_OBJECT_NOT_FOUND = 1710;
  4845.  
  4846.   { The object universal unique identifier (UUID) has already been registered. }
  4847.   RPC_S_ALREADY_REGISTERED = 1711;
  4848.  
  4849.   { The type universal unique identifier (UUID) has already been registered. }
  4850.   RPC_S_TYPE_ALREADY_REGISTERED = 1712;
  4851.  
  4852.   { The RPC server is already listening. }
  4853.   RPC_S_ALREADY_LISTENING = 1713;
  4854.  
  4855.   { No protocol sequences have been registered. }
  4856.   RPC_S_NO_PROTSEQS_REGISTERED = 1714;
  4857.  
  4858.   { The RPC server is not listening. }
  4859.   RPC_S_NOT_LISTENING = 1715;
  4860.  
  4861.   { The manager type is unknown. }
  4862.   RPC_S_UNKNOWN_MGR_TYPE = 1716;
  4863.  
  4864.   { The interface is unknown. }
  4865.   RPC_S_UNKNOWN_IF = 1717;
  4866.  
  4867.   { There are no bindings. }
  4868.   RPC_S_NO_BINDINGS = 1718;
  4869.  
  4870.   { There are no protocol sequences. }
  4871.   RPC_S_NO_PROTSEQS = 1719;
  4872.  
  4873.   { The endpoint cannot be created. }
  4874.   RPC_S_CANT_CREATE_ENDPOINT = 1720;
  4875.  
  4876.   { Not enough resources are available to complete this operation. }
  4877.   RPC_S_OUT_OF_RESOURCES = 1721;
  4878.  
  4879.   { The RPC server is unavailable. }
  4880.   RPC_S_SERVER_UNAVAILABLE = 1722;
  4881.  
  4882.   { The RPC server is too busy to complete this operation. }
  4883.   RPC_S_SERVER_TOO_BUSY = 1723;
  4884.  
  4885.   { The network options are invalid. }
  4886.   RPC_S_INVALID_NETWORK_OPTIONS = 1724;
  4887.  
  4888.   { There is not a remote procedure call active in this thread. }
  4889.   RPC_S_NO_CALL_ACTIVE = 1725;
  4890.  
  4891.   { The remote procedure call failed. }
  4892.   RPC_S_CALL_FAILED = 1726;
  4893.  
  4894.   { The remote procedure call failed and did not execute. }
  4895.   RPC_S_CALL_FAILED_DNE = 1727;
  4896.  
  4897.   { A remote procedure call (RPC) protocol error occurred. }
  4898.   RPC_S_PROTOCOL_ERROR = 1728;
  4899.  
  4900.   { The transfer syntax is not supported by the RPC server. }
  4901.   RPC_S_UNSUPPORTED_TRANS_SYN = 1730;
  4902.  
  4903.   { The universal unique identifier (UUID) type is not supported. }
  4904.   RPC_S_UNSUPPORTED_TYPE = 1732;
  4905.  
  4906.   { The tag is invalid. }
  4907.   RPC_S_INVALID_TAG = 1733;
  4908.  
  4909.   { The array bounds are invalid. }
  4910.   RPC_S_INVALID_BOUND = 1734;
  4911.  
  4912.   { The binding does not contain an entry name. }
  4913.   RPC_S_NO_ENTRY_NAME = 1735;
  4914.  
  4915.   { The name syntax is invalid. }
  4916.   RPC_S_INVALID_NAME_SYNTAX = 1736;
  4917.  
  4918.   { The name syntax is not supported. }
  4919.   RPC_S_UNSUPPORTED_NAME_SYNTAX = 1737;
  4920.  
  4921.   { No network address is available to use to construct a universal }
  4922.  
  4923.   { unique identifier (UUID). }
  4924.   RPC_S_UUID_NO_ADDRESS = 1739;
  4925.  
  4926.   { The endpoint is a duplicate. }
  4927.   RPC_S_DUPLICATE_ENDPOINT = 1740;
  4928.  
  4929.   { The authentication type is unknown. }
  4930.   RPC_S_UNKNOWN_AUTHN_TYPE = 1741;
  4931.  
  4932.   { The maximum number of calls is too small. }
  4933.   RPC_S_MAX_CALLS_TOO_SMALL = 1742;
  4934.  
  4935.   { The string is too long. }
  4936.   RPC_S_STRING_TOO_LONG = 1743;
  4937.  
  4938.   { The RPC protocol sequence was not found. }
  4939.   RPC_S_PROTSEQ_NOT_FOUND = 1744;
  4940.  
  4941.   { The procedure number is out of range. }
  4942.   RPC_S_PROCNUM_OUT_OF_RANGE = 1745;
  4943.  
  4944.   { The binding does not contain any authentication information. }
  4945.   RPC_S_BINDING_HAS_NO_AUTH = 1746;
  4946.  
  4947.   { The authentication service is unknown. }
  4948.   RPC_S_UNKNOWN_AUTHN_SERVICE = 1747;
  4949.  
  4950.   { The authentication level is unknown. }
  4951.   RPC_S_UNKNOWN_AUTHN_LEVEL = 1748;
  4952.  
  4953.   { The security context is invalid. }
  4954.   RPC_S_INVALID_AUTH_IDENTITY = 1749;
  4955.  
  4956.   { The authorization service is unknown. }
  4957.   RPC_S_UNKNOWN_AUTHZ_SERVICE = 1750;
  4958.  
  4959.   { The entry is invalid. }
  4960.   EPT_S_INVALID_ENTRY = 1751;
  4961.  
  4962.   { The server endpoint cannot perform the operation. }
  4963.   EPT_S_CANT_PERFORM_OP = 1752;
  4964.  
  4965.   { There are no more endpoints available from the endpoint mapper. }
  4966.   EPT_S_NOT_REGISTERED = 1753;
  4967.  
  4968.   { No interfaces have been exported. }
  4969.   RPC_S_NOTHING_TO_EXPORT = 1754;
  4970.  
  4971.   { The entry name is incomplete. }
  4972.   RPC_S_INCOMPLETE_NAME = 1755;
  4973.  
  4974.   { The version option is invalid. }
  4975.   RPC_S_INVALID_VERS_OPTION = 1756;
  4976.  
  4977.   { There are no more members. }
  4978.   RPC_S_NO_MORE_MEMBERS = 1757;
  4979.  
  4980.   { There is nothing to unexport. }
  4981.   RPC_S_NOT_ALL_OBJS_UNEXPORTED = 1758;
  4982.  
  4983.   { The interface was not found. }
  4984.   RPC_S_INTERFACE_NOT_FOUND = 1759;
  4985.  
  4986.   { The entry already exists. }
  4987.   RPC_S_ENTRY_ALREADY_EXISTS = 1760;
  4988.  
  4989.   { The entry is not found. }
  4990.   RPC_S_ENTRY_NOT_FOUND = 1761;
  4991.  
  4992.   { The name service is unavailable. }
  4993.   RPC_S_NAME_SERVICE_UNAVAILABLE = 1762;
  4994.  
  4995.   { The network address family is invalid. }
  4996.   RPC_S_INVALID_NAF_ID = 1763;
  4997.  
  4998.   { The requested operation is not supported. }
  4999.   RPC_S_CANNOT_SUPPORT = 1764;
  5000.  
  5001.   { No security context is available to allow impersonation. }
  5002.   RPC_S_NO_CONTEXT_AVAILABLE = 1765;
  5003.  
  5004.   { An internal error occurred in a remote procedure call (RPC). }
  5005.   RPC_S_INTERNAL_ERROR = 1766;
  5006.  
  5007.   { The RPC server attempted an integer division by zero. }
  5008.   RPC_S_ZERO_DIVIDE = 1767;
  5009.  
  5010.   { An addressing error occurred in the RPC server. }
  5011.   RPC_S_ADDRESS_ERROR = 1768;
  5012.  
  5013.   { A floating-point operation at the RPC server caused a division by zero. }
  5014.   RPC_S_FP_DIV_ZERO = 1769;
  5015.  
  5016.   { A floating-point underflow occurred at the RPC server. }
  5017.   RPC_S_FP_UNDERFLOW = 1770;
  5018.  
  5019.   { A floating-point overflow occurred at the RPC server. }
  5020.   RPC_S_FP_OVERFLOW = 1771;
  5021.  
  5022.   { The list of RPC servers available for the binding of auto handles }
  5023.   { has been exhausted. }
  5024.   RPC_X_NO_MORE_ENTRIES = 1772;
  5025.  
  5026.   { Unable to open the character translation table file. }
  5027.   RPC_X_SS_CHAR_TRANS_OPEN_FAIL = 1773;
  5028.  
  5029.   { The file containing the character translation table has fewer than }
  5030.   { 512 bytes. }
  5031.   RPC_X_SS_CHAR_TRANS_SHORT_FILE = 1774;
  5032.  
  5033.   { A null context handle was passed from the client to the host during }
  5034.   { a remote procedure call. }
  5035.   RPC_X_SS_IN_NULL_CONTEXT = 1775;
  5036.  
  5037.   { The context handle changed during a remote procedure call. }
  5038.   RPC_X_SS_CONTEXT_DAMAGED = 1777;
  5039.  
  5040.   { The binding handles passed to a remote procedure call do not match. }
  5041.   RPC_X_SS_HANDLES_MISMATCH = 1778;
  5042.  
  5043.   { The stub is unable to get the remote procedure call handle. }
  5044.   RPC_X_SS_CANNOT_GET_CALL_HANDLE = 1779;
  5045.  
  5046.   { A null reference pointer was passed to the stub. }
  5047.   RPC_X_NULL_REF_POINTER = 1780;
  5048.  
  5049.   { The enumeration value is out of range. }
  5050.   RPC_X_ENUM_VALUE_OUT_OF_RANGE = 1781;
  5051.  
  5052.   { The byte count is too small. }
  5053.   RPC_X_BYTE_COUNT_TOO_SMALL = 1782;
  5054.  
  5055.   { The stub received bad data. }
  5056.   RPC_X_BAD_STUB_DATA = 1783;
  5057.  
  5058.   { The supplied user buffer is not valid for the requested operation. }
  5059.   ERROR_INVALID_USER_BUFFER = 1784;
  5060.  
  5061.   { The disk media is not recognized.  It may not be formatted. }
  5062.   ERROR_UNRECOGNIZED_MEDIA = 1785;
  5063.  
  5064.   { The workstation does not have a trust secret. }
  5065.   ERROR_NO_TRUST_LSA_SECRET = 1786;
  5066.  
  5067.   { The SAM database on the Windows NT Server does not have a computer }
  5068.   { account for this workstation trust relationship. }
  5069.   ERROR_NO_TRUST_SAM_ACCOUNT = 1787;
  5070.  
  5071.   { The trust relationship between the primary domain and the trusted }
  5072.   { domain failed. }
  5073.   ERROR_TRUSTED_DOMAIN_FAILURE = 1788;
  5074.  
  5075.   { The trust relationship between this workstation and the primary }
  5076.   { domain failed. }
  5077.   ERROR_TRUSTED_RELATIONSHIP_FAILU = 1789;
  5078.  
  5079.   { The network logon failed. }
  5080.   ERROR_TRUST_FAILURE = 1790;
  5081.  
  5082.   { A remote procedure call is already in progress for this thread. }
  5083.   RPC_S_CALL_IN_PROGRESS = 1791;
  5084.  
  5085.   { An attempt was made to logon, but the network logon service was not started. }
  5086.   ERROR_NETLOGON_NOT_STARTED = 1792;
  5087.  
  5088.   { The user's account has expired. }
  5089.   ERROR_ACCOUNT_EXPIRED = 1793;
  5090.  
  5091.   { The redirector is in use and cannot be unloaded. }
  5092.   ERROR_REDIRECTOR_HAS_OPEN_HANDLE = 1794;
  5093.  
  5094.   { The specified printer driver is already installed. }
  5095.   ERROR_PRINTER_DRIVER_ALREADY_INS = 1795;
  5096.  
  5097.   { The specified port is unknown. }
  5098.   ERROR_UNKNOWN_PORT = 1796;
  5099.  
  5100.   { The printer driver is unknown. }
  5101.   ERROR_UNKNOWN_PRINTER_DRIVER = 1797;
  5102.  
  5103.   { The print processor is unknown. }
  5104.   ERROR_UNKNOWN_PRINTPROCESSOR = 1798;
  5105.  
  5106.   { The specified separator file is invalid. }
  5107.   ERROR_INVALID_SEPARATOR_FILE = 1799;
  5108.  
  5109.   { The specified priority is invalid. }
  5110.   ERROR_INVALID_PRIORITY = 1800;
  5111.  
  5112.   { The printer name is invalid. }
  5113.   ERROR_INVALID_PRINTER_NAME = 1801;
  5114.  
  5115.   { The printer already exists. }
  5116.   ERROR_PRINTER_ALREADY_EXISTS = 1802;
  5117.  
  5118.   { The printer command is invalid. }
  5119.   ERROR_INVALID_PRINTER_COMMAND = 1803;
  5120.  
  5121.   { The specified datatype is invalid. }
  5122.   ERROR_INVALID_DATATYPE = 1804;
  5123.  
  5124.   { The Environment specified is invalid. }
  5125.   ERROR_INVALID_ENVIRONMENT = 1805;
  5126.  
  5127.   { There are no more bindings. }
  5128.   RPC_S_NO_MORE_BINDINGS = 1806;
  5129.  
  5130.   { The account used is an interdomain trust account.  Use your global user account or local user account to access this server. }
  5131.   ERROR_NOLOGON_INTERDOMAIN_TRUST_ = 1807;
  5132.  
  5133.   { The account used is a Computer Account.  Use your global user account or local user account to access this server. }
  5134.   ERROR_NOLOGON_WORKSTATION_TRUST_ = 1808;
  5135.  
  5136.   { The account used is an server trust account.  Use your global user account or local user account to access this server. }
  5137.   ERROR_NOLOGON_SERVER_TRUST_ACCOU = 1809;
  5138.  
  5139.   { The name or security ID (SID) of the domain specified is inconsistent }
  5140.   { with the trust information for that domain. }
  5141.   ERROR_DOMAIN_TRUST_INCONSISTENT = 1810;
  5142.  
  5143.   { The server is in use and cannot be unloaded. }
  5144.   ERROR_SERVER_HAS_OPEN_HANDLES = 1811;
  5145.  
  5146.   { The specified image file did not contain a resource section. }
  5147.   ERROR_RESOURCE_DATA_NOT_FOUND = 1812;
  5148.  
  5149.   { The specified resource type can not be found in the image file. }
  5150.   ERROR_RESOURCE_TYPE_NOT_FOUND = 1813;
  5151.  
  5152.   { The specified resource name can not be found in the image file. }
  5153.   ERROR_RESOURCE_NAME_NOT_FOUND = 1814;
  5154.  
  5155.   { The specified resource language ID cannot be found in the image file. }
  5156.   ERROR_RESOURCE_LANG_NOT_FOUND = 1815;
  5157.  
  5158.   { Not enough quota is available to process this command. }
  5159.   ERROR_NOT_ENOUGH_QUOTA = 1816;
  5160.  
  5161.   { No interfaces have been registered. }
  5162.   RPC_S_NO_INTERFACES = 1817;
  5163.  
  5164.   { The server was altered while processing this call. }
  5165.   RPC_S_CALL_CANCELLED = 1818;
  5166.  
  5167.   { The binding handle does not contain all required information. }
  5168.   RPC_S_BINDING_INCOMPLETE = 1819;
  5169.  
  5170.   { Communications failure. }
  5171.   RPC_S_COMM_FAILURE = 1820;
  5172.  
  5173.   { The requested authentication level is not supported. }
  5174.   RPC_S_UNSUPPORTED_AUTHN_LEVEL = 1821;
  5175.  
  5176.   { No principal name registered. }
  5177.   RPC_S_NO_PRINC_NAME = 1822;
  5178.  
  5179.   { The error specified is not a valid Windows NT RPC error code. }
  5180.   RPC_S_NOT_RPC_ERROR = 1823;
  5181.  
  5182.   { A UUID that is valid only on this computer has been allocated. }
  5183.   RPC_S_UUID_LOCAL_ONLY = 1824;
  5184.  
  5185.   { A security package specific error occurred. }
  5186.   RPC_S_SEC_PKG_ERROR = 1825;
  5187.  
  5188.   { Thread is not cancelled. }
  5189.   RPC_S_NOT_CANCELLED = 1826;
  5190.  
  5191.   { Invalid operation on the encoding/decoding handle. }
  5192.   RPC_X_INVALID_ES_ACTION = 1827;
  5193.  
  5194.   { Incompatible version of the serializing package. }
  5195.   RPC_X_WRONG_ES_VERSION = 1828;
  5196.  
  5197.   { Incompatible version of the RPC stub. }
  5198.   RPC_X_WRONG_STUB_VERSION = 1829;
  5199.  
  5200.   { The group member was not found. }
  5201.   RPC_S_GROUP_MEMBER_NOT_FOUND = 1898;
  5202.  
  5203.   { The endpoint mapper database could not be created. }
  5204.   EPT_S_CANT_CREATE = 1899;
  5205.  
  5206.   { The object universal unique identifier (UUID) is the nil UUID. }
  5207.   RPC_S_INVALID_OBJECT = 1900;
  5208.  
  5209.   { The specified time is invalid. }
  5210.   ERROR_INVALID_TIME = 1901;
  5211.  
  5212.   { The specified Form name is invalid. }
  5213.   ERROR_INVALID_FORM_NAME = 1902;
  5214.  
  5215.   { The specified Form size is invalid }
  5216.   ERROR_INVALID_FORM_SIZE = 1903;
  5217.  
  5218.   { The specified Printer handle is already being waited on }
  5219.   ERROR_ALREADY_WAITING = 1904;
  5220.  
  5221.   { The specified Printer has been deleted }
  5222.   ERROR_PRINTER_DELETED = 1905;
  5223.  
  5224.   { The state of the Printer is invalid }
  5225.   ERROR_INVALID_PRINTER_STATE = 1906;
  5226.  
  5227.   { The user must change his password before he logs on the first time. }
  5228.   ERROR_PASSWORD_MUST_CHANGE = 1907;
  5229.  
  5230.   { Could not find the domain controller for this domain. }
  5231.   ERROR_DOMAIN_CONTROLLER_NOT_FOUN = 1908;
  5232.  
  5233.   { The referenced account is currently locked out and may not be logged on to. }
  5234.   ERROR_ACCOUNT_LOCKED_OUT = 1909;
  5235.  
  5236.   { The list of servers for this workgroup is not currently available }
  5237.   ERROR_NO_BROWSER_SERVERS_FOUND = 6118;
  5238.  
  5239.  
  5240. { OpenGL Error Code }
  5241.  
  5242.   { The pixel format is invalid. }
  5243.   ERROR_INVALID_PIXEL_FORMAT = 2000;
  5244.  
  5245.   { The specified driver is invalid. }
  5246.   ERROR_BAD_DRIVER = 2001;
  5247.  
  5248.   { The window style or class attribute is invalid for this operation. }
  5249.   ERROR_INVALID_WINDOW_STYLE = 2002;
  5250.  
  5251.   { The requested metafile operation is not supported. }
  5252.   ERROR_METAFILE_NOT_SUPPORTED = 2003;
  5253.  
  5254.   { The requested transformation operation is not supported. }
  5255.   ERROR_TRANSFORM_NOT_SUPPORTED = 2004;
  5256.  
  5257.   { The requested clipping operation is not supported. }
  5258.   ERROR_CLIPPING_NOT_SUPPORTED = 2005;
  5259.  
  5260.  
  5261. { Win32 Spooler Error Codes }
  5262.  
  5263.   { The specified print monitor is unknown. }
  5264.   ERROR_UNKNOWN_PRINT_MONITOR = 3000;
  5265.  
  5266.   { The specified printer driver is currently in use. }
  5267.   ERROR_PRINTER_DRIVER_IN_USE = 3001;
  5268.  
  5269.   { The spool file was not found. }
  5270.   ERROR_SPOOL_FILE_NOT_FOUND = 3002;
  5271.  
  5272.   { A StartDocPrinter call was not issued. }
  5273.   ERROR_SPL_NO_STARTDOC = 3003;
  5274.  
  5275.   { An AddJob call was not issued. }
  5276.   ERROR_SPL_NO_ADDJOB = 3004;
  5277.  
  5278.   { The specified print processor has already been installed. }
  5279.   ERROR_PRINT_PROCESSOR_ALREADY_IN = 3005;
  5280.  
  5281.   { The specified print monitor has already been installed. }
  5282.   ERROR_PRINT_MONITOR_ALREADY_INST = 3006;
  5283.  
  5284.  
  5285. { Wins Error Codes }
  5286.  
  5287.   { WINS encountered an error while processing the command. }
  5288.   ERROR_WINS_INTERNAL = 4000;
  5289.  
  5290.   { The local WINS can not be deleted. }
  5291.   ERROR_CAN_NOT_DEL_LOCAL_WINS = 4001;
  5292.  
  5293.   { The importation from the file failed. }
  5294.   ERROR_STATIC_INIT = 4002;
  5295.  
  5296.   { The backup Failed.  Was a full backup done before ? }
  5297.   ERROR_INC_BACKUP = 4003;
  5298.  
  5299.   { The backup Failed.  Check the directory that you are backing the database to. }
  5300.   ERROR_FULL_BACKUP = 4004;
  5301.  
  5302.   { The name does not exist in the WINS database. }
  5303.   ERROR_REC_NON_EXISTENT = 4005;
  5304.  
  5305.   { Replication with a non-configured partner is not allowed. }
  5306.   ERROR_RPL_NOT_ALLOWED = 4006;
  5307.  
  5308.  
  5309. {------------------------------}
  5310. {     OLE Error Codes          }
  5311. {------------------------------}
  5312.  
  5313. (*
  5314.   The return value of OLE APIs and methods is an HRESULT.
  5315.   This is not a handle to anything, but is merely a 32-bit value
  5316.   with several fields encoded in the value.  The parts of an
  5317.   HRESULT are shown below.
  5318.  
  5319.   HRESULTs are 32 bit values layed out as follows:
  5320.  
  5321.    3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
  5322.    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
  5323.   +-+-+-+-+-+---------------------+-------------------------------+
  5324.   |S|R|C|N|r|    Facility         |               Code            |
  5325.   +-+-+-+-+-+---------------------+-------------------------------+
  5326.  
  5327.   where
  5328.  
  5329.       S - Severity - indicates success/fail
  5330.           0 - Success
  5331.           1 - Fail (COERROR)
  5332.  
  5333.       R - reserved portion of the facility code, corresponds to NT's
  5334.               second severity bit.
  5335.  
  5336.       C - reserved portion of the facility code, corresponds to NT's
  5337.               C field.
  5338.  
  5339.       N - reserved portion of the facility code. Used to indicate a
  5340.               mapped NT status value.
  5341.  
  5342.       r - reserved portion of the facility code. Reserved for internal
  5343.               use. Used to indicate HRESULT values that are not status
  5344.               values, but are instead message ids for display strings.
  5345.  
  5346.       Facility - is the facility code
  5347.  
  5348.       Code - is the facility's status code
  5349. *)
  5350.  
  5351. const
  5352.   { Severity values }
  5353.   SEVERITY_SUCCESS = 0;
  5354.   SEVERITY_ERROR = 1;
  5355.  
  5356. type
  5357.   HRESULT = Longint;  { from WTYPES.H }
  5358.  
  5359. function Succeeded(Status: HRESULT): BOOL;
  5360.  
  5361. { and the inverse }
  5362. function Failed(Status: HRESULT): BOOL;
  5363.  
  5364. { Generic test for error on any status value. }
  5365. function IsError(Status: HRESULT): BOOL;
  5366.  
  5367. { Return the code }
  5368. function HResultCode(hr: HRESULT): Integer;
  5369.  
  5370. { Return the facility }
  5371. function HResultFacility(hr: HRESULT): Integer;
  5372.  
  5373. { Return the severity }
  5374. function HResultSeverity(hr: HRESULT): Integer;
  5375.  
  5376. { Create an HRESULT value from component pieces }
  5377. function MakeResult(sev, fac, code: Integer): HResult;
  5378.  
  5379. { Map a WIN32 error value into a HRESULT }
  5380. { Note: This assumes that WIN32 errors fall in the range -32k to 32k. }
  5381. const
  5382.   { Define bits here so macros are guaranteed to work }
  5383.   FACILITY_NT_BIT = $10000000;
  5384. function HResultFromWin32(x: Integer): HRESULT;
  5385.  
  5386. { Map an NT status value into a HRESULT }
  5387. function HResultFromNT(x: Integer): HRESULT;
  5388.  
  5389. const
  5390.   { HRESULT value definitions }
  5391.   { Codes $4000-$40ff are reserved for OLE }
  5392.  
  5393.   { Success codes }
  5394.   S_OK    = $00000000;
  5395.   S_FALSE = $00000001;
  5396.  
  5397.   NOERROR = S_OK;
  5398.  
  5399.   { Catastrophic failure }
  5400.   E_UNEXPECTED = $8000FFFF;
  5401.  
  5402.   { Not implemented }
  5403.   E_NOTIMPL = $80000001;
  5404.  
  5405.   { Ran out of memory }
  5406.   E_OUTOFMEMORY = $80000002;
  5407.  
  5408.   { One or more arguments are invalid }
  5409.   E_INVALIDARG = $80000003;
  5410.  
  5411.   { No such interface supported }
  5412.   E_NOINTERFACE = $80000004;
  5413.  
  5414.   { Invalid pointer }
  5415.   E_POINTER = $80000005;
  5416.  
  5417.   { Invalid handle }
  5418.   E_HANDLE = $80000006;
  5419.  
  5420.   { Operation aborted }
  5421.   E_ABORT = $80000007;
  5422.  
  5423.   { Unspecified error }
  5424.   E_FAIL = $80000008;
  5425.  
  5426.   { General access denied error }
  5427.   E_ACCESSDENIED = $80000009;
  5428.  
  5429.   { Thread local storage failure }
  5430.   CO_E_INIT_TLS = $80004006;
  5431.  
  5432.   { Get shared memory allocator failure }
  5433.   CO_E_INIT_SHARED_ALLOCATOR = $80004007;
  5434.  
  5435.   { Get memory allocator failure }
  5436.   CO_E_INIT_MEMORY_ALLOCATOR = $80004008;
  5437.  
  5438.   { Unable to initialize class cache }
  5439.   CO_E_INIT_CLASS_CACHE = $80004009;
  5440.  
  5441.   { Unable to initialize RPC services }
  5442.   CO_E_INIT_RPC_CHANNEL = $8000400A;
  5443.  
  5444.   { Cannot set thread local storage channel control }
  5445.   CO_E_INIT_TLS_SET_CHANNEL_CONTRO = $8000400B;
  5446.  
  5447.   { Could not allocate thread local storage channel control }
  5448.   CO_E_INIT_TLS_CHANNEL_CONTROL = $8000400C;
  5449.  
  5450.   { The user supplied memory allocator is unacceptable }
  5451.   CO_E_INIT_UNACCEPTED_USER_ALLOCA = $8000400D;
  5452.  
  5453.   { The OLE service mutex already exists }
  5454.   CO_E_INIT_SCM_MUTEX_EXISTS = $8000400E;
  5455.  
  5456.   { The OLE service file mapping already exists }
  5457.   CO_E_INIT_SCM_FILE_MAPPING_EXIST = $8000400F;
  5458.  
  5459.   { Unable to map view of file for OLE service }
  5460.   CO_E_INIT_SCM_MAP_VIEW_OF_FILE = $80004010;
  5461.  
  5462.   { Failure attempting to launch OLE service }
  5463.   CO_E_INIT_SCM_EXEC_FAILURE = $80004011;
  5464.  
  5465.   { There was an attempt to call CoInitialize a second time while single threaded }
  5466.   CO_E_INIT_ONLY_SINGLE_THREADED = $80004012;
  5467.  
  5468.  
  5469.   { FACILITY_ITF }
  5470.   { Codes $0-$01ff are reserved for the OLE group of }
  5471.  
  5472.   { Generic OLE errors that may be returned by many inerfaces}
  5473.   OLE_E_FIRST = $80040000;
  5474.   OLE_E_LAST  = $800400FF;
  5475.   OLE_S_FIRST = $40000;
  5476.   OLE_S_LAST  = $400FF;
  5477.  
  5478.   { Invalid OLEVERB structure }
  5479.   OLE_E_OLEVERB = $80040000;
  5480.  
  5481.   { Invalid advise flags }
  5482.   OLE_E_ADVF = $80040001;
  5483.  
  5484.   { Can't enumerate any more, because the associated data is missing }
  5485.   OLE_E_ENUM_NOMORE = $80040002;
  5486.  
  5487.   { This implementation doesn't take advises }
  5488.   OLE_E_ADVISENOTSUPPORTED = $80040003;
  5489.  
  5490.   { There is no connection for this connection ID }
  5491.   OLE_E_NOCONNECTION = $80040004;
  5492.  
  5493.   { Need to run the object to perform this operation }
  5494.   OLE_E_NOTRUNNING = $80040005;
  5495.  
  5496.   { There is no cache to operate on }
  5497.   OLE_E_NOCACHE = $80040006;
  5498.  
  5499.   { Uninitialized object }
  5500.   OLE_E_BLANK = $80040007;
  5501.  
  5502.   { Linked object's source class has changed }
  5503.   OLE_E_CLASSDIFF = $80040008;
  5504.  
  5505.   { Not able to get the moniker of the object }
  5506.   OLE_E_CANT_GETMONIKER = $80040009;
  5507.  
  5508.   { Not able to bind to the source }
  5509.   OLE_E_CANT_BINDTOSOURCE = $8004000A;
  5510.  
  5511.   { Object is static; operation not allowed }
  5512.   OLE_E_STATIC = $8004000B;
  5513.  
  5514.   { User cancelled out of save dialog }
  5515.   OLE_E_PROMPTSAVECANCELLED = $8004000C;
  5516.  
  5517.   { Invalid rectangle }
  5518.   OLE_E_INVALIDRECT = $8004000D;
  5519.  
  5520.   { compobj.dll is too old for the ole2.dll initialized }
  5521.   OLE_E_WRONGCOMPOBJ = $8004000E;
  5522.  
  5523.   { Invalid window handle }
  5524.   OLE_E_INVALIDHWND = $8004000F;
  5525.  
  5526.   { Object is not in any of the inplace active states }
  5527.   OLE_E_NOT_INPLACEACTIVE = $80040010;
  5528.  
  5529.   { Not able to convert object }
  5530.   OLE_E_CANTCONVERT = $80040011;
  5531.  
  5532.   OLE_E_NOSTORAGE = $80040012;
  5533.  
  5534.   { Invalid FORMATETC structure }
  5535.   DV_E_FORMATETC = $80040064;
  5536.  
  5537.   { Invalid DVTARGETDEVICE structure }
  5538.   DV_E_DVTARGETDEVICE = $80040065;
  5539.  
  5540.   { Invalid STDGMEDIUM structure }
  5541.   DV_E_STGMEDIUM = $80040066;
  5542.  
  5543.   { Invalid STATDATA structure }
  5544.   DV_E_STATDATA = $80040067;
  5545.  
  5546.   { Invalid lindex }
  5547.   DV_E_LINDEX = $80040068;
  5548.  
  5549.   { Invalid tymed }
  5550.   DV_E_TYMED = $80040069;
  5551.  
  5552.   { Invalid clipboard format }
  5553.   DV_E_CLIPFORMAT = $8004006A;
  5554.  
  5555.   { Invalid aspect(s) }
  5556.   DV_E_DVASPECT = $8004006B;
  5557.  
  5558.   { tdSize parameter of the DVTARGETDEVICE structure is invalid }
  5559.   DV_E_DVTARGETDEVICE_SIZE = $8004006C;
  5560.  
  5561.   { Object doesn't support IViewObject interface }
  5562.   DV_E_NOIVIEWOBJECT = $8004006D;
  5563.  
  5564.   DRAGDROP_E_FIRST = $80040100;
  5565.   DRAGDROP_E_LAST  = $8004010F;
  5566.   DRAGDROP_S_FIRST = $40100;
  5567.  
  5568.   { Trying to revoke a drop target that has not been registered }
  5569.   DRAGDROP_E_NOTREGISTERED = $80040100;
  5570.  
  5571.   { This window has already been registered as a drop target }
  5572.   DRAGDROP_E_ALREADYREGISTERED = $80040101;
  5573.  
  5574.   { Invalid window handle }
  5575.   DRAGDROP_E_INVALIDHWND = $80040102;
  5576.  
  5577.   CLASSFACTORY_E_FIRST = $80040110;
  5578.   CLASSFACTORY_E_LAST  = $8004011F;
  5579.   CLASSFACTORY_S_FIRST = $40110;
  5580.  
  5581.   { Class does not support aggregation (or class object is remote) }
  5582.   CLASS_E_NOAGGREGATION = $80040110;
  5583.  
  5584.   { ClassFactory cannot supply requested class }
  5585.   CLASS_E_CLASSNOTAVAILABLE = $80040111;
  5586.  
  5587.   MARSHAL_E_FIRST = $80040120;
  5588.   MARSHAL_E_LAST  = $8004012F;
  5589.   MARSHAL_S_FIRST = $40120;
  5590.   MARSHAL_S_LAST  = $4012F;
  5591.   DATA_E_FIRST    = $80040130;
  5592.   DATA_E_LAST     = $8004013F;
  5593.   DATA_S_FIRST    = $40130;
  5594.   DATA_S_LAST     = $4013F;
  5595.   VIEW_E_FIRST    = $80040140;
  5596.   VIEW_E_LAST     = $8004014F;
  5597.   VIEW_S_FIRST    = $40140;
  5598.  
  5599.   { Error drawing view }
  5600.   VIEW_E_DRAW = $80040140;
  5601.  
  5602.   REGDB_E_FIRST = $80040150;
  5603.   REGDB_E_LAST  = $8004015F;
  5604.   REGDB_S_FIRST = $40150;
  5605.  
  5606.   { Could not read key from registry }
  5607.   REGDB_E_READREGDB = $80040150;
  5608.  
  5609.   { Could not write key to registry }
  5610.   REGDB_E_WRITEREGDB = $80040151;
  5611.  
  5612.   { Could not find the key in the registry }
  5613.   REGDB_E_KEYMISSING = $80040152;
  5614.  
  5615.   { Invalid value for registry }
  5616.   REGDB_E_INVALIDVALUE = $80040153;
  5617.  
  5618.   { Class not registered }
  5619.   REGDB_E_CLASSNOTREG = $80040154;
  5620.  
  5621.   { Interface not registered }
  5622.   REGDB_E_IIDNOTREG = $80040155;
  5623.  
  5624.   CACHE_E_FIRST = $80040170;
  5625.   CACHE_E_LAST  = $8004017F;
  5626.   CACHE_S_FIRST = $40170;
  5627.  
  5628.   { Cache not updated }
  5629.   CACHE_E_NOCACHE_UPDATED = $80040170;
  5630.  
  5631.   OLEOBJ_E_FIRST = $80040180;
  5632.   OLEOBJ_E_LAST  = $8004018F;
  5633.   OLEOBJ_S_FIRST = $40180;
  5634.  
  5635.   { No verbs for OLE object }
  5636.   OLEOBJ_E_NOVERBS = $80040180;
  5637.  
  5638.   { Invalid verb for OLE object }
  5639.   OLEOBJ_E_INVALIDVERB = $80040181;
  5640.  
  5641.   CLIENTSITE_E_FIRST = $80040190;
  5642.   CLIENTSITE_E_LAST = $8004019F;
  5643.   CLIENTSITE_S_FIRST = $40190;
  5644.  
  5645.   { Undo is not available }
  5646.   INPLACE_E_NOTUNDOABLE = $800401A0;
  5647.  
  5648.   { Space for tools is not available }
  5649.   INPLACE_E_NOTOOLSPACE = $800401A1;
  5650.  
  5651.   INPLACE_E_FIRST = $800401A0;
  5652.   INPLACE_E_LAST  = $800401AF;
  5653.   INPLACE_S_FIRST = $401A0;
  5654.   INPLACE_S_LAST  = $401AF;
  5655.   ENUM_E_FIRST = $800401B0;
  5656.   ENUM_E_LAST  = $800401BF;
  5657.   ENUM_S_FIRST = $401B0;
  5658.   ENUM_S_LAST  = $401BF;
  5659.   CONVERT10_E_FIRST = $800401C0;
  5660.   CONVERT10_E_LAST  = $800401CF;
  5661.   CONVERT10_S_FIRST = $401C0;
  5662.  
  5663.   { OLESTREAM Get method failed }
  5664.   CONVERT10_E_OLESTREAM_GET = $800401C0;
  5665.  
  5666.   { OLESTREAM Put method failed }
  5667.   CONVERT10_E_OLESTREAM_PUT = $800401C1;
  5668.  
  5669.   { Contents of the OLESTREAM not in correct format }
  5670.   CONVERT10_E_OLESTREAM_FMT = $800401C2;
  5671.  
  5672.   { There was an error in a Windows GDI call while converting the bitmap to a DIB }
  5673.   CONVERT10_E_OLESTREAM_BITMAP_TO_ = $800401C3;
  5674.  
  5675.   { Contents of the IStorage not in correct format }
  5676.   CONVERT10_E_STG_FMT = $800401C4;
  5677.  
  5678.   { Contents of IStorage is missing one of the standard streams }
  5679.   CONVERT10_E_STG_NO_STD_STREAM = $800401C5;
  5680.  
  5681.   CONVERT10_E_STG_DIB_TO_BITMAP = $800401C6;
  5682.  
  5683.   CLIPBRD_E_FIRST = $800401D0;
  5684.   CLIPBRD_E_LAST  = $800401DF;
  5685.   CLIPBRD_S_FIRST = $401D0;
  5686.  
  5687.   { OpenClipboard Failed }
  5688.   CLIPBRD_E_CANT_OPEN = $800401D0;
  5689.  
  5690.   { EmptyClipboard Failed }
  5691.   CLIPBRD_E_CANT_EMPTY = $800401D1;
  5692.  
  5693.   { SetClipboard Failed }
  5694.   CLIPBRD_E_CANT_SET = $800401D2;
  5695.  
  5696.   { Data on clipboard is invalid }
  5697.   CLIPBRD_E_BAD_DATA = $800401D3;
  5698.  
  5699.   { CloseClipboard Failed }
  5700.   CLIPBRD_E_CANT_CLOSE = $800401D4;
  5701.  
  5702.   MK_E_FIRST = $800401E0;
  5703.   MK_E_LAST  = $800401EF;
  5704.   MK_S_FIRST = $401E0;
  5705.  
  5706.   { Moniker needs to be connected manually }
  5707.   MK_E_CONNECTMANUALLY = $800401E0;
  5708.  
  5709.   { Operation exceeded deadline }
  5710.   MK_E_EXCEEDEDDEADLINE = $800401E1;
  5711.  
  5712.   { Moniker needs to be generic }
  5713.   MK_E_NEEDGENERIC = $800401E2;
  5714.  
  5715.   { Operation unavailable }
  5716.   MK_E_UNAVAILABLE = $800401E3;
  5717.  
  5718.   { Invalid syntax }
  5719.   MK_E_SYNTAX = $800401E4;
  5720.  
  5721.   { No object for moniker }
  5722.   MK_E_NOOBJECT = $800401E5;
  5723.  
  5724.   { Bad extension for file }
  5725.   MK_E_INVALIDEXTENSION = $800401E6;
  5726.  
  5727.   { Intermediate operation failed }
  5728.   MK_E_INTERMEDIATEINTERFACENOTSUP = $800401E7;
  5729.  
  5730.   { Moniker is not bindable }
  5731.   MK_E_NOTBINDABLE = $800401E8;
  5732.  
  5733.   { Moniker is not bound }
  5734.   MK_E_NOTBOUND = $800401E9;
  5735.  
  5736.   { Moniker cannot open file }
  5737.   MK_E_CANTOPENFILE = $800401EA;
  5738.  
  5739.   { User input required for operation to succeed }
  5740.   MK_E_MUSTBOTHERUSER = $800401EB;
  5741.  
  5742.   { Moniker class has no inverse }
  5743.   MK_E_NOINVERSE = $800401EC;
  5744.  
  5745.   { Moniker does not refer to storage }
  5746.   MK_E_NOSTORAGE = $800401ED;
  5747.  
  5748.   { No common prefix }
  5749.   MK_E_NOPREFIX = $800401EE;
  5750.  
  5751.   { Moniker could not be enumerated }
  5752.   MK_E_ENUMERATION_FAILED = $800401EF;
  5753.  
  5754.   CO_E_FIRST = $800401F0;
  5755.   CO_E_LAST  = $800401FF;
  5756.   CO_S_FIRST = $401F0;
  5757.  
  5758.   { CoInitialize has not been called. }
  5759.   CO_E_NOTINITIALIZED = $800401F0;
  5760.  
  5761.   { CoInitialize has already been called. }
  5762.   CO_E_ALREADYINITIALIZED = $800401F1;
  5763.  
  5764.   { Class of object cannot be determined }
  5765.   CO_E_CANTDETERMINECLASS = $800401F2;
  5766.  
  5767.   { Invalid class string }
  5768.   CO_E_CLASSSTRING = $800401F3;
  5769.  
  5770.   { Invalid interface string }
  5771.   CO_E_IIDSTRING = $800401F4;
  5772.  
  5773.   { Application not found }
  5774.   CO_E_APPNOTFOUND = $800401F5;
  5775.  
  5776.   { Application cannot be run more than once }
  5777.   CO_E_APPSINGLEUSE = $800401F6;
  5778.  
  5779.   { Some error in application program }
  5780.   CO_E_ERRORINAPP = $800401F7;
  5781.  
  5782.   { DLL for class not found }
  5783.   CO_E_DLLNOTFOUND = $800401F8;
  5784.  
  5785.   { Error in the DLL }
  5786.   CO_E_ERRORINDLL = $800401F9;
  5787.  
  5788.   { Wrong OS or OS version for application }
  5789.   CO_E_WRONGOSFORAPP = $800401FA;
  5790.  
  5791.   { Object is not registered }
  5792.   CO_E_OBJNOTREG = $800401FB;
  5793.  
  5794.   { Object is already registered }
  5795.   CO_E_OBJISREG = $800401FC;
  5796.  
  5797.   { Object is not connected to server }
  5798.   CO_E_OBJNOTCONNECTED = $800401FD;
  5799.  
  5800.   { Application was launched but it didn't register a class factory }
  5801.   CO_E_APPDIDNTREG = $800401FE;
  5802.  
  5803.   { Object has been released }
  5804.   CO_E_RELEASED = $800401FF;
  5805.  
  5806.   { Use the registry database to provide the requested information }
  5807.   OLE_S_USEREG = $40000;
  5808.  
  5809.   { Success, but static }
  5810.   OLE_S_STATIC = $40001;
  5811.  
  5812.   { Macintosh clipboard format }
  5813.   OLE_S_MAC_CLIPFORMAT = $40002;
  5814.  
  5815.   { Successful drop took place }
  5816.   DRAGDROP_S_DROP = $40100;
  5817.  
  5818.   { Drag-drop operation canceled }
  5819.   DRAGDROP_S_CANCEL = $40101;
  5820.  
  5821.   { Use the default cursor }
  5822.   DRAGDROP_S_USEDEFAULTCURSORS = $40102;
  5823.  
  5824.   { Data has same FORMATETC }
  5825.   DATA_S_SAMEFORMATETC = $40130;
  5826.  
  5827.   { View is already frozen }
  5828.   VIEW_S_ALREADY_FROZEN = $40140;
  5829.  
  5830.   { FORMATETC not supported }
  5831.   CACHE_S_FORMATETC_NOTSUPPORTED = $40170;
  5832.  
  5833.   { Same cache }
  5834.   CACHE_S_SAMECACHE = $40171;
  5835.  
  5836.   { Some cache(s) not updated }
  5837.   CACHE_S_SOMECACHES_NOTUPDATED = $40172;
  5838.  
  5839.   { Invalid verb for OLE object }
  5840.   OLEOBJ_S_INVALIDVERB = $40180;
  5841.  
  5842.   { Verb number is valid but verb cannot be done now }
  5843.   OLEOBJ_S_CANNOT_DOVERB_NOW = $40181;
  5844.  
  5845.   { Invalid window handle passed }
  5846.   OLEOBJ_S_INVALIDHWND = $40182;
  5847.  
  5848.   { Message is too long; some of it had to be truncated before displaying }
  5849.   INPLACE_S_TRUNCATED = $401A0;
  5850.  
  5851.   { Unable to convert OLESTREAM to IStorage }
  5852.   CONVERT10_S_NO_PRESENTATION = $401C0;
  5853.  
  5854.   { Moniker reduced to itself }
  5855.   MK_S_REDUCED_TO_SELF = $401E2;
  5856.  
  5857.   { Common prefix is this moniker }
  5858.   MK_S_ME = $401E4;
  5859.  
  5860.   { Common prefix is input moniker }
  5861.   MK_S_HIM = $401E5;
  5862.  
  5863.   { Common prefix is both monikers }
  5864.   MK_S_US = $401E6;
  5865.  
  5866.   { Moniker is already registered in running object table }
  5867.   MK_S_MONIKERALREADYREGISTERED = $401E7;
  5868.  
  5869.  
  5870.   { FACILITY_WINDOWS }
  5871.   { Codes $0-$01ff are reserved for the OLE group of}
  5872.  
  5873.   { Attempt to create a class object failed }
  5874.   CO_E_CLASS_CREATE_FAILED = $80080001;
  5875.  
  5876.   { OLE service could not bind object }
  5877.   CO_E_SCM_ERROR = $80080002;
  5878.  
  5879.   { RPC communication failed with OLE service }
  5880.   CO_E_SCM_RPC_FAILURE = $80080003;
  5881.  
  5882.   { Bad path to object }
  5883.   CO_E_BAD_PATH = $80080004;
  5884.  
  5885.   { Server execution failed }
  5886.   CO_E_SERVER_EXEC_FAILURE = $80080005;
  5887.  
  5888.   { OLE service could not communicate with the object server }
  5889.   CO_E_OBJSRV_RPC_FAILURE = $80080006;
  5890.  
  5891.   { Moniker path could not be normalized }
  5892.   MK_E_NO_NORMALIZED = $80080007;
  5893.  
  5894.   { Object server is stopping when OLE service contacts it }
  5895.   CO_E_SERVER_STOPPING = $80080008;
  5896.  
  5897.   { An invalid root block pointer was specified }
  5898.   MEM_E_INVALID_ROOT = $80080009;
  5899.  
  5900.   { An allocation chain contained an invalid link pointer }
  5901.   MEM_E_INVALID_LINK = $80080010;
  5902.  
  5903.   { The requested allocation size was too large }
  5904.   MEM_E_INVALID_SIZE = $80080011;
  5905.  
  5906.  
  5907.   { FACILITY_DISPATCH }
  5908.  
  5909.   { Unknown interface. }
  5910.   DISP_E_UNKNOWNINTERFACE = $80020001;
  5911.  
  5912.   { Member not found. }
  5913.   DISP_E_MEMBERNOTFOUND = $80020003;
  5914.  
  5915.   { Parameter not found. }
  5916.   DISP_E_PARAMNOTFOUND = $80020004;
  5917.  
  5918.   { Type mismatch. }
  5919.   DISP_E_TYPEMISMATCH = $80020005;
  5920.  
  5921.   { Unknown name. }
  5922.   DISP_E_UNKNOWNNAME = $80020006;
  5923.  
  5924.   { No named arguments. }
  5925.   DISP_E_NONAMEDARGS = $80020007;
  5926.  
  5927.   { Bad variable type. }
  5928.   DISP_E_BADVARTYPE = $80020008;
  5929.  
  5930.   { Exception occurred. }
  5931.   DISP_E_EXCEPTION = $80020009;
  5932.  
  5933.   { Out of present range. }
  5934.   DISP_E_OVERFLOW = $8002000A;
  5935.  
  5936.   { Invalid index. }
  5937.   DISP_E_BADINDEX = $8002000B;
  5938.  
  5939.   { Unknown language. }
  5940.   DISP_E_UNKNOWNLCID = $8002000C;
  5941.  
  5942.   { Memory is locked. }
  5943.   DISP_E_ARRAYISLOCKED = $8002000D;
  5944.  
  5945.   { Invalid number of parameters. }
  5946.   DISP_E_BADPARAMCOUNT = $8002000E;
  5947.  
  5948.   { Parameter not optional. }
  5949.   DISP_E_PARAMNOTOPTIONAL = $8002000F;
  5950.  
  5951.   { Invalid callee. }
  5952.   DISP_E_BADCALLEE = $80020010;
  5953.  
  5954.   { Does not support a collection. }
  5955.   DISP_E_NOTACOLLECTION = $80020011;
  5956.  
  5957.   { Buffer too small. }
  5958.   TYPE_E_BUFFERTOOSMALL = $80028016;
  5959.  
  5960.   { Old format or invalid type library. }
  5961.   TYPE_E_INVDATAREAD = $80028018;
  5962.  
  5963.   { Old format or invalid type library. }
  5964.   TYPE_E_UNSUPFORMAT = $80028019;
  5965.  
  5966.   { Error accessing the OLE registry. }
  5967.   TYPE_E_REGISTRYACCESS = $8002801C;
  5968.  
  5969.   { Library not registered. }
  5970.   TYPE_E_LIBNOTREGISTERED = $8002801D;
  5971.  
  5972.   { Bound to unknown type. }
  5973.   TYPE_E_UNDEFINEDTYPE = $80028027;
  5974.  
  5975.   { Qualified name disallowed. }
  5976.   TYPE_E_QUALIFIEDNAMEDISALLOWED = $80028028;
  5977.  
  5978.   { Invalid forward reference, or reference to uncompiled type. }
  5979.   TYPE_E_INVALIDSTATE = $80028029;
  5980.  
  5981.   { Type mismatch. }
  5982.   TYPE_E_WRONGTYPEKIND = $8002802A;
  5983.  
  5984.   { Element not found. }
  5985.   TYPE_E_ELEMENTNOTFOUND = $8002802B;
  5986.  
  5987.   { Ambiguous name. }
  5988.   TYPE_E_AMBIGUOUSNAME = $8002802C;
  5989.  
  5990.   { Name already exists in the library. }
  5991.   TYPE_E_NAMECONFLICT = $8002802D;
  5992.  
  5993.   { Unknown LCID. }
  5994.   TYPE_E_UNKNOWNLCID = $8002802E;
  5995.  
  5996.   { Function not defined in specified DLL. }
  5997.   TYPE_E_DLLFUNCTIONNOTFOUND = $8002802F;
  5998.  
  5999.   { Wrong module kind for the operation. }
  6000.   TYPE_E_BADMODULEKIND = $800288BD;
  6001.  
  6002.   { Size may not exceed 64K. }
  6003.   TYPE_E_SIZETOOBIG = $800288C5;
  6004.  
  6005.   { Duplicate ID in inheritance hierarchy. }
  6006.   TYPE_E_DUPLICATEID = $800288C6;
  6007.  
  6008.   { Incorrect inheritance depth in standard OLE hmember. }
  6009.   TYPE_E_INVALIDID = $800288CF;
  6010.  
  6011.   { Type mismatch. }
  6012.   TYPE_E_TYPEMISMATCH = $80028CA0;
  6013.  
  6014.   { Invalid number of arguments. }
  6015.   TYPE_E_OUTOFBOUNDS = $80028CA1;
  6016.  
  6017.   { I/O Error. }
  6018.   TYPE_E_IOERROR = $80028CA2;
  6019.  
  6020.   { Error creating unique tmp file. }
  6021.   TYPE_E_CANTCREATETMPFILE = $80028CA3;
  6022.  
  6023.   { Error loading type library/DLL. }
  6024.   TYPE_E_CANTLOADLIBRARY = $80029C4A;
  6025.  
  6026.   { Inconsistent property functions. }
  6027.   TYPE_E_INCONSISTENTPROPFUNCS = $80029C83;
  6028.  
  6029.   { Circular dependency between types/modules. }
  6030.   TYPE_E_CIRCULARTYPE = $80029C84;
  6031.  
  6032.  
  6033.   { FACILITY_STORAGE }
  6034.  
  6035.   { Unable to perform requested operation. }
  6036.   STG_E_INVALIDFUNCTION = $80030001;
  6037.  
  6038.   { %s could not be found. }
  6039.   STG_E_FILENOTFOUND = $80030002;
  6040.  
  6041.   { The path %s could not be found. }
  6042.   STG_E_PATHNOTFOUND = $80030003;
  6043.  
  6044.   { There are insufficient resources to open another file. }
  6045.   STG_E_TOOMANYOPENFILES = $80030004;
  6046.  
  6047.   { Access Denied. }
  6048.   STG_E_ACCESSDENIED = $80030005;
  6049.  
  6050.   { Attempted an operation on an invalid object. }
  6051.   STG_E_INVALIDHANDLE = $80030006;
  6052.  
  6053.   { There is insufficient memory available to complete operation. }
  6054.   STG_E_INSUFFICIENTMEMORY = $80030008;
  6055.  
  6056.   { Invalid pointer error. }
  6057.   STG_E_INVALIDPOINTER = $80030009;
  6058.  
  6059.   { There are no more entries to return. }
  6060.   STG_E_NOMOREFILES = $80030012;
  6061.  
  6062.   { Disk is write-protected. }
  6063.   STG_E_DISKISWRITEPROTECTED = $80030013;
  6064.  
  6065.   { An error occurred during a seek operation. }
  6066.   STG_E_SEEKERROR = $80030019;
  6067.  
  6068.   { A disk error occurred during a write operation. }
  6069.   STG_E_WRITEFAULT = $8003001D;
  6070.  
  6071.   { A disk error occurred during a read operation. }
  6072.   STG_E_READFAULT = $8003001E;
  6073.  
  6074.   { A share violation has occurred. }
  6075.   STG_E_SHAREVIOLATION = $80030020;
  6076.  
  6077.   { A lock violation has occurred. }
  6078.   STG_E_LOCKVIOLATION = $80030021;
  6079.  
  6080.   { %s already exists. }
  6081.   STG_E_FILEALREADYEXISTS = $80030050;
  6082.  
  6083.   { Invalid parameter error. }
  6084.   STG_E_INVALIDPARAMETER = $80030057;
  6085.  
  6086.   { There is insufficient disk space to complete operation. }
  6087.   STG_E_MEDIUMFULL = $80030070;
  6088.  
  6089.   { An API call exited abnormally. }
  6090.   STG_E_ABNORMALAPIEXIT = $800300FA;
  6091.  
  6092.   { The file %s is not a valid compound file. }
  6093.   STG_E_INVALIDHEADER = $800300FB;
  6094.  
  6095.   { The name %s is not valid. }
  6096.   STG_E_INVALIDNAME = $800300FC;
  6097.  
  6098.   { An unexpected error occurred. }
  6099.   STG_E_UNKNOWN = $800300FD;
  6100.  
  6101.   { That function is not implemented. }
  6102.   STG_E_UNIMPLEMENTEDFUNCTION = $800300FE;
  6103.  
  6104.   { Invalid flag error. }
  6105.   STG_E_INVALIDFLAG = $800300FF;
  6106.  
  6107.   { Attempted to use an object that is busy. }
  6108.   STG_E_INUSE = $80030100;
  6109.  
  6110.   { The storage has been changed since the last commit. }
  6111.   STG_E_NOTCURRENT = $80030101;
  6112.  
  6113.   { Attempted to use an object that has ceased to exist. }
  6114.   STG_E_REVERTED = $80030102;
  6115.  
  6116.   { Can't save. }
  6117.   STG_E_CANTSAVE = $80030103;
  6118.  
  6119.   { The compound file %s was produced with an incompatible version of storage. }
  6120.   STG_E_OLDFORMAT = $80030104;
  6121.  
  6122.   { The compound file %s was produced with a newer version of storage. }
  6123.   STG_E_OLDDLL = $80030105;
  6124.  
  6125.   { Share.exe or equivalent is required for operation. }
  6126.   STG_E_SHAREREQUIRED = $80030106;
  6127.  
  6128.   { Illegal operation called on non-file based storage. }
  6129.   STG_E_NOTFILEBASEDSTORAGE = $80030107;
  6130.  
  6131.   { Illegal operation called on object with extant marshallings. }
  6132.   STG_E_EXTANTMARSHALLINGS = $80030108;
  6133.  
  6134.   { The underlying file was converted to compound file format. }
  6135.   STG_S_CONVERTED = $30200;
  6136.  
  6137.  
  6138.   { FACILITY_RPC }
  6139.  
  6140.   { Call was rejected by callee. }
  6141.   RPC_E_CALL_REJECTED = $80010001;
  6142.  
  6143.   { Call was canceled by the message filter. }
  6144.   RPC_E_CALL_CANCELED = $80010002;
  6145.  
  6146.   { The caller is dispatching an intertask SendMessage call and }
  6147.   { cannot call out via PostMessage. }
  6148.   RPC_E_CANTPOST_INSENDCALL = $80010003;
  6149.  
  6150.   { The caller is dispatching an asynchronous call and cannot }
  6151.   { make an outgoing call on behalf of this call. }
  6152.   RPC_E_CANTCALLOUT_INASYNCCALL = $80010004;
  6153.  
  6154.   { It is illegal to call out while inside message filter. }
  6155.   RPC_E_CANTCALLOUT_INEXTERNALCALL = $80010005;
  6156.  
  6157.   { The connection terminated or is in a bogus state }
  6158.   { and cannot be used any more. Other connections }
  6159.   { are still valid. }
  6160.   RPC_E_CONNECTION_TERMINATED = $80010006;
  6161.  
  6162.   { The callee (server [not server application]) is not available }
  6163.   { and disappeared; all connections are invalid.  The call may }
  6164.   { have executed. }
  6165.   RPC_E_SERVER_DIED = $80010007;
  6166.  
  6167.   { The caller (client) disappeared while the callee (server) was }
  6168.   { processing a call. }
  6169.   RPC_E_CLIENT_DIED = $80010008;
  6170.  
  6171.   { The data packet with the marshalled parameter data is incorrect. }
  6172.   RPC_E_INVALID_DATAPACKET = $80010009;
  6173.  
  6174.   { The call was not transmitted properly; the message queue }
  6175.   { was full and was not emptied after yielding. }
  6176.   RPC_E_CANTTRANSMIT_CALL = $8001000A;
  6177.  
  6178.   { The client (caller) cannot marshall the parameter data - low memory, etc. }
  6179.   RPC_E_CLIENT_CANTMARSHAL_DATA = $8001000B;
  6180.  
  6181.   { The client (caller) cannot unmarshall the return data - low memory, etc. }
  6182.   RPC_E_CLIENT_CANTUNMARSHAL_DATA = $8001000C;
  6183.  
  6184.   { The server (callee) cannot marshall the return data - low memory, etc. }
  6185.   RPC_E_SERVER_CANTMARSHAL_DATA = $8001000D;
  6186.  
  6187.   { The server (callee) cannot unmarshall the parameter data - low memory, etc. }
  6188.   RPC_E_SERVER_CANTUNMARSHAL_DATA = $8001000E;
  6189.  
  6190.   { Received data is invalid; could be server or client data. }
  6191.   RPC_E_INVALID_DATA = $8001000F;
  6192.  
  6193.   { A particular parameter is invalid and cannot be (un)marshalled. }
  6194.   RPC_E_INVALID_PARAMETER = $80010010;
  6195.  
  6196.   { There is no second outgoing call on same channel in DDE conversation. }
  6197.   RPC_E_CANTCALLOUT_AGAIN = $80010011;
  6198.  
  6199.   { The callee (server [not server application]) is not available }
  6200.   { and disappeared; all connections are invalid.  The call did not execute. }
  6201.   RPC_E_SERVER_DIED_DNE = $80010012;
  6202.  
  6203.   { System call failed. }
  6204.   RPC_E_SYS_CALL_FAILED = $80010100;
  6205.  
  6206.   { Could not allocate some required resource (memory, events, ...) }
  6207.   RPC_E_OUT_OF_RESOURCES = $80010101;
  6208.  
  6209.   { Attempted to make calls on more than one thread in single threaded mode. }
  6210.   RPC_E_ATTEMPTED_MULTITHREAD = $80010102;
  6211.  
  6212.   { The requested interface is not registered on the server object. }
  6213.   RPC_E_NOT_REGISTERED = $80010103;
  6214.  
  6215.   { RPC could not call the server or could not return the results of calling the server. }
  6216.   RPC_E_FAULT = $80010104;
  6217.  
  6218.   { The server threw an exception. }
  6219.   RPC_E_SERVERFAULT = $80010105;
  6220.  
  6221.   { Cannot change thread mode after it is set. }
  6222.   RPC_E_CHANGED_MODE = $80010106;
  6223.  
  6224.   { The method called does not exist on the server. }
  6225.   RPC_E_INVALIDMETHOD = $80010107;
  6226.  
  6227.   { The object invoked has disconnected from its clients. }
  6228.   RPC_E_DISCONNECTED = $80010108;
  6229.  
  6230.   { The object invoked chose not to process the call now.  Try again later. }
  6231.   RPC_E_RETRY = $80010109;
  6232.  
  6233.   { The message filter indicated that the application is busy. }
  6234.   RPC_E_SERVERCALL_RETRYLATER = $8001010A;
  6235.  
  6236.   { The message filter rejected the call. }
  6237.   RPC_E_SERVERCALL_REJECTED = $8001010B;
  6238.  
  6239.   { A call control interfaces was called with invalid data. }
  6240.   RPC_E_INVALID_CALLDATA = $8001010C;
  6241.  
  6242.   { An outgoing call cannot be made since the application is dispatching an input-synchronous call. }
  6243.   RPC_E_CANTCALLOUT_ININPUTSYNCCAL = $8001010D;
  6244.  
  6245.   { The application called an interface that was marshalled for a different thread. }
  6246.   RPC_E_WRONG_THREAD = $8001010E;
  6247.  
  6248.   { CoInitialize has not been called on the current thread. }
  6249.   RPC_E_THREAD_NOT_INIT = $8001010F;
  6250.  
  6251.   { An internal error occurred. }
  6252.   RPC_E_UNEXPECTED = $8001FFFF;
  6253.  
  6254. { End WINERROR.H }
  6255.  
  6256.  
  6257.   { Abnormal termination codes }
  6258.  
  6259.   TC_NORMAL = 0;
  6260.   TC_HARDERR = 1;
  6261.   TC_GP_TRAP = 2;
  6262.   TC_SIGNAL = 3;
  6263.  
  6264.   { Power Management APIs }
  6265.  
  6266.   AC_LINE_OFFLINE = 0;
  6267.   AC_LINE_ONLINE = 1;
  6268.   AC_LINE_BACKUP_POWER = 2;
  6269.   AC_LINE_UNKNOWN = 255;
  6270.  
  6271.   BATTERY_FLAG_HIGH = 1;
  6272.   BATTERY_FLAG_LOW = 2;
  6273.   BATTERY_FLAG_CRITICAL = 4;
  6274.   BATTERY_FLAG_CHARGING = 8;
  6275.   BATTERY_FLAG_NO_BATTERY = $80;
  6276.   BATTERY_FLAG_UNKNOWN = 255;
  6277.   BATTERY_PERCENTAGE_UNKNOWN = 255;
  6278.   BATTERY_LIFE_UNKNOWN = $FFFFFFFF;
  6279.  
  6280. type
  6281.   PSystemPowerStatus = ^TSystemPowerStatus;
  6282.   TSystemPowerStatus = record
  6283.     ACLineStatus : Byte;
  6284.     BatteryFlag : Byte;
  6285.     BatteryLifePercent : Byte;
  6286.     Reserved1 : Byte;
  6287.     BatteryLifeTime : DWORD;
  6288.     BatteryFullLifeTime : DWORD;
  6289.   end;
  6290.  
  6291. function GetSystemPowerStatus(var lpSystemPowerStatus: TSystemPowerStatus): BOOL;
  6292. function SetSystemPowerState(fSuspend, fForce: BOOL): BOOL;
  6293.  
  6294.  
  6295. { Translated from WINGDI.H }
  6296.  
  6297. const
  6298.   { Binary raster ops }
  6299.   R2_BLACK       = 1;     {  0   }
  6300.   R2_NOTMERGEPEN = 2;     { DPon }
  6301.   R2_MASKNOTPEN  = 3;     { DPna }
  6302.   R2_NOTCOPYPEN  = 4;     { PN   }
  6303.   R2_MASKPENNOT  = 5;     { PDna }
  6304.   R2_NOT         = 6;     { Dn   }
  6305.   R2_XORPEN      = 7;     { DPx  }
  6306.   R2_NOTMASKPEN  = 8;     { DPan }
  6307.   R2_MASKPEN     = 9;     { DPa  }
  6308.   R2_NOTXORPEN   = 10;    { DPxn }
  6309.   R2_NOP         = 11;    { D    }
  6310.   R2_MERGENOTPEN = 12;    { DPno }
  6311.   R2_COPYPEN     = 13;    { P    }
  6312.   R2_MERGEPENNOT = 14;    { PDno }
  6313.   R2_MERGEPEN    = 15;    { DPo  }
  6314.   R2_WHITE       = $10;   {  1   }
  6315.   R2_LAST        = $10;
  6316.  
  6317.  
  6318.   { Ternary raster operations }
  6319.   SRCCOPY     = $00CC0020;     { dest = source                    }
  6320.   SRCPAINT    = $00EE0086;     { dest = source OR dest            }
  6321.   SRCAND      = $008800C6;     { dest = source AND dest           }
  6322.   SRCINVERT   = $00660046;     { dest = source XOR dest           }
  6323.   SRCERASE    = $00440328;     { dest = source AND (NOT dest )    }
  6324.   NOTSRCCOPY  = $00330008;     { dest = (NOT source)              }
  6325.   NOTSRCERASE = $001100A6;     { dest = (NOT src) AND (NOT dest)  }
  6326.   MERGECOPY   = $00C000CA;     { dest = (source AND pattern)      }
  6327.   MERGEPAINT  = $00BB0226;     { dest = (NOT source) OR dest      }
  6328.   PATCOPY     = $00F00021;     { dest = pattern                   }
  6329.   PATPAINT    = $00FB0A09;     { dest = DPSnoo                    }
  6330.   PATINVERT   = $005A0049;     { dest = pattern XOR dest          }
  6331.   DSTINVERT   = $00550009;     { dest = (NOT dest)                }
  6332.   BLACKNESS   = $00000042;     { dest = BLACK                     }
  6333.   WHITENESS   = $00FF0062;     { dest = WHITE                     }
  6334.  
  6335.  
  6336. { Quaternary raster codes }
  6337.  
  6338. function MakeROP4(fore,back: DWORD): DWORD;
  6339.  
  6340. const
  6341.   GDI_ERROR = $FFFFFFFF;
  6342.   HGDI_ERROR = $FFFFFFFF;
  6343.  
  6344.  
  6345.   { Region Flags }
  6346.   ERROR = 0;
  6347.   NULLREGION = 1;
  6348.   SIMPLEREGION = 2;
  6349.   COMPLEXREGION = 3;
  6350.   RGN_ERROR = ERROR;
  6351.  
  6352.  
  6353.   { CombineRgn() Styles }
  6354.   RGN_AND = 1;
  6355.   RGN_OR = 2;
  6356.   RGN_XOR = 3;
  6357.   RGN_DIFF = 4;
  6358.   RGN_COPY = 5;
  6359.   RGN_MIN = RGN_AND;
  6360.   RGN_MAX = RGN_COPY;
  6361.  
  6362.   { StretchBlt() Modes }
  6363.   BLACKONWHITE = 1;
  6364.   WHITEONBLACK = 2;
  6365.   COLORONCOLOR = 3;
  6366.   HALFTONE = 4;
  6367.   MAXSTRETCHBLTMODE = 4;
  6368.  
  6369.  
  6370.   { New StretchBlt() Modes }
  6371.   STRETCH_ANDSCANS = BLACKONWHITE;
  6372.   STRETCH_ORSCANS = WHITEONBLACK;
  6373.   STRETCH_DELETESCANS = COLORONCOLOR;
  6374.   STRETCH_HALFTONE = HALFTONE;
  6375.  
  6376.  
  6377.   { PolyFill() Modes }
  6378.   ALTERNATE = 1;
  6379.   WINDING = 2;
  6380.   POLYFILL_LAST = 2;
  6381.  
  6382.  
  6383.   { Text Alignment Options }
  6384.   TA_NOUPDATECP = 0;
  6385.   TA_UPDATECP = 1;
  6386.   TA_LEFT = 0;
  6387.   TA_RIGHT = 2;
  6388.   TA_CENTER = 6;
  6389.   TA_TOP = 0;
  6390.   TA_BOTTOM = 8;
  6391.   TA_BASELINE = 24;
  6392.   TA_RTLREADING = $100;
  6393.   TA_MASK =  (TA_BASELINE+TA_CENTER+TA_UPDATECP+TA_RTLREADING);
  6394.  
  6395.   VTA_BASELINE = TA_BASELINE;
  6396.   VTA_LEFT = TA_BOTTOM;
  6397.   VTA_RIGHT = TA_TOP;
  6398.   VTA_CENTER = TA_CENTER;
  6399.   VTA_BOTTOM = TA_RIGHT;
  6400.   VTA_TOP = TA_LEFT;
  6401.  
  6402.   ETO_OPAQUE = 2;
  6403.   ETO_CLIPPED = 4;
  6404.   ETO_GLYPH_INDEX = $10;
  6405.   ETO_RTLREADING = $80;
  6406.  
  6407.   ASPECT_FILTERING = 1;
  6408.  
  6409.  
  6410.   { Bounds Accumulation APIs }
  6411.   DCB_RESET = 1;
  6412.   DCB_ACCUMULATE = 2;
  6413.   DCB_DIRTY = DCB_ACCUMULATE;
  6414.   DCB_SET = (DCB_RESET or DCB_ACCUMULATE);
  6415.   DCB_ENABLE = 4;
  6416.   DCB_DISABLE = 8;
  6417.  
  6418.   { Metafile Functions }
  6419.   META_SETBKCOLOR = 513;
  6420.   META_SETBKMODE = 258;
  6421.   META_SETMAPMODE = 259;
  6422.   META_SETROP2 = 260;
  6423.   META_SETRELABS = 261;
  6424.   META_SETPOLYFILLMODE = 262;
  6425.   META_SETSTRETCHBLTMODE = 263;
  6426.   META_SETTEXTCHAREXTRA = 264;
  6427.   META_SETTEXTCOLOR = 521;
  6428.   META_SETTEXTJUSTIFICATION = 522;
  6429.   META_SETWINDOWORG = 523;
  6430.   META_SETWINDOWEXT = 524;
  6431.   META_SETVIEWPORTORG = 525;
  6432.   META_SETVIEWPORTEXT = 526;
  6433.   META_OFFSETWINDOWORG = 527;
  6434.   META_SCALEWINDOWEXT = 1040;
  6435.   META_OFFSETVIEWPORTORG = 529;
  6436.   META_SCALEVIEWPORTEXT = 1042;
  6437.   META_LINETO = 531;
  6438.   META_MOVETO = 532;
  6439.   META_EXCLUDECLIPRECT = 1045;
  6440.   META_INTERSECTCLIPRECT = 1046;
  6441.   META_ARC = 2071;
  6442.   META_ELLIPSE = 1048;
  6443.   META_FLOODFILL = 1049;
  6444.   META_PIE = 2074;
  6445.   META_RECTANGLE = 1051;
  6446.   META_ROUNDRECT = 1564;
  6447.   META_PATBLT = 1565;
  6448.   META_SAVEDC = 30;
  6449.   META_SETPIXEL = 1055;
  6450.   META_OFFSETCLIPRGN = 544;
  6451.   META_TEXTOUT = 1313;
  6452.   META_BITBLT = 2338;
  6453.   META_STRETCHBLT = 2851;
  6454.   META_POLYGON = 804;
  6455.   META_POLYLINE = 805;
  6456.   META_ESCAPE = 1574;
  6457.   META_RESTOREDC = 295;
  6458.   META_FILLREGION = 552;
  6459.   META_FRAMEREGION = 1065;
  6460.   META_INVERTREGION = 298;
  6461.   META_PAINTREGION = 299;
  6462.   META_SELECTCLIPREGION = 300;
  6463.   META_SELECTOBJECT = 301;
  6464.   META_SETTEXTALIGN = 302;
  6465.   META_CHORD = 2096;
  6466.   META_SETMAPPERFLAGS = 561;
  6467.   META_EXTTEXTOUT = 2610;
  6468.   META_SETDIBTODEV = 3379;
  6469.   META_SELECTPALETTE = 564;
  6470.   META_REALIZEPALETTE = 53;
  6471.   META_ANIMATEPALETTE = 1078;
  6472.   META_SETPALENTRIES = 55;
  6473.   META_POLYPOLYGON = 1336;
  6474.   META_RESIZEPALETTE = 313;
  6475.   META_DIBBITBLT = 2368;
  6476.   META_DIBSTRETCHBLT = 2881;
  6477.   META_DIBCREATEPATTERNBRUSH = 322;
  6478.   META_STRETCHDIB = 3907;
  6479.   META_EXTFLOODFILL = 1352;
  6480.   META_DELETEOBJECT = 496;
  6481.   META_CREATEPALETTE = 247;
  6482.   META_CREATEPATTERNBRUSH = 505;
  6483.   META_CREATEPENINDIRECT = 762;
  6484.   META_CREATEFONTINDIRECT = 763;
  6485.   META_CREATEBRUSHINDIRECT = 764;
  6486.   META_CREATEREGION = 1791;
  6487.  
  6488.  
  6489.   { GDI Escapes }
  6490.   NEWFRAME = 1;
  6491.   _ABORTDOC = 2; { Renamed }
  6492.   NEXTBAND = 3;
  6493.   SETCOLORTABLE = 4;
  6494.   GETCOLORTABLE = 5;
  6495.   FLUSHOUTPUT = 6;
  6496.   DRAFTMODE = 7;
  6497.   QUERYESCSUPPORT = 8;
  6498.   _SETABORTPROC = 9; { Renamed }
  6499.   _STARTDOC = 10; { Renamed }
  6500.   _ENDDOC = 11; { Renamed }
  6501.   GETPHYSPAGESIZE = 12;
  6502.   GETPRINTINGOFFSET = 13;
  6503.   GETSCALINGFACTOR = 14;
  6504.   MFCOMMENT = 15;
  6505.   GETPENWIDTH = $10;
  6506.   SETCOPYCOUNT = 17;
  6507.   SELECTPAPERSOURCE = 18;
  6508.   DEVICEDATA = 19;
  6509.   PASSTHROUGH = 19;
  6510.   GETTECHNOLGY = 20;
  6511.   GETTECHNOLOGY = 20;
  6512.   SETLINECAP = 21;
  6513.   SETLINEJOIN = 22;
  6514.   _SETMITERLIMIT = 23; { Renamed }
  6515.   BANDINFO = 24;
  6516.   DRAWPATTERNRECT = 25;
  6517.   GETVECTORPENSIZE = 26;
  6518.   GETVECTORBRUSHSIZE = 27;
  6519.   ENABLEDUPLEX = 28;
  6520.   GETSETPAPERBINS = 29;
  6521.   GETSETPRINTORIENT = 30;
  6522.   ENUMPAPERBINS = 31;
  6523.   SETDIBSCALING = $20;
  6524.   EPSPRINTING = 33;
  6525.   ENUMPAPERMETRICS = 34;
  6526.   GETSETPAPERMETRICS = 35;
  6527.   POSTSCRIPT_DATA = 37;
  6528.   POSTSCRIPT_IGNORE = 38;
  6529.   MOUSETRAILS = 39;
  6530.   GETDEVICEUNITS = 42;
  6531.  
  6532.   GETEXTENDEDTEXTMETRICS = 256;
  6533.   GETEXTENTTABLE = 257;
  6534.   GETPAIRKERNTABLE = 258;
  6535.   GETTRACKKERNTABLE = 259;
  6536.   _EXTTEXTOUT = $200; { Renamed }
  6537.   GETFACENAME = 513;
  6538.   DOWNLOADFACE = 514;
  6539.   ENABLERELATIVEWIDTHS = 768;
  6540.   ENABLEPAIRKERNING = 769;
  6541.   SETKERNTRACK = 770;
  6542.   SETALLJUSTVALUES = 771;
  6543.   SETCHARSET = 772;
  6544.  
  6545.   _STRETCHBLT = $800; { Renamed }
  6546.   GETSETSCREENPARAMS = 3072;
  6547.   QUERYDIBSUPPORT = 3073;
  6548.   BEGIN_PATH = $1000;
  6549.   CLIP_TO_PATH = 4097;
  6550.   END_PATH = 4098;
  6551.   EXT_DEVICE_CAPS = 4099;
  6552.   RESTORE_CTM = 4100;
  6553.   SAVE_CTM = 4101;
  6554.   SET_ARC_DIRECTION = 4102;
  6555.   SET_BACKGROUND_COLOR = 4103;
  6556.   SET_POLY_MODE = 4104;
  6557.   SET_SCREEN_ANGLE = 4105;
  6558.   SET_SPREAD = 4106;
  6559.   TRANSFORM_CTM = 4107;
  6560.   SET_CLIP_BOX = 4108;
  6561.   SET_BOUNDS = 4109;
  6562.   SET_MIRROR_MODE = 4110;
  6563.   OPENCHANNEL = 4110;
  6564.   DOWNLOADHEADER = 4111;
  6565.   CLOSECHANNEL = 4112;
  6566.   POSTSCRIPT_PASSTHROUGH = 4115;
  6567.   ENCAPSULATED_POSTSCRIPT = 4116;
  6568.  
  6569.   { Flag returned from QUERYDIBSUPPORT }
  6570.   QDI_SETDIBITS = 1;
  6571.   QDI_GETDIBITS = 2;
  6572.   QDI_DIBTOSCREEN = 4;
  6573.   QDI_STRETCHDIB = 8;
  6574.  
  6575.  
  6576.   { Spooler Error Codes }
  6577.   SP_NOTREPORTED = $4000;
  6578.   SP_ERROR = -1;
  6579.   SP_APPABORT = -2;
  6580.   SP_USERABORT = -3;
  6581.   SP_OUTOFDISK = -4;
  6582.   SP_OUTOFMEMORY = -5;
  6583.  
  6584.   PR_JOBSTATUS = 0;
  6585.  
  6586.  
  6587.   { Object Definitions for EnumObjects() }
  6588.   OBJ_PEN = 1;
  6589.   OBJ_BRUSH = 2;
  6590.   OBJ_DC = 3;
  6591.   OBJ_METADC = 4;
  6592.   OBJ_PAL = 5;
  6593.   OBJ_FONT = 6;
  6594.   OBJ_BITMAP = 7;
  6595.   OBJ_REGION = 8;
  6596.   OBJ_METAFILE = 9;
  6597.   OBJ_MEMDC = 10;
  6598.   OBJ_EXTPEN = 11;
  6599.   OBJ_ENHMETADC = 12;
  6600.   OBJ_ENHMETAFILE = 13;
  6601.  
  6602.  
  6603.   { xform stuff }
  6604.   MWT_IDENTITY = 1;
  6605.   MWT_LEFTMULTIPLY = 2;
  6606.   MWT_RIGHTMULTIPLY = 3;
  6607.  
  6608.   MWT_MIN = MWT_IDENTITY;
  6609.   MWT_MAX = MWT_RIGHTMULTIPLY;
  6610.  
  6611.  
  6612. type
  6613.   PXForm = ^TXForm;
  6614.   TXForm = packed record
  6615.     eM11: Single;
  6616.     eM12: Single;
  6617.     eM21: Single;
  6618.     eM22: Single;
  6619.     eDx: Single;
  6620.     eDy: Single;
  6621.   end;
  6622.  
  6623. { Bitmap Header Definition }
  6624.   PBitmap = ^TBitmap;
  6625.   TBitmap = packed record
  6626.     bmType: Longint;
  6627.     bmWidth: Longint;
  6628.     bmHeight: Longint;
  6629.     bmWidthBytes: Longint;
  6630.     bmPlanes: Word;
  6631.     bmBitsPixel: Word;
  6632.     bmBits: Pointer;
  6633.   end;
  6634.  
  6635.   TRGBTriple = packed record
  6636.     rgbtBlue: Byte;
  6637.     rgbtGreen: Byte;
  6638.     rgbtRed: Byte;
  6639.   end;
  6640.  
  6641.   PRGBQuad = ^TRGBQuad;
  6642.   TRGBQuad = packed record
  6643.     rgbBlue: Byte;
  6644.     rgbGreen: Byte;
  6645.     rgbRed: Byte;
  6646.     rgbReserved: Byte;
  6647.   end;
  6648.  
  6649.  
  6650.   { Image Color Matching color definitions }
  6651.   LCSCSTYPE = Longint;
  6652. const
  6653.   LCS_CALIBRATED_RGB = 0;
  6654.   LCS_DEVICE_RGB = 1;
  6655.   LCS_DEVICE_CMYK = 2;
  6656.  
  6657. type
  6658.   LCSGAMUTMATCH = Longint;
  6659. const
  6660.   LCS_GM_BUSINESS = 1;
  6661.   LCS_GM_GRAPHICS = 2;
  6662.   LCS_GM_IMAGES = 4;
  6663.  
  6664.  
  6665.   { ICM Defines for results from CheckColorInGamut() }
  6666.   CM_OUT_OF_GAMUT = 255;
  6667.   CM_IN_GAMUT = 0;
  6668.  
  6669.  
  6670. { functions to retrieve CMYK values from a COLORREF }
  6671.  
  6672. function GetCValue(cmyk: COLORREF): Byte;
  6673. function GetMValue(cmyk: COLORREF): Byte;
  6674. function GetYValue(cmyk: COLORREF): Byte;
  6675. function GetKValue(cmyk: COLORREF): Byte;
  6676. function CMYK(c, m, y, k: Byte): COLORREF;
  6677.  
  6678. type
  6679.   FXPT16DOT16 = Longint;
  6680.   LPFXPT16DOT16 = ^Longint;
  6681.   FXPT2DOT30 = Longint;
  6682.   LPFXPT2DOT30 = ^Longint;
  6683.  
  6684.  
  6685.   { ICM Color Definitions }
  6686.   { The following two structures are used for defining RGB's in terms of
  6687.   { CIEXYZ. The values are fixed point 16.16. }
  6688.  
  6689.   PCIEXYZ = ^TCIEXYZ;
  6690.   TCIEXYZ = packed record
  6691.     ciexyzX: FXPT2DOT30;
  6692.     ciexyzY: FXPT2DOT30;
  6693.     ciexyzZ: FXPT2DOT30;
  6694.   end;
  6695.  
  6696.   PCIEXYZTriple = ^TCIEXYZTriple;
  6697.   TCIEXYZTriple = packed record
  6698.     ciexyzRed: TCIEXYZ;
  6699.     ciexyzGreen: TCIEXYZ;
  6700.     ciexyzBlue: TCIEXYZ;
  6701.   end;
  6702.  
  6703.   { The next structures the logical color space. Unlike pens and brushes,
  6704.     but like palettes, there is only one way to create a LogColorSpace.
  6705.     A pointer to it must be passed, its elements can't be pushed as
  6706.     arguments. }
  6707.  
  6708. type
  6709.   PLogColorSpaceA = ^TLogColorSpaceA;
  6710.   PLogColorSpaceW = ^TLogColorSpaceW;
  6711.   PLogColorSpace = PLogColorSpaceA;
  6712.   TLogColorSpaceA = packed record
  6713.     lcsSignature: DWORD;
  6714.     lcsVersion: DWORD;
  6715.     lcsSize: DWORD;
  6716.     lcsCSType: LCSCSTYPE;
  6717.     lcsIntent: LCSGAMUTMATCH;
  6718.     lcsEndpoints: TCIEXYZTriple;
  6719.     lcsGammaRed: DWORD;
  6720.     lcsGammaGreen: DWORD;
  6721.     lcsGammaBlue: DWORD;
  6722.     lcsFilename: array[0..259] of AnsiChar;
  6723.   end;
  6724.   TLogColorSpaceW = packed record
  6725.     lcsSignature: DWORD;
  6726.     lcsVersion: DWORD;
  6727.     lcsSize: DWORD;
  6728.     lcsCSType: LCSCSTYPE;
  6729.     lcsIntent: LCSGAMUTMATCH;
  6730.     lcsEndpoints: TCIEXYZTriple;
  6731.     lcsGammaRed: DWORD;
  6732.     lcsGammaGreen: DWORD;
  6733.     lcsGammaBlue: DWORD;
  6734.     lcsFilename: array[0..259] of WideChar;
  6735.   end;
  6736.   TLogColorSpace = TLogColorSpaceA;
  6737.  
  6738.   { structures for defining DIBs - used to get to color table }
  6739.   PBitmapCoreHeader = ^TBitmapCoreHeader;
  6740.   TBitmapCoreHeader = packed record
  6741.     bcSize: DWORD;
  6742.     bcWidth: Word;
  6743.     bcHeight: Word;
  6744.     bcPlanes: Word;
  6745.     bcBitCount: Word;
  6746.   end;
  6747.  
  6748.   PBitmapInfoHeader = ^TBitmapInfoHeader;
  6749.   TBitmapInfoHeader = packed record
  6750.     biSize: DWORD;
  6751.     biWidth: Longint;
  6752.     biHeight: Longint;
  6753.     biPlanes: Word;
  6754.     biBitCount: Word;
  6755.     biCompression: DWORD;
  6756.     biSizeImage: DWORD;
  6757.     biXPelsPerMeter: Longint;
  6758.     biYPelsPerMeter: Longint;
  6759.     biClrUsed: DWORD;
  6760.     biClrImportant: DWORD;
  6761.   end;
  6762.  
  6763.   PBitmapV4Header = ^TBitmapV4Header;
  6764.   TBitmapV4Header = packed record
  6765.     bV4Size: DWORD;
  6766.     bV4Width: Longint;
  6767.     bV4Height: Longint;
  6768.     bV4Planes: Word;
  6769.     bV4BitCount: Word;
  6770.     bV4V4Compression: DWORD;
  6771.     bV4SizeImage: DWORD;
  6772.     bV4XPelsPerMeter: Longint;
  6773.     bV4YPelsPerMeter: Longint;
  6774.     bV4ClrUsed: DWORD;
  6775.     bV4ClrImportant: DWORD;
  6776.     bV4RedMask: DWORD;
  6777.     bV4GreenMask: DWORD;
  6778.     bV4BlueMask: DWORD;
  6779.     bV4AlphaMask: DWORD;
  6780.     bV4CSType: DWORD;
  6781.     bV4Endpoints: TCIEXYZTriple;
  6782.     bV4GammaRed: DWORD;
  6783.     bV4GammaGreen: DWORD;
  6784.     bV4GammaBlue: DWORD;
  6785.   end;
  6786.  
  6787. const
  6788.   { constants for the biCompression field }
  6789.   BI_RGB = 0;
  6790.   BI_RLE8 = 1;
  6791.   BI_RLE4 = 2;
  6792.   BI_BITFIELDS = 3;
  6793.  
  6794. type
  6795.   PBitmapInfo = ^TBitmapInfo;
  6796.   TBitmapInfo = packed record
  6797.     bmiHeader: TBitmapInfoHeader;
  6798.     bmiColors: array[0..0] of TRGBQuad;
  6799.   end;
  6800.  
  6801.   PBitmapCoreInfo = ^TBitmapCoreInfo;
  6802.   TBitmapCoreInfo = packed record
  6803.     bmciHeader: TBitmapCoreHeader;
  6804.     bmciColors: array[0..0] of TRGBTriple;
  6805.   end;
  6806.  
  6807.   PBitmapFileHeader = ^TBitmapFileHeader;
  6808.   TBitmapFileHeader = packed record
  6809.     bfType: Word;
  6810.     bfSize: DWORD;
  6811.     bfReserved1: Word;
  6812.     bfReserved2: Word;
  6813.     bfOffBits: DWORD;
  6814.   end;
  6815.  
  6816.   PFontSignature = ^TFontSignature;
  6817.   TFontSignature = packed record
  6818.     fsUsb: array[0..3] of DWORD;
  6819.     fsCsb: array[0..1] of DWORD;
  6820.   end;
  6821.  
  6822.   PCharsetInfo = ^TCharsetInfo;
  6823.   TCharsetInfo = packed record
  6824.     ciCharset: UINT;
  6825.     ciACP: UINT;
  6826.     fs: TFontSignature;
  6827.   end;
  6828.  
  6829. const
  6830.   TCI_SRCCHARSET = 1;
  6831.   TCI_SRCCODEPAGE = 2;
  6832.   TCI_SRCFONTSIG = 3;
  6833.  
  6834. type
  6835.   PLocaleSignature = ^TLocaleSignature;
  6836.   TLocaleSignature = packed record
  6837.     lsUsb: array[0..3] of DWORD;
  6838.     lsCsbDefault: array[0..1] of DWORD;
  6839.     lsCsbSupported: array[0..1] of DWORD;
  6840.   end;
  6841.  
  6842.   { Clipboard Metafile Picture Structure }
  6843.   PHandleTable = ^THandleTable;
  6844.   THandleTable = packed record
  6845.     objectHandle: array[0..0] of HGDIOBJ;
  6846.   end;
  6847.  
  6848.   PMetaRecord = ^TMetaRecord;
  6849.   TMetaRecord = packed record
  6850.     rdSize: DWORD;
  6851.     rdFunction: Word;
  6852.     rdParm: array[0..0] of Word;
  6853.   end;
  6854.  
  6855.   PMetafilePict = ^TMetafilePict;
  6856.   TMetafilePict = packed record
  6857.     mm: Longint;
  6858.     xExt: Longint;
  6859.     yExt: Longint;
  6860.     hMF: HMETAFILE;
  6861.   end;
  6862.  
  6863.   PMetaHeader = ^TMetaHeader;
  6864.   TMetaHeader = packed record
  6865.     mtType: Word;
  6866.     mtHeaderSize: Word;
  6867.     mtVersion: Word;
  6868.     mtSize: DWORD;
  6869.     mtNoObjects: Word;
  6870.     mtMaxRecord: DWORD;
  6871.     mtNoParameters: Word;
  6872.   end;
  6873.  
  6874.   { Enhanced Metafile structures }
  6875.  
  6876.   PEnhMetaRecord = ^TEnhMetaRecord;
  6877.   TEnhMetaRecord = packed record
  6878.     iType: DWORD; { Record type EMR_XXX}
  6879.     nSize: DWORD; { Record size in bytes}
  6880.     dParm: array[0..0] of DWORD; { Parameters}
  6881.   end;
  6882.  
  6883.   PEnhMetaHeader = ^TEnhMetaHeader;
  6884.   TEnhMetaHeader = packed record
  6885.     iType: DWORD;          { Record type EMR_HEADER}
  6886.     nSize: DWORD;          { Record size in bytes.  This may be greater
  6887.                              than the sizeof(TEnhMetaHeader). }
  6888.     rclBounds: TRect;     { Inclusive-inclusive bounds in device units}
  6889.     rclFrame: TRect;      { Inclusive-inclusive Picture Frame of metafile in .01 mm units}
  6890.     dSignature: DWORD;     { Signature.  Must be ENHMETA_SIGNATURE.}
  6891.     nVersion: DWORD;       { Version number}
  6892.     nBytes: DWORD;         { Size of the metafile in bytes}
  6893.     nRecords: DWORD;       { Number of records in the metafile}
  6894.     nHandles: Word;        { Number of handles in the handle table
  6895.                              Handle index zero is reserved. }
  6896.     sReserved: Word;       { Reserved.  Must be zero.}
  6897.     nDescription: DWORD;   { Number of chars in the unicode description string
  6898.                              This is 0 if there is no description string }
  6899.     offDescription: DWORD; { Offset to the metafile description record.
  6900.                            { This is 0 if there is no description string }
  6901.     nPalEntries: DWORD;    { Number of entries in the metafile palette.}
  6902.     szlDevice: TSize;      { Size of the reference device in pels}
  6903.     szlMillimeters: TSize; { Size of the reference device in millimeters}
  6904.   end;
  6905.  
  6906. const
  6907.   { tmPitchAndFamily flags }
  6908.   TMPF_FIXED_PITCH = 1;
  6909.   TMPF_VECTOR = 2;
  6910.   TMPF_DEVICE = 8;
  6911.   TMPF_TRUETYPE = 4;
  6912.  
  6913. type
  6914.   PTextMetricA = ^TTextMetricA;
  6915.   PTextMetricW = ^TTextMetricW;
  6916.   PTextMetric = PTextMetricA;
  6917.   TTextMetricA = packed record
  6918.     tmHeight: Longint;
  6919.     tmAscent: Longint;
  6920.     tmDescent: Longint;
  6921.     tmInternalLeading: Longint;
  6922.     tmExternalLeading: Longint;
  6923.     tmAveCharWidth: Longint;
  6924.     tmMaxCharWidth: Longint;
  6925.     tmWeight: Longint;
  6926.     tmOverhang: Longint;
  6927.     tmDigitizedAspectX: Longint;
  6928.     tmDigitizedAspectY: Longint;
  6929.     tmFirstChar: AnsiChar;
  6930.     tmLastChar: AnsiChar;
  6931.     tmDefaultChar: AnsiChar;
  6932.     tmBreakChar: AnsiChar;
  6933.     tmItalic: Byte;
  6934.     tmUnderlined: Byte;
  6935.     tmStruckOut: Byte;
  6936.     tmPitchAndFamily: Byte;
  6937.     tmCharSet: Byte;
  6938.   end;
  6939.   TTextMetricW = packed record
  6940.     tmHeight: Longint;
  6941.     tmAscent: Longint;
  6942.     tmDescent: Longint;
  6943.     tmInternalLeading: Longint;
  6944.     tmExternalLeading: Longint;
  6945.     tmAveCharWidth: Longint;
  6946.     tmMaxCharWidth: Longint;
  6947.     tmWeight: Longint;
  6948.     tmOverhang: Longint;
  6949.     tmDigitizedAspectX: Longint;
  6950.     tmDigitizedAspectY: Longint;
  6951.     tmFirstChar: WideChar;
  6952.     tmLastChar: WideChar;
  6953.     tmDefaultChar: WideChar;
  6954.     tmBreakChar: WideChar;
  6955.     tmItalic: Byte;
  6956.     tmUnderlined: Byte;
  6957.     tmStruckOut: Byte;
  6958.     tmPitchAndFamily: Byte;
  6959.     tmCharSet: Byte;
  6960.   end;
  6961.   TTextMetric = TTextMetricA;
  6962.  
  6963. const
  6964.   { ntmFlags field flags }
  6965.   NTM_REGULAR = $40;
  6966.   NTM_BOLD = $20;
  6967.   NTM_ITALIC = 1;
  6968.  
  6969. type
  6970.   PNewTextMetricA = ^TNewTextMetricA;
  6971.   PNewTextMetricW = ^TNewTextMetricW;
  6972.   PNewTextMetric = PNewTextMetricA;
  6973.   TNewTextMetricA = record
  6974.     tmHeight: Longint;
  6975.     tmAscent: Longint;
  6976.     tmDescent: Longint;
  6977.     tmInternalLeading: Longint;
  6978.     tmExternalLeading: Longint;
  6979.     tmAveCharWidth: Longint;
  6980.     tmMaxCharWidth: Longint;
  6981.     tmWeight: Longint;
  6982.     tmOverhang: Longint;
  6983.     tmDigitizedAspectX: Longint;
  6984.     tmDigitizedAspectY: Longint;
  6985.     tmFirstChar: AnsiChar;
  6986.     tmLastChar: AnsiChar;
  6987.     tmDefaultChar: AnsiChar;
  6988.     tmBreakChar: AnsiChar;
  6989.     tmItalic: Byte;
  6990.     tmUnderlined: Byte;
  6991.     tmStruckOut: Byte;
  6992.     tmPitchAndFamily: Byte;
  6993.     tmCharSet: Byte;
  6994.     ntmFlags: DWORD;
  6995.     ntmSizeEM: UINT;
  6996.     ntmCellHeight: UINT;
  6997.     ntmAvgWidth: UINT;
  6998.   end;
  6999.   TNewTextMetricW = record
  7000.     tmHeight: Longint;
  7001.     tmAscent: Longint;
  7002.     tmDescent: Longint;
  7003.     tmInternalLeading: Longint;
  7004.     tmExternalLeading: Longint;
  7005.     tmAveCharWidth: Longint;
  7006.     tmMaxCharWidth: Longint;
  7007.     tmWeight: Longint;
  7008.     tmOverhang: Longint;
  7009.     tmDigitizedAspectX: Longint;
  7010.     tmDigitizedAspectY: Longint;
  7011.     tmFirstChar: WideChar;
  7012.     tmLastChar: WideChar;
  7013.     tmDefaultChar: WideChar;
  7014.     tmBreakChar: WideChar;
  7015.     tmItalic: Byte;
  7016.     tmUnderlined: Byte;
  7017.     tmStruckOut: Byte;
  7018.     tmPitchAndFamily: Byte;
  7019.     tmCharSet: Byte;
  7020.     ntmFlags: DWORD;
  7021.     ntmSizeEM: UINT;
  7022.     ntmCellHeight: UINT;
  7023.     ntmAvgWidth: UINT;
  7024.   end;
  7025.   TNewTextMetric = TNewTextMetricA;
  7026.  
  7027.   PNewTextMetricEx = ^TNewTextMetricEx;
  7028.   TNewTextMetricEx = packed record
  7029.     ntmTm: TNewTextMetric;
  7030.     ntmFontSig: TFontSignature;
  7031.   end;
  7032.  
  7033. { GDI Logical Objects: }
  7034.  
  7035.   { Pel Array }
  7036.   PPelArray = ^TPelArray;
  7037.   TPelArray = packed record
  7038.     paXCount: Longint;
  7039.     paYCount: Longint;
  7040.     paXExt: Longint;
  7041.     paYExt: Longint;
  7042.     paRGBs: Byte;
  7043.   end;
  7044.  
  7045.   { Logical Brush (or Pattern) }
  7046.   PLogBrush = ^TLogBrush;
  7047.   TLogBrush = packed record
  7048.     lbStyle: UINT;
  7049.     lbColor: COLORREF;
  7050.     lbHatch: Longint;
  7051.   end;
  7052.  
  7053.   PPattern = ^TPattern;
  7054.   TPattern = TLogBrush;
  7055.  
  7056.   { Logical Pen }
  7057.   PLogPen = ^TLogPen;
  7058.   TLogPen = packed record
  7059.     lopnStyle: UINT;
  7060.     lopnWidth: TPoint;
  7061.     lopnColor: COLORREF;
  7062.   end;
  7063.  
  7064.   PExtLogPen = ^TLogPen;
  7065.   TExtLogPen = packed record
  7066.     elpPenStyle: DWORD;
  7067.     elpWidth: DWORD;
  7068.     elpBrushStyle: UINT;
  7069.     elpColor: COLORREF;
  7070.     elpHatch: Longint;
  7071.     elpNumEntries: DWORD;
  7072.     elpStyleEntry: array[0..0] of DWORD;
  7073.   end;
  7074.  
  7075.   PPaletteEntry = ^TPaletteEntry;
  7076.   TPaletteEntry = packed record
  7077.     peRed: Byte;
  7078.     peGreen: Byte;
  7079.     peBlue: Byte;
  7080.     peFlags: Byte;
  7081.   end;
  7082.  
  7083.  
  7084.   { Logical Palette }
  7085.   PLogPalette = ^TLogPalette;
  7086.   TLogPalette = packed record
  7087.     palVersion: Word;
  7088.     palNumEntries: Word;
  7089.     palPalEntry: array[0..0] of TPaletteEntry;
  7090.   end;
  7091.  
  7092.  
  7093. const
  7094.   { Logical Font }
  7095.   LF_FACESIZE = 32;
  7096.  
  7097. type
  7098.   PLogFontA = ^TLogFontA;
  7099.   PLogFontW = ^TLogFontW;
  7100.   PLogFont = PLogFontA;
  7101.   TLogFontA = packed record
  7102.     lfHeight: Longint;
  7103.     lfWidth: Longint;
  7104.     lfEscapement: Longint;
  7105.     lfOrientation: Longint;
  7106.     lfWeight: Longint;
  7107.     lfItalic: Byte;
  7108.     lfUnderline: Byte;
  7109.     lfStrikeOut: Byte;
  7110.     lfCharSet: Byte;
  7111.     lfOutPrecision: Byte;
  7112.     lfClipPrecision: Byte;
  7113.     lfQuality: Byte;
  7114.     lfPitchAndFamily: Byte;
  7115.     lfFaceName: array[0..LF_FACESIZE - 1] of AnsiChar;
  7116.   end;
  7117.   TLogFontW = packed record
  7118.     lfHeight: Longint;
  7119.     lfWidth: Longint;
  7120.     lfEscapement: Longint;
  7121.     lfOrientation: Longint;
  7122.     lfWeight: Longint;
  7123.     lfItalic: Byte;
  7124.     lfUnderline: Byte;
  7125.     lfStrikeOut: Byte;
  7126.     lfCharSet: Byte;
  7127.     lfOutPrecision: Byte;
  7128.     lfClipPrecision: Byte;
  7129.     lfQuality: Byte;
  7130.     lfPitchAndFamily: Byte;
  7131.     lfFaceName: array[0..LF_FACESIZE - 1] of WideChar;
  7132.   end;
  7133.   TLogFont = TLogFontA;
  7134.  
  7135. const
  7136.   LF_FULLFACESIZE = 64;
  7137.  
  7138. type
  7139.   { Structure passed to FONTENUMPROC }
  7140.   PEnumLogFontA = ^TEnumLogFontA;
  7141.   PEnumLogFontW = ^TEnumLogFontW;
  7142.   PEnumLogFont = PEnumLogFontA;
  7143.   TEnumLogFontA = packed record
  7144.     elfLogFont: TLogFont;
  7145.     elfFullName: array[0..LF_FULLFACESIZE - 1] of AnsiChar;
  7146.     elfStyle: array[0..LF_FACESIZE - 1] of AnsiChar;
  7147.   end;
  7148.   TEnumLogFontW = packed record
  7149.     elfLogFont: TLogFont;
  7150.     elfFullName: array[0..LF_FULLFACESIZE - 1] of WideChar;
  7151.     elfStyle: array[0..LF_FACESIZE - 1] of WideChar;
  7152.   end;
  7153.   TEnumLogFont = TEnumLogFontA;
  7154.  
  7155.   PEnumLogFontEx = ^TEnumLogFontEx;
  7156.   TEnumLogFontEx = packed record
  7157.     elfLogFont: TLogFont;
  7158.     elfFullName: array[0..LF_FULLFACESIZE - 1] of Byte;
  7159.     elfStyle: array[0..LF_FACESIZE - 1] of Byte;
  7160.     elfScript: array[0..LF_FACESIZE - 1] of Byte;
  7161.   end;
  7162.  
  7163. const
  7164.   OUT_DEFAULT_PRECIS = 0;
  7165.   OUT_STRING_PRECIS = 1;
  7166.   OUT_CHARACTER_PRECIS = 2;
  7167.   OUT_STROKE_PRECIS = 3;
  7168.   OUT_TT_PRECIS = 4;
  7169.   OUT_DEVICE_PRECIS = 5;
  7170.   OUT_RASTER_PRECIS = 6;
  7171.   OUT_TT_ONLY_PRECIS = 7;
  7172.   OUT_OUTLINE_PRECIS = 8;
  7173.  
  7174.   CLIP_DEFAULT_PRECIS = 0;
  7175.   CLIP_CHARACTER_PRECIS = 1;
  7176.   CLIP_STROKE_PRECIS = 2;
  7177.   CLIP_MASK = 15;
  7178.   CLIP_LH_ANGLES = (1 shl 4);
  7179.   CLIP_TT_ALWAYS = (2 shl 4);
  7180.   CLIP_EMBEDDED  = (8 shl 4);
  7181.  
  7182.   DEFAULT_QUALITY = 0;
  7183.   DRAFT_QUALITY = 1;
  7184.   PROOF_QUALITY = 2;
  7185.   NONANTIALIASED_QUALITY = 3;
  7186.   ANTIALIASED_QUALITY = 4;
  7187.  
  7188.   DEFAULT_PITCH = 0;
  7189.   FIXED_PITCH = 1;
  7190.   VARIABLE_PITCH = 2;
  7191.   MONO_FONT = 8;
  7192.  
  7193.   ANSI_CHARSET = 0;
  7194.   DEFAULT_CHARSET = 1;
  7195.   SYMBOL_CHARSET = 2;
  7196.   SHIFTJIS_CHARSET = $80;
  7197.   HANGEUL_CHARSET = 129;
  7198.   GB2312_CHARSET = 134;
  7199.   CHINESEBIG5_CHARSET = 136;
  7200.   OEM_CHARSET = 255;
  7201.   JOHAB_CHARSET = 130;
  7202.   HEBREW_CHARSET = 177;
  7203.   ARABIC_CHARSET = 178;
  7204.   GREEK_CHARSET = 161;
  7205.   TURKISH_CHARSET = 162;
  7206.   THAI_CHARSET = 222;
  7207.   EASTEUROPE_CHARSET = 238;
  7208.   RUSSIAN_CHARSET = 204;
  7209.  
  7210.   MAC_CHARSET = 77;
  7211.   BALTIC_CHARSET = 186;
  7212.  
  7213.   FS_LATIN1 = 1;
  7214.   FS_LATIN2 = 2;
  7215.   FS_CYRILLIC = 4;
  7216.   FS_GREEK = 8;
  7217.   FS_TURKISH = $10;
  7218.   FS_HEBREW = $20;
  7219.   FS_ARABIC = $40;
  7220.   FS_BALTIC = $80;
  7221.   FS_THAI = $10000;
  7222.   FS_JISJAPAN = $20000;
  7223.   FS_CHINESESIMP = $40000;
  7224.   FS_WANSUNG = $80000;
  7225.   FS_CHINESETRAD = $100000;
  7226.   FS_JOHAB = $200000;
  7227.   FS_SYMBOL = $80000000;
  7228.  
  7229.   { Font Families }
  7230.   FF_DONTCARE   = (0 shl 4);     { Don't care or don't know. }
  7231.   FF_ROMAN      = (1 shl 4);     { Variable stroke width, serifed. }
  7232.                                  { Times Roman, Century Schoolbook, etc. }
  7233.   FF_SWISS      = (2 shl 4);     { Variable stroke width, sans-serifed. }
  7234.                                  { Helvetica, Swiss, etc. }
  7235.   FF_MODERN     = (3 shl 4);     { Constant stroke width, serifed or sans-serifed. }
  7236.                                  { Pica, Elite, Courier, etc. }
  7237.   FF_SCRIPT     = (4 shl 4);     { Cursive, etc. }
  7238.   FF_DECORATIVE = (5 shl 4);     { Old English, etc. }
  7239.  
  7240.   { Font Weights }
  7241.   FW_DONTCARE = 0;
  7242.   FW_THIN = 100;
  7243.   FW_EXTRALIGHT = 200;
  7244.   FW_LIGHT = 300;
  7245.   FW_NORMAL = 400;
  7246.   FW_MEDIUM = 500;
  7247.   FW_SEMIBOLD = 600;
  7248.   FW_BOLD = 700;
  7249.   FW_EXTRABOLD = 800;
  7250.   FW_HEAVY = 900;
  7251.   FW_ULTRALIGHT = FW_EXTRALIGHT;
  7252.   FW_REGULAR = FW_NORMAL;
  7253.   FW_DEMIBOLD = FW_SEMIBOLD;
  7254.   FW_ULTRABOLD = FW_EXTRABOLD;
  7255.   FW_BLACK = FW_HEAVY;
  7256.  
  7257.   PANOSE_COUNT = 10;
  7258.   PAN_FAMILYTYPE_INDEX = 0;
  7259.   PAN_SERIFSTYLE_INDEX = 1;
  7260.   PAN_WEIGHT_INDEX = 2;
  7261.   PAN_PROPORTION_INDEX = 3;
  7262.   PAN_CONTRAST_INDEX = 4;
  7263.   PAN_STROKEVARIATION_INDEX = 5;
  7264.   PAN_ARMSTYLE_INDEX = 6;
  7265.   PAN_LETTERFORM_INDEX = 7;
  7266.   PAN_MIDLINE_INDEX = 8;
  7267.   PAN_XHEIGHT_INDEX = 9;
  7268.  
  7269.   PAN_CULTURE_LATIN = 0;
  7270.  
  7271. type
  7272.   PPanose = ^TPanose;
  7273.   TPanose = packed record
  7274.     bFamilyType: Byte;
  7275.     bSerifStyle: Byte;
  7276.     bWeight: Byte;
  7277.     bProportion: Byte;
  7278.     bContrast: Byte;
  7279.     bStrokeVariation: Byte;
  7280.     bArmStyle: Byte;
  7281.     bLetterform: Byte;
  7282.     bMidline: Byte;
  7283.     bXHeight: Byte;
  7284.   end;
  7285.  
  7286. const
  7287.   PAN_ANY = 0;
  7288.   PAN_NO_FIT = 1;
  7289.  
  7290.   PAN_FAMILY_TEXT_DISPLAY = 2;
  7291.   PAN_FAMILY_SCRIPT = 3;
  7292.   PAN_FAMILY_DECORATIVE = 4;
  7293.   PAN_FAMILY_PICTORIAL = 5;
  7294.  
  7295.   PAN_SERIF_COVE = 2;
  7296.   PAN_SERIF_OBTUSE_COVE = 3;
  7297.   PAN_SERIF_SQUARE_COVE = 4;
  7298.   PAN_SERIF_OBTUSE_SQUARE_COVE = 5;
  7299.   PAN_SERIF_SQUARE = 6;
  7300.   PAN_SERIF_THIN = 7;
  7301.   PAN_SERIF_BONE = 8;
  7302.   PAN_SERIF_EXAGGERATED = 9;
  7303.   PAN_SERIF_TRIANGLE = 10;
  7304.   PAN_SERIF_NORMAL_SANS = 11;
  7305.   PAN_SERIF_OBTUSE_SANS = 12;
  7306.   PAN_SERIF_PERP_SANS = 13;
  7307.   PAN_SERIF_FLARED = 14;
  7308.   PAN_SERIF_ROUNDED = 15;
  7309.  
  7310.   PAN_WEIGHT_VERY_LIGHT = 2;
  7311.   PAN_WEIGHT_LIGHT = 3;
  7312.   PAN_WEIGHT_THIN = 4;
  7313.   PAN_WEIGHT_BOOK = 5;
  7314.   PAN_WEIGHT_MEDIUM = 6;
  7315.   PAN_WEIGHT_DEMI = 7;
  7316.   PAN_WEIGHT_BOLD = 8;
  7317.   PAN_WEIGHT_HEAVY = 9;
  7318.   PAN_WEIGHT_BLACK = 10;
  7319.   PAN_WEIGHT_NORD = 11;
  7320.  
  7321.   PAN_PROP_OLD_STYLE = 2;
  7322.   PAN_PROP_MODERN = 3;
  7323.   PAN_PROP_EVEN_WIDTH = 4;
  7324.   PAN_PROP_EXPANDED = 5;
  7325.   PAN_PROP_CONDENSED = 6;
  7326.   PAN_PROP_VERY_EXPANDED = 7;
  7327.   PAN_PROP_VERY_CONDENSED = 8;
  7328.   PAN_PROP_MONOSPACED = 9;
  7329.  
  7330.   PAN_CONTRAST_NONE = 2;
  7331.   PAN_CONTRAST_VERY_LOW = 3;
  7332.   PAN_CONTRAST_LOW = 4;
  7333.   PAN_CONTRAST_MEDIUM_LOW = 5;
  7334.   PAN_CONTRAST_MEDIUM = 6;
  7335.   PAN_CONTRAST_MEDIUM_HIGH = 7;
  7336.   PAN_CONTRAST_HIGH = 8;
  7337.   PAN_CONTRAST_VERY_HIGH = 9;
  7338.  
  7339.   PAN_STROKE_GRADUAL_DIAG = 2;
  7340.   PAN_STROKE_GRADUAL_TRAN = 3;
  7341.   PAN_STROKE_GRADUAL_VERT = 4;
  7342.   PAN_STROKE_GRADUAL_HORZ = 5;
  7343.   PAN_STROKE_RAPID_VERT = 6;
  7344.   PAN_STROKE_RAPID_HORZ = 7;
  7345.   PAN_STROKE_INSTANT_VERT = 8;
  7346.  
  7347.   PAN_STRAIGHT_ARMS_HORZ = 2;
  7348.   PAN_STRAIGHT_ARMS_WEDGE = 3;
  7349.   PAN_STRAIGHT_ARMS_VERT = 4;
  7350.   PAN_STRAIGHT_ARMS_SINGLE_SERIF = 5;
  7351.   PAN_STRAIGHT_ARMS_DOUBLE_SERIF = 6;
  7352.   PAN_BENT_ARMS_HORZ = 7;
  7353.   PAN_BENT_ARMS_WEDGE = 8;
  7354.   PAN_BENT_ARMS_VERT = 9;
  7355.   PAN_BENT_ARMS_SINGLE_SERIF = 10;
  7356.   PAN_BENT_ARMS_DOUBLE_SERIF = 11;
  7357.  
  7358.   PAN_LETT_NORMAL_CONTACT = 2;
  7359.   PAN_LETT_NORMAL_WEIGHTED = 3;
  7360.   PAN_LETT_NORMAL_BOXED = 4;
  7361.   PAN_LETT_NORMAL_FLATTENED = 5;
  7362.   PAN_LETT_NORMAL_ROUNDED = 6;
  7363.   PAN_LETT_NORMAL_OFF_CENTER = 7;
  7364.   PAN_LETT_NORMAL_SQUARE = 8;
  7365.   PAN_LETT_OBLIQUE_CONTACT = 9;
  7366.   PAN_LETT_OBLIQUE_WEIGHTED = 10;
  7367.   PAN_LETT_OBLIQUE_BOXED = 11;
  7368.   PAN_LETT_OBLIQUE_FLATTENED = 12;
  7369.   PAN_LETT_OBLIQUE_ROUNDED = 13;
  7370.   PAN_LETT_OBLIQUE_OFF_CENTER = 14;
  7371.   PAN_LETT_OBLIQUE_SQUARE = 15;
  7372.  
  7373.   PAN_MIDLINE_STANDARD_TRIMMED = 2;
  7374.   PAN_MIDLINE_STANDARD_POINTED = 3;
  7375.   PAN_MIDLINE_STANDARD_SERIFED = 4;
  7376.   PAN_MIDLINE_HIGH_TRIMMED = 5;
  7377.   PAN_MIDLINE_HIGH_POINTED = 6;
  7378.   PAN_MIDLINE_HIGH_SERIFED = 7;
  7379.   PAN_MIDLINE_CONSTANT_TRIMMED = 8;
  7380.   PAN_MIDLINE_CONSTANT_POINTED = 9;
  7381.   PAN_MIDLINE_CONSTANT_SERIFED = 10;
  7382.   PAN_MIDLINE_LOW_TRIMMED = 11;
  7383.   PAN_MIDLINE_LOW_POINTED = 12;
  7384.   PAN_MIDLINE_LOW_SERIFED = 13;
  7385.  
  7386.   PAN_XHEIGHT_CONSTANT_SMALL = 2;
  7387.   PAN_XHEIGHT_CONSTANT_STD = 3;
  7388.   PAN_XHEIGHT_CONSTANT_LARGE = 4;
  7389.   PAN_XHEIGHT_DUCKING_SMALL = 5;
  7390.   PAN_XHEIGHT_DUCKING_STD = 6;
  7391.   PAN_XHEIGHT_DUCKING_LARGE = 7;
  7392.  
  7393.   ELF_VENDOR_SIZE = 4;
  7394.  
  7395. { The extended logical font       }
  7396. { An extension of the ENUMLOGFONT }
  7397.  
  7398. type
  7399.   PExtLogFontA = ^TExtLogFontA;
  7400.   PExtLogFontW = ^TExtLogFontW;
  7401.   PExtLogFont = PExtLogFontA;
  7402.   TExtLogFontA = packed record
  7403.     elfLogFont: TLogFont;
  7404.     elfFullName: array[0..LF_FULLFACESIZE - 1] of AnsiChar;
  7405.     elfStyle: array[0..LF_FACESIZE - 1] of AnsiChar;
  7406.     elfVersion: DWORD;     { 0 for the first release of NT }
  7407.     elfStyleSize: DWORD;
  7408.     elfMatch: DWORD;
  7409.     elfReserved: DWORD;
  7410.     elfVendorId: array[0..ELF_VENDOR_SIZE - 1] of Byte;
  7411.     elfCulture: DWORD;     { 0 for Latin }
  7412.     elfPanose: TPanose;
  7413.   end;
  7414.   TExtLogFontW = packed record
  7415.     elfLogFont: TLogFont;
  7416.     elfFullName: array[0..LF_FULLFACESIZE - 1] of WideChar;
  7417.     elfStyle: array[0..LF_FACESIZE - 1] of WideChar;
  7418.     elfVersion: DWORD;     { 0 for the first release of NT }
  7419.     elfStyleSize: DWORD;
  7420.     elfMatch: DWORD;
  7421.     elfReserved: DWORD;
  7422.     elfVendorId: array[0..ELF_VENDOR_SIZE - 1] of Byte;
  7423.     elfCulture: DWORD;     { 0 for Latin }
  7424.     elfPanose: TPanose;
  7425.   end;
  7426.   TExtLogFont = TExtLogFontA;
  7427.  
  7428. const
  7429.   ELF_VERSION = 0;
  7430.   ELF_CULTURE_LATIN = 0;
  7431.  
  7432.  
  7433.   { EnumFonts Masks }
  7434.   RASTER_FONTTYPE = 1;
  7435.   DEVICE_FONTTYPE = 2;
  7436.   TRUETYPE_FONTTYPE = 4;
  7437.  
  7438. function RGB(r, g, b: Byte): COLORREF;
  7439. function PaletteRGB(r, g, b: Byte): COLORREF;
  7440. function PaletteIndex(i: Word): COLORREF;
  7441.  
  7442. const
  7443.   { palette entry flags }
  7444.   PC_RESERVED = 1;     { palette index used for animation }
  7445.   PC_EXPLICIT = 2;     { palette index is explicit to device }
  7446.   PC_NOCOLLAPSE = 4;   { do not match color to system palette }
  7447.  
  7448. function GetRValue(rgb: DWORD): Byte;
  7449. function GetGValue(rgb: DWORD): Byte;
  7450. function GetBValue(rgb: DWORD): Byte;
  7451.  
  7452. const
  7453.   { Background Modes }
  7454.   TRANSPARENT = 1;
  7455.   OPAQUE = 2;
  7456.   BKMODE_LAST = 2;
  7457.  
  7458.   { Graphics Modes }
  7459.   GM_COMPATIBLE = 1;
  7460.   GM_ADVANCED = 2;
  7461.   GM_LAST = 2;
  7462.  
  7463.   { PolyDraw and GetPath point types }
  7464.   PT_CLOSEFIGURE = 1;
  7465.   PT_LINETO = 2;
  7466.   PT_BEZIERTO = 4;
  7467.   PT_MOVETO = 6;
  7468.  
  7469.   { Mapping Modes }
  7470.   MM_TEXT = 1;
  7471.   MM_LOMETRIC = 2;
  7472.   MM_HIMETRIC = 3;
  7473.   MM_LOENGLISH = 4;
  7474.   MM_HIENGLISH = 5;
  7475.   MM_TWIPS = 6;
  7476.   MM_ISOTROPIC = 7;
  7477.   MM_ANISOTROPIC = 8;
  7478.  
  7479.   { Min and Max Mapping Mode values }
  7480.   MM_MIN = MM_TEXT;
  7481.   MM_MAX = MM_ANISOTROPIC;
  7482.   MM_MAX_FIXEDSCALE = MM_TWIPS;
  7483.  
  7484.   { Coordinate Modes }
  7485.   ABSOLUTE = 1;
  7486.   RELATIVE = 2;
  7487.  
  7488.   { Stock Logical Objects }
  7489.   WHITE_BRUSH = 0;
  7490.   LTGRAY_BRUSH = 1;
  7491.   GRAY_BRUSH = 2;
  7492.   DKGRAY_BRUSH = 3;
  7493.   BLACK_BRUSH = 4;
  7494.   NULL_BRUSH = 5;
  7495.   HOLLOW_BRUSH = NULL_BRUSH;
  7496.   WHITE_PEN = 6;
  7497.   BLACK_PEN = 7;
  7498.   NULL_PEN = 8;
  7499.   OEM_FIXED_FONT = 10;
  7500.   ANSI_FIXED_FONT = 11;
  7501.   ANSI_VAR_FONT = 12;
  7502.   SYSTEM_FONT = 13;
  7503.   DEVICE_DEFAULT_FONT = 14;
  7504.   DEFAULT_PALETTE = 15;
  7505.   SYSTEM_FIXED_FONT = $10;
  7506.   DEFAULT_GUI_FONT = 17;
  7507.   STOCK_LAST = 17;
  7508.  
  7509.   CLR_INVALID = $FFFFFFFF;
  7510.  
  7511.   { Brush Styles }
  7512.   BS_SOLID = 0;
  7513.   BS_NULL = 1;
  7514.   BS_HOLLOW = BS_NULL;
  7515.   BS_HATCHED = 2;
  7516.   BS_PATTERN = 3;
  7517.   BS_INDEXED = 4;
  7518.   BS_DIBPATTERN = 5;
  7519.   BS_DIBPATTERNPT = 6;
  7520.   BS_PATTERN8X8 = 7;
  7521.   BS_DIBPATTERN8X8 = 8;
  7522.  
  7523.   { Hatch Styles }
  7524.   HS_HORIZONTAL = 0;       { ----- }
  7525.   HS_VERTICAL   = 1;       { ||||| }
  7526.   HS_FDIAGONAL  = 2;       { ///// }
  7527.   HS_BDIAGONAL  = 3;       { \\\\\ }
  7528.   HS_CROSS      = 4;       { +++++ }
  7529.   HS_DIAGCROSS  = 5;       { xxxxx }
  7530.  
  7531.  
  7532.   { Pen Styles }
  7533.   PS_SOLID       = 0;
  7534.   PS_DASH        = 1;      { ------- }
  7535.   PS_DOT         = 2;      { ....... }
  7536.   PS_DASHDOT     = 3;      { _._._._ }
  7537.   PS_DASHDOTDOT  = 4;      { _.._.._ }
  7538.   PS_NULL = 5;
  7539.   PS_INSIDEFRAME = 6;
  7540.   PS_USERSTYLE = 7;
  7541.   PS_ALTERNATE = 8;
  7542.   PS_STYLE_MASK = 15;
  7543.  
  7544.   PS_ENDCAP_ROUND = 0;
  7545.   PS_ENDCAP_SQUARE = $100;
  7546.   PS_ENDCAP_FLAT = $200;
  7547.   PS_ENDCAP_MASK = 3840;
  7548.  
  7549.   PS_JOIN_ROUND = 0;
  7550.   PS_JOIN_BEVEL = $1000;
  7551.   PS_JOIN_MITER = $2000;
  7552.   PS_JOIN_MASK = 61440;
  7553.  
  7554.   PS_COSMETIC = 0;
  7555.   PS_GEOMETRIC = $10000;
  7556.   PS_TYPE_MASK = $F0000;
  7557.  
  7558.   AD_COUNTERCLOCKWISE = 1;
  7559.   AD_CLOCKWISE = 2;
  7560.  
  7561.   { Device Parameters for GetDeviceCaps() }
  7562.   DRIVERVERSION = 0;     { Device driver version                     }
  7563.   TECHNOLOGY    = 2;     { Device classification                     }
  7564.   HORZSIZE      = 4;     { Horizontal size in millimeters            }
  7565.   VERTSIZE      = 6;     { Vertical size in millimeters              }
  7566.   HORZRES       = 8;     { Horizontal width in pixels                }
  7567.   VERTRES       = 10;    { Vertical height in pixels                 }
  7568.   BITSPIXEL     = 12;    { Number of bits per pixel                  }
  7569.   PLANES        = 14;    { Number of planes                          }
  7570.   NUMBRUSHES    = $10;   { Number of brushes the device has          }
  7571.   NUMPENS       = 18;    { Number of pens the device has             }
  7572.   NUMMARKERS    = 20;    { Number of markers the device has          }
  7573.   NUMFONTS      = 22;    { Number of fonts the device has            }
  7574.   NUMCOLORS     = 24;    { Number of colors the device supports      }
  7575.   PDEVICESIZE   = 26;    { Size required for device descriptor       }
  7576.   CURVECAPS     = 28;    { Curve capabilities                        }
  7577.   LINECAPS      = 30;    { Line capabilities                         }
  7578.   POLYGONALCAPS = $20;   { Polygonal capabilities                    }
  7579.   TEXTCAPS      = 34;    { Text capabilities                         }
  7580.   CLIPCAPS      = 36;    { Clipping capabilities                     }
  7581.   RASTERCAPS    = 38;    { Bitblt capabilities                       }
  7582.   ASPECTX       = 40;    { Length of the X leg                       }
  7583.   ASPECTY       = 42;    { Length of the Y leg                       }
  7584.   ASPECTXY      = 44;    { Length of the hypotenuse                  }
  7585.  
  7586.   LOGPIXELSX    = 88;    { Logical pixelsinch in X                  }
  7587.   LOGPIXELSY    = 90;    { Logical pixelsinch in Y                  }
  7588.  
  7589.   SIZEPALETTE   = 104;   { Number of entries in physical palette     }
  7590.   NUMRESERVED   = 106;   { Number of reserved entries in palette     }
  7591.   COLORRES      = 108;   { Actual color resolution                   }
  7592.  
  7593.   { Printing related DeviceCaps. These replace the appropriate Escapes }
  7594.   PHYSICALWIDTH   = 110;     { Physical Width in device units            }
  7595.   PHYSICALHEIGHT  = 111;     { Physical Height in device units           }
  7596.   PHYSICALOFFSETX = 112;     { Physical Printable Area x margin          }
  7597.   PHYSICALOFFSETY = 113;     { Physical Printable Area y margin          }
  7598.   SCALINGFACTORX  = 114;     { Scaling factor x                          }
  7599.   SCALINGFACTORY  = 115;     { Scaling factor y                          }
  7600.  
  7601.  
  7602.   { Display driver specific}
  7603.   VREFRESH       = 116;     { Current vertical refresh rate of the     }
  7604.                             { display device (for displays only) in Hz}
  7605.   DESKTOPVERTRES = 117;     { Horizontal width of entire desktop in    }
  7606.                             { pixels                                  }
  7607.   DESKTOPHORZRES = 118;     { Vertical height of entire desktop in     }
  7608.                             { pixels                                  }
  7609.   BLTALIGNMENT   = 119;     { Preferred blt alignment                  }
  7610.  
  7611.  
  7612. { Device Capability Masks: }
  7613.  
  7614. { Device Technologies }
  7615.  
  7616.   DT_PLOTTER    = 0;     { Vector plotter                    }
  7617.   DT_RASDISPLAY = 1;     { Raster display                    }
  7618.   DT_RASPRINTER = 2;     { Raster printer                    }
  7619.   DT_RASCAMERA  = 3;     { Raster camera                     }
  7620.   DT_CHARSTREAM = 4;     { Character-stream, PLP             }
  7621.   DT_METAFILE   = 5;     { Metafile, VDM                     }
  7622.   DT_DISPFILE   = 6;     { Display-file                      }
  7623.  
  7624. { Curve Capabilities }
  7625.  
  7626.   CC_NONE       = 0;     { Curves not supported              }
  7627.   CC_CIRCLES    = 1;     { Can do circles                    }
  7628.   CC_PIE        = 2;     { Can do pie wedges                 }
  7629.   CC_CHORD      = 4;     { Can do chord arcs                 }
  7630.   CC_ELLIPSES   = 8;     { Can do ellipese                   }
  7631.   CC_WIDE       = $10;   { Can do wide lines                 }
  7632.   CC_STYLED     = $20;   { Can do styled lines               }
  7633.   CC_WIDESTYLED = $40;   { Can do wide styled lines          }
  7634.   CC_INTERIORS  = $80;   { Can do interiors                  }
  7635.   CC_ROUNDRECT  = $100;
  7636.  
  7637. { Line Capabilities }
  7638.  
  7639.   LC_NONE       = 0;     { Lines not supported               }
  7640.   LC_POLYLINE   = 2;     { Can do polylines                  }
  7641.   LC_MARKER     = 4;     { Can do markers                    }
  7642.   LC_POLYMARKER = 8;     { Can do polymarkers                }
  7643.   LC_WIDE       = $10;   { Can do wide lines                 }
  7644.   LC_STYLED     = $20;   { Can do styled lines               }
  7645.   LC_WIDESTYLED = $40;   { Can do wide styled lines          }
  7646.   LC_INTERIORS  = $80;   { Can do interiors                  }
  7647.  
  7648. { Polygonal Capabilities }
  7649.  
  7650.   PC_NONE        = 0;     { Polygonals not supported          }
  7651.   PC_POLYGON     = 1;     { Can do polygons                   }
  7652.   PC_RECTANGLE   = 2;     { Can do rectangles                 }
  7653.   PC_WINDPOLYGON = 4;     { Can do winding polygons           }
  7654.   PC_TRAPEZOID   = 4;     { Can do trapezoids                 }
  7655.   PC_SCANLINE    = 8;     { Can do scanlines                  }
  7656.   PC_WIDE        = $10;   { Can do wide borders               }
  7657.   PC_STYLED      = $20;   { Can do styled borders             }
  7658.   PC_WIDESTYLED  = $40;   { Can do wide styled borders        }
  7659.   PC_INTERIORS   = $80;   { Can do interiors                  }
  7660.   PC_POLYPOLYGON = $100;  { Can do polypolygons               }
  7661.   PC_PATHS       = $200;  { Can do paths                      }
  7662.  
  7663. { Clipping Capabilities }
  7664.  
  7665.   CP_NONE      = 0;     { No clipping of output             }
  7666.   CP_RECTANGLE = 1;     { Output clipped to rects           }
  7667.   CP_REGION    = 2;     { obsolete                          }
  7668.  
  7669. { Text Capabilities }
  7670.  
  7671.   TC_OP_CHARACTER = 1;      { Can do OutputPrecision   CHARACTER       }
  7672.   TC_OP_STROKE    = 2;      { Can do OutputPrecision   STROKE          }
  7673.   TC_CP_STROKE    = 4;      { Can do ClipPrecision     STROKE          }
  7674.   TC_CR_90        = 8;      { Can do CharRotAbility    90              }
  7675.   TC_CR_ANY       = $10;    { Can do CharRotAbility    ANY             }
  7676.   TC_SF_X_YINDEP  = $20;    { Can do ScaleFreedom      X_YINDEPENDENT  }
  7677.   TC_SA_DOUBLE    = $40;    { Can do ScaleAbility      DOUBLE          }
  7678.   TC_SA_INTEGER   = $80;    { Can do ScaleAbility      INTEGER         }
  7679.   TC_SA_CONTIN    = $100;   { Can do ScaleAbility      CONTINUOUS      }
  7680.   TC_EA_DOUBLE    = $200;   { Can do EmboldenAbility   DOUBLE          }
  7681.   TC_IA_ABLE      = $400;   { Can do ItalisizeAbility  ABLE            }
  7682.   TC_UA_ABLE      = $800;   { Can do UnderlineAbility  ABLE            }
  7683.   TC_SO_ABLE      = $1000;  { Can do StrikeOutAbility  ABLE            }
  7684.   TC_RA_ABLE      = $2000;  { Can do RasterFontAble    ABLE            }
  7685.   TC_VA_ABLE      = $4000;  { Can do VectorFontAble    ABLE            }
  7686.   TC_RESERVED     = $8000;
  7687.   TC_SCROLLBLT    = $10000; { Don't do text scroll with blt            }
  7688.  
  7689. { Raster Capabilities }
  7690.  
  7691.   RC_BITBLT       = 1;     { Can do standard BLT.              }
  7692.   RC_BANDING      = 2;     { Device requires banding support   }
  7693.   RC_SCALING      = 4;     { Device requires scaling support   }
  7694.   RC_BITMAP64     = 8;     { Device can support >64K bitmap    }
  7695.   RC_GDI20_OUTPUT = $10;   { has 2.0 output calls          }
  7696.   RC_GDI20_STATE  = $20;
  7697.   RC_SAVEBITMAP   = $40;
  7698.   RC_DI_BITMAP    = $80;   { supports DIB to memory        }
  7699.   RC_PALETTE      = $100;  { supports a palette            }
  7700.   RC_DIBTODEV     = $200;  { supports DIBitsToDevice       }
  7701.   RC_BIGFONT      = $400;  { supports >64K fonts           }
  7702.   RC_STRETCHBLT   = $800;  { supports StretchBlt           }
  7703.   RC_FLOODFILL    = $1000; { supports FloodFill            }
  7704.   RC_STRETCHDIB   = $2000; { supports StretchDIBits        }
  7705.   RC_OP_DX_OUTPUT = $4000;
  7706.   RC_DEVBITS      = $8000;
  7707.  
  7708. { DIB color table identifiers }
  7709.  
  7710.   DIB_RGB_COLORS = 0;     { color table in RGBs  }
  7711.   DIB_PAL_COLORS = 1;     { color table in palette indices  }
  7712.  
  7713. { constants for GetSetSystemPaletteUse() }
  7714.  
  7715.   SYSPAL_ERROR = 0;
  7716.   SYSPAL_STATIC = 1;
  7717.   SYSPAL_NOSTATIC = 2;
  7718.  
  7719. { constants for CreateDIBitmap }
  7720.  
  7721.   CBM_INIT = 4;     { initialize bitmap  }
  7722.  
  7723. { ExtFloodFill style flags }
  7724.  
  7725.   FLOODFILLBORDER = 0;
  7726.   FLOODFILLSURFACE = 1;
  7727.  
  7728.   CCHDEVICENAME = 32;     { size of a device name string  }
  7729.   CCHFORMNAME   = 32;     { size of a form name string  }
  7730.  
  7731. type
  7732.   PDeviceModeA = ^TDeviceModeA;
  7733.   PDeviceModeW = ^TDeviceModeW;
  7734.   PDeviceMode = PDeviceModeA;
  7735.   TDeviceModeA = packed record
  7736.     dmDeviceName: array[0..CCHDEVICENAME - 1] of AnsiChar;
  7737.     dmSpecVersion: Word;
  7738.     dmDriverVersion: Word;
  7739.     dmSize: Word;
  7740.     dmDriverExtra: Word;
  7741.     dmFields: DWORD;
  7742.     dmOrientation: SHORT;
  7743.     dmPaperSize: SHORT;
  7744.     dmPaperLength: SHORT;
  7745.     dmPaperWidth: SHORT;
  7746.     dmScale: SHORT;
  7747.     dmCopies: SHORT;
  7748.     dmDefaultSource: SHORT;
  7749.     dmPrintQuality: SHORT;
  7750.     dmColor: SHORT;
  7751.     dmDuplex: SHORT;
  7752.     dmYResolution: SHORT;
  7753.     dmTTOption: SHORT;
  7754.     dmCollate: SHORT;
  7755.     dmFormName: array[0..CCHFORMNAME - 1] of AnsiChar;
  7756.     dmLogPixels: Word;
  7757.     dmBitsPerPel: DWORD;
  7758.     dmPelsWidth: DWORD;
  7759.     dmPelsHeight: DWORD;
  7760.     dmDisplayFlags: DWORD;
  7761.     dmDisplayFrequency: DWORD;
  7762.     dmICMMethod: DWORD;
  7763.     dmICMIntent: DWORD;
  7764.     dmMediaType: DWORD;
  7765.     dmDitherType: DWORD;
  7766.     dmReserved1: DWORD;
  7767.     dmReserved2: DWORD;
  7768.   end;
  7769.   TDeviceModeW = packed record
  7770.     dmDeviceName: array[0..CCHDEVICENAME - 1] of WideChar;
  7771.     dmSpecVersion: Word;
  7772.     dmDriverVersion: Word;
  7773.     dmSize: Word;
  7774.     dmDriverExtra: Word;
  7775.     dmFields: DWORD;
  7776.     dmOrientation: SHORT;
  7777.     dmPaperSize: SHORT;
  7778.     dmPaperLength: SHORT;
  7779.     dmPaperWidth: SHORT;
  7780.     dmScale: SHORT;
  7781.     dmCopies: SHORT;
  7782.     dmDefaultSource: SHORT;
  7783.     dmPrintQuality: SHORT;
  7784.     dmColor: SHORT;
  7785.     dmDuplex: SHORT;
  7786.     dmYResolution: SHORT;
  7787.     dmTTOption: SHORT;
  7788.     dmCollate: SHORT;
  7789.     dmFormName: array[0..CCHFORMNAME - 1] of WideChar;
  7790.     dmLogPixels: Word;
  7791.     dmBitsPerPel: DWORD;
  7792.     dmPelsWidth: DWORD;
  7793.     dmPelsHeight: DWORD;
  7794.     dmDisplayFlags: DWORD;
  7795.     dmDisplayFrequency: DWORD;
  7796.     dmICMMethod: DWORD;
  7797.     dmICMIntent: DWORD;
  7798.     dmMediaType: DWORD;
  7799.     dmDitherType: DWORD;
  7800.     dmReserved1: DWORD;
  7801.     dmReserved2: DWORD;
  7802.   end;
  7803.   TDeviceMode = TDeviceModeA;
  7804.  
  7805.   PDevMode = PDeviceMode;  {compatibility with Delphi 1.0}
  7806.   TDevMode = TDeviceMode;  {compatibility with Delphi 1.0}
  7807.  
  7808. const
  7809.   DM_SPECVERSION = $400;  { current version of specification }
  7810.  
  7811. { field selection bits }
  7812.  
  7813.   DM_ORIENTATION = 1;
  7814.   DM_PAPERSIZE = 2;
  7815.   DM_PAPERLENGTH = 4;
  7816.   DM_PAPERWIDTH = 8;
  7817.   DM_SCALE = $10;
  7818.   DM_COPIES = $100;
  7819.   DM_DEFAULTSOURCE = $200;
  7820.   DM_PRINTQUALITY = $400;
  7821.   DM_COLOR = $800;
  7822.   DM_DUPLEX = $1000;
  7823.   DM_YRESOLUTION = $2000;
  7824.   DM_TTOPTION = $4000;
  7825.   DM_COLLATE = $8000;
  7826.   DM_FORMNAME = $10000;
  7827.   DM_LOGPIXELS = $20000;
  7828.   DM_BITSPERPEL = $40000;
  7829.   DM_PELSWIDTH = $80000;
  7830.   DM_PELSHEIGHT = $100000;
  7831.   DM_DISPLAYFLAGS = $200000;
  7832.   DM_DISPLAYFREQUENCY = $400000;
  7833.   DM_RESERVED1 = $800000;
  7834.   DM_RESERVED2 = $1000000;
  7835.   DM_ICMMETHOD = $2000000;
  7836.   DM_ICMINTENT = $4000000;
  7837.   DM_MEDIATYPE = $8000000;
  7838.   DM_DITHERTYPE = $10000000;
  7839.  
  7840. { orientation selections }
  7841.  
  7842.   DMORIENT_PORTRAIT = 1;
  7843.   DMORIENT_LANDSCAPE = 2;
  7844.  
  7845. { paper selections }
  7846.  
  7847.   DMPAPER_LETTER      = 1;  { Letter 8 12 x 11 in               }
  7848.   DMPAPER_FIRST       = DMPAPER_LETTER;
  7849.   DMPAPER_LETTERSMALL = 2;  { Letter Small 8 12 x 11 in         }
  7850.   DMPAPER_TABLOID     = 3;  { Tabloid 11 x 17 in                }
  7851.   DMPAPER_LEDGER      = 4;  { Ledger 17 x 11 in                 }
  7852.   DMPAPER_LEGAL       = 5;  { Legal 8 12 x 14 in                }
  7853.   DMPAPER_STATEMENT   = 6;  { Statement 5 12 x 8 12 in          }
  7854.   DMPAPER_EXECUTIVE   = 7;  { Executive 7 14 x 10 12 in         }
  7855.   DMPAPER_A3      = 8;      { A3 297 x 420 mm                     }
  7856.   DMPAPER_A4      = 9;      { A4 210 x 297 mm                     }
  7857.   DMPAPER_A4SMALL = 10;     { A4 Small 210 x 297 mm               }
  7858.   DMPAPER_A5      = 11;     { A5 148 x 210 mm                     }
  7859.   DMPAPER_B4      = 12;     { B4 (JIS) 250 x 354                  }
  7860.   DMPAPER_B5      = 13;     { B5 (JIS) 182 x 257 mm               }
  7861.   DMPAPER_FOLIO   = 14;     { Folio 8 12 x 13 in                  }
  7862.   DMPAPER_QUARTO  = 15;     { Quarto 215 x 275 mm                 }
  7863.   DMPAPER_10X14   = 16;     { 10x14 in                            }
  7864.   DMPAPER_11X17   = 17;     { 11x17 in                            }
  7865.   DMPAPER_NOTE    = 18;     { Note 8 12 x 11 in                   }
  7866.   DMPAPER_ENV_9   = 19;     { Envelope #9 3 78 x 8 78             }
  7867.   DMPAPER_ENV_10  = 20;     { Envelope #10 4 18 x 9 12            }
  7868.   DMPAPER_ENV_11  = 21;     { Envelope #11 4 12 x 10 38           }
  7869.   DMPAPER_ENV_12  = 22;     { Envelope #12 4 \276 x 11            }
  7870.   DMPAPER_ENV_14  = 23;     { Envelope #14 5 x 11 12              }
  7871.   DMPAPER_CSHEET  = 24;     { C size sheet                        }
  7872.   DMPAPER_DSHEET  = 25;     { D size sheet                        }
  7873.   DMPAPER_ESHEET  = 26;     { E size sheet                        }
  7874.   DMPAPER_ENV_DL  = 27;     { Envelope DL 110 x 220mm             }
  7875.   DMPAPER_ENV_C5  = 28;     { Envelope C5 162 x 229 mm            }
  7876.   DMPAPER_ENV_C3  = 29;     { Envelope C3  324 x 458 mm           }
  7877.   DMPAPER_ENV_C4  = 30;     { Envelope C4  229 x 324 mm           }
  7878.   DMPAPER_ENV_C6  = 31;     { Envelope C6  114 x 162 mm           }
  7879.   DMPAPER_ENV_C65  = 32;    { Envelope C65 114 x 229 mm           }
  7880.   DMPAPER_ENV_B4   = 33;    { Envelope B4  250 x 353 mm           }
  7881.   DMPAPER_ENV_B5   = 34;    { Envelope B5  176 x 250 mm           }
  7882.   DMPAPER_ENV_B6   = 35;    { Envelope B6  176 x 125 mm           }
  7883.   DMPAPER_ENV_ITALY          = 36;  { Envelope 110 x 230 mm               }
  7884.   DMPAPER_ENV_MONARCH        = 37;  { Envelope Monarch 3.875 x 7.5 in     }
  7885.   DMPAPER_ENV_PERSONAL       = 38;  { 6 34 Envelope 3 58 x 6 12 in        }
  7886.   DMPAPER_FANFOLD_US         = 39;  { US Std Fanfold 14 78 x 11 in        }
  7887.   DMPAPER_FANFOLD_STD_GERMAN = 40;  { German Std Fanfold 8 12 x 12 in    }
  7888.   DMPAPER_FANFOLD_LGL_GERMAN = 41;  { German Legal Fanfold 8 12 x 13 in  }
  7889.   DMPAPER_ISO_B4             = 42;  { B4 (ISO) 250 x 353 mm               }
  7890.   DMPAPER_JAPANESE_POSTCARD  = 43;  { Japanese Postcard 100 x 148 mm      }
  7891.   DMPAPER_9X11               = 44;  { 9 x 11 in                           }
  7892.   DMPAPER_10X11              = 45;  { 10 x 11 in                          }
  7893.   DMPAPER_15X11              = 46;  { 15 x 11 in                          }
  7894.   DMPAPER_ENV_INVITE         = 47;  { Envelope Invite 220 x 220 mm        }
  7895.   DMPAPER_RESERVED_48        = 48;  { RESERVED--DO NOT USE                }
  7896.   DMPAPER_RESERVED_49        = 49;  { RESERVED--DO NOT USE                }
  7897.   DMPAPER_LETTER_EXTRA       = 50;  { Letter Extra 9 \275 x 12 in         }
  7898.   DMPAPER_LEGAL_EXTRA        = 51;  { Legal Extra 9 \275 x 15 in          }
  7899.   DMPAPER_TABLOID_EXTRA      = 52;  { Tabloid Extra 11.69 x 18 in         }
  7900.   DMPAPER_A4_EXTRA           = 53;  { A4 Extra 9.27 x 12.69 in            }
  7901.   DMPAPER_LETTER_TRANSVERSE  = 54;  { Letter Transverse 8 \275 x 11 in    }
  7902.   DMPAPER_A4_TRANSVERSE      = 55;  { A4 Transverse 210 x 297 mm          }
  7903.   DMPAPER_LETTER_EXTRA_TRANSVERSE = 56;     { Letter Extra Transverse 9\275 x 12 in  }
  7904.   DMPAPER_A_PLUS        = 57;     { SuperASuperAA4 227 x 356 mm       }
  7905.   DMPAPER_B_PLUS        = 58;     { SuperBSuperBA3 305 x 487 mm       }
  7906.   DMPAPER_LETTER_PLUS   = 59;     { Letter Plus 8.5 x 12.69 in          }
  7907.   DMPAPER_A4_PLUS       = 60;     { A4 Plus 210 x 330 mm                }
  7908.   DMPAPER_A5_TRANSVERSE = 61;     { A5 Transverse 148 x 210 mm          }
  7909.   DMPAPER_B5_TRANSVERSE = 62;     { B5 (JIS) Transverse 182 x 257 mm    }
  7910.   DMPAPER_A3_EXTRA      = 63;     { A3 Extra 322 x 445 mm               }
  7911.   DMPAPER_A5_EXTRA      = $40;    { A5 Extra 174 x 235 mm               }
  7912.   DMPAPER_B5_EXTRA      = 65;     { B5 (ISO) Extra 201 x 276 mm         }
  7913.   DMPAPER_A2            = 66;     { A2 420 x 594 mm                     }
  7914.   DMPAPER_A3_TRANSVERSE = 67;     { A3 Transverse 297 x 420 mm          }
  7915.   DMPAPER_A3_EXTRA_TRANSVERSE = 68;     { A3 Extra Transverse 322 x 445 mm    }
  7916.   DMPAPER_LAST                = DMPAPER_A3_EXTRA_TRANSVERSE;
  7917.   DMPAPER_USER                = $100;
  7918.  
  7919. { bin selections }
  7920.  
  7921.   DMBIN_UPPER = 1;
  7922.   DMBIN_FIRST = DMBIN_UPPER;
  7923.   DMBIN_ONLYONE = 1;
  7924.   DMBIN_LOWER = 2;
  7925.   DMBIN_MIDDLE = 3;
  7926.   DMBIN_MANUAL = 4;
  7927.   DMBIN_ENVELOPE = 5;
  7928.   DMBIN_ENVMANUAL = 6;
  7929.   DMBIN_AUTO = 7;
  7930.   DMBIN_TRACTOR = 8;
  7931.   DMBIN_SMALLFMT = 9;
  7932.   DMBIN_LARGEFMT = 10;
  7933.   DMBIN_LARGECAPACITY = 11;
  7934.   DMBIN_CASSETTE = 14;
  7935.   DMBIN_FORMSOURCE = 15;
  7936.   DMBIN_LAST = DMBIN_FORMSOURCE;
  7937.   DMBIN_USER = $100;   { device specific bins start here }
  7938.  
  7939.   { print qualities }
  7940.   DMRES_DRAFT = -1;
  7941.   DMRES_LOW = -2;
  7942.   DMRES_MEDIUM = -3;
  7943.   DMRES_HIGH = -4;
  7944.  
  7945.   { color enabledisable for color printers }
  7946.   DMCOLOR_MONOCHROME = 1;
  7947.   DMCOLOR_COLOR = 2;
  7948.  
  7949.   { duplex enable }
  7950.   DMDUP_SIMPLEX = 1;
  7951.   DMDUP_VERTICAL = 2;
  7952.   DMDUP_HORIZONTAL = 3;
  7953.  
  7954.   { TrueType options }
  7955.   DMTT_BITMAP           = 1;     { print TT fonts as graphics  }
  7956.   DMTT_DOWNLOAD         = 2;     { download TT fonts as soft fonts  }
  7957.   DMTT_SUBDEV           = 3;     { substitute device fonts for TT fonts  }
  7958.   DMTT_DOWNLOAD_OUTLINE = 4;     { download TT fonts as outline soft fonts  }
  7959.  
  7960.   { Collation selections }
  7961.   DMCOLLATE_FALSE = 0;
  7962.   DMCOLLATE_TRUE = 1;
  7963.  
  7964.   { DEVMODE dmDisplayFlags flags }
  7965.   DM_GRAYSCALE = 1;
  7966.   DM_INTERLACED = 2;
  7967.  
  7968.   { ICM methods }
  7969.   DMICMMETHOD_NONE   = 1;     { ICM disabled  }
  7970.   DMICMMETHOD_SYSTEM = 2;     { ICM handled by system  }
  7971.   DMICMMETHOD_DRIVER = 3;     { ICM handled by driver  }
  7972.   DMICMMETHOD_DEVICE = 4;     { ICM handled by device  }
  7973.  
  7974.   DMICMMETHOD_USER = $100;    { Device-specific methods start here  }
  7975.  
  7976.   { ICM Intents }
  7977.   DMICM_SATURATE    = 1;     { Maximize color saturation  }
  7978.   DMICM_CONTRAST    = 2;     { Maximize color contrast  }
  7979.   DMICM_COLORMETRIC = 3;     { Use specific color metric  }
  7980.  
  7981.   DMICM_USER = $100;     { Device-specific intents start here  }
  7982.  
  7983.  
  7984.   { Media types }
  7985.   DMMEDIA_STANDARD     = 1;     { Standard paper  }
  7986.   DMMEDIA_TRANSPARENCY = 2;     { Transparency  }
  7987.   DMMEDIA_GLOSSY       = 3;     { Glossy paper  }
  7988.  
  7989.   DMMEDIA_USER = $100;     { Device-specific media start here  }
  7990.  
  7991.  
  7992.   { Dither types }
  7993.   DMDITHER_NONE      = 1;     { No dithering  }
  7994.   DMDITHER_COARSE    = 2;     { Dither with a coarse brush  }
  7995.   DMDITHER_FINE      = 3;     { Dither with a fine brush  }
  7996.   DMDITHER_LINEART   = 4;     { LineArt dithering  }
  7997.  
  7998.   DMDITHER_ERRORDIFFUSION  = 5; { LineArt dithering }
  7999.   DMDITHER_RESERVED6     = 6;    { LineArt dithering }
  8000.   DMDITHER_RESERVED7     = 7;    { LineArt dithering }
  8001.   DMDITHER_RESERVED8     = 8;    { LineArt dithering }
  8002.   DMDITHER_RESERVED9     = 9;    { LineArt dithering }
  8003.  
  8004.   DMDITHER_GRAYSCALE = 10;    { Device does grayscaling  }
  8005.  
  8006.   DMDITHER_USER = 256;        { Device-specific dithers start here  }
  8007.  
  8008.  
  8009. { GetRegionData / ExtCreateRegion }
  8010.  
  8011.   RDH_RECTANGLES = 1;
  8012.  
  8013. type
  8014.   PRgnDataHeader = ^TRgnDataHeader;
  8015.   TRgnDataHeader = packed record
  8016.     dwSize: DWORD;
  8017.     iType: DWORD;
  8018.     nCount: DWORD;
  8019.     nRgnSize: DWORD;
  8020.     rcBound: TRect;
  8021.   end;
  8022.  
  8023.   PRgnData = ^TRgnData;
  8024.   TRgnData = packed record
  8025.     rdh: TRgnDataHeader;
  8026.     Buffer: array[0..0] of CHAR;
  8027.   end;
  8028.  
  8029.   PABC = ^TABC;
  8030.   TABC = packed record
  8031.     abcA: Integer;
  8032.     abcB: UINT;
  8033.     abcC: Integer;
  8034.   end;
  8035.  
  8036.   PABCFloat = ^TABCFloat;
  8037.   TABCFloat = packed record
  8038.     abcfA: Single;
  8039.     abcfB: Single;
  8040.     abcfC: Single;
  8041.   end;
  8042.  
  8043.   POutlineTextmetricA = ^TOutlineTextmetricA;
  8044.   POutlineTextmetricW = ^TOutlineTextmetricW;
  8045.   POutlineTextmetric = POutlineTextmetricA;
  8046.   TOutlineTextmetricA = packed record
  8047.     otmSize: UINT;
  8048.     otmTextMetrics: TTextMetric;
  8049.     otmFiller: Byte;
  8050.     otmPanoseNumber: TPanose;
  8051.     otmfsSelection: UINT;
  8052.     otmfsType: UINT;
  8053.     otmsCharSlopeRise: Integer;
  8054.     otmsCharSlopeRun: Integer;
  8055.     otmItalicAngle: Integer;
  8056.     otmEMSquare: UINT;
  8057.     otmAscent: Integer;
  8058.     otmDescent: Integer;
  8059.     otmLineGap: UINT;
  8060.     otmsCapEmHeight: UINT;
  8061.     otmsXHeight: UINT;
  8062.     otmrcFontBox: TRect;
  8063.     otmMacAscent: Integer;
  8064.     otmMacDescent: Integer;
  8065.     otmMacLineGap: UINT;
  8066.     otmusMinimumPPEM: UINT;
  8067.     otmptSubscriptSize: TPoint;
  8068.     otmptSubscriptOffset: TPoint;
  8069.     otmptSuperscriptSize: TPoint;
  8070.     otmptSuperscriptOffset: TPoint;
  8071.     otmsStrikeoutSize: UINT;
  8072.     otmsStrikeoutPosition: Integer;
  8073.     otmsUnderscoreSize: Integer;
  8074.     otmsUnderscorePosition: Integer;
  8075.     otmpFamilyName: PAnsiChar;
  8076.     otmpFaceName: PAnsiChar;
  8077.     otmpStyleName: PAnsiChar;
  8078.     otmpFullName: PAnsiChar;
  8079.   end;
  8080.   TOutlineTextmetricW = packed record
  8081.     otmSize: UINT;
  8082.     otmTextMetrics: TTextMetric;
  8083.     otmFiller: Byte;
  8084.     otmPanoseNumber: TPanose;
  8085.     otmfsSelection: UINT;
  8086.     otmfsType: UINT;
  8087.     otmsCharSlopeRise: Integer;
  8088.     otmsCharSlopeRun: Integer;
  8089.     otmItalicAngle: Integer;
  8090.     otmEMSquare: UINT;
  8091.     otmAscent: Integer;
  8092.     otmDescent: Integer;
  8093.     otmLineGap: UINT;
  8094.     otmsCapEmHeight: UINT;
  8095.     otmsXHeight: UINT;
  8096.     otmrcFontBox: TRect;
  8097.     otmMacAscent: Integer;
  8098.     otmMacDescent: Integer;
  8099.     otmMacLineGap: UINT;
  8100.     otmusMinimumPPEM: UINT;
  8101.     otmptSubscriptSize: TPoint;
  8102.     otmptSubscriptOffset: TPoint;
  8103.     otmptSuperscriptSize: TPoint;
  8104.     otmptSuperscriptOffset: TPoint;
  8105.     otmsStrikeoutSize: UINT;
  8106.     otmsStrikeoutPosition: Integer;
  8107.     otmsUnderscoreSize: Integer;
  8108.     otmsUnderscorePosition: Integer;
  8109.     otmpFamilyName: PWideChar;
  8110.     otmpFaceName: PWideChar;
  8111.     otmpStyleName: PWideChar;
  8112.     otmpFullName: PWideChar;
  8113.   end;
  8114.   TOutlineTextmetric = TOutlineTextmetricA;
  8115.  
  8116. type
  8117.   PPolyTextA = ^TPolyTextA;
  8118.   PPolyTextW = ^TPolyTextW;
  8119.   PPolyText = PPolyTextA;
  8120.   TPolyTextA = packed record
  8121.     x: Integer;
  8122.     y: Integer;
  8123.     n: UINT;
  8124.     PAnsiChar: PAnsiChar;
  8125.     uiFlags: UINT;
  8126.     rcl: TRect;
  8127.     pdx: PINT;
  8128.   end;
  8129.   TPolyTextW = packed record
  8130.     x: Integer;
  8131.     y: Integer;
  8132.     n: UINT;
  8133.     PAnsiChar: PWideChar;
  8134.     uiFlags: UINT;
  8135.     rcl: TRect;
  8136.     pdx: PINT;
  8137.   end;
  8138.   TPolyText = TPolyTextA;
  8139.  
  8140.   TFixed = packed record
  8141.     fract: Word;
  8142.     value: SHORT;
  8143.   end;
  8144.  
  8145.   PMat2 = ^TMat2;
  8146.   TMat2 = packed record
  8147.     eM11: TFixed;
  8148.     eM12: TFixed;
  8149.     eM21: TFixed;
  8150.     eM22: TFixed;
  8151.   end;
  8152.  
  8153.   PGlyphMetrics = ^TGlyphMetrics;
  8154.   TGlyphMetrics = packed record
  8155.     gmBlackBoxX: UINT;
  8156.     gmBlackBoxY: UINT;
  8157.     gmptGlyphOrigin: TPoint;
  8158.     gmCellIncX: SHORT;
  8159.     gmCellIncY: SHORT;
  8160.   end;
  8161.  
  8162. const
  8163.   { GetGlyphOutline constants }
  8164.   GGO_METRICS = 0;
  8165.   GGO_BITMAP = 1;
  8166.   GGO_NATIVE = 2;
  8167.  
  8168.   GGO_GRAY2_BITMAP = 4;
  8169.   GGO_GRAY4_BITMAP = 5;
  8170.   GGO_GRAY8_BITMAP = 6;
  8171.   GGO_GLYPH_INDEX = $80;
  8172.  
  8173.   TT_POLYGON_TYPE = 24;
  8174.   TT_PRIM_LINE = 1;
  8175.   TT_PRIM_QSPLINE = 2;
  8176.  
  8177. type
  8178.   PPointfx = ^TPointfx;
  8179.   TPointfx = packed record
  8180.     x: TFixed;
  8181.     y: TFixed;
  8182.   end;
  8183.  
  8184.   PTTPolyCurve = ^TTTPolyCurve;
  8185.   TTTPolyCurve = packed record
  8186.     wType: Word;
  8187.     cpfx: Word;
  8188.     apfx: array[0..0] of TPointFX;
  8189.   end;
  8190.  
  8191.   PTTPolygonHeader = ^TTTPolygonHeader;
  8192.   TTTPolygonHeader = packed record
  8193.     cb: DWORD;
  8194.     dwType: DWORD;
  8195.     pfxStart: TPointFX;
  8196.   end;
  8197.  
  8198. const
  8199.   GCP_DBCS = 1;
  8200.   GCP_REORDER = 2;
  8201.   GCP_USEKERNING = 8;
  8202.   GCP_GLYPHSHAPE = $10;
  8203.   GCP_LIGATE = 32;
  8204.   GCP_GLYPHINDEXING = $0080;
  8205.  
  8206.   GCP_DIACRITIC = $100;
  8207.   GCP_KASHIDA = $400;
  8208.   GCP_ERROR = $8000;
  8209.   FLI_MASK = 4155;
  8210.  
  8211.   GCP_JUSTIFY = $10000;
  8212.   GCP_NODIACRITICS = $00020000;
  8213.  
  8214.   FLI_GLYPHS = $40000;
  8215.   GCP_CLASSIN = $80000;
  8216.   GCP_MAXEXTENT = $100000;
  8217.   GCP_JUSTIFYIN = $200000;
  8218.   GCP_DISPLAYZWG = $400000;
  8219.   GCP_SYMSWAPOFF = $800000;
  8220.   GCP_NUMERICOVERRIDE = $1000000;
  8221.   GCP_NEUTRALOVERRIDE = $2000000;
  8222.   GCP_NUMERICSLATIN = $4000000;
  8223.   GCP_NUMERICSLOCAL = $8000000;
  8224.  
  8225.   GCPCLASS_LATIN = 1;
  8226.   GCPCLASS_HEBREW = 2;
  8227.   GCPCLASS_ARABIC = 2;
  8228.   GCPCLASS_NEUTRAL = 3;
  8229.   GCPCLASS_LOCALNUMBER = 4;
  8230.   GCPCLASS_LATINNUMBER = 5;
  8231.   GCPCLASS_LATINNUMERICTERMINATOR = 6;
  8232.   GCPCLASS_LATINNUMERICSEPARATOR = 7;
  8233.   GCPCLASS_NUMERICSEPARATOR = 8;
  8234.   GCPCLASS_PREBOUNDRTL = $80;
  8235.   GCPCLASS_PREBOUNDLTR = $40;
  8236.   GCPCLASS_POSTBOUNDLTR        = $20;
  8237.   GCPCLASS_POSTBOUNDRTL        = $10;
  8238.  
  8239.   GCPGLYPH_LINKBEFORE          = $8000;
  8240.   GCPGLYPH_LINKAFTER           = $4000;
  8241.  
  8242.  
  8243. type
  8244.   PGCPResultsA = ^TGCPResultsA;
  8245.   PGCPResultsW = ^TGCPResultsW;
  8246.   PGCPResults = PGCPResultsA;
  8247.   TGCPResultsA = packed record
  8248.     lStructSize: DWORD;
  8249.     lpOutString: PAnsiChar;
  8250.     lpOrder: PUINT;
  8251.     lpDx: PINT;
  8252.     lpCaretPos: PINT;
  8253.     lpClass: PAnsiChar;
  8254.     lpGlyphs: PUINT;
  8255.     nGlyphs: UINT;
  8256.     nMaxFit: Integer;
  8257.   end;
  8258.   TGCPResultsW = packed record
  8259.     lStructSize: DWORD;
  8260.     lpOutString: PWideChar;
  8261.     lpOrder: PUINT;
  8262.     lpDx: PINT;
  8263.     lpCaretPos: PINT;
  8264.     lpClass: PWideChar;
  8265.     lpGlyphs: PUINT;
  8266.     nGlyphs: UINT;
  8267.     nMaxFit: Integer;
  8268.   end;
  8269.   TGCPResults = TGCPResultsA;
  8270.  
  8271.   PRasterizerStatus = ^TRasterizerStatus;
  8272.   TRasterizerStatus = packed record
  8273.     nSize: SHORT;
  8274.     wFlags: SHORT;
  8275.     nLanguageID: SHORT;
  8276.   end;
  8277.  
  8278. const
  8279.   { bits defined in wFlags of RASTERIZER_STATUS }
  8280.   TT_AVAILABLE = 1;
  8281.   TT_ENABLED = 2;
  8282.  
  8283. type
  8284.   { Pixel format descriptor }
  8285.   PPixelFormatDescriptor = ^TPixelFormatDescriptor;
  8286.   TPixelFormatDescriptor = packed record
  8287.     nSize: Word;
  8288.     nVersion: Word;
  8289.     dwFlags: DWORD;
  8290.     iPixelType: Byte;
  8291.     cColorBits: Byte;
  8292.     cRedBits: Byte;
  8293.     cRedShift: Byte;
  8294.     cGreenBits: Byte;
  8295.     cGreenShift: Byte;
  8296.     cBlueBits: Byte;
  8297.     cBlueShift: Byte;
  8298.     cAlphaBits: Byte;
  8299.     cAlphaShift: Byte;
  8300.     cAccumBits: Byte;
  8301.     cAccumRedBits: Byte;
  8302.     cAccumGreenBits: Byte;
  8303.     cAccumBlueBits: Byte;
  8304.     cAccumAlphaBits: Byte;
  8305.     cDepthBits: Byte;
  8306.     cStencilBits: Byte;
  8307.     cAuxBuffers: Byte;
  8308.     iLayerType: Byte;
  8309.     bReserved: Byte;
  8310.     dwLayerMask: DWORD;
  8311.     dwVisibleMask: DWORD;
  8312.     dwDamageMask: DWORD;
  8313.   end;
  8314.  
  8315. const
  8316.   { pixel types }
  8317.   PFD_TYPE_RGBA = 0;
  8318.   PFD_TYPE_COLORINDEX = 1;
  8319.  
  8320.   { layer types }
  8321.   PFD_MAIN_PLANE = 0;
  8322.   PFD_OVERLAY_PLANE = 1;
  8323.   PFD_UNDERLAY_PLANE = -1;
  8324.  
  8325.   { PIXELFORMATDESCRIPTOR flags }
  8326.   PFD_DOUBLEBUFFER = 1;
  8327.   PFD_STEREO = 2;
  8328.   PFD_DRAW_TO_WINDOW = 4;
  8329.   PFD_DRAW_TO_BITMAP = 8;
  8330.   PFD_SUPPORT_GDI = $10;
  8331.   PFD_SUPPORT_OPENGL = $20;
  8332.   PFD_GENERIC_FORMAT = $40;
  8333.   PFD_NEED_PALETTE = $80;
  8334.   PFD_NEED_SYSTEM_PALETTE = $100;
  8335.   PFD_SWAP_EXCHANGE = $200;
  8336.   PFD_SWAP_COPY = $400;
  8337.  
  8338.  
  8339.   { PIXELFORMATDESCRIPTOR flags for use in ChoosePixelFormat only }
  8340.   PFD_DOUBLEBUFFER_DONTCARE = $40000000;
  8341.   PFD_STEREO_DONTCARE = $80000000;
  8342.  
  8343. type
  8344. {$IFDEF STRICT}
  8345.   TFNOldFontEnumProcA = function (const logfont: TLogFontA;
  8346.     const textmetric: TTextMetricA; dword: DWORD; lparam: LPARAM): Integer stdcall;
  8347.   TFNOldFontEnumProcW = function (const logfont: TLogFontW;
  8348.     const textmetric: TTextMetricW; dword: DWORD; lparam: LPARAM): Integer stdcall;
  8349.   TFNOldFontEnumProc = TFNOldFontEnumProcA;
  8350.   TFNGObjEnumProc = function (lpvoid: Pointer; lparam: LPARAM): Integer stdcall;
  8351.   TFNLineDDAProc = procedure (p1, p2: Integer; lparam: LPARAM) stdcall;
  8352.   TFNFontEnumProcA = TFNOldFontEnumProcA;
  8353.   TFNFontEnumProcW = TFNOldFontEnumProcW;
  8354.   TFNFontEnumProc = TFNFontEnumProcA;
  8355. {$ELSE}
  8356.   TFNOldFontEnumProcA = TFarProc;
  8357.   TFNOldFontEnumProcW = TFarProc;
  8358.   TFNOldFontEnumProc = TFNOldFontEnumProcA;
  8359.   TFNGObjEnumProc = TFarProc;
  8360.   TFNLineDDAProc = TFarProc;
  8361.   TFNFontEnumProcA = TFarProc;
  8362.   TFNFontEnumProcW = TFarProc;
  8363.   TFNFontEnumProc = TFNFontEnumProcA;
  8364. {$ENDIF}
  8365.  
  8366.  
  8367.  
  8368. function AddFontResourceA(p1: PAnsiChar): Integer; stdcall;
  8369. function AddFontResourceW(p1: PWideChar): Integer; stdcall;
  8370. function AddFontResource(p1: PChar): Integer; stdcall;
  8371. function AnimatePalette(p1: HPALETTE; p2, p3: UINT; p4: PPaletteEntry): BOOL; stdcall;
  8372. function Arc(hDC: HDC; left, top, right, bottom, startX, startY, endX, endY: Integer): BOOL; stdcall;
  8373. function BitBlt(DestDC: HDC; X, Y, nWidth, Height: Integer; SrcDC: HDC;
  8374.   XSrc, YSrc: Integer; Rop: DWORD): BOOL; stdcall;
  8375. function CancelDC(DC: HDC): BOOL; stdcall;
  8376. function Chord(DC: HDC; X1, Y1, X2, Y2, X3, Y3, X4, Y4: Integer): BOOL; stdcall;
  8377. function ChoosePixelFormat(DC: HDC; p2: PPixelFormatDescriptor): Integer; stdcall;
  8378. function CloseMetaFile(DC: HDC): HMETAFILE; stdcall;
  8379. function CombineRgn(p1, p2, p3: HRGN; p4: Integer): Integer; stdcall;
  8380. function CopyMetaFileA(p1: HMETAFILE; p2: PAnsiChar): HMETAFILE; stdcall;
  8381. function CopyMetaFileW(p1: HMETAFILE; p2: PWideChar): HMETAFILE; stdcall;
  8382. function CopyMetaFile(p1: HMETAFILE; p2: PChar): HMETAFILE; stdcall;
  8383. function CreateBitmap(Width, Height: Integer; Planes, BitCount: Longint;
  8384.   Bits: Pointer): HBITMAP; stdcall;
  8385. function CreateBitmapIndirect(const p1: TBitmap): HBITMAP; stdcall;
  8386. function CreateBrushIndirect(const p1: TLogBrush): HBRUSH; stdcall;
  8387. function CreateCompatibleBitmap(DC: HDC; Width, Height: Integer): HBITMAP; stdcall;
  8388. function CreateDiscardableBitmap(DC: HDC; p2, p3: Integer): HBITMAP; stdcall;
  8389. function CreateCompatibleDC(DC: HDC): HDC; stdcall;
  8390. function CreateDCA(lpszDriver, lpszDevice, lpszOutput: PAnsiChar;
  8391.   lpdvmInit: PDeviceModeA): HDC; stdcall;
  8392. function CreateDCW(lpszDriver, lpszDevice, lpszOutput: PWideChar;
  8393.   lpdvmInit: PDeviceModeW): HDC; stdcall;
  8394. function CreateDC(lpszDriver, lpszDevice, lpszOutput: PChar;
  8395.   lpdvmInit: PDeviceMode): HDC; stdcall;
  8396. function CreateDIBitmap(DC: HDC; var InfoHeader: TBitmapInfoHeader;
  8397.   dwUsage: DWORD; InitBits: PChar; var InitInfo: TBitmapInfo;
  8398.   wUsage: UINT): HBITMAP; stdcall;
  8399. function CreateDIBPatternBrush(p1: HGLOBAL; p2: UINT): HBRUSH; stdcall;
  8400. function CreateDIBPatternBrushPt(const p1: Pointer; p2: UINT): HBRUSH; stdcall;
  8401. function CreateEllipticRgn(p1, p2, p3, p4: Integer): HRGN; stdcall;
  8402. function CreateEllipticRgnIndirect(const p1: TRect): HRGN; stdcall;
  8403. function CreateFontIndirectA(const p1: TLogFontA): HFONT; stdcall;
  8404. function CreateFontIndirectW(const p1: TLogFontW): HFONT; stdcall;
  8405. function CreateFontIndirect(const p1: TLogFont): HFONT; stdcall;
  8406. function CreateFontA(nHeight, nWidth, nEscapement, nOrientaion, fnWeight: Integer;
  8407.   fdwItalic, fdwUnderline, fdwStrikeOut, fdwCharSet, fdwOutputPrecision, 
  8408.   fdwClipPrecision, fdwQuality, fdwPitchAndFamily: DWORD; lpszFace: PAnsiChar): HFONT; stdcall;
  8409. function CreateFontW(nHeight, nWidth, nEscapement, nOrientaion, fnWeight: Integer;
  8410.   fdwItalic, fdwUnderline, fdwStrikeOut, fdwCharSet, fdwOutputPrecision, 
  8411.   fdwClipPrecision, fdwQuality, fdwPitchAndFamily: DWORD; lpszFace: PWideChar): HFONT; stdcall;
  8412. function CreateFont(nHeight, nWidth, nEscapement, nOrientaion, fnWeight: Integer;
  8413.   fdwItalic, fdwUnderline, fdwStrikeOut, fdwCharSet, fdwOutputPrecision, 
  8414.   fdwClipPrecision, fdwQuality, fdwPitchAndFamily: DWORD; lpszFace: PChar): HFONT; stdcall;
  8415. function CreateHatchBrush(p1: Integer; p2: COLORREF): HBRUSH; stdcall;
  8416. function CreateICA(lpszDriver, lpszDevice, lpszOutput: PAnsiChar; lpdvmInit: PDeviceModeA): HDC; stdcall;
  8417. function CreateICW(lpszDriver, lpszDevice, lpszOutput: PWideChar; lpdvmInit: PDeviceModeW): HDC; stdcall;
  8418. function CreateIC(lpszDriver, lpszDevice, lpszOutput: PChar; lpdvmInit: PDeviceMode): HDC; stdcall;
  8419. function CreateMetaFileA(p1: PAnsiChar): HDC; stdcall;
  8420. function CreateMetaFileW(p1: PWideChar): HDC; stdcall;
  8421. function CreateMetaFile(p1: PChar): HDC; stdcall;
  8422. function CreatePalette(const LogPalette: TLogPalette): HPalette; stdcall;
  8423. function CreatePen(Style, Width: Integer; Color: COLORREF): HPEN; stdcall;
  8424. function CreatePenIndirect(const LogPen: TLogPen): HPEN; stdcall;
  8425. function CreatePolyPolygonRgn(const pPtStructs; const pIntArray; p3, p4: Integer): HRGN; stdcall;
  8426. function CreatePatternBrush(Bitmap: HBITMAP): HBRUSH; stdcall;
  8427. function CreateRectRgn(p1, p2, p3, p4: Integer): HRGN; stdcall;
  8428. function CreateRectRgnIndirect(const p1: TRect): HRGN; stdcall;
  8429. function CreateRoundRectRgn(p1, p2, p3, p4, p5, p6: Integer): HRGN; stdcall;
  8430. function CreateScalableFontResourceA(p1: DWORD; p2, p3, p4: PAnsiChar): BOOL; stdcall;
  8431. function CreateScalableFontResourceW(p1: DWORD; p2, p3, p4: PWideChar): BOOL; stdcall;
  8432. function CreateScalableFontResource(p1: DWORD; p2, p3, p4: PChar): BOOL; stdcall;
  8433. function CreateSolidBrush(p1: COLORREF): HBRUSH; stdcall;
  8434. function DeleteDC(DC: HDC): BOOL; stdcall;
  8435. function DeleteMetaFile(p1: HMETAFILE): BOOL; stdcall;
  8436. function DeleteObject(p1: HGDIOBJ): BOOL; stdcall;
  8437. function DescribePixelFormat(DC: HDC; p2: Integer; p3: UINT; var p4: TPixelFormatDescriptor): BOOL; stdcall;
  8438.  
  8439. { define types of pointers to ExtDeviceMode() and DeviceCapabilities()
  8440.   functions for Win 3.1 compatibility }
  8441.  
  8442. type
  8443.   TFNDevMode = function(Wnd: HWND; Driver: HMODULE;
  8444.     var DevModeOutput: TDeviceMode; DeciveName, Port: LPSTR;
  8445.     var DevModeInput: TDeviceMode; Profile: LPSTR; Mode: UINT): UINT stdcall;
  8446.   TFNDevCaps = function(DeviceName, Port: LPSTR;
  8447.     Index: UINT; Output: LPSTR; var DevMode: TDeviceMode): DWORD stdcall;
  8448.  
  8449. const
  8450.   { mode selections for the device mode function }
  8451.   DM_UPDATE = 1;
  8452.   DM_COPY = 2;
  8453.   DM_PROMPT = 4;
  8454.   DM_MODIFY = 8;
  8455.  
  8456.   DM_IN_BUFFER = DM_MODIFY;
  8457.   DM_IN_PROMPT = DM_PROMPT;
  8458.   DM_OUT_BUFFER = DM_COPY;
  8459.   DM_OUT_DEFAULT = DM_UPDATE;
  8460.  
  8461.   { device capabilities indices }
  8462.   DC_FIELDS = 1;
  8463.   DC_PAPERS = 2;
  8464.   DC_PAPERSIZE = 3;
  8465.   DC_MINEXTENT = 4;
  8466.   DC_MAXEXTENT = 5;
  8467.   DC_BINS = 6;
  8468.   DC_DUPLEX = 7;
  8469.   DC_SIZE = 8;
  8470.   DC_EXTRA = 9;
  8471.   DC_VERSION = 10;
  8472.   DC_DRIVER = 11;
  8473.   DC_BINNAMES = 12;
  8474.   DC_ENUMRESOLUTIONS = 13;
  8475.   DC_FILEDEPENDENCIES = 14;
  8476.   DC_TRUETYPE = 15;
  8477.   DC_PAPERNAMES = 16;
  8478.   DC_ORIENTATION = 17;
  8479.   DC_COPIES = 18;
  8480.   DC_BINADJUST = 19;
  8481.   DC_EMF_COMPLIANT = 20;
  8482.   DC_DATATYPE_PRODUCED = 21;
  8483.   DC_MANUFACTURER = 23;
  8484.   DC_MODEL = 24;
  8485.  
  8486.  
  8487.   { bit fields of the return value (DWORD) for DC_TRUETYPE }
  8488.   DCTT_BITMAP = 1;
  8489.   DCTT_DOWNLOAD = 2;
  8490.   DCTT_SUBDEV = 4;
  8491.   DCTT_DOWNLOAD_OUTLINE = 8;
  8492.  
  8493.  
  8494.   { return values for DC_BINADJUST }
  8495.   DCBA_FACEUPNONE = 0;
  8496.   DCBA_FACEUPCENTER = 1;
  8497.   DCBA_FACEUPLEFT = 2;
  8498.   DCBA_FACEUPRIGHT = 3;
  8499.   DCBA_FACEDOWNNONE = $100;
  8500.   DCBA_FACEDOWNCENTER = 257;
  8501.   DCBA_FACEDOWNLEFT = 258;
  8502.   DCBA_FACEDOWNRIGHT = 259;
  8503.  
  8504. function DeviceCapabilitiesA(pDevice, pPort: PAnsiChar; fwCapability: Word;
  8505.   pOutput: PAnsiChar; DevMode: PDeviceModeA): Integer; stdcall;
  8506. function DeviceCapabilitiesW(pDevice, pPort: PWideChar; fwCapability: Word;
  8507.   pOutput: PWideChar; DevMode: PDeviceModeW): Integer; stdcall;
  8508. function DeviceCapabilities(pDevice, pPort: PChar; fwCapability: Word;
  8509.   pOutput: PChar; DevMode: PDeviceMode): Integer; stdcall;
  8510.  
  8511. function DrawEscape(DC: HDC; p2, p3: Integer; p4: LPCSTR): BOOL; stdcall;
  8512. function Ellipse(DC: HDC; X1, Y1, X2, Y2: Integer): BOOL; stdcall;
  8513. function EnumFontFamiliesExA(DC: HDC; var p2: TLogFontA;
  8514.   p3: TFNFontEnumProcA; p4: LPARAM; p5: DWORD): BOOL; stdcall;
  8515. function EnumFontFamiliesExW(DC: HDC; var p2: TLogFontW;
  8516.   p3: TFNFontEnumProcW; p4: LPARAM; p5: DWORD): BOOL; stdcall;
  8517. function EnumFontFamiliesEx(DC: HDC; var p2: TLogFont;
  8518.   p3: TFNFontEnumProc; p4: LPARAM; p5: DWORD): BOOL; stdcall;
  8519. function EnumFontFamiliesA(DC: HDC; p2: PAnsiChar; p3: TFNFontEnumProcA; p4: LPARAM): BOOL; stdcall;
  8520. function EnumFontFamiliesW(DC: HDC; p2: PWideChar; p3: TFNFontEnumProcW; p4: LPARAM): BOOL; stdcall;
  8521. function EnumFontFamilies(DC: HDC; p2: PChar; p3: TFNFontEnumProc; p4: LPARAM): BOOL; stdcall;
  8522. function EnumFontsA(DC: HDC; lpszFace: PAnsiChar; fntenmprc: TFNFontEnumProcA;
  8523.   lpszData: PChar): Integer; stdcall;
  8524. function EnumFontsW(DC: HDC; lpszFace: PWideChar; fntenmprc: TFNFontEnumProcW;
  8525.   lpszData: PChar): Integer; stdcall;
  8526. function EnumFonts(DC: HDC; lpszFace: PChar; fntenmprc: TFNFontEnumProc;
  8527.   lpszData: PChar): Integer; stdcall;
  8528. function EnumObjects(DC: HDC; p2: Integer; p3: TFNGObjEnumProc; p4: LPARAM): Integer; stdcall;
  8529. function EqualRgn(p1, p2: HRGN): BOOL; stdcall;
  8530. function Escape(DC: HDC; p2, p3: Integer; p4: LPCSTR; p5: Pointer): Integer; stdcall;
  8531. function ExtEscape(DC: HDC; p2, p3: Integer;
  8532.   const p4: LPCSTR; p5: Integer; p6: LPSTR): Integer; stdcall;
  8533. function ExcludeClipRect(DC: HDC; p2, p3, p4, p5: Integer): Integer; stdcall;
  8534. function ExtCreateRegion(p1: PXForm; p2: DWORD; const p3: TRgnData): HRGN; stdcall;
  8535. function ExtFloodFill(DC: HDC; X, Y: Integer; Color: COLORREF; FillType: UINT): BOOL; stdcall;
  8536. function FillRgn(DC: HDC; p2: HRGN; p3: HBRUSH): BOOL; stdcall;
  8537. function FloodFill(DC: HDC; nXStart, nYStart: Integer; crFill: COLORREF): BOOL; stdcall;
  8538. function FrameRgn(DC: HDC; p2: HRGN; p3: HBRUSH; p4, p5: Integer): BOOL; stdcall;
  8539. function GetROP2(DC: HDC): Integer; stdcall;
  8540. function GetAspectRatioFilterEx(DC: HDC; var p2: TSize): BOOL; stdcall;
  8541. function GetBkColor(hDC: HDC): COLORREF; stdcall;
  8542. function GetBkMode(hDC: HDC): Integer; stdcall;
  8543. function GetBitmapBits(Bitmap: HBITMAP; Count: Longint;
  8544.   Bits: Pointer): Longint; stdcall;
  8545. function GetBitmapDimensionEx(p1: HBITMAP; var p2: TSize): BOOL; stdcall;
  8546. function GetBoundsRect(DC: HDC; var p2: TRect; p3: UINT): UINT; stdcall;
  8547. function GetBrushOrgEx(DC: HDC; var p2: TPoint): BOOL; stdcall;
  8548. function GetCharWidthA(DC: HDC; p2, p3: UINT; const Widths): BOOL; stdcall;
  8549. function GetCharWidthW(DC: HDC; p2, p3: UINT; const Widths): BOOL; stdcall;
  8550. function GetCharWidth(DC: HDC; p2, p3: UINT; const Widths): BOOL; stdcall;
  8551. function GetCharWidth32A(DC: HDC; p2, p3: UINT; const Widths): BOOL; stdcall;
  8552. function GetCharWidth32W(DC: HDC; p2, p3: UINT; const Widths): BOOL; stdcall;
  8553. function GetCharWidth32(DC: HDC; p2, p3: UINT; const Widths): BOOL; stdcall;
  8554. function GetCharWidthFloatA(DC: HDC; p2, p3: UINT; const Widths): BOOL; stdcall;
  8555. function GetCharWidthFloatW(DC: HDC; p2, p3: UINT; const Widths): BOOL; stdcall;
  8556. function GetCharWidthFloat(DC: HDC; p2, p3: UINT; const Widths): BOOL; stdcall;
  8557. function GetCharABCWidthsA(DC: HDC; p2, p3: UINT; const ABCStructs): BOOL; stdcall;
  8558. function GetCharABCWidthsW(DC: HDC; p2, p3: UINT; const ABCStructs): BOOL; stdcall;
  8559. function GetCharABCWidths(DC: HDC; p2, p3: UINT; const ABCStructs): BOOL; stdcall;
  8560. function GetCharABCWidthsFloatA(DC: HDC; p2, p3: UINT; const ABCFloatSturcts): BOOL; stdcall;
  8561. function GetCharABCWidthsFloatW(DC: HDC; p2, p3: UINT; const ABCFloatSturcts): BOOL; stdcall;
  8562. function GetCharABCWidthsFloat(DC: HDC; p2, p3: UINT; const ABCFloatSturcts): BOOL; stdcall;
  8563. function GetClipBox(DC: HDC; var Rect: TRect): Integer; stdcall;
  8564. function GetClipRgn(DC: HDC; rgn: HRGN): Integer; stdcall;
  8565. function GetMetaRgn(DC: HDC; rgn: HRGN): Integer; stdcall;
  8566. function GetCurrentObject(DC: HDC; p2: UINT): HGDIOBJ; stdcall;
  8567. function GetCurrentPositionEx(DC: HDC; Point: PPoint): BOOL; stdcall;
  8568. function GetDeviceCaps(DC: HDC; Index: Integer): Integer; stdcall;
  8569. function GetDIBits(DC: HDC; Bitmap: HBitmap; StartScan, NumScans: UINT;
  8570.   Bits: Pointer; var BitInfo: TBitmapInfo; Usage: UINT): Integer; stdcall;
  8571. function GetFontData(DC: HDC; p2, p3: DWORD; p4: Pointer; p5: DWORD): DWORD; stdcall;
  8572. function GetGlyphOutlineA(DC: HDC; p2, p3: UINT;
  8573.   const p4: TGlyphMetrics; p5: DWORD; p6: Pointer; const p7: TMat2): DWORD; stdcall;
  8574. function GetGlyphOutlineW(DC: HDC; p2, p3: UINT;
  8575.   const p4: TGlyphMetrics; p5: DWORD; p6: Pointer; const p7: TMat2): DWORD; stdcall;
  8576. function GetGlyphOutline(DC: HDC; p2, p3: UINT;
  8577.   const p4: TGlyphMetrics; p5: DWORD; p6: Pointer; const p7: TMat2): DWORD; stdcall;
  8578. function GetGraphicsMode(DC: HDC): Integer; stdcall;
  8579. function GetMapMode(DC: HDC): Integer; stdcall;
  8580. function GetMetaFileBitsEx(p1: HMETAFILE; p2: UINT; p3: Pointer): UINT; stdcall;
  8581. function GetMetaFileA(p1: PAnsiChar): HMETAFILE; stdcall;
  8582. function GetMetaFileW(p1: PWideChar): HMETAFILE; stdcall;
  8583. function GetMetaFile(p1: PChar): HMETAFILE; stdcall;
  8584. function GetNearestColor(DC: HDC; p2: COLORREF): COLORREF; stdcall;
  8585. function GetNearestPaletteIndex(p1: HPALETTE; p2: COLORREF): UINT; stdcall;
  8586. function GetObjectType(h: HGDIOBJ): DWORD; stdcall;
  8587. function GetOutlineTextMetricsA(DC: HDC; p2: UINT; OTMetricStructs: Pointer): UINT; stdcall;
  8588. function GetOutlineTextMetricsW(DC: HDC; p2: UINT; OTMetricStructs: Pointer): UINT; stdcall;
  8589. function GetOutlineTextMetrics(DC: HDC; p2: UINT; OTMetricStructs: Pointer): UINT; stdcall;
  8590. function GetPaletteEntries(Palette: HPALETTE; StartIndex, NumEntries: UINT;
  8591.   var PaletteEntries): UINT; stdcall;
  8592. function GetPixel(DC: HDC; X, Y: Integer): COLORREF; stdcall;
  8593. function GetPixelFormat(DC: HDC): Integer; stdcall;
  8594. function GetPolyFillMode(DC: HDC): Integer; stdcall;
  8595. function GetRasterizerCaps(var p1: TRasterizerStatus; p2: UINT): BOOL; stdcall;
  8596. function GetRegionData(RGN: HRGN; p2: DWORD; p3: PRgnData): DWORD; stdcall;
  8597. function GetRgnBox(RGN: HRGN; var p2: TRect): Integer; stdcall;
  8598. function GetStockObject(Index: Integer): HGDIOBJ; stdcall;
  8599. function GetStretchBltMode(DC: HDC): Integer; stdcall;
  8600. function GetSystemPaletteEntries(DC: HDC; StartIndex, NumEntries: UINT;
  8601.   var PaletteEntries): UINT; stdcall;
  8602. function GetSystemPaletteUse(DC: HDC): UINT; stdcall;
  8603. function GetTextCharacterExtra(DC: HDC): Integer; stdcall;
  8604. function GetTextAlign(DC: HDC): UINT; stdcall;
  8605. function GetTextColor(DC: HDC): COLORREF; stdcall;
  8606. function GetTextExtentPointA(DC: HDC; Str: PAnsiChar; Count: Integer;
  8607.   var Size: TSize): BOOL; stdcall;
  8608. function GetTextExtentPointW(DC: HDC; Str: PWideChar; Count: Integer;
  8609.   var Size: TSize): BOOL; stdcall;
  8610. function GetTextExtentPoint(DC: HDC; Str: PChar; Count: Integer;
  8611.   var Size: TSize): BOOL; stdcall;
  8612. function GetTextExtentPoint32A(DC: HDC; Str: PAnsiChar; Count: Integer;
  8613.   var Size: TSize): BOOL; stdcall;
  8614. function GetTextExtentPoint32W(DC: HDC; Str: PWideChar; Count: Integer;
  8615.   var Size: TSize): BOOL; stdcall;
  8616. function GetTextExtentPoint32(DC: HDC; Str: PChar; Count: Integer;
  8617.   var Size: TSize): BOOL; stdcall;
  8618. function GetTextExtentExPointA(DC: HDC; p2: PAnsiChar;
  8619.   p3, p4: Integer; var p5, p6: Integer; var p7: TSize): BOOL; stdcall;
  8620. function GetTextExtentExPointW(DC: HDC; p2: PWideChar;
  8621.   p3, p4: Integer; var p5, p6: Integer; var p7: TSize): BOOL; stdcall;
  8622. function GetTextExtentExPoint(DC: HDC; p2: PChar;
  8623.   p3, p4: Integer; var p5, p6: Integer; var p7: TSize): BOOL; stdcall;
  8624. function GetTextCharset(hdc: HDC): Integer; stdcall;
  8625. function GetTextCharsetInfo(hdc: HDC; lpSig: PFontSignature; dwFlags: DWORD): BOOL; stdcall;
  8626. function TranslateCharsetInfo(var lpSrc: DWORD; var lpCs: TCharsetInfo; dwFlags: DWORD): BOOL; stdcall;
  8627. function GetFontLanguageInfo(DC: HDC): DWORD; stdcall;
  8628. function GetCharacterPlacementA(DC: HDC; p2: PAnsiChar; p3, p4: BOOL;
  8629.   var p5: TGCPResults; p6: DWORD): DWORD; stdcall;
  8630. function GetCharacterPlacementW(DC: HDC; p2: PWideChar; p3, p4: BOOL;
  8631.   var p5: TGCPResults; p6: DWORD): DWORD; stdcall;
  8632. function GetCharacterPlacement(DC: HDC; p2: PChar; p3, p4: BOOL;
  8633.   var p5: TGCPResults; p6: DWORD): DWORD; stdcall;
  8634. function GetViewportExtEx(DC: HDC; var p2: TSize): BOOL; stdcall;
  8635. function GetViewportOrgEx(DC: HDC; Point: PPoint): BOOL; stdcall;
  8636. function GetWindowExtEx(DC: HDC; var p2: TSize): BOOL; stdcall;
  8637. function GetWindowOrgEx(DC: HDC; var p2: TPoint): BOOL; stdcall;
  8638. function IntersectClipRect(DC: HDC; X1, Y1, X2, Y2: Integer): Integer; stdcall;
  8639. function InvertRgn(DC: HDC; p2: HRGN): BOOL; stdcall;
  8640. function LineDDA(p1, p2, p3, p4: Integer; p5: TFNLineDDAProc; p6: LPARAM): BOOL; stdcall;
  8641. function LineTo(DC: HDC; X, Y: Integer): BOOL; stdcall;
  8642. function MaskBlt(DC: HDC; p2, p3, p4, p5: Integer; p6: HDC;
  8643.   p7, p8: Integer; p9: HBITMAP; p10, p11: Integer; p12: DWORD): BOOL; stdcall;
  8644. function PlgBlt(DC: HDC; const PointsArray; p3: HDC;
  8645.   p4, p5, p6, p7: Integer; p8: HBITMAP; p9, p10: Integer): BOOL; stdcall;
  8646. function OffsetClipRgn(DC: HDC; p2, p3: Integer): Integer; stdcall;
  8647. function OffsetRgn(RGN: HRGN; p2, p3: Integer): Integer; stdcall;
  8648. function PatBlt(DC: HDC; X, Y, Width, Height: Integer; Rop: DWORD): BOOL; stdcall;
  8649. function Pie(DC: HDC; X1, Y1, X2, Y2, X3, Y3, X4, Y4: Integer): BOOL; stdcall;
  8650. function PlayMetaFile(DC: HDC; MF: HMETAFILE): BOOL; stdcall;
  8651. function PaintRgn(DC: HDC; RGN: HRGN): BOOL; stdcall;
  8652. function PolyPolygon(DC: HDC; var Points; var nPoints; p4: Integer): BOOL; stdcall;
  8653. function PtInRegion(RGN: HRGN; p2, p3: Integer): BOOL; stdcall;
  8654. function PtVisible(DC: HDC; p2, p3: Integer): BOOL; stdcall;
  8655. function RectInRegion(RGN: HRGN; const p2: TRect): BOOL; stdcall;
  8656. function RectVisible(DC: HDC; const Rect: TRect): BOOL; stdcall;
  8657. function Rectangle(DC: HDC; X1, Y1, X2, Y2: Integer): BOOL; stdcall;
  8658. function RestoreDC(DC: HDC; SavedDC: Integer): BOOL; stdcall;
  8659. function ResetDCA(DC: HDC; const p2: TDeviceModeA): HDC; stdcall;
  8660. function ResetDCW(DC: HDC; const p2: TDeviceModeW): HDC; stdcall;
  8661. function ResetDC(DC: HDC; const p2: TDeviceMode): HDC; stdcall;
  8662. function RealizePalette(DC: HDC): UINT; stdcall;
  8663. function RemoveFontResourceA(p1: PAnsiChar): BOOL; stdcall;
  8664. function RemoveFontResourceW(p1: PWideChar): BOOL; stdcall;
  8665. function RemoveFontResource(p1: PChar): BOOL; stdcall;
  8666. function RoundRect(DC: HDC; X1, Y1, X2, Y2, X3, Y3: Integer): BOOL; stdcall;
  8667. function ResizePalette(p1: HPALETTE; p2: UINT): BOOL; stdcall;
  8668. function SaveDC(DC: HDC): Integer; stdcall;
  8669. function SelectClipRgn(DC: HDC; p2: HRGN): Integer; stdcall;
  8670. function ExtSelectClipRgn(DC: HDC; p2: HRGN; p3: Integer): Integer; stdcall;
  8671. function SetMetaRgn(DC: HDC): Integer; stdcall;
  8672. function SelectObject(DC: HDC; p2: HGDIOBJ): HGDIOBJ; stdcall;
  8673. function SelectPalette(DC: HDC; Palette: HPALETTE;
  8674.   ForceBackground: Bool): HPALETTE; stdcall;
  8675. function SetBkColor(DC: HDC; Color: COLORREF): COLORREF; stdcall;
  8676. function SetBkMode(DC: HDC; BkMode: Integer): Integer; stdcall;
  8677. function SetBitmapBits(p1: HBITMAP; p2: DWORD; bits: Pointer): Longint; stdcall;
  8678. function SetBoundsRect(DC: HDC; p2: PRect; p3: UINT): UINT; stdcall;
  8679. function SetDIBits(DC: HDC; Bitmap: HBITMAP; StartScan, NumScans: UINT;
  8680.   Bits: Pointer; var BitsInfo: TBitmapInfo; Usage: UINT): Integer; stdcall;
  8681. function SetDIBitsToDevice(DC: HDC; DestX, DestY: Integer; Width, Height: DWORD;
  8682.   SrcX, SrcY: Integer; nStartScan, NumScans: UINT; Bits: Pointer;
  8683.   var BitsInfo: TBitmapInfo; Usage: UINT): Integer; stdcall;
  8684. function SetMapperFlags(DC: HDC; Flag: DWORD): DWORD; stdcall;
  8685. function SetGraphicsMode(hdc: HDC; iMode: Integer): Integer; stdcall;
  8686. function SetMapMode(DC: HDC; p2: Integer): Integer; stdcall;
  8687. function SetMetaFileBitsEx(p1: UINT; const p2: PChar): HMETAFILE; stdcall;
  8688. function SetPaletteEntries(Palette: HPALETTE; StartIndex, NumEntries: UINT;
  8689.   var PaletteEntries): UINT; stdcall;
  8690. function SetPixel(DC: HDC; X, Y: Integer; Color: COLORREF): COLORREF; stdcall;
  8691. function SetPixelV(DC: HDC; X, Y: Integer; Color: COLORREF): BOOL; stdcall;
  8692. function SetPixelFormat(DC: HDC; p2: Integer; p3: PPixelFormatDescriptor): BOOL; stdcall;
  8693. function SetPolyFillMode(DC: HDC; PolyFillMode: Integer): Integer; stdcall;
  8694. function StretchBlt(DestDC: HDC; X, Y, Width, Height: Integer; SrcDC: HDC;
  8695.   XSrc, YSrc, SrcWidth, SrcHeight: Integer; Rop: DWORD): BOOL; stdcall;
  8696. function SetRectRgn(Rgn: HRgn; X1, Y1, X2, Y2: Integer): BOOL; stdcall;
  8697. function StretchDIBits(DC: HDC; DestX, DestY, DestWidth, DestHegiht, SrcX,
  8698.   SrcY, SrcWidth, SrcHeight: Integer; Bits: Pointer; var BitsInfo: TBitmapInfo;
  8699.   Usage: UINT; Rop: DWORD): Integer; stdcall;
  8700. function SetROP2(DC: HDC; p2: Integer): Integer; stdcall;
  8701. function SetStretchBltMode(DC: HDC; p2: Integer): Integer; stdcall;
  8702. function SetSystemPaletteUse(DC: HDC; p2: UINT): UINT; stdcall;
  8703. function SetTextCharacterExtra(DC: HDC; CharExtra: Integer): Integer; stdcall;
  8704. function SetTextColor(DC: HDC; Color: COLORREF): COLORREF; stdcall;
  8705. function SetTextAlign(DC: HDC; Flags: UINT): UINT; stdcall;
  8706. function SetTextJustification(DC: HDC; BreakExtra, BreakCount: Integer): Integer; stdcall;
  8707. function UpdateColors(DC: HDC): BOOL; stdcall;
  8708. function PlayMetaFileRecord(DC: HDC; const p2: THandleTable; const p3: TMetaRecord; p4: UINT): BOOL; stdcall;
  8709.  
  8710. type
  8711. {$IFDEF STRICT}
  8712.   TFNMFEnumProc = function (DC: HDC; var p2: THandleTable; p3: TMetaRecord;
  8713.     p4: Integer; p5: LPARAM): Integer stdcall;
  8714.   TFNEnhMFEnumProc = function (DC: HDC; var p2: THandleTable; p3: TEnhMetaRecord;
  8715.     p4: Integer; p5: LPARAM): Integer stdcall;
  8716. {$ELSE}
  8717.   TFNMFEnumProc = TFarProc;
  8718.   TFNEnhMFEnumProc = TFarProc;
  8719. {$ENDIF}
  8720.  
  8721. function EnumMetaFile(DC: HDC; p2: HMETAFILE; p3: TFNMFEnumProc; p4: LPARAM): BOOL; stdcall;
  8722.  
  8723. { Enhanced Metafile Function Declarations }
  8724.  
  8725. function CloseEnhMetaFile(DC: HDC): HENHMETAFILE; stdcall;
  8726. function CopyEnhMetaFileA(p1: HENHMETAFILE; p2: PAnsiChar): HENHMETAFILE; stdcall;
  8727. function CopyEnhMetaFileW(p1: HENHMETAFILE; p2: PWideChar): HENHMETAFILE; stdcall;
  8728. function CopyEnhMetaFile(p1: HENHMETAFILE; p2: PChar): HENHMETAFILE; stdcall;
  8729. function CreateEnhMetaFileA(DC: HDC; p2: PAnsiChar; p3: PRect; p4: PAnsiChar): HDC; stdcall;
  8730. function CreateEnhMetaFileW(DC: HDC; p2: PWideChar; p3: PRect; p4: PWideChar): HDC; stdcall;
  8731. function CreateEnhMetaFile(DC: HDC; p2: PChar; p3: PRect; p4: PChar): HDC; stdcall;
  8732. function DeleteEnhMetaFile(p1: HENHMETAFILE): BOOL; stdcall;
  8733. function EnumEnhMetaFile(DC: HDC; p2: HENHMETAFILE; p3: TFNEnhMFEnumProc; p4: Pointer; const p5: TRect): BOOL; stdcall;
  8734. function GetEnhMetaFileA(p1: PAnsiChar): HENHMETAFILE; stdcall;
  8735. function GetEnhMetaFileW(p1: PWideChar): HENHMETAFILE; stdcall;
  8736. function GetEnhMetaFile(p1: PChar): HENHMETAFILE; stdcall;
  8737. function GetEnhMetaFileBits(p1: HENHMETAFILE; p2: UINT; p3: PByte): UINT; stdcall;
  8738. function GetEnhMetaFileDescriptionA(p1: HENHMETAFILE; p2: UINT; p3: PAnsiChar): UINT; stdcall;
  8739. function GetEnhMetaFileDescriptionW(p1: HENHMETAFILE; p2: UINT; p3: PWideChar): UINT; stdcall;
  8740. function GetEnhMetaFileDescription(p1: HENHMETAFILE; p2: UINT; p3: PChar): UINT; stdcall;
  8741. function GetEnhMetaFileHeader(p1: HENHMETAFILE; p2: UINT; p3: PEnhMetaHeader): UINT; stdcall;
  8742. function GetEnhMetaFilePaletteEntries(p1: HENHMETAFILE; p2: UINT; p3: Pointer): UINT; stdcall;
  8743. function GetWinMetaFileBits(p1: HENHMETAFILE; p2: UINT; p3: PByte;
  8744.   p4: Integer; p5: HDC): UINT; stdcall;
  8745. function PlayEnhMetaFile(DC: HDC; p2: HENHMETAFILE; const p3: TRect): BOOL; stdcall;
  8746. function PlayEnhMetaFileRecord(DC: HDC; var p2: THandleTable;
  8747.   const p3: TEnhMetaRecord; p4: UINT): BOOL; stdcall;
  8748. function SetEnhMetaFileBits(p1: UINT; p2: PChar): HENHMETAFILE; stdcall;
  8749. function SetWinMetaFileBits(p1: UINT; p2: PChar; p3: HDC;
  8750.   const p4: TMetaFilePict): HENHMETAFILE; stdcall;
  8751. function GdiComment(DC: HDC; p2: UINT; p3: PChar): BOOL; stdcall;
  8752. function GetTextMetricsA(DC: HDC; var TM: TTextMetricA): BOOL; stdcall;
  8753. function GetTextMetricsW(DC: HDC; var TM: TTextMetricW): BOOL; stdcall;
  8754. function GetTextMetrics(DC: HDC; var TM: TTextMetric): BOOL; stdcall;
  8755.  
  8756. { new GDI }
  8757.  
  8758. type
  8759.   PDIBSection = ^TDIBSection;
  8760.   TDIBSection = packed record
  8761.     dsBm: TBitmap;
  8762.     dsBmih: TBitmapInfoHeader;
  8763.     dsBitfields: array[0..3] of DWORD;
  8764.     dshSection: THandle;
  8765.     dsOffset: DWORD;
  8766.   end;
  8767.  
  8768. function AngleArc(DC: HDC; p2, p3: Integer; p4: DWORD; p5, p6: Single): BOOL; stdcall;
  8769. function PolyPolyline(DC: HDC; const PointStructs; const Points; p4: DWORD): BOOL; stdcall;
  8770. function GetWorldTransform(DC: HDC; var p2: TXForm): BOOL; stdcall;
  8771. function SetWorldTransform(DC: HDC; const p2: TXForm): BOOL; stdcall;
  8772. function ModifyWorldTransform(DC: HDC; const p2: TXForm; p3: DWORD): BOOL; stdcall;
  8773. function CombineTransform(var p1: TXForm; const p2, p3: TXForm): BOOL; stdcall;
  8774. function CreateDIBSection(DC: HDC; const p2: TBitmapInfo; p3: UINT;
  8775.   var p4: Pointer; p5: PHandle; p6: DWORD): HBITMAP; stdcall;
  8776. function GetDIBColorTable(DC: HDC; p2, p3: UINT; var RGBQuadStructs): UINT; stdcall;
  8777. function SetDIBColorTable(DC: HDC; p2, p3: UINT; var RGBQuadSTructs): UINT; stdcall;
  8778.  
  8779. const
  8780.   { Flags value for COLORADJUSTMENT }
  8781.   CA_NEGATIVE = 1;
  8782.   CA_LOG_FILTER = 2;
  8783.  
  8784.   { IlluminantIndex values }
  8785.   ILLUMINANT_DEVICE_DEFAULT = 0;
  8786.   ILLUMINANT_A = 1;
  8787.   ILLUMINANT_B = 2;
  8788.   ILLUMINANT_C = 3;
  8789.   ILLUMINANT_D50 = 4;
  8790.   ILLUMINANT_D55 = 5;
  8791.   ILLUMINANT_D65 = 6;
  8792.   ILLUMINANT_D75 = 7;
  8793.   ILLUMINANT_F2 = 8;
  8794.  
  8795.   ILLUMINANT_MAX_INDEX = ILLUMINANT_F2;
  8796.   ILLUMINANT_TUNGSTEN = ILLUMINANT_A;
  8797.   ILLUMINANT_DAYLIGHT = ILLUMINANT_C;
  8798.   ILLUMINANT_FLUORESCENT = ILLUMINANT_F2;
  8799.   ILLUMINANT_NTSC = ILLUMINANT_C;
  8800.  
  8801.   { Min and max for RedGamma, GreenGamma, BlueGamma }
  8802.   RGB_GAMMA_MIN = 02500;
  8803.   RGB_GAMMA_MAX = 65000;
  8804.  
  8805.   { Min and max for ReferenceBlack and ReferenceWhite }
  8806.   REFERENCE_WHITE_MIN = 6000;
  8807.   REFERENCE_WHITE_MAX = 10000;
  8808.   REFERENCE_BLACK_MIN = 0;
  8809.   REFERENCE_BLACK_MAX = 4000;
  8810.  
  8811.   { Min and max for Contrast, Brightness, Colorfulness, RedGreenTint }
  8812.   COLOR_ADJ_MIN = -100;
  8813.   COLOR_ADJ_MAX = 100;
  8814.  
  8815. type
  8816.   PColorAdjustment = ^TColorAdjustment;
  8817.   TColorAdjustment = packed record
  8818.     caSize: Word;
  8819.     caFlags: Word;
  8820.     caIlluminantIndex: Word;
  8821.     caRedGamma: Word;
  8822.     caGreenGamma: Word;
  8823.     caBlueGamma: Word;
  8824.     caReferenceBlack: Word;
  8825.     caReferenceWhite: Word;
  8826.     caContrast: SHORT;
  8827.     caBrightness: SHORT;
  8828.     caColorfulness: SHORT;
  8829.     caRedGreenTint: SHORT;
  8830.   end;
  8831.  
  8832. function SetColorAdjustment(DC: HDC; const p2: TColorAdjustment): BOOL; stdcall;
  8833. function GetColorAdjustment(DC: HDC; var p2: TColorAdjustment): BOOL; stdcall;
  8834. function CreateHalftonePalette(DC: HDC): HPALETTE; stdcall;
  8835.  
  8836. type
  8837.   TFNAbortProc = function (DC: HDC; p2: Integer): BOOL stdcall stdcall;
  8838.  
  8839.   PDocInfoA = ^TDocInfoA;
  8840.   PDocInfoW = ^TDocInfoW;
  8841.   PDocInfo = PDocInfoA;
  8842.   TDocInfoA = packed record
  8843.     cbSize: Integer;
  8844.     lpszDocName: PAnsiChar;
  8845.     lpszOutput: PAnsiChar;
  8846.     lpszDatatype: PAnsiChar;
  8847.     fwType: DWORD;
  8848.   end;
  8849.   TDocInfoW = packed record
  8850.     cbSize: Integer;
  8851.     lpszDocName: PWideChar;
  8852.     lpszOutput: PWideChar;
  8853.     lpszDatatype: PWideChar;
  8854.     fwType: DWORD;
  8855.   end;
  8856.   TDocInfo = TDocInfoA;
  8857.  
  8858. const
  8859.   DI_APPBANDING = 1;
  8860.  
  8861. function StartDocA(DC: HDC; const p2: TDocInfoA): Integer; stdcall;
  8862. function StartDocW(DC: HDC; const p2: TDocInfoW): Integer; stdcall;
  8863. function StartDoc(DC: HDC; const p2: TDocInfo): Integer; stdcall;
  8864. function EndDoc(DC: HDC): Integer; stdcall;
  8865. function StartPage(DC: HDC): Integer; stdcall;
  8866. function EndPage(DC: HDC): Integer; stdcall;
  8867. function AbortDoc(DC: HDC): Integer; stdcall;
  8868. function SetAbortProc(DC: HDC; lpAbortProc: TFNAbortProc): Integer; stdcall;
  8869. function AbortPath(DC: HDC): BOOL; stdcall;
  8870. function ArcTo(DC: HDC; RLeft, RTop, RRight, RBottom: Integer;
  8871.   X1, Y1, X2, Y2: Integer): BOOL; stdcall;
  8872. function BeginPath(DC: HDC): BOOL; stdcall;
  8873. function CloseFigure(DC: HDC): BOOL; stdcall;
  8874. function EndPath(DC: HDC): BOOL; stdcall;
  8875. function FillPath(DC: HDC): BOOL; stdcall;
  8876. function FlattenPath(DC: HDC): BOOL; stdcall;
  8877. function GetPath(DC: HDC; var Points, Types; nSize: Integer): Integer; stdcall;
  8878. function PathToRegion(DC: HDC): HRGN; stdcall;
  8879. function PolyDraw(DC: HDC; const Points, Types; cCount: Integer): BOOL; stdcall;
  8880. function SelectClipPath(DC: HDC; Mode: Integer): BOOL; stdcall;
  8881. function SetArcDirection(DC: HDC; Direction: Integer): Integer; stdcall;
  8882. function SetMiterLimit(DC: HDC; NewLimit: Single; OldLimit: PSingle): BOOL; stdcall;
  8883. function StrokeAndFillPath(DC: HDC): BOOL; stdcall;
  8884. function StrokePath(DC: HDC): BOOL; stdcall;
  8885. function WidenPath(DC: HDC): BOOL; stdcall;
  8886. function ExtCreatePen(PenStyle, Width: DWORD; const Brush: TLogBrush;
  8887.   StyleCount: DWORD; Style: Pointer): HPEN; stdcall;
  8888. function GetMiterLimit(DC: HDC; var Limit: Single): BOOL; stdcall;
  8889. function GetArcDirection(DC: HDC): Integer; stdcall;
  8890. function GetObjectA(p1: HGDIOBJ; p2: Integer; p3: Pointer): Integer; stdcall;
  8891. function GetObjectW(p1: HGDIOBJ; p2: Integer; p3: Pointer): Integer; stdcall;
  8892. function GetObject(p1: HGDIOBJ; p2: Integer; p3: Pointer): Integer; stdcall;
  8893. function MoveToEx(DC: HDC; p2, p3: Integer; p4: PPoint): BOOL; stdcall;
  8894. function TextOutA(DC: HDC; X, Y: Integer; Str: PAnsiChar; Count: Integer): BOOL; stdcall;
  8895. function TextOutW(DC: HDC; X, Y: Integer; Str: PWideChar; Count: Integer): BOOL; stdcall;
  8896. function TextOut(DC: HDC; X, Y: Integer; Str: PChar; Count: Integer): BOOL; stdcall;
  8897. function ExtTextOutA(DC: HDC; X, Y: Integer; Options: Longint;
  8898.   Rect: PRect; Str: PAnsiChar; Count: Longint; Dx: PInteger): BOOL; stdcall;
  8899. function ExtTextOutW(DC: HDC; X, Y: Integer; Options: Longint;
  8900.   Rect: PRect; Str: PWideChar; Count: Longint; Dx: PInteger): BOOL; stdcall;
  8901. function ExtTextOut(DC: HDC; X, Y: Integer; Options: Longint;
  8902.   Rect: PRect; Str: PChar; Count: Longint; Dx: PInteger): BOOL; stdcall;
  8903. function PolyTextOutA(DC: HDC; const PolyTextArray; Strings: Integer): BOOL; stdcall;
  8904. function PolyTextOutW(DC: HDC; const PolyTextArray; Strings: Integer): BOOL; stdcall;
  8905. function PolyTextOut(DC: HDC; const PolyTextArray; Strings: Integer): BOOL; stdcall;
  8906. function CreatePolygonRgn(const Points; Count, FillMode: Integer): HRGN; stdcall;
  8907. function DPtoLP(DC: HDC; var Points; Count: Integer): BOOL; stdcall;
  8908. function LPtoDP(DC: HDC; var Points; Count: Integer): BOOL; stdcall;
  8909. function Polygon(DC: HDC; var Points; Count: Integer): BOOL; stdcall;
  8910. function Polyline(DC: HDC; var Points; Count: Integer): BOOL; stdcall;
  8911. function PolyBezier(DC: HDC; const Points; Count: DWORD): BOOL; stdcall;
  8912. function PolyBezierTo(DC: HDC; const Points; Count: DWORD): BOOL; stdcall;
  8913. function PolyLineTo(DC: HDC; const Points; Count: DWORD): BOOL; stdcall;
  8914. function SetViewportExtEx(DC: HDC; XExt, YExt: Integer; Size: PSize): BOOL; stdcall;
  8915. function SetViewportOrgEx(DC: HDC; X, Y: Integer; Point: PPoint): BOOL; stdcall;
  8916. function SetWindowExtEx(DC: HDC; XExt, YExt: Integer; Size: PSize): BOOL; stdcall;
  8917. function SetWindowOrgEx(DC: HDC; X, Y: Integer; Point: PPoint): BOOL; stdcall;
  8918. function OffsetViewportOrgEx(DC: HDC; X, Y: Integer; var Points): BOOL; stdcall;
  8919. function OffsetWindowOrgEx(DC: HDC; X, Y: Integer; var Points): BOOL; stdcall;
  8920. function ScaleViewportExtEx(DC: HDC; XM, XD, YM, YD: Integer; Size: PSize): BOOL; stdcall;
  8921. function ScaleWindowExtEx(DC: HDC; XM, XD, YM, YD: Integer; Size: PSize): BOOL; stdcall;
  8922. function SetBitmapDimensionEx(hBitmap: HBITMAP; Width, Height: Integer; Size: PSize): BOOL; stdcall;
  8923. function SetBrushOrgEx(DC: HDC; X, Y: Integer; var Points): BOOL; stdcall;
  8924. function GetTextFaceA(DC: HDC; Count: Integer; Buffer: PAnsiChar): Integer; stdcall;
  8925. function GetTextFaceW(DC: HDC; Count: Integer; Buffer: PWideChar): Integer; stdcall;
  8926. function GetTextFace(DC: HDC; Count: Integer; Buffer: PChar): Integer; stdcall;
  8927.  
  8928. const
  8929.   FONTMAPPER_MAX = 10;
  8930.  
  8931. type
  8932.   PKerningPair = ^TKerningPair;
  8933.   TKerningPair = packed record
  8934.     wFirst: Word;
  8935.     wSecond: Word;
  8936.     iKernAmount: Integer;
  8937.   end;
  8938.  
  8939. function GetKerningPairs(DC: HDC; Count: DWORD; var KerningPairs): DWORD; stdcall;
  8940. function GetDCOrgEx(DC: HDC; var Origin: TPoint): BOOL; stdcall;
  8941. function UnrealizeObject(hGDIObj: HGDIOBJ): BOOL; stdcall;
  8942. function GdiFlush: BOOL; stdcall;
  8943. function GdiSetBatchLimit(Limit: DWORD): DWORD; stdcall;
  8944. function GdiGetBatchLimit: DWORD; stdcall;
  8945.  
  8946. const
  8947.   ICM_OFF = 1;
  8948.   ICM_ON = 2;
  8949.   ICM_QUERY = 3;
  8950.  
  8951. function SetICMMode(DC: HDC; Mode: Integer): Integer; stdcall;
  8952. function CheckColorsInGamut(DC: HDC; var RGBQuads, Results; Count: DWORD): BOOL; stdcall;
  8953. function GetColorSpace(DC: HDC): THandle; stdcall;
  8954. function GetLogColorSpaceA(p1: HCOLORSPACE; var ColorSpace: TLogColorSpaceA; Size: DWORD): BOOL; stdcall;
  8955. function GetLogColorSpaceW(p1: HCOLORSPACE; var ColorSpace: TLogColorSpaceW; Size: DWORD): BOOL; stdcall;
  8956. function GetLogColorSpace(p1: HCOLORSPACE; var ColorSpace: TLogColorSpace; Size: DWORD): BOOL; stdcall;
  8957. function CreateColorSpaceA(var ColorSpace: TLogColorSpaceA): HCOLORSPACE; stdcall;
  8958. function CreateColorSpaceW(var ColorSpace: TLogColorSpaceW): HCOLORSPACE; stdcall;
  8959. function CreateColorSpace(var ColorSpace: TLogColorSpace): HCOLORSPACE; stdcall;
  8960. function SetColorSpace(DC: HDC; ColorSpace: HCOLORSPACE): BOOL; stdcall;
  8961. function DeleteColorSpace(ColorSpace: HCOLORSPACE): BOOL; stdcall;
  8962. function GetICMProfileA(DC: HDC; Size: DWORD; Name: PAnsiChar): BOOL; stdcall;
  8963. function GetICMProfileW(DC: HDC; Size: DWORD; Name: PWideChar): BOOL; stdcall;
  8964. function GetICMProfile(DC: HDC; Size: DWORD; Name: PChar): BOOL; stdcall;
  8965. function SetICMProfileA(DC: HDC; Name: PAnsiChar): BOOL; stdcall;
  8966. function SetICMProfileW(DC: HDC; Name: PWideChar): BOOL; stdcall;
  8967. function SetICMProfile(DC: HDC; Name: PChar): BOOL; stdcall;
  8968. function GetDeviceGammaRamp(DC: HDC; var Ramp): BOOL; stdcall;
  8969. function SetDeviceGammaRamp(DC: HDC; var Ramp): BOOL; stdcall;
  8970. function ColorMatchToTarget(DC: HDC; Target: HDC; Action: DWORD): BOOL; stdcall;
  8971. function UpdateICMRegKeyA(p1, p2: DWORD; p3: PAnsiChar; p4: UINT): BOOL; stdcall;
  8972. function UpdateICMRegKeyW(p1, p2: DWORD; p3: PWideChar; p4: UINT): BOOL; stdcall;
  8973. function UpdateICMRegKey(p1, p2: DWORD; p3: PChar; p4: UINT): BOOL; stdcall;
  8974.  
  8975. type
  8976. {$IFDEF STRICT}
  8977.   TFNICMEnumProc = function (p1: LPTSTR; p2: LPARAM): Integer stdcall;
  8978. {$ELSE}
  8979.   TFNICMEnumProc = TFarProc;
  8980. {$ENDIF}
  8981.  
  8982. function EnumICMProfilesA(DC: HDC; ICMProc: TFNICMEnumProc; p3: LPARAM): Integer; stdcall;
  8983. function EnumICMProfilesW(DC: HDC; ICMProc: TFNICMEnumProc; p3: LPARAM): Integer; stdcall;
  8984. function EnumICMProfiles(DC: HDC; ICMProc: TFNICMEnumProc; p3: LPARAM): Integer; stdcall;
  8985.  
  8986. const
  8987.   ENHMETA_SIGNATURE = $464D4520;  { Enhanced metafile constants. }
  8988.  
  8989. { Stock object flag used in the object handle index in the enhanced
  8990.   metafile records.
  8991.   E.g. The object handle index (META_STOCK_OBJECT or BLACK_BRUSH)
  8992.   represents the stock object BLACK_BRUSH. }
  8993.  
  8994.   ENHMETA_STOCK_OBJECT = $80000000;
  8995.  
  8996. { Enhanced metafile record types.}
  8997.  
  8998.   EMR_HEADER = 1;
  8999.   EMR_POLYBEZIER = 2;
  9000.   EMR_POLYGON = 3;
  9001.   EMR_POLYLINE = 4;
  9002.   EMR_POLYBEZIERTO = 5;
  9003.   EMR_POLYLINETO = 6;
  9004.   EMR_POLYPOLYLINE = 7;
  9005.   EMR_POLYPOLYGON = 8;
  9006.   EMR_SETWINDOWEXTEX = 9;
  9007.   EMR_SETWINDOWORGEX = 10;
  9008.   EMR_SETVIEWPORTEXTEX = 11;
  9009.   EMR_SETVIEWPORTORGEX = 12;
  9010.   EMR_SETBRUSHORGEX = 13;
  9011.   EMR_EOF = 14;
  9012.   EMR_SETPIXELV = 15;
  9013.   EMR_SETMAPPERFLAGS = $10;
  9014.   EMR_SETMAPMODE = 17;
  9015.   EMR_SETBKMODE = 18;
  9016.   EMR_SETPOLYFILLMODE = 19;
  9017.   EMR_SETROP2 = 20;
  9018.   EMR_SETSTRETCHBLTMODE = 21;
  9019.   EMR_SETTEXTALIGN = 22;
  9020.   EMR_SETCOLORADJUSTMENT = 23;
  9021.   EMR_SETTEXTCOLOR = 24;
  9022.   EMR_SETBKCOLOR = 25;
  9023.   EMR_OFFSETCLIPRGN = 26;
  9024.   EMR_MOVETOEX = 27;
  9025.   EMR_SETMETARGN = 28;
  9026.   EMR_EXCLUDECLIPRECT = 29;
  9027.   EMR_INTERSECTCLIPRECT = 30;
  9028.   EMR_SCALEVIEWPORTEXTEX = 31;
  9029.   EMR_SCALEWINDOWEXTEX = 32;
  9030.   EMR_SAVEDC = 33;
  9031.   EMR_RESTOREDC = 34;
  9032.   EMR_SETWORLDTRANSFORM = 35;
  9033.   EMR_MODIFYWORLDTRANSFORM = 36;
  9034.   EMR_SELECTOBJECT = 37;
  9035.   EMR_CREATEPEN = 38;
  9036.   EMR_CREATEBRUSHINDIRECT = 39;
  9037.   EMR_DELETEOBJECT = 40;
  9038.   EMR_ANGLEARC = 41;
  9039.   EMR_ELLIPSE = 42;
  9040.   EMR_RECTANGLE = 43;
  9041.   EMR_ROUNDRECT = 44;
  9042.   EMR_ARC = 45;
  9043.   EMR_CHORD = 46;
  9044.   EMR_PIE = 47;
  9045.   EMR_SELECTPALETTE = 48;
  9046.   EMR_CREATEPALETTE = 49;
  9047.   EMR_SETPALETTEENTRIES = 50;
  9048.   EMR_RESIZEPALETTE = 51;
  9049.   EMR_REALIZEPALETTE = 52;
  9050.   EMR_EXTFLOODFILL = 53;
  9051.   EMR_LINETO = 54;
  9052.   EMR_ARCTO = 55;
  9053.   EMR_POLYDRAW = 56;
  9054.   EMR_SETARCDIRECTION = 57;
  9055.   EMR_SETMITERLIMIT = 58;
  9056.   EMR_BEGINPATH = 59;
  9057.   EMR_ENDPATH = 60;
  9058.   EMR_CLOSEFIGURE = 61;
  9059.   EMR_FILLPATH = 62;
  9060.   EMR_STROKEANDFILLPATH = 63;
  9061.   EMR_STROKEPATH = $40;
  9062.   EMR_FLATTENPATH = 65;
  9063.   EMR_WIDENPATH = 66;
  9064.   EMR_SELECTCLIPPATH = 67;
  9065.   EMR_ABORTPATH = 68;
  9066.  
  9067.   EMR_GDICOMMENT = 70;
  9068.   EMR_FILLRGN = 71;
  9069.   EMR_FRAMERGN = 72;
  9070.   EMR_INVERTRGN = 73;
  9071.   EMR_PAINTRGN = 74;
  9072.   EMR_EXTSELECTCLIPRGN = 75;
  9073.   EMR_BITBLT = 76;
  9074.   EMR_STRETCHBLT = 77;
  9075.   EMR_MASKBLT = 78;
  9076.   EMR_PLGBLT = 79;
  9077.   EMR_SETDIBITSTODEVICE = 80;
  9078.   EMR_STRETCHDIBITS = 81;
  9079.   EMR_EXTCREATEFONTINDIRECTW = 82;
  9080.   EMR_EXTTEXTOUTA = 83;
  9081.   EMR_EXTTEXTOUTW = 84;
  9082.   EMR_POLYBEZIER16 = 85;
  9083.   EMR_POLYGON16 = 86;
  9084.   EMR_POLYLINE16 = 87;
  9085.   EMR_POLYBEZIERTO16 = 88;
  9086.   EMR_POLYLINETO16 = 89;
  9087.   EMR_POLYPOLYLINE16 = 90;
  9088.   EMR_POLYPOLYGON16 = 91;
  9089.   EMR_POLYDRAW16 = 92;
  9090.   EMR_CREATEMONOBRUSH = 93;
  9091.   EMR_CREATEDIBPATTERNBRUSHPT = 94;
  9092.   EMR_EXTCREATEPEN = 95;
  9093.   EMR_POLYTEXTOUTA = 96;
  9094.   EMR_POLYTEXTOUTW = 97;
  9095.   EMR_SETICMMODE = 98;
  9096.   EMR_CREATECOLORSPACE = 99;
  9097.   EMR_SETCOLORSPACE = 100;
  9098.   EMR_DELETECOLORSPACE = 101;
  9099.   EMR_MAX = 101;
  9100.   EMR_MIN = 1;
  9101.  
  9102.  
  9103. type
  9104.   { Base record type for the enhanced metafile.}
  9105.   PEMR = ^TEMR;
  9106.   TEMR = packed record
  9107.     iType: DWORD; { Enhanced metafile record type}
  9108.     nSize: DWORD; { Length of the record in bytes.}
  9109.                   { This must be a multiple of 4.}
  9110.   end;
  9111.  
  9112.   { Base text record type for the enhanced metafile.}
  9113.   PEMRText = ^TEMRText;
  9114.   TEMRText = packed record
  9115.     ptlReference: TPoint;
  9116.     nChars: DWORD;
  9117.     offString: DWORD; { Offset to the string}
  9118.     fOptions: DWORD;
  9119.     rcl: TRect;
  9120.     offDx: DWORD;     { Offset to the inter-character spacing array.}
  9121.                       { This is always given.}
  9122.   end;
  9123.  
  9124.  
  9125.   { Record structures for the enhanced metafile.}
  9126.   PAbortPath = ^TAbortPath;
  9127.   TAbortPath = packed record
  9128.     emr: TEMR;
  9129.   end;
  9130.   TEMRAbortPath = TAbortPath;
  9131.   PEMRAbortPath = PAbortPath;
  9132.   TEMRBeginPath = TAbortPath;
  9133.   PEMRBeginPath = PAbortPath;
  9134.   TEMREndPath = TAbortPath;
  9135.   PEMREndPath = PAbortPath;
  9136.   TEMRCloseFigure = TAbortPath;
  9137.   PEMRCloseFigure = PAbortPath;
  9138.   TEMRFlattenPath = TAbortPath;
  9139.   PEMRFlattenPath = PAbortPath;
  9140.   TEMRWidenPath = TAbortPath;
  9141.   PEMRWidenPath = PAbortPath;
  9142.   TEMRSetMetaRgn = TAbortPath;
  9143.   PEMRSetMetaRgn = PAbortPath;
  9144.   TEMRSaveDC = TAbortPath;
  9145.   PEMRSaveDC = PAbortPath;
  9146.   TEMRRealizePalette = TAbortPath;
  9147.   PEMRRealizePalette = PAbortPath;
  9148.  
  9149.   PEMRSelectclippath = ^TEMRSelectClipPath;
  9150.   TEMRSelectClipPath = packed record
  9151.     emr: TEMR;
  9152.     iMode: DWORD;
  9153.   end;
  9154.   TEMRSetBkMode = TEMRSelectClipPath;
  9155.   PEMRSetBkMode = PEMRSelectClipPath;
  9156.   TEMRSetMapMode = TEMRSelectClipPath;
  9157.   PEMRSetMapMode = PEMRSelectClipPath;
  9158.   TEMRSetPolyFillMode = TEMRSelectClipPath;
  9159.   PEMRSetPolyFillMode = PEMRSelectClipPath;
  9160.   TEMRSetRop2 = TEMRSelectClipPath;
  9161.   PEMRSetRop2 = PEMRSelectClipPath;
  9162.   TEMRSetStretchBltMode = TEMRSelectClipPath;
  9163.   PEMRSetStretchBltMode = PEMRSelectClipPath;
  9164.   TEMRSetICMMode = TEMRSelectClipPath;
  9165.   PEMRSetICMMode = PEMRSelectClipPath;
  9166.   TEMRSetTextAlign = TEMRSelectClipPath;
  9167.   PEMRSetTextAlign = PEMRSelectClipPath;
  9168.  
  9169.   PEMRSetMiterLimit = ^TEMRSetMiterLimit;
  9170.   TEMRSetMiterLimit = packed record
  9171.     emr: TEMR;
  9172.     eMiterLimit: Single;
  9173.   end;
  9174.  
  9175.   PEMRRestoreDC = ^TEMRRestoreDC;
  9176.   TEMRRestoreDC = packed record
  9177.     emr: TEMR;
  9178.     iRelative: Longint;   { Specifies a relative instance}
  9179.   end;
  9180.  
  9181.   PEMRSetArcDirection = ^TEMRSetArcDirection;
  9182.   TEMRSetArcDirection = packed record
  9183.     emr: TEMR;
  9184.     iArcDirection: DWORD; { Specifies the arc direction in the advanced graphics mode.}
  9185.   end;
  9186.  
  9187.   PEMRSetMapperFlags = ^TEMRSetMapperFlags;
  9188.   TEMRSetMapperFlags = packed record
  9189.     emr: TEMR;
  9190.     dwFlags: DWORD;
  9191.   end;
  9192.  
  9193.   PEMRSetTextColor = ^TEMRSetTextColor;
  9194.   TEMRSetTextColor = packed record
  9195.     emr: TEMR;
  9196.     crColor: COLORREF;
  9197.   end;
  9198.   TEMRSetBkColor = TEMRSetTextColor;
  9199.   PEMRSetBkColor = PEMRSetTextColor;
  9200.  
  9201.   PEMRSelectObject = ^TEMRSelectObject;
  9202.   TEMRSelectObject = packed record
  9203.     emr: TEMR;
  9204.     ihObject: DWORD;   { Object handle index }
  9205.   end;
  9206.   EMRDeleteObject = TEMRSelectObject;
  9207.   PEMRDeleteObject = PEMRSelectObject;
  9208.  
  9209.   PEMRSelectColorSpace = ^TEMRSelectColorSpace;
  9210.   TEMRSelectColorSpace = packed record
  9211.     emr: TEMR;
  9212.     ihCS: DWORD;  { ColorSpace handle index }
  9213.   end;
  9214.   EMRDeleteColorSpace = TEMRSelectColorSpace;
  9215.   PEMRDeleteColorSpace = PEMRSelectColorSpace;
  9216.  
  9217.   PEMRSelectPalette = ^TEMRSelectPalette;
  9218.   TEMRSelectPalette = packed record
  9219.     emr: TEMR;
  9220.     ihPal: DWORD;   { Palette handle index, background mode only }
  9221.   end;
  9222.  
  9223.   PEMRResizePalette = ^TEMRResizePalette;
  9224.   TEMRResizePalette = packed record
  9225.     emr: TEMR;
  9226.     ihPal: DWORD;   { Palette handle index }
  9227.     cEntries: DWORD;
  9228.   end;
  9229.  
  9230.   PEMRSetPaletteEntries = ^TEMRSetPaletteEntries;
  9231.   TEMRSetPaletteEntries = packed record
  9232.     emr: TEMR;
  9233.     ihPal: DWORD;      { Palette handle index }
  9234.     iStart: DWORD;
  9235.     cEntries: DWORD;
  9236.     aPalEntries: array[0..0] of TPaletteEntry; { The peFlags fields do not contain any flags }
  9237.   end;
  9238.  
  9239.   PEMRSetColorAdjustment = ^TEMRSetColorAdjustment;
  9240.   TEMRSetColorAdjustment = packed record
  9241.     emr: TEMR;
  9242.     ColorAdjustment: TColorAdjustment;
  9243.   end;
  9244.  
  9245.   PEMRGDIComment = ^TEMRGDIComment;
  9246.   TEMRGDIComment = packed record
  9247.     emr: TEMR;
  9248.     cbData: DWORD;   { Size of data in bytes}
  9249.     Data: array[0..0] of Byte;
  9250.   end;
  9251.  
  9252.   PEMREOF = ^TEMREOF;
  9253.   TEMREOF = packed record
  9254.     emr: TEMR;
  9255.     nPalEntries: DWORD;   { Number of palette entries }
  9256.     offPalEntries: DWORD; { Offset to the palette entries }
  9257.     nSizeLast: DWORD;     { Same as nSize and must be the last DWORD }
  9258.                           { of the record.  The palette entries, }
  9259.                           { if exist, precede this field. }
  9260.   end;
  9261.  
  9262.   PEMRLineTo = ^TEMRLineTo;
  9263.   TEMRLineTo = packed record
  9264.     emr: TEMR;
  9265.     ptl: TPoint;
  9266.   end;
  9267.   EMRMoveToEx = TEMRLineTo;
  9268.   PEMRMoveToEx = PEMRLineTo;
  9269.  
  9270.   PEMROffsetClipRgn = ^TEMROffsetClipRgn;
  9271.   TEMROffsetClipRgn = packed record
  9272.     emr: TEMR;
  9273.     ptlOffset: TPoint;
  9274.   end;
  9275.  
  9276.   PEMRFillPath = ^TEMRFillPath;
  9277.   TEMRFillPath = packed record
  9278.     emr: TEMR;
  9279.     rclBounds: TRect; { Inclusive-inclusive bounds in device units}
  9280.   end;
  9281.   EMRStrokeAndFillPath = TEMRFillPath;
  9282.   PEMRStrokeAndFillPath = PEMRFillPath;
  9283.   EMRStrokePath = TEMRFillPath;
  9284.   PEMRStrokePath = PEMRFillPath;
  9285.  
  9286.   PEMRExcludeClipRect = ^TEMRExcludeClipRect;
  9287.   TEMRExcludeClipRect = packed record
  9288.     emr: TEMR;
  9289.     rclClip: TRect;
  9290.   end;
  9291.   EMRIntersectClipRect = TEMRExcludeClipRect;
  9292.   PEMRIntersectClipRect = PEMRExcludeClipRect;
  9293.  
  9294.   PEMRSetViewportOrgEx = ^TEMRSetViewportOrgEx;
  9295.   TEMRSetViewportOrgEx = packed record
  9296.     emr: TEMR;
  9297.     ptlOrigin: TPoint;
  9298.   end;
  9299.   EMRSetWindowOrgEx = TEMRSetViewportOrgEx;
  9300.   PEMRSetWindowOrgEx = PEMRSetViewportOrgEx;
  9301.   EMRSetBrushOrgEx = TEMRSetViewportOrgEx;
  9302.   PEMRSetBrushOrgEx = PEMRSetViewportOrgEx;
  9303.  
  9304.   PEMRSetViewportExtEx = ^TEMRSetViewportExtEx;
  9305.   TEMRSetViewportExtEx = packed record
  9306.     emr: TEMR;
  9307.     szlExtent: TSize;
  9308.   end;
  9309.   EMRSetWindowExtEx = TEMRSetViewportExtEx;
  9310.   PEMRSetWindowExtEx = PEMRSetViewportExtEx;
  9311.  
  9312.   PEMRScaleViewportExtEx = ^TEMRScaleViewportExtEx;
  9313.   TEMRScaleViewportExtEx = packed record
  9314.     emr: TEMR;
  9315.     xNum: Longint;
  9316.     xDenom: Longint;
  9317.     yNum: Longint;
  9318.     yDenom: Longint;
  9319.   end;
  9320.   EMRScaleWindowExtEx = TEMRScaleViewportExtEx;
  9321.   PEMRScaleWindowExtEx = PEMRScaleViewportExtEx;
  9322.  
  9323.   PEMRSetWorldTransform = ^TEMRSetWorldTransform;
  9324.   TEMRSetWorldTransform = packed record
  9325.     emr: TEMR;
  9326.     xform: TXForm;
  9327.   end;
  9328.  
  9329.   PEMRModifyWorldTransform = ^TEMRModifyWorldTransform;
  9330.   TEMRModifyWorldTransform = packed record
  9331.     emr: TEMR;
  9332.     xform: TXForm;
  9333.     iMode: DWORD;
  9334.   end;
  9335.  
  9336.   PEMRSetPixelV = ^TEMRSetPixelV;
  9337.   TEMRSetPixelV = packed record
  9338.     emr: TEMR;
  9339.     ptlPixel: TPoint;
  9340.     crColor: COLORREF;
  9341.   end;
  9342.  
  9343.   PEMRExtFloodFill = ^TEMRExtFloodFill;
  9344.   TEMRExtFloodFill = packed record
  9345.     emr: TEMR;
  9346.     ptlStart: TPoint;
  9347.     crColor: COLORREF;
  9348.     iMode: DWORD;
  9349.   end;
  9350.  
  9351.   PEMREllipse = ^TEMREllipse;
  9352.   TEMREllipse = packed record
  9353.     emr: TEMR;
  9354.     rclBox: TRect; { Inclusive-inclusive bounding rectangle}
  9355.   end;
  9356.   EMRRectangle = TEMREllipse;
  9357.   PEMRRectangle = PEMREllipse;
  9358.  
  9359.   PEMRRoundRect = ^TEMRRoundRect;
  9360.   TEMRRoundRect = packed record
  9361.     emr: TEMR;
  9362.     rclBox: TRect;     { Inclusive-inclusive bounding rectangle }
  9363.     szlCorner: TSize;
  9364.   end;
  9365.  
  9366.   PEMRArc = ^TEMRArc;
  9367.   TEMRArc = packed record
  9368.     emr: TEMR;
  9369.     rclBox: TRect;     { Inclusive-inclusive bounding rectangle }
  9370.     ptlStart: TPoint;
  9371.     ptlEnd: TPoint;
  9372.   end;
  9373.   EMRArcTo = TEMRArc;
  9374.   PEMRArcTo = PEMRArc;
  9375.   EMRChord = TEMRArc;
  9376.   PEMRChord = PEMRArc;
  9377.   EMRPie = TEMRArc;
  9378.   PEMRPie = PEMRArc;
  9379.  
  9380.   PEMRAngleArc = ^TEMRAngleArc;
  9381.   TEMRAngleArc = packed record
  9382.     emr: TEMR;
  9383.     ptlCenter: TPoint;
  9384.     nRadius: DWORD;
  9385.     eStartAngle: Single;
  9386.     eSweepAngle: Single;
  9387.   end;
  9388.  
  9389.   PEMRPolyline = ^TEMRPolyline;
  9390.   TEMRPolyline = packed record
  9391.     emr: TEMR;
  9392.     rclBounds: TRect;    { Inclusive-inclusive bounds in device units }
  9393.     cptl: DWORD;
  9394.     aptl: array[0..0] of TPoint;
  9395.   end;
  9396.   EMRPolyBezier = TEMRPolyLine;
  9397.   PEMRPolyBezier = PEMRPolyLine;
  9398.   EMRPolyGON = TEMRPolyLine;
  9399.   PEMRPolyGON = PEMRPolyLine;
  9400.   EMRPolyBezierTo = TEMRPolyLine;
  9401.   PEMRPolyBezierTo = PEMRPolyLine;
  9402.   EMRPolyLineTo = TEMRPolyLine;
  9403.   PEMRPolyLineTo = PEMRPolyLine;
  9404.  
  9405.   PEMRPolyline16 = ^TEMRPolyline16;
  9406.   TEMRPolyline16 = packed record
  9407.     emr: TEMR;
  9408.     rclBounds: TRect; { Inclusive-inclusive bounds in device units}
  9409.     cpts: DWORD;
  9410.     apts: array[0..0] of TPoint;
  9411.   end;
  9412.   EMRPolyBezier16 = TEMRPolyLine16;
  9413.   PEMRPolyBezier16 = PEMRPolyLine16;
  9414.   EMRPolygon16 = TEMRPolyLine16;
  9415.   PEMRPolygon16 = PEMRPolyLine16;
  9416.   EMRPolyBezierTo16 = TEMRPolyLine16;
  9417.   PEMRPolyBezierTo16 = PEMRPolyLine16;
  9418.   EMRPolyLineTo16 = TEMRPolyLine16;
  9419.   PEMRPolyLineTo16 = PEMRPolyLine16;
  9420.  
  9421.   PEMRPolyDraw = ^TEMRPolyDraw;
  9422.   TEMRPolyDraw = packed record
  9423.     emr: TEMR;
  9424.     rclBounds: TRect;    { Inclusive-inclusive bounds in device units}
  9425.     cptl: DWORD;         { Number of points}
  9426.     aptl: array[0..0] of TPoint;  { Array of points}
  9427.     abTypes: array[0..0] of Byte; { Array of point types}
  9428.   end;
  9429.  
  9430.   PEMRPolyDraw16 = ^TEMRPolyDraw16;
  9431.   TEMRPolyDraw16 = packed record
  9432.     emr: TEMR;
  9433.     rclBounds: TRect;
  9434.     cpts: DWORD;
  9435.     apts: array[0..0] of TSmallPoint;
  9436.     abTypes: array[0..0] of Byte;
  9437.   end;
  9438.  
  9439.   PEMRPolyPolyline = ^TEMRPolyPolyline;
  9440.   TEMRPolyPolyline = packed record
  9441.     emr: TEMR;
  9442.     rclBounds: TRect; { Inclusive-inclusive bounds in device units}
  9443.     nPolys: DWORD;    { Number of polys}
  9444.     cptl: DWORD;      { Total number of points in all polys}
  9445.     aPolyCounts: array[0..0] of DWORD; { Array of point counts for each poly}
  9446.     aptl: array[0..0] of TPoint;       { Array of points}
  9447.   end;
  9448.   EMRPolyPolygon = TEMRPolyPolyline;
  9449.   PEMRPolyPolygon = PEMRPolyPolyline;
  9450.  
  9451.   PEMRPolyPolyline16 = ^TEMRPolyPolyline16;
  9452.   TEMRPolyPolyline16 = packed record
  9453.     emr: TEMR;
  9454.     rclBounds: TRect;
  9455.     nPolys: DWORD;
  9456.     cpts: DWORD;
  9457.     aPolyCounts: array[0..0] of DWORD;
  9458.     apts: array[0..0] of TSmallPoint;
  9459.   end;
  9460.   EMRPolyPolygon16 = TEMRPolyPolyline16;
  9461.   PEMRPolyPolygon16 = PEMRPolyPolyline16;
  9462.  
  9463.   PEMRInvertRgn = ^TEMRInvertRgn;
  9464.   TEMRInvertRgn = packed record
  9465.     emr: TEMR;
  9466.     rclBounds: TRect; { Inclusive-inclusive bounds in device units }
  9467.     cbRgnData: DWORD; { Size of region data in bytes}
  9468.     RgnData: array[0..0] of Byte;
  9469.   end;
  9470.   EMRPaintRgn = TEMRInvertRgn;
  9471.   PEMRPaintRgn = PEMRInvertRgn;
  9472.  
  9473.   PEMRFillRgn = ^TEMRFillRgn;
  9474.   TEMRFillRgn = packed record
  9475.     emr: TEMR;
  9476.     rclBounds: TRect;  { Inclusive-inclusive bounds in device units}
  9477.     cbRgnData: DWORD;  { Size of region data in bytes}
  9478.     ihBrush: DWORD;    { Brush handle index }
  9479.     RgnData: array[0..0] of Byte;
  9480.   end;
  9481.  
  9482.   PEMRFrameRgn = ^TEMRFrameRgn;
  9483.   TEMRFrameRgn = packed record
  9484.     emr: TEMR;
  9485.     rclBounds: TRect;   { Inclusive-inclusive bounds in device units}
  9486.     cbRgnData: DWORD;   { Size of region data in bytes}
  9487.     ihBrush: DWORD;     { Brush handle index}
  9488.     szlStroke: TSize;
  9489.     RgnData: array[0..0] of Byte;
  9490.   end;
  9491.  
  9492.   PEMRExtSelectClipRgn = ^TEMRExtSelectClipRgn;
  9493.   TEMRExtSelectClipRgn = packed record
  9494.     emr: TEMR;
  9495.     cbRgnData: DWORD; { Size of region data in bytes}
  9496.     iMode: DWORD;
  9497.     RgnData: array[0..0] of Byte;
  9498.   end;
  9499.  
  9500.   PEMRExtTextOut = ^TEMRExtTextOut;
  9501.   TEMRExtTextOut = packed record
  9502.     emr: TEMR;
  9503.     rclBounds: TRect;     { Inclusive-inclusive bounds in device units}
  9504.     iGraphicsMode: DWORD; { Current graphics mode}
  9505.     exScale: Single;       { X and Y scales from Page units to .01mm units}
  9506.     eyScale: Single;       {   if graphics mode is GM_COMPATIBLE.}
  9507.     emrtext: TEMRText;    { This is followed by the string and spacing array}
  9508.   end;
  9509.  
  9510.   PEMRPolyTextOut = ^TEMRPolyTextOut;
  9511.   TEMRPolyTextOut = packed record
  9512.     emr: TEMR;
  9513.     rclBounds: TRect;     { Inclusive-inclusive bounds in device units}
  9514.     iGraphicsMode: DWORD; { Current graphics mode}
  9515.     exScale: Single;       { X and Y scales from Page units to .01mm units}
  9516.     eyScale: Single;       {   if graphics mode is GM_COMPATIBLE.}
  9517.     cStrings: Longint;
  9518.     aemrtext: array[0..0] of TEMRText; { array of TEMRText structures.  This is}
  9519.                                        { followed by the strings and spacing arrays.}
  9520.   end;
  9521.  
  9522.   PEMRBitBlt = ^TEMRBitBlt;
  9523.   TEMRBitBlt = packed record
  9524.     emr: TEMR;
  9525.     rclBounds: TRect;        { Inclusive-inclusive bounds in device units}
  9526.     xDest: Longint;
  9527.     yDest: Longint;
  9528.     cxDest: Longint;
  9529.     cyDest: Longint;
  9530.     dwRop: DWORD;
  9531.     xSrc: Longint;
  9532.     ySrc: Longint;
  9533.     xformSrc: TXForm;        { Source DC transform}
  9534.     crBkColorSrc: COLORREF; { Source DC BkColor in RGB}
  9535.     iUsageSrc: DWORD;        { Source bitmap info color table usage}
  9536.                              { (DIB_RGB_COLORS)}
  9537.     offBmiSrc: DWORD;        { Offset to the source TBitmapInfo structure}
  9538.     cbBmiSrc: DWORD;         { Size of the source TBitmapInfo structure}
  9539.     offBitsSrc: DWORD;       { Offset to the source bitmap bits}
  9540.     cbBitsSrc: DWORD;        { Size of the source bitmap bits}
  9541.   end;
  9542.  
  9543.   PEMRStretchBlt = ^TEMRStretchBlt;
  9544.   TEMRStretchBlt = packed record
  9545.     emr: TEMR;
  9546.     rclBounds: TRect; { Inclusive-inclusive bounds in device units}
  9547.     xDest: Longint;
  9548.     yDest: Longint;
  9549.     cxDest: Longint;
  9550.     cyDest: Longint;
  9551.     dwRop: DWORD;
  9552.     xSrc: Longint;
  9553.     ySrc: Longint;
  9554.     xformSrc: TXForm;        { Source DC transform}
  9555.     crBkColorSrc: COLORREF; { Source DC BkColor in RGB}
  9556.     iUsageSrc: DWORD;        { Source bitmap info color table usage}
  9557.                              { (DIB_RGB_COLORS)}
  9558.     offBmiSrc: DWORD;        { Offset to the source TBitmapInfo structure}
  9559.     cbBmiSrc: DWORD;         { Size of the source TBitmapInfo structure}
  9560.     offBitsSrc: DWORD;       { Offset to the source bitmap bits}
  9561.     cbBitsSrc: DWORD;        { Size of the source bitmap bits}
  9562.     cxSrc: Longint;
  9563.     cySrc: Longint;
  9564.   end;
  9565.  
  9566.   PEMRMaskBlt = ^TEMRMaskBlt;
  9567.   TEMRMaskBlt = packed record
  9568.     emr: TEMR;
  9569.     rclBounds: TRect;        { Inclusive-inclusive bounds in device units}
  9570.     xDest: Longint;
  9571.     yDest: Longint;
  9572.     cxDest: Longint;
  9573.     cyDest: Longint;
  9574.     dwRop: DWORD;
  9575.     xSrc: Longint;
  9576.     ySrc: Longint;
  9577.     xformSrc: TXForm;        { Source DC transform}
  9578.     crBkColorSrc: COLORREF; { Source DC BkColor in RGB}
  9579.     iUsageSrc: DWORD;        { Source bitmap info color table usage}
  9580.                              { (DIB_RGB_COLORS)}
  9581.     offBmiSrc: DWORD;        { Offset to the source TBitmapInfo structure}
  9582.     cbBmiSrc: DWORD;         { Size of the source TBitmapInfo structure}
  9583.     offBitsSrc: DWORD;       { Offset to the source bitmap bits}
  9584.     cbBitsSrc: DWORD;        { Size of the source bitmap bits}
  9585.     xMask: Longint;
  9586.     yMask: Longint;
  9587.     iUsageMask: DWORD;       { Mask bitmap info color table usage}
  9588.     offBmiMask: DWORD;       { Offset to the mask TBitmapInfo structure if any}
  9589.     cbBmiMask: DWORD;        { Size of the mask TBitmapInfo structure if any}
  9590.     offBitsMask: DWORD;      { Offset to the mask bitmap bits if any}
  9591.     cbBitsMask: DWORD;       { Size of the mask bitmap bits if any}
  9592.   end;
  9593.  
  9594.   PEMRPLGBlt = ^TEMRPLGBlt;
  9595.   TEMRPLGBlt = packed record
  9596.     emr: TEMR;
  9597.     rclBounds: TRect;
  9598.     aptlDest: array[0..3] of TPoint;
  9599.     xSrc: Longint;
  9600.     ySrc: Longint;
  9601.     cxSrc: Longint;
  9602.     cySrc: Longint;
  9603.     xformSrc: TXForm;        { Source DC transform}
  9604.     crBkColorSrc: COLORREF; { Source DC BkColor in RGB}
  9605.     iUsageSrc: DWORD;        { Source bitmap info color table usage}
  9606.                              { (DIB_RGB_COLORS)}
  9607.     offBmiSrc: DWORD;        { Offset to the source TBitmapInfo structure}
  9608.     cbBmiSrc: DWORD;         { Size of the source TBitmapInfo structure}
  9609.     offBitsSrc: DWORD;       { Offset to the source bitmap bits}
  9610.     cbBitsSrc: DWORD;        { Size of the source bitmap bits}
  9611.     xMask: Longint;
  9612.     yMask: Longint;
  9613.     iUsageMask: DWORD;       { Mask bitmap info color table usage}
  9614.     offBmiMask: DWORD;       { Offset to the mask TBitmapInfo structure if any}
  9615.     cbBmiMask: DWORD;        { Size of the mask TBitmapInfo structure if any}
  9616.     offBitsMask: DWORD;      { Offset to the mask bitmap bits if any}
  9617.     cbBitsMask: DWORD;       { Size of the mask bitmap bits if any}
  9618.   end;
  9619.  
  9620.   PEMRSetDIBitsToDevice = ^TEMRSetDIBitsToDevice;
  9621.   TEMRSetDIBitsToDevice = packed record
  9622.     emr: TEMR;
  9623.     rclBounds: TRect;
  9624.     xDest: Longint;
  9625.     yDest: Longint;
  9626.     xSrc: Longint;
  9627.     ySrc: Longint;
  9628.     cxSrc: Longint;
  9629.     cySrc: Longint;
  9630.     offBmiSrc: DWORD;        { Offset to the source TBitmapInfo structure}
  9631.     cbBmiSrc: DWORD;         { Size of the source TBitmapInfo structure}
  9632.     offBitsSrc: DWORD;       { Offset to the source bitmap bits}
  9633.     cbBitsSrc: DWORD;        { Size of the source bitmap bits}
  9634.     iUsageSrc: DWORD;        { Source bitmap info color table usage}
  9635.     iStartScan: DWORD;
  9636.     cScans: DWORD;
  9637.   end;
  9638.  
  9639.   PEMRStretchDIBits = ^TEMRStretchDIBits;
  9640.   TEMRStretchDIBits = packed record
  9641.     emr: TEMR;
  9642.     rclBounds: TRect;
  9643.     xDest: Longint;
  9644.     yDest: Longint;
  9645.     xSrc: Longint;
  9646.     ySrc: Longint;
  9647.     cxSrc: Longint;
  9648.     cySrc: Longint;
  9649.     offBmiSrc: DWORD;        { Offset to the source TBitmapInfo structure}
  9650.     cbBmiSrc: DWORD;         { Size of the source TBitmapInfo structure}
  9651.     offBitsSrc: DWORD;       { Offset to the source bitmap bits}
  9652.     cbBitsSrc: DWORD;        { Size of the source bitmap bits}
  9653.     iUsageSrc: DWORD;        { Source bitmap info color table usage}
  9654.     dwRop: DWORD;
  9655.     cxDest: Longint;
  9656.     cyDest: Longint;
  9657.   end;
  9658.  
  9659.   PEMRExtCreateFontIndirect = ^TEMRExtCreateFontIndirect;
  9660.   TEMRExtCreateFontIndirect = packed record
  9661.     emr: TEMR;
  9662.     ihFont: DWORD;     { Font handle index}
  9663.     elfw: TExtLogFont;
  9664.   end;
  9665.  
  9666.   PEMRCreatePalette = ^TEMRCreatePalette;
  9667.   TEMRCreatePalette = packed record
  9668.     emr: TEMR;
  9669.     ihPal: DWORD;        { Palette handle index}
  9670.     lgpl: TLogPalette;   { The peFlags fields in the palette entries}
  9671.                          { do not contain any flags}
  9672.   end;
  9673.  
  9674.   PEMRCreateColorSpace = ^TEMRCreateColorSpace;
  9675.   TEMRCreateColorSpace = packed record
  9676.     emr: TEMR;
  9677.     ihCS: DWORD;          { ColorSpace handle index}
  9678.     lcs: TLogColorSpace;
  9679.   end;
  9680.  
  9681.   PEMRCreatePen = ^TEMRCreatePen;
  9682.   TEMRCreatePen = packed record
  9683.     emr: TEMR;
  9684.     ihPen: DWORD;   { Pen handle index}
  9685.     lopn: TLogPen;
  9686.   end;
  9687.  
  9688.   PEMRExtCreatePen = ^TEMRExtCreatePen;
  9689.   TEMRExtCreatePen = packed record
  9690.     emr: TEMR;
  9691.     ihPen: DWORD;      { Pen handle index}
  9692.     offBmi: DWORD;     { Offset to the TBitmapInfo structure if any}
  9693.     cbBmi: DWORD;      { Size of the TBitmapInfo structure if any}
  9694.                        { The bitmap info is followed by the bitmap}
  9695.                        { bits to form a packed DIB.}
  9696.     offBits: DWORD;    { Offset to the brush bitmap bits if any}
  9697.     cbBits: DWORD;     { Size of the brush bitmap bits if any}
  9698.     elp: TExtLogPen;   { The extended pen with the style array.}
  9699.   end;
  9700.  
  9701.   PEMRCreateBrushIndirect = ^TEMRCreateBrushIndirect;
  9702.   TEMRCreateBrushIndirect = packed record
  9703.     emr: TEMR;
  9704.     ihBrush: DWORD; { Brush handle index}
  9705.     lb: TLogBrush;  { The style must be BS_SOLID, BS_HOLLOW,}
  9706.                     { BS_NULL or BS_HATCHED.}
  9707.   end;
  9708.  
  9709.   PEMRCreateMonoBrush = ^TEMRCreateMonoBrush;
  9710.   TEMRCreateMonoBrush = packed record
  9711.     emr: TEMR;
  9712.     ihBrush: DWORD; { Brush handle index}
  9713.     iUsage: DWORD;  { Bitmap info color table usage}
  9714.     offBmi: DWORD;  { Offset to the TBitmapInfo structure}
  9715.     cbBmi: DWORD;   { Size of the TBitmapInfo structure if any}
  9716.                     { The bitmap info is followed by the bitmap}
  9717.                     { bits to form a packed DIB.}
  9718.     offBits: DWORD; { Offset to the bitmap bits}
  9719.     cbBits: DWORD;  { Size of the bitmap bits}
  9720.   end;
  9721.  
  9722.   PEMRCreateDIBPatternBrushPt = ^TEMRCreateDIBPatternBrushPt;
  9723.   TEMRCreateDIBPatternBrushPt = packed record
  9724.     emr: TEMR;
  9725.     ihBrush: DWORD; { Brush handle index}
  9726.     iUsage: DWORD;  { Bitmap info color table usage}
  9727.     offBmi: DWORD;  { Offset to the TBitmapInfo structure}
  9728.     cbBmi: DWORD;   { Size of the TBitmapInfo structure if any}
  9729.                     { The bitmap info is followed by the bitmap}
  9730.                     { bits to form a packed DIB.}
  9731.     offBits: DWORD; { Offset to the bitmap bits}
  9732.     cbBits: DWORD;  { Size of the bitmap bits}
  9733.   end;
  9734.  
  9735.   PEMRFormat = ^TEMRFormat;
  9736.   TEMRFormat = packed record
  9737.     dSignature: DWORD; { Format signature, e.g. ENHMETA_SIGNATURE.}
  9738.     nVersion: DWORD;   { Format version number.}
  9739.     cbData: DWORD;     { Size of data in bytes.}
  9740.     offData: DWORD;    { Offset to data from GDICOMMENT_IDENTIFIER.}
  9741.                        { It must begin at a DWORD offset.}
  9742.   end;
  9743.  
  9744. const
  9745.   GDICOMMENT_IDENTIFIER = $43494447;
  9746.   GDICOMMENT_WINDOWS_METAFILE = $80000001;
  9747.   GDICOMMENT_BEGINGROUP = 2;
  9748.   GDICOMMENT_ENDGROUP = 3;
  9749.   GDICOMMENT_MULTIFORMATS = $40000004;
  9750.   EPS_SIGNATURE = $46535045;
  9751.  
  9752. { OpenGL wgl prototypes}
  9753.  
  9754. function wglCreateContext(DC: HDC): HGLRC; stdcall;
  9755. function wglDeleteContext(p1: HGLRC): BOOL; stdcall;
  9756. function wglGetCurrentContext: HGLRC; stdcall;
  9757. function wglGetCurrentDC: HDC; stdcall;
  9758. function wglMakeCurrent(DC: HDC; p2: HGLRC): BOOL; stdcall;
  9759. function wglShareLists(p1, p2: HGLRC): BOOL; stdcall;
  9760. function wglUseFontBitmapsA(DC: HDC; p2, p3, p4: DWORD): BOOL; stdcall;
  9761. function wglUseFontBitmapsW(DC: HDC; p2, p3, p4: DWORD): BOOL; stdcall;
  9762. function wglUseFontBitmaps(DC: HDC; p2, p3, p4: DWORD): BOOL; stdcall;
  9763. function SwapBuffers(DC: HDC): BOOL; stdcall;
  9764.  
  9765. type
  9766.   PPointFloat = ^TPointFloat;
  9767.   TPointFloat = packed record
  9768.     x: Single;
  9769.     y: Single;
  9770.   end;
  9771.  
  9772.   PGlyphMetricsFloat = ^TGlyphMetricsFloat;
  9773.   TGlyphMetricsFloat = packed record
  9774.     gmfBlackBoxX: Single;
  9775.     gmfBlackBoxY: Single;
  9776.     gmfptGlyphOrigin: TPointFloat;
  9777.     gmfCellIncX: Single;
  9778.     gmfCellIncY: Single;
  9779.   end;
  9780.  
  9781. const
  9782.   WGL_FONT_LINES = 0;
  9783.   WGL_FONT_POLYGONS = 1;
  9784.  
  9785.  
  9786. { Translated from WINUSER.H }
  9787.  
  9788. type
  9789.   HDWP = THandle;
  9790.   PMENUTEMPLATE = Pointer;
  9791.   va_list = PChar;
  9792.  
  9793. {$IFDEF STRICT}
  9794.   TFNWndProc = function (p1: HWND; p2: UINT; p3: WPARAM; p4: LPARAM): LRESULT stdcall;
  9795.   TFNDlgProc = function (p1: HWND; p2: UINT; p3: WPARAM; p4: LPARAM): BOOL stdcall;
  9796.   TFNTimerProc = procedure (p1: HWND; p2, p3: UINT; p4: DWORD) stdcall;
  9797.   TFNGrayStringProc = function (DC: HDC; p2: LPARAM; p3: Integer): BOOL stdcall;
  9798.   TFNWndEnumProc = function (p1: HWND; p2: LPARAM): BOOL stdcall;
  9799.   TFNSendAsyncProc = procedure (p1: HWND; p2: UINT; p3: DWORD; p4: LRESULT) stdcall;
  9800.   TFNDrawStateProc = function (hdc: HDC; lData: LPARAM; wData: WPARAM; cx,cy: Integer): BOOL stdcall;
  9801. {$ELSE}
  9802.   TFNWndProc = TFarProc;
  9803.   TFNDlgProc = TFarProc;
  9804.   TFNTimerProc = TFarProc;
  9805.   TFNGrayStringProc = TFarProc;
  9806.   TFNWndEnumProc = TFarProc;
  9807.   TFNSendAsyncProc = TFarProc;
  9808.   TFNDrawStateProc = TFarProc;
  9809. {$ENDIF}
  9810.  
  9811.   TFNHookProc = function (code: Integer; wparam: WPARAM; lparam: LPARAM): LRESULT stdcall;
  9812.  
  9813. type
  9814. {$IFDEF STRICT}
  9815.   TFNPropEnumProc = function (p1: HWND; p2: LPCTSTR; p3: THandle): BOOL stdcall;
  9816.   TFNPropEnumProcEx = function (p1: HWND; p2: LPTSTR; p3: THandle;
  9817.     p4: DWORD): BOOL stdcall;
  9818.   TFNEditWordBreakProc = function (lpch: LPTSTR; ichCurrent, cch, code: Integer): Integer stdcall;
  9819.   TFNNameEnumProc = function (p1: LPTSTR; p2: LPARAM): BOOL stdcall;
  9820. {$ELSE}
  9821.   TFNPropEnumProc = TFarProc;
  9822.   TFNPropEnumProcEx = TFarProc;
  9823.   TFNEditWordBreakProc = TFarProc;
  9824.   TFNNameEnumProc = TFarProc;
  9825. {$ENDIF}
  9826.   TFNWinStaEnumProc = TFNNameEnumProc;
  9827.   TFNDeskTopEnumProc = TFNNameEnumProc;
  9828.  
  9829.   MakeIntResourceA = PAnsiChar;
  9830.   MakeIntResourceW = PWideChar;
  9831.   MakeIntResource = MakeIntResourceA;
  9832.  
  9833. const
  9834.   { Predefined Resource Types }
  9835.   RT_CURSOR       = MakeIntResource(1);
  9836.   RT_BITMAP       = MakeIntResource(2);
  9837.   RT_ICON         = MakeIntResource(3);
  9838.   RT_MENU         = MakeIntResource(4);
  9839.   RT_DIALOG       = MakeIntResource(5);
  9840.   RT_STRING       = MakeIntResource(6);
  9841.   RT_FONTDIR      = MakeIntResource(7);
  9842.   RT_FONT         = MakeIntResource(8);
  9843.   RT_ACCELERATOR  = MakeIntResource(9);
  9844.   RT_RCDATA       = MakeIntResource(10);
  9845.   RT_MESSAGETABLE = MakeIntResource(11);
  9846.  
  9847.   DIFFERENCE = 11;
  9848.  
  9849.   RT_GROUP_CURSOR = MakeIntResource(DWORD(RT_CURSOR + DIFFERENCE));
  9850.   RT_GROUP_ICON   = MakeIntResource(DWORD(RT_ICON + DIFFERENCE));
  9851.   RT_VERSION      = MakeIntResource(16);
  9852.   RT_DLGINCLUDE   = MakeIntResource(17);
  9853.   RT_PLUGPLAY     = MakeIntResource(19);
  9854.   RT_VXD          = MakeIntResource(20);
  9855.  
  9856. function wvsprintfA(Output: PAnsiChar; Format: PAnsiChar; arglist: va_list): Integer; stdcall;
  9857. function wvsprintfW(Output: PWideChar; Format: PWideChar; arglist: va_list): Integer; stdcall;
  9858. function wvsprintf(Output: PChar; Format: PChar; arglist: va_list): Integer; stdcall;
  9859. function wsprintfA(Output: PAnsiChar; Format: PAnsiChar): Integer; stdcall;
  9860. function wsprintfW(Output: PWideChar; Format: PWideChar): Integer; stdcall;
  9861. function wsprintf(Output: PChar; Format: PChar): Integer; stdcall;
  9862.  
  9863. const
  9864.   { Scroll Bar Constants }
  9865.   SB_HORZ = 0;
  9866.   SB_VERT = 1;
  9867.   SB_CTL = 2;
  9868.   SB_BOTH = 3;
  9869.  
  9870.   { Scroll Bar Commands }
  9871.   SB_LINEUP = 0;
  9872.   SB_LINELEFT = 0;
  9873.   SB_LINEDOWN = 1;
  9874.   SB_LINERIGHT = 1;
  9875.   SB_PAGEUP = 2;
  9876.   SB_PAGELEFT = 2;
  9877.   SB_PAGEDOWN = 3;
  9878.   SB_PAGERIGHT = 3;
  9879.   SB_THUMBPOSITION = 4;
  9880.   SB_THUMBTRACK = 5;
  9881.   SB_TOP = 6;
  9882.   SB_LEFT = 6;
  9883.   SB_BOTTOM = 7;
  9884.   SB_RIGHT = 7;
  9885.   SB_ENDSCROLL = 8;
  9886.  
  9887.   { ShowWindow() Commands }
  9888.   SW_HIDE = 0;
  9889.   SW_SHOWNORMAL = 1;
  9890.   SW_NORMAL = 1;
  9891.   SW_SHOWMINIMIZED = 2;
  9892.   SW_SHOWMAXIMIZED = 3;
  9893.   SW_MAXIMIZE = 3;
  9894.   SW_SHOWNOACTIVATE = 4;
  9895.   SW_SHOW = 5;
  9896.   SW_MINIMIZE = 6;
  9897.   SW_SHOWMINNOACTIVE = 7;
  9898.   SW_SHOWNA = 8;
  9899.   SW_RESTORE = 9;
  9900.   SW_SHOWDEFAULT = 10;
  9901.   SW_MAX = 10;
  9902.  
  9903.   { Old ShowWindow() Commands }
  9904.   HIDE_WINDOW = 0;
  9905.   SHOW_OPENWINDOW = 1;
  9906.   SHOW_ICONWINDOW = 2;
  9907.   SHOW_FULLSCREEN = 3;
  9908.   SHOW_OPENNOACTIVATE = 4;
  9909.  
  9910.   { Identifiers for the WM_SHOWWINDOW message }
  9911.   SW_PARENTCLOSING = 1;
  9912.   SW_OTHERZOOM = 2;
  9913.   SW_PARENTOPENING = 3;
  9914.   SW_OTHERUNZOOM = 4;
  9915.  
  9916.   { WM_KEYUPDOWNCHAR HiWord(lParam) flags }
  9917.   KF_EXTENDED = $100;
  9918.   KF_DLGMODE = $800;
  9919.   KF_MENUMODE = $1000;
  9920.   KF_ALTDOWN = $2000;
  9921.   KF_REPEAT = $4000;
  9922.   KF_UP = $8000;
  9923.  
  9924.   { Virtual Keys, Standard Set }
  9925.   VK_LBUTTON = 1;
  9926.   VK_RBUTTON = 2;
  9927.   VK_CANCEL = 3;
  9928.   VK_MBUTTON = 4;  { NOT contiguous with L & RBUTTON }
  9929.   VK_BACK = 8;
  9930.   VK_TAB = 9;
  9931.   VK_CLEAR = 12;
  9932.   VK_RETURN = 13;
  9933.   VK_SHIFT = $10;
  9934.   VK_CONTROL = 17;
  9935.   VK_MENU = 18;
  9936.   VK_PAUSE = 19;
  9937.   VK_CAPITAL = 20;
  9938.   VK_ESCAPE = 27;
  9939.   VK_SPACE = $20;
  9940.   VK_PRIOR = 33;
  9941.   VK_NEXT = 34;
  9942.   VK_END = 35;
  9943.   VK_HOME = 36;
  9944.   VK_LEFT = 37;
  9945.   VK_UP = 38;
  9946.   VK_RIGHT = 39;
  9947.   VK_DOWN = 40;
  9948.   VK_SELECT = 41;
  9949.   VK_PRINT = 42;
  9950.   VK_EXECUTE = 43;
  9951.   VK_SNAPSHOT = 44;
  9952.   VK_INSERT = 45;
  9953.   VK_DELETE = 46;
  9954.   VK_HELP = 47;
  9955. { VK_0 thru VK_9 are the same as ASCII '0' thru '9' ($30 - $39) }
  9956. { VK_A thru VK_Z are the same as ASCII 'A' thru 'Z' ($41 - $5A) }
  9957.   VK_LWIN = 91;
  9958.   VK_RWIN = 92;
  9959.   VK_APPS = 93;
  9960.   VK_NUMPAD0 = 96;
  9961.   VK_NUMPAD1 = 97;
  9962.   VK_NUMPAD2 = 98;
  9963.   VK_NUMPAD3 = 99;
  9964.   VK_NUMPAD4 = 100;
  9965.   VK_NUMPAD5 = 101;
  9966.   VK_NUMPAD6 = 102;
  9967.   VK_NUMPAD7 = 103;
  9968.   VK_NUMPAD8 = 104;
  9969.   VK_NUMPAD9 = 105;
  9970.   VK_MULTIPLY = 106;
  9971.   VK_ADD = 107;
  9972.   VK_SEPARATOR = 108;
  9973.   VK_SUBTRACT = 109;
  9974.   VK_DECIMAL = 110;
  9975.   VK_DIVIDE = 111;
  9976.   VK_F1 = 112;
  9977.   VK_F2 = 113;
  9978.   VK_F3 = 114;
  9979.   VK_F4 = 115;
  9980.   VK_F5 = 116;
  9981.   VK_F6 = 117;
  9982.   VK_F7 = 118;
  9983.   VK_F8 = 119;
  9984.   VK_F9 = 120;
  9985.   VK_F10 = 121;
  9986.   VK_F11 = 122;
  9987.   VK_F12 = 123;
  9988.   VK_F13 = 124;
  9989.   VK_F14 = 125;
  9990.   VK_F15 = 126;
  9991.   VK_F16 = 127;
  9992.   VK_F17 = 128;
  9993.   VK_F18 = 129;
  9994.   VK_F19 = 130;
  9995.   VK_F20 = 131;
  9996.   VK_F21 = 132;
  9997.   VK_F22 = 133;
  9998.   VK_F23 = 134;
  9999.   VK_F24 = 135;
  10000.   VK_NUMLOCK = 144;
  10001.   VK_SCROLL = 145;
  10002. { VK_L & VK_R - left and right Alt, Ctrl and Shift virtual keys.
  10003.   Used only as parameters to GetAsyncKeyState() and GetKeyState().
  10004.   No other API or message will distinguish left and right keys in this way. }
  10005.   VK_LSHIFT = 160;
  10006.   VK_RSHIFT = 161;
  10007.   VK_LCONTROL = 162;
  10008.   VK_RCONTROL = 163;
  10009.   VK_LMENU = 164;
  10010.   VK_RMENU = 165;
  10011.   VK_PROCESSKEY = 229;
  10012.   VK_ATTN = 246;
  10013.   VK_CRSEL = 247;
  10014.   VK_EXSEL = 248;
  10015.   VK_EREOF = 249;
  10016.   VK_PLAY = 250;
  10017.   VK_ZOOM = 251;
  10018.   VK_NONAME = 252;
  10019.   VK_PA1 = 253;
  10020.   VK_OEM_CLEAR = 254;
  10021.  
  10022.  
  10023.   { SetWindowsHook() codes }
  10024.   WH_MIN = -1;
  10025.   WH_MSGFILTER = -1;
  10026.   WH_JOURNALRECORD = 0;
  10027.   WH_JOURNALPLAYBACK = 1;
  10028.   WH_KEYBOARD = 2;
  10029.   WH_GETMESSAGE = 3;
  10030.   WH_CALLWNDPROC = 4;
  10031.   WH_CBT = 5;
  10032.   WH_SYSMSGFILTER = 6;
  10033.   WH_MOUSE = 7;
  10034.   WH_HARDWARE = 8;
  10035.   WH_DEBUG = 9;
  10036.   WH_SHELL = 10;
  10037.   WH_FOREGROUNDIDLE = 11;
  10038.   WH_CALLWNDPROCRET = 12;
  10039.   WH_MAX = 12;
  10040.   WH_MINHOOK = WH_MIN;
  10041.   WH_MAXHOOK = WH_MAX;
  10042.  
  10043.   { Hook Codes }
  10044.   HC_ACTION = 0;
  10045.   HC_GETNEXT = 1;
  10046.   HC_SKIP = 2;
  10047.   HC_NOREMOVE = 3;
  10048.   HC_NOREM = HC_NOREMOVE;
  10049.   HC_SYSMODALON = 4;
  10050.   HC_SYSMODALOFF = 5;
  10051.  
  10052.   { CBT Hook Codes }
  10053.   HCBT_MOVESIZE = 0;
  10054.   HCBT_MINMAX = 1;
  10055.   HCBT_QS = 2;
  10056.   HCBT_CREATEWND = 3;
  10057.   HCBT_DESTROYWND = 4;
  10058.   HCBT_ACTIVATE = 5;
  10059.   HCBT_CLICKSKIPPED = 6;
  10060.   HCBT_KEYSKIPPED = 7;
  10061.   HCBT_SYSCOMMAND = 8;
  10062.   HCBT_SETFOCUS = 9;
  10063.  
  10064.  
  10065. type
  10066.   PCreateStructA = ^TCreateStructA;
  10067.   PCreateStructW = ^TCreateStructW;
  10068.   PCreateStruct = PCreateStructA;
  10069.   TCreateStructA = packed record
  10070.     lpCreateParams: Pointer;
  10071.     hInstance: HINST;
  10072.     hMenu: HMENU;
  10073.     hwndParent: HWND;
  10074.     cy: Integer;
  10075.     cx: Integer;
  10076.     y: Integer;
  10077.     x: Integer;
  10078.     style: Longint;
  10079.     lpszName: PAnsiChar;
  10080.     lpszClass: PAnsiChar;
  10081.     dwExStyle: DWORD;
  10082.   end;
  10083.   TCreateStructW = packed record
  10084.     lpCreateParams: Pointer;
  10085.     hInstance: HINST;
  10086.     hMenu: HMENU;
  10087.     hwndParent: HWND;
  10088.     cy: Integer;
  10089.     cx: Integer;
  10090.     y: Integer;
  10091.     x: Integer;
  10092.     style: Longint;
  10093.     lpszName: PWideChar;
  10094.     lpszClass: PWideChar;
  10095.     dwExStyle: DWORD;
  10096.   end;
  10097.   TCreateStruct = TCreateStructA;
  10098.  
  10099.   { HCBT_CREATEWND parameters pointed to by lParam }
  10100.   PCBTCreateWnd = ^TCBTCreateWnd;
  10101.   TCBTCreateWnd = packed record
  10102.     lpcs: PCreateStruct;
  10103.     hwndInsertAfter: HWND;
  10104.   end;
  10105.  
  10106.   { HCBT_ACTIVATE structure pointed to by lParam }
  10107.   PCBTActivateStruct = ^TCBTActivateStruct;
  10108.   TCBTActivateStruct = packed record
  10109.     fMouse: BOOL;
  10110.     hWndActive: HWND;
  10111.   end;
  10112.  
  10113. const
  10114.   { WH_MSGFILTER Filter Proc Codes }
  10115.   MSGF_DIALOGBOX = 0;
  10116.   MSGF_MESSAGEBOX = 1;
  10117.   MSGF_MENU = 2;
  10118.   MSGF_MOVE = 3;
  10119.   MSGF_SIZE = 4;
  10120.   MSGF_SCROLLBAR = 5;
  10121.   MSGF_NEXTWINDOW = 6;
  10122.   MSGF_MAINLOOP = 8;
  10123.   MSGF_MAX = 8;
  10124.   MSGF_USER = $1000;
  10125.  
  10126.   { Shell support }
  10127.   HSHELL_WINDOWCREATED = 1;
  10128.   HSHELL_WINDOWDESTROYED = 2;
  10129.   HSHELL_ACTIVATESHELLWINDOW = 3;
  10130.   HSHELL_WINDOWACTIVATED = 4;
  10131.   HSHELL_GETMINRECT = 5;
  10132.   HSHELL_REDRAW = 6;
  10133.   HSHELL_TASKMAN = 7;
  10134.   HSHELL_LANGUAGE = 8;
  10135.  
  10136.  
  10137. type
  10138.   { Message Structure used in Journaling }
  10139.   PEventMsg = ^TEventMsg;
  10140.   TEventMsg = packed record
  10141.     message: UINT;
  10142.     paramL: UINT;
  10143.     paramH: UINT;
  10144.     time: DWORD;
  10145.     hwnd: HWND;
  10146.   end;
  10147.   PEventMsgMsg = ^TEventMsg;
  10148.  
  10149.   { Message structure used by WH_CALLWNDPROC }
  10150.   PCWPStruct = ^TCWPStruct;
  10151.   TCWPStruct = packed record
  10152.     lParam: LPARAM;
  10153.     wParam: WPARAM;
  10154.     message: UINT;
  10155.     hwnd: HWND;
  10156.   end;
  10157.  
  10158.   { Message structure used by WH_CALLWNDPROCRET }
  10159.   PCWPRetStruct = ^TCWPRetStruct;
  10160.   TCWPRetStruct = packed record
  10161.     lResult: LRESULT;
  10162.     lParam: LPARAM;
  10163.     wParam: WPARAM;
  10164.     message: UINT;
  10165.     hwnd: HWND;
  10166.   end;
  10167.  
  10168.   { Structure used by WH_DEBUG }
  10169.   PDebugHookInfo = ^TDebugHookInfo;
  10170.   TDebugHookInfo = packed record
  10171.     idThread: DWORD;
  10172.     idThreadInstaller: DWORD;
  10173.     lParam: LPARAM;
  10174.     wParam: WPARAM;
  10175.     code: Integer;
  10176.   end;
  10177.  
  10178.   { Structure used by WH_MOUSE }
  10179.   PMouseHookStruct = ^TMouseHookStruct;
  10180.   TMouseHookStruct = packed record
  10181.     pt: TPoint;
  10182.     hwnd: HWND;
  10183.     wHitTestCode: UINT;
  10184.     dwExtraInfo: DWORD;
  10185.   end;
  10186.  
  10187.   { Structure used by WH_HARDWARE }
  10188.   PHardwareHookStruct = ^THardwareHookStruct;
  10189.   THardwareHookStruct = packed record
  10190.     hwnd: HWND;
  10191.     message: UINT;
  10192.     wParam: WPARAM;
  10193.     lParam: LPARAM;
  10194.   end;
  10195.  
  10196. const
  10197.   { Keyboard Layout API }
  10198.   HKL_PREV = 0;
  10199.   HKL_NEXT = 1;
  10200.  
  10201.   KLF_ACTIVATE = 1;
  10202.   KLF_SUBSTITUTE_OK = 2;
  10203.   KLF_UNLOADPREVIOUS = 4;
  10204.   KLF_REORDER = 8;
  10205.   KLF_REPLACELANG = $10;
  10206.   KLF_NOTELLSHELL = 128;
  10207.  
  10208.   { Size of KeyboardLayoutName (number of characters), including nul terminator }
  10209.   KL_NAMELENGTH = 9;
  10210.  
  10211.  
  10212. function LoadKeyboardLayoutA(pwszKLID: PAnsiChar; Flags: UINT): HKL; stdcall;
  10213. function LoadKeyboardLayoutW(pwszKLID: PWideChar; Flags: UINT): HKL; stdcall;
  10214. function LoadKeyboardLayout(pwszKLID: PChar; Flags: UINT): HKL; stdcall;
  10215. function ActivateKeyboardLayout(hkl: HKL; Flags: UINT): HKL; stdcall;
  10216. function UnloadKeyboardLayout(hkl: HKL): BOOL; stdcall;
  10217. function ToUnicodeEx(wVirtKey, wScanCode: UINT; lpKeyState: PByte;
  10218.   pwszBuff: PWideChar; cchBuff: Integer; wFlags: UINT; dwhkl: HKL): Integer; stdcall;
  10219. function GetKeyboardLayoutNameA(pwszKLID: PAnsiChar): BOOL; stdcall;
  10220. function GetKeyboardLayoutNameW(pwszKLID: PWideChar): BOOL; stdcall;
  10221. function GetKeyboardLayoutName(pwszKLID: PChar): BOOL; stdcall;
  10222. function GetKeyboardLayoutList(nBuff: Integer; var List): UINT; stdcall;
  10223. function GetKeyboardLayout(dwLayout: DWORD): HKL; stdcall;
  10224.  
  10225.  
  10226. const
  10227.   { Desktop-specific access flags }
  10228.   DESKTOP_READOBJECTS = 1;
  10229.   DESKTOP_CREATEWINDOW = 2;
  10230.   DESKTOP_CREATEMENU = 4;
  10231.   DESKTOP_HOOKCONTROL = 8;
  10232.   DESKTOP_JOURNALRECORD = $10;
  10233.   DESKTOP_JOURNALPLAYBACK = $20;
  10234.   DESKTOP_ENUMERATE = $40;
  10235.   DESKTOP_WRITEOBJECTS = 128;
  10236.   DESKTOP_SWITCHDESKTOP = $100;
  10237.  
  10238.   { Desktop-specific control flags }
  10239.   DF_ALLOWOTHERACCOUNTHOOK = 1;
  10240.  
  10241.  
  10242. function CreateDesktopA(lpszDesktop, lpszDevice: PAnsiChar;
  10243.   pDevmode: PDeviceModeA; dwFlags: DWORD; dwDesiredAccess:
  10244.   DWORD; lpsa: PSecurityAttributes): HDESK; stdcall;
  10245. function CreateDesktopW(lpszDesktop, lpszDevice: PWideChar;
  10246.   pDevmode: PDeviceModeW; dwFlags: DWORD; dwDesiredAccess:
  10247.   DWORD; lpsa: PSecurityAttributes): HDESK; stdcall;
  10248. function CreateDesktop(lpszDesktop, lpszDevice: PChar;
  10249.   pDevmode: PDeviceMode; dwFlags: DWORD; dwDesiredAccess:
  10250.   DWORD; lpsa: PSecurityAttributes): HDESK; stdcall;
  10251. function OpenDesktopA(lpszDesktop: PAnsiChar; dwFlags: DWORD; fInherit: BOOL;
  10252.   dwDesiredAccess: DWORD): HDESK; stdcall;
  10253. function OpenDesktopW(lpszDesktop: PWideChar; dwFlags: DWORD; fInherit: BOOL;
  10254.   dwDesiredAccess: DWORD): HDESK; stdcall;
  10255. function OpenDesktop(lpszDesktop: PChar; dwFlags: DWORD; fInherit: BOOL;
  10256.   dwDesiredAccess: DWORD): HDESK; stdcall;
  10257. function EnumDesktopsA(hwinsta: HWINSTA; lpEnumFunc: TFNDeskTopEnumProc; lParam: LPARAM): BOOL; stdcall;
  10258. function EnumDesktopsW(hwinsta: HWINSTA; lpEnumFunc: TFNDeskTopEnumProc; lParam: LPARAM): BOOL; stdcall;
  10259. function EnumDesktops(hwinsta: HWINSTA; lpEnumFunc: TFNDeskTopEnumProc; lParam: LPARAM): BOOL; stdcall;
  10260. function OpenInputDesktop(dwFlags: DWORD; fInherit: BOOL; dwDesiredAccess: DWORD): HDESK; stdcall;
  10261. function EnumDesktopWindows(hDesktop: HDESK; lpfn: TFNWndEnumProc; lParam: LPARAM): BOOL; stdcall;
  10262. function SwitchDesktop(hDesktop: HDESK): BOOL; stdcall;
  10263. function SetThreadDesktop(hDesktop: HDESK): BOOL; stdcall;
  10264. function CloseDesktop(hDesktop: HDESK): BOOL; stdcall;
  10265. function GetThreadDesktop(dwThreadId: DWORD): HDESK; stdcall;
  10266.  
  10267. const
  10268.   { Windowstation-specific access flags }
  10269.   WINSTA_ENUMDESKTOPS = 1;
  10270.   WINSTA_READATTRIBUTES = 2;
  10271.   WINSTA_ACCESSCLIPBOARD = 4;
  10272.   WINSTA_CREATEDESKTOP = 8;
  10273.   WINSTA_WRITEATTRIBUTES = $10;
  10274.   WINSTA_ACCESSGLOBALATOMS = $20;
  10275.   WINSTA_EXITWINDOWS = $40;
  10276.   WINSTA_ENUMERATE = $100;
  10277.   WINSTA_READSCREEN = $200;
  10278.  
  10279.   { Windowstation-specific attribute flags }
  10280.   WSF_VISIBLE = 1;
  10281.  
  10282. function CreateWindowStationA(lpwinsta: PAnsiChar; dwReserved, dwDesiredAccess: DWORD;
  10283.   lpsa: PSecurityAttributes): HWINSTA; stdcall;
  10284. function CreateWindowStationW(lpwinsta: PWideChar; dwReserved, dwDesiredAccess: DWORD;
  10285.   lpsa: PSecurityAttributes): HWINSTA; stdcall;
  10286. function CreateWindowStation(lpwinsta: PChar; dwReserved, dwDesiredAccess: DWORD;
  10287.   lpsa: PSecurityAttributes): HWINSTA; stdcall;
  10288. function OpenWindowStationA(lpszWinSta: PAnsiChar; fInherit: BOOL;
  10289.   dwDesiredAccess: DWORD): HWINSTA; stdcall;
  10290. function OpenWindowStationW(lpszWinSta: PWideChar; fInherit: BOOL;
  10291.   dwDesiredAccess: DWORD): HWINSTA; stdcall;
  10292. function OpenWindowStation(lpszWinSta: PChar; fInherit: BOOL;
  10293.   dwDesiredAccess: DWORD): HWINSTA; stdcall;
  10294. function EnumWindowStationsA(lpEnumFunc: TFNWinStaEnumProc; lParam: LPARAM): BOOL; stdcall;
  10295. function EnumWindowStationsW(lpEnumFunc: TFNWinStaEnumProc; lParam: LPARAM): BOOL; stdcall;
  10296. function EnumWindowStations(lpEnumFunc: TFNWinStaEnumProc; lParam: LPARAM): BOOL; stdcall;
  10297. function CloseWindowStation(hWinSta: HWINSTA): BOOL; stdcall;
  10298. function SetProcessWindowStation(hWinSta: HWINSTA): BOOL; stdcall;
  10299. function GetProcessWindowStation: HWINSTA; stdcall;
  10300. function SetUserObjectSecurity(hObj: THandle; var pSIRequested: DWORD;
  10301.   pSID: PSecurityDescriptor): BOOL; stdcall;
  10302. function GetUserObjectSecurity(hObj: THandle; var pSIRequested: DWORD;
  10303.   pSID: PSecurityDescriptor; nLength: DWORD; var lpnLengthNeeded: DWORD): BOOL; stdcall;
  10304.  
  10305. const
  10306.   UOI_FLAGS = 1;
  10307.   UOI_NAME = 2;
  10308.   UOI_TYPE = 3;
  10309.  
  10310. type
  10311.   PUserObjectFlags = ^TUserObjectFlags;
  10312.   TUserObjectFlags = packed record
  10313.     fInherit: BOOL;
  10314.     fReserved: BOOL;
  10315.     dwFlags: DWORD;
  10316.   end;
  10317.  
  10318. function GetUserObjectInformationA(hObj: THandle; nIndex: Integer; pvInfo: Pointer;
  10319.   nLength: DWORD; var lpnLengthNeeded: DWORD): BOOL; stdcall;
  10320. function GetUserObjectInformationW(hObj: THandle; nIndex: Integer; pvInfo: Pointer;
  10321.   nLength: DWORD; var lpnLengthNeeded: DWORD): BOOL; stdcall;
  10322. function GetUserObjectInformation(hObj: THandle; nIndex: Integer; pvInfo: Pointer;
  10323.   nLength: DWORD; var lpnLengthNeeded: DWORD): BOOL; stdcall;
  10324. function SetUserObjectInformationA(hObj: THandle; nIndex: Integer;
  10325.   pvInfo: Pointer; nLength: DWORD): BOOL; stdcall;
  10326. function SetUserObjectInformationW(hObj: THandle; nIndex: Integer;
  10327.   pvInfo: Pointer; nLength: DWORD): BOOL; stdcall;
  10328. function SetUserObjectInformation(hObj: THandle; nIndex: Integer;
  10329.   pvInfo: Pointer; nLength: DWORD): BOOL; stdcall;
  10330.  
  10331. type
  10332.   PWndClassExA = ^TWndClassExA;
  10333.   PWndClassExW = ^TWndClassExW;
  10334.   PWndClassEx = PWndClassExA;
  10335.   TWndClassExA = packed record
  10336.     cbSize: UINT;
  10337.     style: UINT;
  10338.     lpfnWndProc: TFNWndProc;
  10339.     cbClsExtra: Integer;
  10340.     cbWndExtra: Integer;
  10341.     hInstance: HINST;
  10342.     hIcon: HICON;
  10343.     hCursor: HCURSOR;
  10344.     hbrBackground: HBRUSH;
  10345.     lpszMenuName: PAnsiChar;
  10346.     lpszClassName: PAnsiChar;
  10347.     hIconSm: HICON;
  10348.   end;
  10349.   TWndClassExW = packed record
  10350.     cbSize: UINT;
  10351.     style: UINT;
  10352.     lpfnWndProc: TFNWndProc;
  10353.     cbClsExtra: Integer;
  10354.     cbWndExtra: Integer;
  10355.     hInstance: HINST;
  10356.     hIcon: HICON;
  10357.     hCursor: HCURSOR;
  10358.     hbrBackground: HBRUSH;
  10359.     lpszMenuName: PWideChar;
  10360.     lpszClassName: PWideChar;
  10361.     hIconSm: HICON;
  10362.   end;
  10363.   TWndClassEx = TWndClassExA;
  10364.  
  10365.   PWndClassA = ^TWndClassA;
  10366.   PWndClassW = ^TWndClassW;
  10367.   PWndClass = PWndClassA;
  10368.   TWndClassA = packed record
  10369.     style: UINT;
  10370.     lpfnWndProc: TFNWndProc;
  10371.     cbClsExtra: Integer;
  10372.     cbWndExtra: Integer;
  10373.     hInstance: HINST;
  10374.     hIcon: HICON;
  10375.     hCursor: HCURSOR;
  10376.     hbrBackground: HBRUSH;
  10377.     lpszMenuName: PAnsiChar;
  10378.     lpszClassName: PAnsiChar;
  10379.   end;
  10380.   TWndClassW = packed record
  10381.     style: UINT;
  10382.     lpfnWndProc: TFNWndProc;
  10383.     cbClsExtra: Integer;
  10384.     cbWndExtra: Integer;
  10385.     hInstance: HINST;
  10386.     hIcon: HICON;
  10387.     hCursor: HCURSOR;
  10388.     hbrBackground: HBRUSH;
  10389.     lpszMenuName: PWideChar;
  10390.     lpszClassName: PWideChar;
  10391.   end;
  10392.   TWndClass = TWndClassA;
  10393.  
  10394. { Message structure }
  10395.   PMsg = ^TMsg;
  10396.   TMsg = packed record
  10397.     hwnd: HWND;
  10398.     message: UINT;
  10399.     wParam: WPARAM;
  10400.     lParam: LPARAM;
  10401.     time: DWORD;
  10402.     pt: TPoint;
  10403.   end;
  10404.  
  10405. function SmallPointToPoint(const P: TSmallPoint): TPoint;
  10406. function PointToSmallPoint(const P: TPoint): TSmallPoint;
  10407. function MakeWParam(l, h: Word): WPARAM;
  10408. function MakeLParam(l, h: Word): LPARAM;
  10409. function MakeLResult(l, h: Word): LRESULT;
  10410.  
  10411.  
  10412. const
  10413. { Window field offsets for GetWindowLong() }
  10414.  
  10415.   GWL_WNDPROC = -4;
  10416.   GWL_HINSTANCE = -6;
  10417.   GWL_HWNDPARENT = -8;
  10418.   GWL_STYLE = -16;
  10419.   GWL_EXSTYLE = -20;
  10420.   GWL_USERDATA = -21;
  10421.   GWL_ID = -12;
  10422.  
  10423.   { Class field offsets for GetClassLong() }
  10424.   GCL_MENUNAME = -8;
  10425.   GCL_HBRBACKGROUND = -10;
  10426.   GCL_HCURSOR = -12;
  10427.   GCL_HICON = -14;
  10428.   GCL_HMODULE = -16;
  10429.   GCL_CBWNDEXTRA = -18;
  10430.   GCL_CBCLSEXTRA = -20;
  10431.   GCL_WNDPROC = -24;
  10432.   GCL_STYLE = -26;
  10433.   GCW_ATOM = -32;
  10434.   GCL_HICONSM = -34;
  10435.  
  10436. const
  10437.   { WM_ACTIVATE state values }
  10438.   WA_INACTIVE = 0;
  10439.   WA_ACTIVE = 1;
  10440.   WA_CLICKACTIVE = 2;
  10441.  
  10442. type
  10443.   { Struct pointed to by WM_GETMINMAXINFO lParam }
  10444.   PMinMaxInfo = ^TMinMaxInfo;
  10445.   TMinMaxInfo = packed record
  10446.     ptReserved: TPoint;
  10447.     ptMaxSize: TPoint;
  10448.     ptMaxPosition: TPoint;
  10449.     ptMinTrackSize: TPoint;
  10450.     ptMaxTrackSize: TPoint;
  10451.   end;
  10452.  
  10453. const
  10454.   { wParam for WM_POWER window message and DRV_POWER driver notification }
  10455.   PWR_OK = 1;
  10456.   PWR_FAIL = -1;
  10457.   PWR_SUSPENDREQUEST = 1;
  10458.   PWR_SUSPENDRESUME = 2;
  10459.   PWR_CRITICALRESUME = 3;
  10460.  
  10461. type
  10462.   { lParam of WM_COPYDATA message points to... }
  10463.   PCopyDataStruct = ^TCopyDataStruct;
  10464.   TCopyDataStruct = packed record
  10465.     dwData: DWORD;
  10466.     cbData: DWORD;
  10467.     lpData: Pointer;
  10468.   end;
  10469.  
  10470. const
  10471.   NFR_ANSI = 1;
  10472.   NFR_UNICODE = 2;
  10473.   NF_QUERY = 3;
  10474.   NF_REQUERY = 4;
  10475.  
  10476.   MENULOOP_WINDOW = 0;
  10477.   MENULOOP_POPUP = 1;
  10478.  
  10479. type
  10480.   PMDINextMenu = ^TMDINextMenu;
  10481.   TMDINextMenu = packed record
  10482.     hmenuIn: HMENU;
  10483.     hmenuNext: HMENU;
  10484.     hwndNext: HWND;
  10485.   end;
  10486.  
  10487. const
  10488.   { wParam for WM_SIZING message  }
  10489.   WMSZ_LEFT = 1;
  10490.   WMSZ_RIGHT = 2;
  10491.   WMSZ_TOP = 3;
  10492.   WMSZ_TOPLEFT = 4;
  10493.   WMSZ_TOPRIGHT = 5;
  10494.   WMSZ_BOTTOM = 6;
  10495.   WMSZ_BOTTOMLEFT = 7;
  10496.   WMSZ_BOTTOMRIGHT = 8;
  10497.  
  10498.   { WM_SYNCTASK Commands }
  10499.   ST_BEGINSWP = 0;
  10500.   ST_ENDSWP = 1;
  10501.  
  10502.   { WM_NCHITTEST and MOUSEHOOKSTRUCT Mouse Position Codes }
  10503.   HTERROR = -2;
  10504.   HTTRANSPARENT = -1;
  10505.   HTNOWHERE = 0;
  10506.   HTCLIENT = 1;
  10507.   HTCAPTION = 2;
  10508.   HTSYSMENU = 3;
  10509.   HTGROWBOX = 4;
  10510.   HTSIZE = HTGROWBOX;
  10511.   HTMENU = 5;
  10512.   HTHSCROLL = 6;
  10513.   HTVSCROLL = 7;
  10514.   HTMINBUTTON = 8;
  10515.   HTMAXBUTTON = 9;
  10516.   HTLEFT = 10;
  10517.   HTRIGHT = 11;
  10518.   HTTOP = 12;
  10519.   HTTOPLEFT = 13;
  10520.   HTTOPRIGHT = 14;
  10521.   HTBOTTOM = 15;
  10522.   HTBOTTOMLEFT = $10;
  10523.   HTBOTTOMRIGHT = 17;
  10524.   HTBORDER = 18;
  10525.   HTREDUCE = HTMINBUTTON;
  10526.   HTZOOM = HTMAXBUTTON;
  10527.   HTSIZEFIRST = HTLEFT;
  10528.   HTSIZELAST = HTBOTTOMRIGHT;
  10529.   HTOBJECT = 19;
  10530.   HTCLOSE = 20;
  10531.   HTHELP = 21;
  10532.  
  10533.   { SendMessageTimeout values }
  10534.   SMTO_NORMAL = 0;
  10535.   SMTO_BLOCK = 1;
  10536.   SMTO_ABORTIFHUNG = 2;
  10537.  
  10538.   { WM_MOUSEACTIVATE Return Codes }
  10539.   MA_ACTIVATE = 1;
  10540.   MA_ACTIVATEANDEAT = 2;
  10541.   MA_NOACTIVATE = 3;
  10542.   MA_NOACTIVATEANDEAT = 4;
  10543.  
  10544. function RegisterWindowMessageA(lpString: PAnsiChar): UINT; stdcall;
  10545. function RegisterWindowMessageW(lpString: PWideChar): UINT; stdcall;
  10546. function RegisterWindowMessage(lpString: PChar): UINT; stdcall;
  10547.  
  10548. const
  10549.   { WM_SIZE message wParam values }
  10550.   SIZE_RESTORED = 0;
  10551.   SIZE_MINIMIZED = 1;
  10552.   SIZE_MAXIMIZED = 2;
  10553.   SIZE_MAXSHOW = 3;
  10554.   SIZE_MAXHIDE = 4;
  10555.  
  10556.   { Obsolete constant names }
  10557.   SIZENORMAL = SIZE_RESTORED;
  10558.   SIZEICONIC = SIZE_MINIMIZED;
  10559.   SIZEFULLSCREEN = SIZE_MAXIMIZED;
  10560.   SIZEZOOMSHOW = SIZE_MAXSHOW;
  10561.   SIZEZOOMHIDE = SIZE_MAXHIDE;
  10562.  
  10563.  
  10564. type
  10565.   { WM_WINDOWPOSCHANGINGCHANGED struct pointed to by lParam }
  10566.   PWindowPos = ^TWindowPos;
  10567.   TWindowPos = packed record
  10568.     hwnd: HWND;
  10569.     hwndInsertAfter: HWND;
  10570.     x: Integer;
  10571.     y: Integer;
  10572.     cx: Integer;
  10573.     cy: Integer;
  10574.     flags: UINT;
  10575.   end;
  10576.  
  10577.   { WM_NCCALCSIZE parameter structure }
  10578.   PNCCalcSizeParams = ^TNCCalcSizeParams;
  10579.   TNCCalcSizeParams = packed record
  10580.     rgrc: array[0..3] of TRect;
  10581.     lppos: PWindowPos;
  10582.   end;
  10583.  
  10584.  
  10585. const
  10586.   { WM_NCCALCSIZE "window valid rect" return values }
  10587.   WVR_ALIGNTOP = $10;
  10588.   WVR_ALIGNLEFT = $20;
  10589.   WVR_ALIGNBOTTOM = $40;
  10590.   WVR_ALIGNRIGHT = $80;
  10591.   WVR_HREDRAW = $100;
  10592.   WVR_VREDRAW = $200;
  10593.   WVR_REDRAW = (WVR_HREDRAW or WVR_VREDRAW);
  10594.   WVR_VALIDRECTS = $400;
  10595.  
  10596.   { Key State Masks for Mouse Messages }
  10597.   MK_LBUTTON = 1;
  10598.   MK_RBUTTON = 2;
  10599.   MK_SHIFT = 4;
  10600.   MK_CONTROL = 8;
  10601.   MK_MBUTTON = $10;
  10602.  
  10603.   { Window Styles }
  10604.   WS_OVERLAPPED = 0;
  10605.   WS_POPUP = $80000000;
  10606.   WS_CHILD = $40000000;
  10607.   WS_MINIMIZE = $20000000;
  10608.   WS_VISIBLE = $10000000;
  10609.   WS_DISABLED = $8000000;
  10610.   WS_CLIPSIBLINGS = $4000000;
  10611.   WS_CLIPCHILDREN = $2000000;
  10612.   WS_MAXIMIZE = $1000000;
  10613.   WS_CAPTION = $C00000;      { WS_BORDER or WS_DLGFRAME  }
  10614.   WS_BORDER = $800000;
  10615.   WS_DLGFRAME = $400000;
  10616.   WS_VSCROLL = $200000;
  10617.   WS_HSCROLL = $100000;
  10618.   WS_SYSMENU = $80000;
  10619.   WS_THICKFRAME = $40000;
  10620.   WS_GROUP = $20000;
  10621.   WS_TABSTOP = $10000;
  10622.  
  10623.   WS_MINIMIZEBOX = $20000;
  10624.   WS_MAXIMIZEBOX = $10000;
  10625.  
  10626.   WS_TILED = WS_OVERLAPPED;
  10627.   WS_ICONIC = WS_MINIMIZE;
  10628.   WS_SIZEBOX = WS_THICKFRAME;
  10629.  
  10630.   { Common Window Styles }
  10631.   WS_OVERLAPPEDWINDOW = (WS_OVERLAPPED or WS_CAPTION or WS_SYSMENU or
  10632.     WS_THICKFRAME or WS_MINIMIZEBOX or WS_MAXIMIZEBOX);
  10633.   WS_TILEDWINDOW = WS_OVERLAPPEDWINDOW;
  10634.   WS_POPUPWINDOW = (WS_POPUP or WS_BORDER or WS_SYSMENU);
  10635.   WS_CHILDWINDOW = (WS_CHILD);
  10636.  
  10637.   { Extended Window Styles }
  10638.   WS_EX_DLGMODALFRAME = 1;
  10639.   WS_EX_NOPARENTNOTIFY = 4;
  10640.   WS_EX_TOPMOST = 8;
  10641.   WS_EX_ACCEPTFILES = $10;
  10642.   WS_EX_TRANSPARENT = $20;
  10643.   WS_EX_MDICHILD = $40;
  10644.   WS_EX_TOOLWINDOW = $80;
  10645.   WS_EX_WINDOWEDGE = $100;
  10646.   WS_EX_CLIENTEDGE = $200;
  10647.   WS_EX_CONTEXTHELP = $400;
  10648.  
  10649.   WS_EX_RIGHT = $1000;
  10650.   WS_EX_LEFT = 0;
  10651.   WS_EX_RTLREADING = $2000;
  10652.   WS_EX_LTRREADING = 0;
  10653.   WS_EX_LEFTSCROLLBAR = $4000;
  10654.   WS_EX_RIGHTSCROLLBAR = 0;
  10655.  
  10656.   WS_EX_CONTROLPARENT = $10000;
  10657.   WS_EX_STATICEDGE = $20000;
  10658.   WS_EX_APPWINDOW = $40000;
  10659.   WS_EX_OVERLAPPEDWINDOW = (WS_EX_WINDOWEDGE or WS_EX_CLIENTEDGE);
  10660.   WS_EX_PALETTEWINDOW = (WS_EX_WINDOWEDGE or WS_EX_TOOLWINDOW or WS_EX_TOPMOST);
  10661.  
  10662.   { Class styles }
  10663.   CS_VREDRAW = 1;
  10664.   CS_HREDRAW = 2;
  10665.   CS_KEYCVTWINDOW = 4;
  10666.   CS_DBLCLKS = 8;
  10667.   CS_OWNDC = $20;
  10668.   CS_CLASSDC = $40;
  10669.   CS_PARENTDC = $80;
  10670.   CS_NOKEYCVT = $100;
  10671.   CS_NOCLOSE = $200;
  10672.   CS_SAVEBITS = $800;
  10673.   CS_BYTEALIGNCLIENT = $1000;
  10674.   CS_BYTEALIGNWINDOW = $2000;
  10675.   CS_GLOBALCLASS = $4000;
  10676.  
  10677.   CS_IME = $10000;
  10678.  
  10679.   { WM_PRINT flags }
  10680.   PRF_CHECKVISIBLE = 1;
  10681.   PRF_NONCLIENT = 2;
  10682.   PRF_CLIENT = 4;
  10683.   PRF_ERASEBKGND = 8;
  10684.   PRF_CHILDREN = $10;
  10685.   PRF_OWNED = $20;
  10686.  
  10687.   { 3D border styles }
  10688.   BDR_RAISEDOUTER = 1;
  10689.   BDR_SUNKENOUTER = 2;
  10690.   BDR_RAISEDINNER = 4;
  10691.   BDR_SUNKENINNER = 8;
  10692.  
  10693.   BDR_OUTER = 3;
  10694.   BDR_INNER = 12;
  10695.   BDR_RAISED = 5;
  10696.   BDR_SUNKEN = 10;
  10697.  
  10698.   EDGE_RAISED = (BDR_RAISEDOUTER or BDR_RAISEDINNER);
  10699.   EDGE_SUNKEN = (BDR_SUNKENOUTER or BDR_SUNKENINNER);
  10700.   EDGE_ETCHED = (BDR_SUNKENOUTER or BDR_RAISEDINNER);
  10701.   EDGE_BUMP = (BDR_RAISEDOUTER or BDR_SUNKENINNER);
  10702.  
  10703.   { Border flags }
  10704.   BF_LEFT = 1;
  10705.   BF_TOP = 2;
  10706.   BF_RIGHT = 4;
  10707.   BF_BOTTOM = 8;
  10708.  
  10709.   BF_TOPLEFT = (BF_TOP or BF_LEFT);
  10710.   BF_TOPRIGHT = (BF_TOP or BF_RIGHT);
  10711.   BF_BOTTOMLEFT = (BF_BOTTOM or BF_LEFT);
  10712.   BF_BOTTOMRIGHT = (BF_BOTTOM or BF_RIGHT);
  10713.   BF_RECT = (BF_LEFT or BF_TOP or BF_RIGHT or BF_BOTTOM);
  10714.  
  10715.   BF_DIAGONAL = $10;
  10716.  
  10717.   { For diagonal lines, the BF_RECT flags specify the end point of the}
  10718.   { vector bounded by the rectangle parameter.}
  10719.   BF_DIAGONAL_ENDTOPRIGHT = (BF_DIAGONAL or BF_TOP or BF_RIGHT);
  10720.   BF_DIAGONAL_ENDTOPLEFT = (BF_DIAGONAL or BF_TOP or BF_LEFT);
  10721.   BF_DIAGONAL_ENDBOTTOMLEFT = (BF_DIAGONAL or BF_BOTTOM or BF_LEFT);
  10722.   BF_DIAGONAL_ENDBOTTOMRIGHT = (BF_DIAGONAL or BF_BOTTOM or BF_RIGHT);
  10723.  
  10724.   BF_MIDDLE = $800;   { Fill in the middle }
  10725.   BF_SOFT = $1000;    { For softer buttons }
  10726.   BF_ADJUST = $2000;  { Calculate the space left over }
  10727.   BF_FLAT = $4000;    { For flat rather than 3D borders }
  10728.   BF_MONO = $8000;    { For monochrome borders }
  10729.  
  10730. function DrawEdge(hdc: HDC; var qrc: TRect; edge: UINT; grfFlags: UINT): BOOL; stdcall;
  10731.  
  10732. const
  10733.   { flags for DrawFrameControl }
  10734.   DFC_CAPTION = 1;
  10735.   DFC_MENU = 2;
  10736.   DFC_SCROLL = 3;
  10737.   DFC_BUTTON = 4;
  10738.  
  10739.   DFCS_CAPTIONCLOSE = 0;
  10740.   DFCS_CAPTIONMIN = 1;
  10741.   DFCS_CAPTIONMAX = 2;
  10742.   DFCS_CAPTIONRESTORE = 3;
  10743.   DFCS_CAPTIONHELP = 4;
  10744.  
  10745.   DFCS_MENUARROW = 0;
  10746.   DFCS_MENUCHECK = 1;
  10747.   DFCS_MENUBULLET = 2;
  10748.   DFCS_MENUARROWRIGHT = 4;
  10749.  
  10750.   DFCS_SCROLLUP = 0;
  10751.   DFCS_SCROLLDOWN = 1;
  10752.   DFCS_SCROLLLEFT = 2;
  10753.   DFCS_SCROLLRIGHT = 3;
  10754.   DFCS_SCROLLCOMBOBOX = 5;
  10755.   DFCS_SCROLLSIZEGRIP = 8;
  10756.   DFCS_SCROLLSIZEGRIPRIGHT = $10;
  10757.  
  10758.   DFCS_BUTTONCHECK = 0;
  10759.   DFCS_BUTTONRADIOIMAGE = 1;
  10760.   DFCS_BUTTONRADIOMASK = 2;
  10761.   DFCS_BUTTONRADIO = 4;
  10762.   DFCS_BUTTON3STATE = 8;
  10763.   DFCS_BUTTONPUSH = $10;
  10764.  
  10765.   DFCS_INACTIVE = $100;
  10766.   DFCS_PUSHED = $200;
  10767.   DFCS_CHECKED = $400;
  10768.   DFCS_ADJUSTRECT = $2000;
  10769.   DFCS_FLAT = $4000;
  10770.   DFCS_MONO = $8000;
  10771.  
  10772. function DrawFrameControl(DC: HDC; const Rect: TRect; uType, uState: UINT): BOOL; stdcall;
  10773.  
  10774. const
  10775.   { flags for DrawCaption }
  10776.   DC_ACTIVE = 1;
  10777.   DC_SMALLCAP = 2;
  10778.   DC_ICON = 4;
  10779.   DC_TEXT = 8;
  10780.   DC_INBUTTON = $10;
  10781.  
  10782. {!!! doesn't match help !!!}
  10783. function DrawCaption(p1: HWND; p2: HDC; const p3: TRect; p4: UINT): BOOL; stdcall;
  10784.  
  10785. const
  10786.   IDANI_OPEN = 1;
  10787.   IDANI_CLOSE = 2;
  10788.   IDANI_CAPTION = 3;
  10789.  
  10790. function DrawAnimatedRects(hwnd: HWND; idAni: Integer; const lprcFrom, lprcTo: TRect): BOOL; stdcall;
  10791.  
  10792. const
  10793.   { Predefined Clipboard Formats }
  10794.   CF_TEXT = 1;
  10795.   CF_BITMAP = 2;
  10796.   CF_METAFILEPICT = 3;
  10797.   CF_SYLK = 4;
  10798.   CF_DIF = 5;
  10799.   CF_TIFF = 6;
  10800.   CF_OEMTEXT = 7;
  10801.   CF_DIB = 8;
  10802.   CF_PALETTE = 9;
  10803.   CF_PENDATA = 10;
  10804.   CF_RIFF = 11;
  10805.   CF_WAVE = 12;
  10806.   CF_UNICODETEXT = 13;
  10807.   CF_ENHMETAFILE = 14;
  10808.   CF_HDROP = 15;
  10809.   CF_LOCALE = $10;
  10810.   CF_MAX = 17;
  10811.  
  10812.   CF_OWNERDISPLAY = 128;
  10813.   CF_DSPTEXT = 129;
  10814.   CF_DSPBITMAP = 130;
  10815.   CF_DSPMETAFILEPICT = 131;
  10816.   CF_DSPENHMETAFILE = 142;
  10817.  
  10818.   { "Private" formats don't get GlobalFree()'d }
  10819.   CF_PRIVATEFIRST = $200;
  10820.   CF_PRIVATELAST = 767;
  10821.  
  10822.   { "GDIOBJ" formats do get DeleteObject()'d }
  10823.   CF_GDIOBJFIRST = 768;
  10824.   CF_GDIOBJLAST = 1023;
  10825.  
  10826.  
  10827.   { Defines for the fVirt field of the Accelerator table structure. }
  10828.   FVIRTKEY = 1;
  10829.   FNOINVERT = 2;
  10830.   FSHIFT = 4;
  10831.   FCONTROL = 8;
  10832.   FALT = $10;
  10833.  
  10834. type
  10835.   PAccel = ^TAccel;
  10836.   TAccel = packed record
  10837.     fVirt: Word;     { Also called the flags field }
  10838.     key: Word;
  10839.     cmd: Word;
  10840.   end;
  10841.  
  10842.   PPaintStruct = ^TPaintStruct;
  10843.   TPaintStruct = packed record
  10844.     hdc: HDC;
  10845.     fErase: BOOL;
  10846.     rcPaint: TRect;
  10847.     fRestore: BOOL;
  10848.     fIncUpdate: BOOL;
  10849.     rgbReserved: array[0..31] of Byte;
  10850.   end;
  10851.  
  10852.   PWindowPlacement = ^TWindowPlacement;
  10853.   TWindowPlacement = packed record
  10854.     length: UINT;
  10855.     flags: UINT;
  10856.     showCmd: UINT;
  10857.     ptMinPosition: TPoint;
  10858.     ptMaxPosition: TPoint;
  10859.     rcNormalPosition: TRect;
  10860.   end;
  10861.  
  10862. const
  10863.   WPF_SETMINPOSITION = 1;
  10864.   WPF_RESTORETOMAXIMIZED = 2;
  10865.  
  10866. type
  10867.   PNMHdr = ^TNMHdr;
  10868.   TNMHdr = packed record
  10869.     hwndFrom: HWND;
  10870.     idFrom: UINT;
  10871.     code: Integer;     { NM_ code }
  10872.   end;
  10873.  
  10874.   PStyleStruct = ^TStyleStruct;
  10875.   TStyleStruct = packed record
  10876.     styleOld: DWORD;
  10877.     styleNew: DWORD;
  10878.   end;
  10879.  
  10880. const
  10881.   { Owner draw control types }
  10882.   ODT_MENU = 1;
  10883.   ODT_LISTBOX = 2;
  10884.   ODT_COMBOBOX = 3;
  10885.   ODT_BUTTON = 4;
  10886.   ODT_STATIC = 5;
  10887.  
  10888.   { Owner draw actions }
  10889.   ODA_DRAWENTIRE = 1;
  10890.   ODA_SELECT = 2;
  10891.   ODA_FOCUS = 4;
  10892.  
  10893.   { Owner draw state }
  10894.   ODS_SELECTED = 1;
  10895.   ODS_GRAYED = 2;
  10896.   ODS_DISABLED = 4;
  10897.   ODS_CHECKED = 8;
  10898.   ODS_FOCUS = $10;
  10899.   ODS_DEFAULT = $20;
  10900.   ODS_COMBOBOXEDIT = $1000;
  10901.  
  10902. type
  10903.   { for ownerdraw }
  10904.   PMeasureItemStruct = ^TMeasureItemStruct;
  10905.   TMeasureItemStruct = packed record
  10906.     CtlType: UINT;
  10907.     CtlID: UINT;
  10908.     itemID: UINT;
  10909.     itemWidth: UINT;
  10910.     itemHeight: UINT;
  10911.     itemData: DWORD;
  10912.   end;
  10913.  
  10914.   { for ownerdraw }
  10915.   PDrawItemStruct = ^TDrawItemStruct;
  10916.   TDrawItemStruct = packed record
  10917.     CtlType: UINT;
  10918.     CtlID: UINT;
  10919.     itemID: UINT;
  10920.     itemAction: UINT;
  10921.     itemState: UINT;
  10922.     hwndItem: HWND;
  10923.     hDC: HDC;
  10924.     rcItem: TRect;
  10925.     itemData: DWORD;
  10926.   end;
  10927.  
  10928.   { for ownerdraw }
  10929.   PDeleteItemStruct = ^TDeleteItemStruct;
  10930.   TDeleteItemStruct = packed record
  10931.     CtlType: UINT;
  10932.     CtlID: UINT;
  10933.     itemID: UINT;
  10934.     hwndItem: HWND;
  10935.     itemData: UINT;
  10936.   end;
  10937.  
  10938.   { for ownerdraw sorting }
  10939.   PCompareItemStruct = ^TCompareItemStruct;
  10940.   TCompareItemStruct = packed record
  10941.     CtlType: UINT;
  10942.     CtlID: UINT;
  10943.     hwndItem: HWND;
  10944.     itemID1: UINT;
  10945.     itemData1: DWORD;
  10946.     itemID2: UINT;
  10947.     itemData2: DWORD;
  10948.     dwLocaleId: DWORD;
  10949.   end;
  10950.  
  10951. { Message Function Templates }
  10952.  
  10953. function GetMessageA(var lpMsg: TMsg; hWnd: HWND;
  10954.   wMsgFilterMin, wMsgFilterMax: UINT): BOOL; stdcall;
  10955. function GetMessageW(var lpMsg: TMsg; hWnd: HWND;
  10956.   wMsgFilterMin, wMsgFilterMax: UINT): BOOL; stdcall;
  10957. function GetMessage(var lpMsg: TMsg; hWnd: HWND;
  10958.   wMsgFilterMin, wMsgFilterMax: UINT): BOOL; stdcall;
  10959. function DispatchMessageA(const lpMsg: TMsg): Longint; stdcall;
  10960. function DispatchMessageW(const lpMsg: TMsg): Longint; stdcall;
  10961. function DispatchMessage(const lpMsg: TMsg): Longint; stdcall;
  10962. function TranslateMessage(const lpMsg: TMsg): BOOL; stdcall;
  10963. function SetMessageQueue(cMessagesMax: Integer): BOOL; stdcall;
  10964. function PeekMessageA(var lpMsg: TMsg; hWnd: HWND;
  10965.   wMsgFilterMin, wMsgFilterMax, wRemoveMsg: UINT): BOOL; stdcall;
  10966. function PeekMessageW(var lpMsg: TMsg; hWnd: HWND;
  10967.   wMsgFilterMin, wMsgFilterMax, wRemoveMsg: UINT): BOOL; stdcall;
  10968. function PeekMessage(var lpMsg: TMsg; hWnd: HWND;
  10969.   wMsgFilterMin, wMsgFilterMax, wRemoveMsg: UINT): BOOL; stdcall;
  10970.  
  10971. const
  10972.   { PeekMessage() Options }
  10973.   PM_NOREMOVE = 0;
  10974.   PM_REMOVE = 1;
  10975.   PM_NOYIELD = 2;
  10976.  
  10977. function RegisterHotKey(hWnd: HWND; id: Integer; fsModifiers, vk: UINT): BOOL; stdcall;
  10978. function UnregisterHotKey(hWnd: HWND; id: Integer): BOOL; stdcall;
  10979.  
  10980. const
  10981.   MOD_ALT = 1;
  10982.   MOD_CONTROL = 2;
  10983.   MOD_SHIFT = 4;
  10984.   MOD_WIN = 8;
  10985.  
  10986.   IDHOT_SNAPWINDOW = -1;    { SHIFT-PRINTSCRN  }
  10987.   IDHOT_SNAPDESKTOP = -2;   { PRINTSCRN        }
  10988.  
  10989.   EW_RESTARTWINDOWS = 66;
  10990.   EW_REBOOTSYSTEM = 67;
  10991.   EW_EXITANDEXECAPP = 68;
  10992.  
  10993.   EWX_LOGOFF = 0;
  10994.   EWX_SHUTDOWN = 1;
  10995.   EWX_REBOOT = 2;
  10996.   EWX_FORCE = 4;
  10997.   EWX_POWEROFF = 8;
  10998.  
  10999.  
  11000. function ExitWindows(dwReserved: DWORD; Code: Word): BOOL;
  11001.  
  11002. function ExitWindowsEx(uFlags: UINT; dwReserved: DWORD): BOOL; stdcall;
  11003. function SwapMouseButton(fSwap: BOOL): BOOL; stdcall;
  11004. function GetMessagePos: DWORD; stdcall;
  11005. function GetMessageTime: Longint; stdcall;
  11006. function GetMessageExtraInfo: Longint; stdcall;
  11007. function SetMessageExtraInfo(lParam: LPARAM): LPARAM; stdcall;
  11008.  
  11009. function SendMessageA(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
  11010. function SendMessageW(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
  11011. function SendMessage(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
  11012. function SendMessageTimeoutA(hWnd: HWND; Msg: UINT; wParam: WPARAM;
  11013.   lParam: LPARAM; fuFlags, uTimeout: UINT; var lpdwResult: DWORD): LRESULT; stdcall;
  11014. function SendMessageTimeoutW(hWnd: HWND; Msg: UINT; wParam: WPARAM;
  11015.   lParam: LPARAM; fuFlags, uTimeout: UINT; var lpdwResult: DWORD): LRESULT; stdcall;
  11016. function SendMessageTimeout(hWnd: HWND; Msg: UINT; wParam: WPARAM;
  11017.   lParam: LPARAM; fuFlags, uTimeout: UINT; var lpdwResult: DWORD): LRESULT; stdcall;
  11018. function SendNotifyMessageA(hWnd: HWND; Msg: UINT; wParam: WPARAM;
  11019.   lParam: LPARAM): BOOL; stdcall;
  11020. function SendNotifyMessageW(hWnd: HWND; Msg: UINT; wParam: WPARAM;
  11021.   lParam: LPARAM): BOOL; stdcall;
  11022. function SendNotifyMessage(hWnd: HWND; Msg: UINT; wParam: WPARAM;
  11023.   lParam: LPARAM): BOOL; stdcall;
  11024. function SendMessageCallbackA(hWnd: HWND; Msg: UINT; wParam: WPARAM;
  11025.   lParam: LPARAM; lpResultCallBack: TFNSendAsyncProc; dwData: DWORD): BOOL; stdcall;
  11026. function SendMessageCallbackW(hWnd: HWND; Msg: UINT; wParam: WPARAM;
  11027.   lParam: LPARAM; lpResultCallBack: TFNSendAsyncProc; dwData: DWORD): BOOL; stdcall;
  11028. function SendMessageCallback(hWnd: HWND; Msg: UINT; wParam: WPARAM;
  11029.   lParam: LPARAM; lpResultCallBack: TFNSendAsyncProc; dwData: DWORD): BOOL; stdcall;
  11030.  
  11031. function BroadcastSystemMessage(Flags: DWORD; Recipients: PDWORD;
  11032.   uiMessage: UINT; wParam: WPARAM; lParam: LPARAM): Longint; stdcall;
  11033.  
  11034. const
  11035.   { Broadcast Special Message Recipient list }
  11036.   BSM_ALLCOMPONENTS = 0;
  11037.   BSM_VXDS = 1;
  11038.   BSM_NETDRIVER = 2;
  11039.   BSM_INSTALLABLEDRIVERS = 4;
  11040.   BSM_APPLICATIONS = 8;
  11041.  
  11042.   { Broadcast Special Message Flags }
  11043.   BSF_QUERY = 1;
  11044.   BSF_IGNORECURRENTTASK = 2;
  11045.   BSF_FLUSHDISK = 4;
  11046.   BSF_NOHANG = 8;
  11047.   BSF_POSTMESSAGE = $10;
  11048.   BSF_FORCEIFHUNG = $20;
  11049.   BSF_NOTIMEOUTIFNOTHUNG = $40;
  11050.  
  11051. type
  11052.   PBroadcastSysMsg = ^TBroadcastSysMsg;
  11053.   TBroadcastSysMsg = packed record
  11054.     uiMessage: UINT;
  11055.     wParam: WPARAM;
  11056.     lParam: LPARAM;
  11057.   end;
  11058.  
  11059. const
  11060.   DBWF_LPARAMPOINTER = $8000;
  11061.  
  11062.   BROADCAST_QUERY_DENY = $424D5144;  { Return this value to deny a query. }
  11063.  
  11064. function PostMessageA(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): BOOL; stdcall;
  11065. function PostMessageW(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): BOOL; stdcall;
  11066. function PostMessage(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): BOOL; stdcall;
  11067. function PostThreadMessageA(idThread: DWORD; Msg: UINT; wParam: WPARAM; lParam: LPARAM): BOOL; stdcall;
  11068. function PostThreadMessageW(idThread: DWORD; Msg: UINT; wParam: WPARAM; lParam: LPARAM): BOOL; stdcall;
  11069. function PostThreadMessage(idThread: DWORD; Msg: UINT; wParam: WPARAM; lParam: LPARAM): BOOL; stdcall;
  11070. function PostAppMessage(idThread: DWORD; Msg: UINT; wParam: WPARAM; lParam: LPARAM): BOOL;
  11071.  
  11072. const
  11073.   { Special HWND value for use with PostMessage() and SendMessage() }
  11074.   HWND_BROADCAST = $FFFF;
  11075.   wnd_Broadcast = HWND_BROADCAST;
  11076.  
  11077. function AttachThreadInput(idAttach, idAttachTo: DWORD; fAttach: BOOL): BOOL; stdcall;
  11078. function ReplyMessage(lResult: LRESULT): BOOL; stdcall;
  11079. function WaitMessage: BOOL; stdcall;
  11080. function WaitForInputIdle(hProcess: THandle; dwMilliseconds: DWORD): DWORD; stdcall;
  11081. function DefWindowProcA(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
  11082. function DefWindowProcW(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
  11083. function DefWindowProc(hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
  11084. function CallWindowProcA(lpPrevWndFunc: TFNWndProc; hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
  11085. function CallWindowProcW(lpPrevWndFunc: TFNWndProc; hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
  11086. function CallWindowProc(lpPrevWndFunc: TFNWndProc; hWnd: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
  11087. procedure PostQuitMessage(nExitCode: Integer); stdcall;
  11088. function InSendMessage: BOOL; stdcall;
  11089. function GetDoubleClickTime: UINT; stdcall;
  11090. function SetDoubleClickTime(Interval: UINT): BOOL; stdcall;
  11091. function RegisterClassA(const lpWndClass: TWndClassA): ATOM; stdcall;
  11092. function RegisterClassW(const lpWndClass: TWndClassW): ATOM; stdcall;
  11093. function RegisterClass(const lpWndClass: TWndClass): ATOM; stdcall;
  11094. function UnregisterClassA(lpClassName: PAnsiChar; hInstance: HINST): BOOL; stdcall;
  11095. function UnregisterClassW(lpClassName: PWideChar; hInstance: HINST): BOOL; stdcall;
  11096. function UnregisterClass(lpClassName: PChar; hInstance: HINST): BOOL; stdcall;
  11097. function GetClassInfoA(hInstance: HINST; lpClassName: PAnsiChar;
  11098.   var lpWndClass: TWndClassA): BOOL; stdcall;
  11099. function GetClassInfoW(hInstance: HINST; lpClassName: PWideChar;
  11100.   var lpWndClass: TWndClassW): BOOL; stdcall;
  11101. function GetClassInfo(hInstance: HINST; lpClassName: PChar;
  11102.   var lpWndClass: TWndClass): BOOL; stdcall;
  11103. function RegisterClassExA(const WndClass: TWndClassExA): ATOM; stdcall;
  11104. function RegisterClassExW(const WndClass: TWndClassExW): ATOM; stdcall;
  11105. function RegisterClassEx(const WndClass: TWndClassEx): ATOM; stdcall;
  11106. function GetClassInfoExA(Instance: HINST; Classname: PAnsiChar; var WndClass: TWndClassExA): BOOL; stdcall;
  11107. function GetClassInfoExW(Instance: HINST; Classname: PWideChar; var WndClass: TWndClassExW): BOOL; stdcall;
  11108. function GetClassInfoEx(Instance: HINST; Classname: PChar; var WndClass: TWndClassEx): BOOL; stdcall;
  11109.  
  11110. const
  11111.   CW_USEDEFAULT = $80000000;
  11112.  
  11113.   { Special value for CreateWindow, et al. }
  11114.   HWND_DESKTOP = 0;
  11115.  
  11116. function CreateWindowExA(dwExStyle: DWORD; lpClassName: PAnsiChar;
  11117.   lpWindowName: PAnsiChar; dwStyle: DWORD; X, Y, nWidth, nHeight: Integer;
  11118.   hWndParent: HWND; hMenu: HMENU; hInstance: HINST; lpParam: Pointer): HWND; stdcall;
  11119. function CreateWindowExW(dwExStyle: DWORD; lpClassName: PWideChar;
  11120.   lpWindowName: PWideChar; dwStyle: DWORD; X, Y, nWidth, nHeight: Integer;
  11121.   hWndParent: HWND; hMenu: HMENU; hInstance: HINST; lpParam: Pointer): HWND; stdcall;
  11122. function CreateWindowEx(dwExStyle: DWORD; lpClassName: PChar;
  11123.   lpWindowName: PChar; dwStyle: DWORD; X, Y, nWidth, nHeight: Integer;
  11124.   hWndParent: HWND; hMenu: HMENU; hInstance: HINST; lpParam: Pointer): HWND; stdcall;
  11125. function CreateWindowA(lpClassName: PAnsiChar; lpWindowName: PAnsiChar;
  11126.   dwStyle: DWORD; X, Y, nWidth, nHeight: Integer; hWndParent: HWND;
  11127.   hMenu: HMENU; hInstance: HINST; lpParam: Pointer): HWND;
  11128. function CreateWindowW(lpClassName: PWideChar; lpWindowName: PWideChar;
  11129.   dwStyle: DWORD; X, Y, nWidth, nHeight: Integer; hWndParent: HWND;
  11130.   hMenu: HMENU; hInstance: HINST; lpParam: Pointer): HWND;
  11131. function CreateWindow(lpClassName: PChar; lpWindowName: PChar;
  11132.   dwStyle: DWORD; X, Y, nWidth, nHeight: Integer; hWndParent: HWND;
  11133.   hMenu: HMENU; hInstance: HINST; lpParam: Pointer): HWND;
  11134.  
  11135. function IsWindow(hWnd: HWND): BOOL; stdcall;
  11136. function IsMenu(hMenu: HMENU): BOOL; stdcall;
  11137. function IsChild(hWndParent, hWnd: HWND): BOOL; stdcall;
  11138. function DestroyWindow(hWnd: HWND): BOOL; stdcall;
  11139. function ShowWindow(hWnd: HWND; nCmdShow: Integer): BOOL; stdcall;
  11140. function ShowWindowAsync(hWnd: HWND; nCmdShow: Integer): BOOL; stdcall;
  11141. function FlashWindow(hWnd: HWND; bInvert: BOOL): BOOL; stdcall;
  11142. function ShowOwnedPopups(hWnd: HWND; fShow: BOOL): BOOL; stdcall;
  11143. function OpenIcon(hWnd: HWND): BOOL; stdcall;
  11144. function CloseWindow(hWnd: HWND): BOOL; stdcall;
  11145. function MoveWindow(hWnd: HWND; X, Y, nWidth, nHeight: Integer; bRepaint: BOOL): BOOL; stdcall;
  11146. function SetWindowPos(hWnd: HWND; hWndInsertAfter: HWND;
  11147.   X, Y, cx, cy: Integer; uFlags: UINT): BOOL; stdcall;
  11148. function GetWindowPlacement(hWnd: HWND; WindowPlacement: PWindowPlacement): BOOL; stdcall;
  11149. function SetWindowPlacement(hWnd: HWND; WindowPlacement: PWindowPlacement): BOOL; stdcall;
  11150. function BeginDeferWindowPos(nNumWindows: Integer): HDWP; stdcall;
  11151. function DeferWindowPos(hWinPosInfo: HDWP; hWnd: HWND;
  11152.   hWndInsertAfter: HWND; x, y, cx, cy: Integer; uFlags: UINT): HDWP; stdcall;
  11153. function EndDeferWindowPos(hWinPosInfo: HDWP): BOOL; stdcall;
  11154. function IsWindowVisible(hWnd: HWND): BOOL; stdcall;
  11155. function IsIconic(hWnd: HWND): BOOL; stdcall;
  11156. function AnyPopup: BOOL; stdcall;
  11157. function BringWindowToTop(hWnd: HWND): BOOL; stdcall;
  11158. function IsZoomed(hWnd: HWND): BOOL; stdcall;
  11159.  
  11160.  
  11161. const
  11162.   { SetWindowPos Flags }
  11163.   SWP_NOSIZE = 1;
  11164.   SWP_NOMOVE = 2;
  11165.   SWP_NOZORDER = 4;
  11166.   SWP_NOREDRAW = 8;
  11167.   SWP_NOACTIVATE = $10;
  11168.   SWP_FRAMECHANGED = $20;    { The frame changed: send WM_NCCALCSIZE }
  11169.   SWP_SHOWWINDOW = $40;
  11170.   SWP_HIDEWINDOW = $80;
  11171.   SWP_NOCOPYBITS = $100;
  11172.   SWP_NOOWNERZORDER = $200;  { Don't do owner Z ordering }
  11173.   SWP_NOSENDCHANGING = $400;  { Don't send WM_WINDOWPOSCHANGING }
  11174.   SWP_DRAWFRAME = SWP_FRAMECHANGED;
  11175.   SWP_NOREPOSITION = SWP_NOOWNERZORDER;
  11176.   SWP_DEFERERASE = $2000;
  11177.   SWP_ASYNCWINDOWPOS = $4000;
  11178.  
  11179.   HWND_TOP = 0;
  11180.   HWND_BOTTOM = 1;
  11181.   HWND_TOPMOST = -1;
  11182.   HWND_NOTOPMOST = -2;
  11183.  
  11184.  
  11185. type
  11186.   PDlgTemplate = ^TDlgTemplate;
  11187.   TDlgTemplate = packed record
  11188.     style: DWORD;
  11189.     dwExtendedStyle: DWORD;
  11190.     cdit: Word;
  11191.     x: SHORT;
  11192.     y: SHORT;
  11193.     cx: SHORT;
  11194.     cy: SHORT;
  11195.   end;
  11196.  
  11197.   { 32 bit Dialog item template. }
  11198.   PDlgItemTemplate = ^TDlgItemTemplate;
  11199.   TDlgItemTemplate = packed record
  11200.     style: DWORD;
  11201.     dwExtendedStyle: DWORD;
  11202.     x: SHORT;
  11203.     y: SHORT;
  11204.     cx: SHORT;
  11205.     cy: SHORT;
  11206.     id: Word;
  11207.   end;
  11208.  
  11209. function CreateDialogParamA(hInstance: HINST; lpTemplateName: PAnsiChar;
  11210.   hWndParent: HWND; lpDialogFunc: TFNDlgProc; dwInitParam: LPARAM): HWND; stdcall;
  11211. function CreateDialogParamW(hInstance: HINST; lpTemplateName: PWideChar;
  11212.   hWndParent: HWND; lpDialogFunc: TFNDlgProc; dwInitParam: LPARAM): HWND; stdcall;
  11213. function CreateDialogParam(hInstance: HINST; lpTemplateName: PChar;
  11214.   hWndParent: HWND; lpDialogFunc: TFNDlgProc; dwInitParam: LPARAM): HWND; stdcall;
  11215. function CreateDialogIndirectParamA(hInstance: HINST; const lpTemplate: TDlgTemplate;
  11216.   hWndParent: HWND; lpDialogFunc: TFNDlgProc; dwInitParam: LPARAM): HWND; stdcall;
  11217. function CreateDialogIndirectParamW(hInstance: HINST; const lpTemplate: TDlgTemplate;
  11218.   hWndParent: HWND; lpDialogFunc: TFNDlgProc; dwInitParam: LPARAM): HWND; stdcall;
  11219. function CreateDialogIndirectParam(hInstance: HINST; const lpTemplate: TDlgTemplate;
  11220.   hWndParent: HWND; lpDialogFunc: TFNDlgProc; dwInitParam: LPARAM): HWND; stdcall;
  11221. function CreateDialogA(hInstance: HINST; lpTemplateName: PAnsiChar;
  11222.   hWndParent: HWND; lpDialogFunc: TFNDlgProc): HWND;
  11223. function CreateDialogW(hInstance: HINST; lpTemplateName: PWideChar;
  11224.   hWndParent: HWND; lpDialogFunc: TFNDlgProc): HWND;
  11225. function CreateDialog(hInstance: HINST; lpTemplateName: PChar;
  11226.   hWndParent: HWND; lpDialogFunc: TFNDlgProc): HWND;
  11227. function CreateDialogIndirectA(hInstance: HINST; const lpTemplate: TDlgTemplate;
  11228.   hWndParent: HWND; lpDialogFunc: TFNDlgProc): HWND;
  11229. function CreateDialogIndirectW(hInstance: HINST; const lpTemplate: TDlgTemplate;
  11230.   hWndParent: HWND; lpDialogFunc: TFNDlgProc): HWND;
  11231. function CreateDialogIndirect(hInstance: HINST; const lpTemplate: TDlgTemplate;
  11232.   hWndParent: HWND; lpDialogFunc: TFNDlgProc): HWND;
  11233. function DialogBoxParamA(hInstance: HINST; lpTemplateName: PAnsiChar;
  11234.   hWndParent: HWND; lpDialogFunc: TFNDlgProc; dwInitParam: LPARAM): Integer; stdcall;
  11235. function DialogBoxParamW(hInstance: HINST; lpTemplateName: PWideChar;
  11236.   hWndParent: HWND; lpDialogFunc: TFNDlgProc; dwInitParam: LPARAM): Integer; stdcall;
  11237. function DialogBoxParam(hInstance: HINST; lpTemplateName: PChar;
  11238.   hWndParent: HWND; lpDialogFunc: TFNDlgProc; dwInitParam: LPARAM): Integer; stdcall;
  11239. function DialogBoxIndirectParamA(hInstance: HINST; const lpDialogTemplate: TDlgTemplate;
  11240.   hWndParent: HWND; lpDialogFunc: TFNDlgProc; dwInitParam: LPARAM): Integer; stdcall;
  11241. function DialogBoxIndirectParamW(hInstance: HINST; const lpDialogTemplate: TDlgTemplate;
  11242.   hWndParent: HWND; lpDialogFunc: TFNDlgProc; dwInitParam: LPARAM): Integer; stdcall;
  11243. function DialogBoxIndirectParam(hInstance: HINST; const lpDialogTemplate: TDlgTemplate;
  11244.   hWndParent: HWND; lpDialogFunc: TFNDlgProc; dwInitParam: LPARAM): Integer; stdcall;
  11245. function DialogBoxA(hInstance: HINST; lpTemplate: PAnsiChar;
  11246.   hWndParent: HWND; lpDialogFunc: TFNDlgProc): Integer;
  11247. function DialogBoxW(hInstance: HINST; lpTemplate: PWideChar;
  11248.   hWndParent: HWND; lpDialogFunc: TFNDlgProc): Integer;
  11249. function DialogBox(hInstance: HINST; lpTemplate: PChar;
  11250.   hWndParent: HWND; lpDialogFunc: TFNDlgProc): Integer;
  11251. function DialogBoxIndirectA(hInstance: HINST; const lpDialogTemplate: TDlgTemplate;
  11252.   hWndParent: HWND; lpDialogFunc: TFNDlgProc): Integer;
  11253. function DialogBoxIndirectW(hInstance: HINST; const lpDialogTemplate: TDlgTemplate;
  11254.   hWndParent: HWND; lpDialogFunc: TFNDlgProc): Integer;
  11255. function DialogBoxIndirect(hInstance: HINST; const lpDialogTemplate: TDlgTemplate;
  11256.   hWndParent: HWND; lpDialogFunc: TFNDlgProc): Integer;
  11257. function EndDialog(hDlg: HWND; nResult: Integer): BOOL; stdcall;
  11258. function GetDlgItem(hDlg: HWND; nIDDlgItem: Integer): HWND; stdcall;
  11259. function SetDlgItemInt(hDlg: HWND; nIDDlgItem: Integer; uValue: UINT; bSigned: BOOL): BOOL; stdcall;
  11260. function GetDlgItemInt(hDlg: HWND; nIDDlgItem: Integer;
  11261.   var lpTranslated: BOOL; bSigned: BOOL): UINT; stdcall;
  11262. function SetDlgItemTextA(hDlg: HWND; nIDDlgItem: Integer; lpString: PAnsiChar): BOOL; stdcall;
  11263. function SetDlgItemTextW(hDlg: HWND; nIDDlgItem: Integer; lpString: PWideChar): BOOL; stdcall;
  11264. function SetDlgItemText(hDlg: HWND; nIDDlgItem: Integer; lpString: PChar): BOOL; stdcall;
  11265. function GetDlgItemTextA(hDlg: HWND; nIDDlgItem: Integer;
  11266.   lpString: PAnsiChar; nMaxCount: Integer): UINT; stdcall;
  11267. function GetDlgItemTextW(hDlg: HWND; nIDDlgItem: Integer;
  11268.   lpString: PWideChar; nMaxCount: Integer): UINT; stdcall;
  11269. function GetDlgItemText(hDlg: HWND; nIDDlgItem: Integer;
  11270.   lpString: PChar; nMaxCount: Integer): UINT; stdcall;
  11271. function CheckDlgButton(hDlg: HWND; nIDButton: Integer; uCheck: UINT): BOOL; stdcall;
  11272. function CheckRadioButton(hDlg: HWND; nIDFirstButton, nIDLastButton, nIDCheckButton: Integer): BOOL; stdcall;
  11273. function IsDlgButtonChecked(hDlg: HWND; nIDButton: Integer): UINT; stdcall;
  11274. function SendDlgItemMessageA(hDlg: HWND; nIDDlgItem: Integer;
  11275.   Msg: UINT; wParam: WPARAM; lParam: LPARAM): Longint; stdcall;
  11276. function SendDlgItemMessageW(hDlg: HWND; nIDDlgItem: Integer;
  11277.   Msg: UINT; wParam: WPARAM; lParam: LPARAM): Longint; stdcall;
  11278. function SendDlgItemMessage(hDlg: HWND; nIDDlgItem: Integer;
  11279.   Msg: UINT; wParam: WPARAM; lParam: LPARAM): Longint; stdcall;
  11280. function GetNextDlgGroupItem(hDlg: HWND; hCtl: HWND; bPrevious: BOOL): HWND; stdcall;
  11281. function GetNextDlgTabItem(hDlg: HWND; hCtl: HWND; bPrevious: BOOL): HWND; stdcall;
  11282. function GetDlgCtrlID(hWnd: HWND): Integer; stdcall;
  11283. function GetDialogBaseUnits: Longint; stdcall;
  11284. function DefDlgProcA(hDlg: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
  11285. function DefDlgProcW(hDlg: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
  11286. function DefDlgProc(hDlg: HWND; Msg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
  11287.  
  11288. const
  11289.   { Window extra byted needed for private dialog classes. }
  11290.   DLGWINDOWEXTRA = 30;
  11291.  
  11292. function CallMsgFilterA(var lpMsg: TMsg; nCode: Integer): BOOL; stdcall;
  11293. function CallMsgFilterW(var lpMsg: TMsg; nCode: Integer): BOOL; stdcall;
  11294. function CallMsgFilter(var lpMsg: TMsg; nCode: Integer): BOOL; stdcall;
  11295.  
  11296. { Clipboard Manager Functions }
  11297.  
  11298. function OpenClipboard(hWndNewOwner: HWND): BOOL; stdcall;
  11299. function CloseClipboard: BOOL; stdcall;
  11300. function GetClipboardOwner: HWND; stdcall;
  11301. function SetClipboardViewer(hWndNewViewer: HWND): HWND; stdcall;
  11302. function GetClipboardViewer: HWND; stdcall;
  11303. function ChangeClipboardChain(hWndRemove, hWndNewNext: HWND): BOOL; stdcall;
  11304. function SetClipboardData(uFormat: UINT; hMem: THandle): THandle; stdcall;
  11305. function GetClipboardData(uFormat: UINT): THandle; stdcall;
  11306. function RegisterClipboardFormatA(lpszFormat: PAnsiChar): UINT; stdcall;
  11307. function RegisterClipboardFormatW(lpszFormat: PWideChar): UINT; stdcall;
  11308. function RegisterClipboardFormat(lpszFormat: PChar): UINT; stdcall;
  11309. function CountClipboardFormats: Integer; stdcall;
  11310. function EnumClipboardFormats(format: UINT): UINT; stdcall;
  11311. function GetClipboardFormatNameA(format: UINT; lpszFormatName: PAnsiChar;
  11312.   cchMaxCount: Integer): Integer; stdcall;
  11313. function GetClipboardFormatNameW(format: UINT; lpszFormatName: PWideChar;
  11314.   cchMaxCount: Integer): Integer; stdcall;
  11315. function GetClipboardFormatName(format: UINT; lpszFormatName: PChar;
  11316.   cchMaxCount: Integer): Integer; stdcall;
  11317. function EmptyClipboard: BOOL; stdcall;
  11318. function IsClipboardFormatAvailable(format: UINT): BOOL; stdcall;
  11319. function GetPriorityClipboardFormat(var paFormatPriorityList; cFormats: Integer): Integer; stdcall;
  11320. function GetOpenClipboardWindow: HWND; stdcall;
  11321.  
  11322. { Character Translation Routines }
  11323.  
  11324. function CharToOemA(lpszSrc: PAnsiChar; lpszDst: PAnsiChar): BOOL; stdcall;
  11325. function CharToOemW(lpszSrc: PWideChar; lpszDst: PWideChar): BOOL; stdcall;
  11326. function CharToOem(lpszSrc: PChar; lpszDst: PChar): BOOL; stdcall;
  11327. function OemToCharA(lpszSrc: PAnsiChar; lpszDst: PAnsiChar): BOOL; stdcall;
  11328. function OemToCharW(lpszSrc: PWideChar; lpszDst: PWideChar): BOOL; stdcall;
  11329. function OemToChar(lpszSrc: PChar; lpszDst: PChar): BOOL; stdcall;
  11330. function CharToOemBuffA(lpszSrc: PAnsiChar; lpszDst: PAnsiChar; cchDstLength: DWORD): BOOL; stdcall;
  11331. function CharToOemBuffW(lpszSrc: PWideChar; lpszDst: PWideChar; cchDstLength: DWORD): BOOL; stdcall;
  11332. function CharToOemBuff(lpszSrc: PChar; lpszDst: PChar; cchDstLength: DWORD): BOOL; stdcall;
  11333. function OemToCharBuffA(lpszSrc: PAnsiChar; lpszDst: PAnsiChar; cchDstLength: DWORD): BOOL; stdcall;
  11334. function OemToCharBuffW(lpszSrc: PWideChar; lpszDst: PWideChar; cchDstLength: DWORD): BOOL; stdcall;
  11335. function OemToCharBuff(lpszSrc: PChar; lpszDst: PChar; cchDstLength: DWORD): BOOL; stdcall;
  11336. function CharUpperA(lpsz: PAnsiChar): PAnsiChar; stdcall;
  11337. function CharUpperW(lpsz: PWideChar): PWideChar; stdcall;
  11338. function CharUpper(lpsz: PChar): PChar; stdcall;
  11339. function CharUpperBuffA(lpsz: PAnsiChar; cchLength: DWORD): DWORD; stdcall;
  11340. function CharUpperBuffW(lpsz: PWideChar; cchLength: DWORD): DWORD; stdcall;
  11341. function CharUpperBuff(lpsz: PChar; cchLength: DWORD): DWORD; stdcall;
  11342. function CharLowerA(lpsz: PAnsiChar): PAnsiChar; stdcall;
  11343. function CharLowerW(lpsz: PWideChar): PWideChar; stdcall;
  11344. function CharLower(lpsz: PChar): PChar; stdcall;
  11345. function CharLowerBuffA(lpsz: PAnsiChar; cchLength: DWORD): DWORD; stdcall;
  11346. function CharLowerBuffW(lpsz: PWideChar; cchLength: DWORD): DWORD; stdcall;
  11347. function CharLowerBuff(lpsz: PChar; cchLength: DWORD): DWORD; stdcall;
  11348. function CharNextA(lpsz: PAnsiChar): PAnsiChar; stdcall;
  11349. function CharNextW(lpsz: PWideChar): PWideChar; stdcall;
  11350. function CharNext(lpsz: PChar): PChar; stdcall;
  11351. function CharPrevA(lpszStart: PAnsiChar; lpszCurrent: PAnsiChar): PAnsiChar; stdcall;
  11352. function CharPrevW(lpszStart: PWideChar; lpszCurrent: PWideChar): PWideChar; stdcall;
  11353. function CharPrev(lpszStart: PChar; lpszCurrent: PChar): PChar; stdcall;
  11354.  
  11355. function CharNextEx(CodePage: Word; lpCurrentChar: LPCSTR; dwFlags: DWORD): LPSTR; stdcall;
  11356. function CharPrevEx(CodePage: Word; lpStart, lpCurrentChar: LPCSTR; dwFlags: DWORD): LPSTR; stdcall;
  11357.  
  11358. { Compatibility defines for character translation routines }
  11359.  
  11360. function AnsiToOem(const lpszSrc: LPCSTR; lpszDst: LPSTR): BOOL; stdcall;
  11361. function OemToAnsi(const lpszSrc: LPCSTR; lpszDst: LPSTR): BOOL; stdcall;
  11362. function AnsiToOemBuff(lpszSrc: LPCSTR; lpszDst: LPSTR; cchDstLength: DWORD): BOOL; stdcall;
  11363. function OemToAnsiBuff(lpszSrc: LPCSTR; lpszDst: LPSTR; cchDstLength: DWORD): BOOL; stdcall;
  11364. function AnsiUpper(lpsz: LPSTR): LPSTR; stdcall;
  11365. function AnsiUpperBuff(lpsz: LPSTR; cchLength: DWORD): DWORD; stdcall;
  11366. function AnsiLower(lpsz: LPSTR): LPSTR; stdcall;
  11367. function AnsiLowerBuff(lpsz: LPSTR; cchLength: DWORD): DWORD; stdcall;
  11368. function AnsiNext(const lpsz: LPCSTR): LPSTR; stdcall;
  11369. function AnsiPrev(const lpszStart: LPCSTR; const lpszCurrent: LPCSTR): LPSTR; stdcall;
  11370.  
  11371. { Language dependent Routines }
  11372.  
  11373. function IsCharAlphaA(ch: AnsiChar): BOOL; stdcall;
  11374. function IsCharAlphaW(ch: WideChar): BOOL; stdcall;
  11375. function IsCharAlpha(ch: Char): BOOL; stdcall;
  11376. function IsCharAlphaNumericA(ch: AnsiChar): BOOL; stdcall;
  11377. function IsCharAlphaNumericW(ch: WideChar): BOOL; stdcall;
  11378. function IsCharAlphaNumeric(ch: Char): BOOL; stdcall;
  11379. function IsCharUpperA(ch: AnsiChar): BOOL; stdcall;
  11380. function IsCharUpperW(ch: WideChar): BOOL; stdcall;
  11381. function IsCharUpper(ch: Char): BOOL; stdcall;
  11382. function IsCharLowerA(ch: AnsiChar): BOOL; stdcall;
  11383. function IsCharLowerW(ch: WideChar): BOOL; stdcall;
  11384. function IsCharLower(ch: Char): BOOL; stdcall;
  11385.  
  11386. function SetFocus(hWnd: HWND): HWND; stdcall;
  11387. function GetActiveWindow: HWND; stdcall;
  11388. function GetFocus: HWND; stdcall;
  11389. function GetKBCodePage: UINT; stdcall;
  11390. function GetKeyState(nVirtKey: Integer): SHORT; stdcall;
  11391. function GetAsyncKeyState(vKey: Integer): SHORT; stdcall;
  11392.  
  11393. type
  11394.   PKeyboardState = ^TKeyboardState;
  11395.   TKeyboardState = array[0..255] of Byte;
  11396.  
  11397. function GetKeyboardState(var KeyState: TKeyboardState): BOOL; stdcall;
  11398. function SetKeyboardState(var KeyState: TKeyboardState): BOOL; stdcall;
  11399. function GetKeyNameTextA(lParam: Longint; lpString: PAnsiChar; nSize: Integer): Integer; stdcall;
  11400. function GetKeyNameTextW(lParam: Longint; lpString: PWideChar; nSize: Integer): Integer; stdcall;
  11401. function GetKeyNameText(lParam: Longint; lpString: PChar; nSize: Integer): Integer; stdcall;
  11402. function GetKeyboardType(nTypeFlag: Integer): Integer; stdcall;
  11403. function ToAscii(uVirtKey, uScanCode: UINT; const KeyState: TKeyboardState;
  11404.   lpChar: PChar; uFlags: UINT): Integer; stdcall;
  11405. function ToAsciiEx(uVirtKey: UINT; uScanCode: UINT; const KeyState: TKeyboardState;
  11406.   lpChar: PChar; uFlags: UINT; dwhkl: HKL): Integer; stdcall;
  11407. function ToUnicode(wVirtKey, wScanCode: UINT; const KeyState: TKeyboardState;
  11408.   var pwszBuff; cchBuff: Integer; wFlags: UINT): Integer; stdcall;
  11409. function OemKeyScan(wOemChar: Word): DWORD; stdcall;
  11410.  
  11411. function VkKeyScanA(ch: AnsiChar): SHORT; stdcall;
  11412. function VkKeyScanW(ch: WideChar): SHORT; stdcall;
  11413. function VkKeyScan(ch: Char): SHORT; stdcall;
  11414. function VkKeyScanExA(ch: AnsiChar; dwhkl: HKL): SHORT; stdcall;
  11415. function VkKeyScanExW(ch: WideChar; dwhkl: HKL): SHORT; stdcall;
  11416. function VkKeyScanEx(ch: Char; dwhkl: HKL): SHORT; stdcall;
  11417.  
  11418. const
  11419.   KEYEVENTF_EXTENDEDKEY = 1;
  11420.   KEYEVENTF_KEYUP = 2;
  11421.  
  11422. procedure keybd_event(bVk: Byte; bScan: Byte; dwFlags, dwExtraInfo: DWORD); stdcall;
  11423.  
  11424. const
  11425.   MOUSEEVENTF_MOVE = 1;
  11426.   MOUSEEVENTF_LEFTDOWN = 2;
  11427.   MOUSEEVENTF_LEFTUP = 4;
  11428.   MOUSEEVENTF_RIGHTDOWN = 8;
  11429.   MOUSEEVENTF_RIGHTUP = $10;
  11430.   MOUSEEVENTF_MIDDLEDOWN = $20;
  11431.   MOUSEEVENTF_MIDDLEUP = $40;
  11432.   MOUSEEVENTF_ABSOLUTE = $8000;
  11433.  
  11434. procedure mouse_event(dwFlags, dx, dy, cButtons, dwExtraInfo: DWORD); stdcall;
  11435. function MapVirtualKeyA(uCode, uMapType: UINT): UINT; stdcall;
  11436. function MapVirtualKeyW(uCode, uMapType: UINT): UINT; stdcall;
  11437. function MapVirtualKey(uCode, uMapType: UINT): UINT; stdcall;
  11438. function MapVirtualKeyExA(uCode, uMapType: UINT; dwhkl: HKL): UINT; stdcall;
  11439. function MapVirtualKeyExW(uCode, uMapType: UINT; dwhkl: HKL): UINT; stdcall;
  11440. function MapVirtualKeyEx(uCode, uMapType: UINT; dwhkl: HKL): UINT; stdcall;
  11441. function GetInputState: BOOL; stdcall;
  11442. function GetQueueStatus(flags: UINT): DWORD; stdcall;
  11443. function GetCapture: HWND; stdcall;
  11444. function SetCapture(hWnd: HWND): HWND; stdcall;
  11445. function ReleaseCapture: BOOL; stdcall;
  11446. function MsgWaitForMultipleObjects(nCount: DWORD; var pHandles;
  11447.   fWaitAll: BOOL; dwMilliseconds, dwWakeMask: DWORD): DWORD; stdcall;
  11448.  
  11449. const
  11450.   { Queue status flags for GetQueueStatus() and MsgWaitForMultipleObjects() }
  11451.   QS_KEY = 1;
  11452.   QS_MOUSEMOVE = 2;
  11453.   QS_MOUSEBUTTON = 4;
  11454.   QS_POSTMESSAGE = 8;
  11455.   QS_TIMER = $10;
  11456.   QS_PAINT = $20;
  11457.   QS_SENDMESSAGE = $40;
  11458.   QS_HOTKEY = $80;
  11459.  
  11460.   QS_MOUSE = (QS_MOUSEMOVE or QS_MOUSEBUTTON);
  11461.   QS_INPUT = (QS_MOUSE or QS_KEY);
  11462.   QS_ALLEVENTS = (QS_INPUT or QS_POSTMESSAGE or QS_TIMER or QS_PAINT
  11463.     or QS_HOTKEY);
  11464.   QS_ALLINPUT = (QS_INPUT or QS_POSTMESSAGE or QS_TIMER or QS_PAINT
  11465.     or QS_HOTKEY or QS_SENDMESSAGE);
  11466.  
  11467.  
  11468. { Windows Functions }
  11469.  
  11470. function SetTimer(hWnd: HWND; nIDEvent, uElapse: UINT;
  11471.   lpTimerFunc: TFNTimerProc): UINT; stdcall;
  11472. function KillTimer(hWnd: HWND; uIDEvent: UINT): BOOL; stdcall;
  11473. function IsWindowUnicode(hWnd: HWND): BOOL; stdcall;
  11474. function EnableWindow(hWnd: HWND; bEnable: BOOL): BOOL; stdcall;
  11475. function IsWindowEnabled(hWnd: HWND): BOOL; stdcall;
  11476. function LoadAcceleratorsA(hInstance: HINST; lpTableName: PAnsiChar): HACCEL; stdcall;
  11477. function LoadAcceleratorsW(hInstance: HINST; lpTableName: PWideChar): HACCEL; stdcall;
  11478. function LoadAccelerators(hInstance: HINST; lpTableName: PChar): HACCEL; stdcall;
  11479. function CreateAcceleratorTableA(var Accel; Count: Integer): HACCEL; stdcall;
  11480. function CreateAcceleratorTableW(var Accel; Count: Integer): HACCEL; stdcall;
  11481. function CreateAcceleratorTable(var Accel; Count: Integer): HACCEL; stdcall;
  11482. function CopyAcceleratorTableA(hAccelSrc: HACCEL; var lpAccelDst; cAccelEntries: Integer): Integer; stdcall;
  11483. function CopyAcceleratorTableW(hAccelSrc: HACCEL; var lpAccelDst; cAccelEntries: Integer): Integer; stdcall;
  11484. function CopyAcceleratorTable(hAccelSrc: HACCEL; var lpAccelDst; cAccelEntries: Integer): Integer; stdcall;
  11485. function TranslateAcceleratorA(hWnd: HWND; hAccTable: HACCEL; var lpMsg: TMsg): Integer; stdcall;
  11486. function TranslateAcceleratorW(hWnd: HWND; hAccTable: HACCEL; var lpMsg: TMsg): Integer; stdcall;
  11487. function TranslateAccelerator(hWnd: HWND; hAccTable: HACCEL; var lpMsg: TMsg): Integer; stdcall;
  11488. function DestroyAcceleratorTable(hAccel: HACCEL): BOOL; stdcall;
  11489.  
  11490. const
  11491.   { GetSystemMetrics() codes }
  11492.   SM_CXSCREEN = 0;
  11493.   SM_CYSCREEN = 1;
  11494.   SM_CXVSCROLL = 2;
  11495.   SM_CYHSCROLL = 3;
  11496.   SM_CYCAPTION = 4;
  11497.   SM_CXBORDER = 5;
  11498.   SM_CYBORDER = 6;
  11499.   SM_CXDLGFRAME = 7;
  11500.   SM_CYDLGFRAME = 8;
  11501.   SM_CYVTHUMB = 9;
  11502.   SM_CXHTHUMB = 10;
  11503.   SM_CXICON = 11;
  11504.   SM_CYICON = 12;
  11505.   SM_CXCURSOR = 13;
  11506.   SM_CYCURSOR = 14;
  11507.   SM_CYMENU = 15;
  11508.   SM_CXFULLSCREEN = $10;
  11509.   SM_CYFULLSCREEN = 17;
  11510.   SM_CYKANJIWINDOW = 18;
  11511.   SM_MOUSEPRESENT = 19;
  11512.   SM_CYVSCROLL = 20;
  11513.   SM_CXHSCROLL = 21;
  11514.   SM_DEBUG = 22;
  11515.   SM_SWAPBUTTON = 23;
  11516.   SM_RESERVED1 = 24;
  11517.   SM_RESERVED2 = 25;
  11518.   SM_RESERVED3 = 26;
  11519.   SM_RESERVED4 = 27;
  11520.   SM_CXMIN = 28;
  11521.   SM_CYMIN = 29;
  11522.   SM_CXSIZE = 30;
  11523.   SM_CYSIZE = 31;
  11524.   SM_CXFRAME = $20;
  11525.   SM_CYFRAME = 33;
  11526.   SM_CXMINTRACK = 34;
  11527.   SM_CYMINTRACK = 35;
  11528.   SM_CXDOUBLECLK = 36;
  11529.   SM_CYDOUBLECLK = 37;
  11530.   SM_CXICONSPACING = 38;
  11531.   SM_CYICONSPACING = 39;
  11532.   SM_MENUDROPALIGNMENT = 40;
  11533.   SM_PENWINDOWS = 41;
  11534.   SM_DBCSENABLED = 42;
  11535.   SM_CMOUSEBUTTONS = 43;
  11536.  
  11537.   SM_CXFIXEDFRAME = SM_CXDLGFRAME; { win40 name change }
  11538.   SM_CYFIXEDFRAME = SM_CYDLGFRAME; { win40 name change }
  11539.   SM_CXSIZEFRAME = SM_CXFRAME;     { win40 name change }
  11540.   SM_CYSIZEFRAME = SM_CYFRAME;     { win40 name change }
  11541.  
  11542.   SM_SECURE = 44;
  11543.   SM_CXEDGE = 45;
  11544.   SM_CYEDGE = 46;
  11545.   SM_CXMINSPACING = 47;
  11546.   SM_CYMINSPACING = 48;
  11547.   SM_CXSMICON = 49;
  11548.   SM_CYSMICON = 50;
  11549.   SM_CYSMCAPTION = 51;
  11550.   SM_CXSMSIZE = 52;
  11551.   SM_CYSMSIZE = 53;
  11552.   SM_CXMENUSIZE = 54;
  11553.   SM_CYMENUSIZE = 55;
  11554.   SM_ARRANGE = 56;
  11555.   SM_CXMINIMIZED = 57;
  11556.   SM_CYMINIMIZED = 58;
  11557.   SM_CXMAXTRACK = 59;
  11558.   SM_CYMAXTRACK = 60;
  11559.   SM_CXMAXIMIZED = 61;
  11560.   SM_CYMAXIMIZED = 62;
  11561.   SM_NETWORK = 63;
  11562.   SM_CLEANBOOT = 67;
  11563.   SM_CXDRAG = 68;
  11564.   SM_CYDRAG = 69;
  11565.   SM_SHOWSOUNDS = 70;
  11566.   SM_CXMENUCHECK = 71;     { Use instead of GetMenuCheckMarkDimensions()! }
  11567.   SM_CYMENUCHECK = 72;
  11568.   SM_SLOWMACHINE = 73;
  11569.   SM_MIDEASTENABLED = 74;
  11570.   SM_CMETRICS = 75;
  11571.  
  11572. function GetSystemMetrics(nIndex: Integer): Integer; stdcall;
  11573. function LoadMenuA(hInstance: HINST; lpMenuName: PAnsiChar): HMENU; stdcall;
  11574. function LoadMenuW(hInstance: HINST; lpMenuName: PAnsiChar): HMENU; stdcall;
  11575. function LoadMenu(hInstance: HINST; lpMenuName: PAnsiChar): HMENU; stdcall;
  11576. function LoadMenuIndirectA(lpMenuTemplate: Pointer): HMENU; stdcall;
  11577. function LoadMenuIndirectW(lpMenuTemplate: Pointer): HMENU; stdcall;
  11578. function LoadMenuIndirect(lpMenuTemplate: Pointer): HMENU; stdcall;
  11579. function GetMenu(hWnd: HWND): HMENU; stdcall;
  11580. function SetMenu(hWnd: HWND; hMenu: HMENU): BOOL; stdcall;
  11581. function ChangeMenuA(hMenu: HMENU; cmd: UINT; lpszNewItem: PAnsiChar;
  11582.   cmdInsert: UINT; flags: UINT): BOOL; stdcall;
  11583. function ChangeMenuW(hMenu: HMENU; cmd: UINT; lpszNewItem: PWideChar;
  11584.   cmdInsert: UINT; flags: UINT): BOOL; stdcall;
  11585. function ChangeMenu(hMenu: HMENU; cmd: UINT; lpszNewItem: PChar;
  11586.   cmdInsert: UINT; flags: UINT): BOOL; stdcall;
  11587. function HiliteMenuItem(hWnd: HWND; hMenu: HMENU; uIDHiliteItem: UINT;
  11588.   uHilite: UINT): BOOL; stdcall;
  11589. function GetMenuStringA(hMenu: HMENU; uIDItem: UINT; lpString: PAnsiChar;
  11590.   nMaxCount: Integer; uFlag: UINT): Integer; stdcall;
  11591. function GetMenuStringW(hMenu: HMENU; uIDItem: UINT; lpString: PWideChar;
  11592.   nMaxCount: Integer; uFlag: UINT): Integer; stdcall;
  11593. function GetMenuString(hMenu: HMENU; uIDItem: UINT; lpString: PChar;
  11594.   nMaxCount: Integer; uFlag: UINT): Integer; stdcall;
  11595. function GetMenuState(hMenu: HMENU; uId, uFlags: UINT): UINT; stdcall;
  11596. function DrawMenuBar(hWnd: HWND): BOOL; stdcall;
  11597. function GetSystemMenu(hWnd: HWND; bRevert: BOOL): HMENU; stdcall;
  11598. function CreateMenu: HMENU; stdcall;
  11599. function CreatePopupMenu: HMENU; stdcall;
  11600. function DestroyMenu(hMenu: HMENU): BOOL; stdcall;
  11601. function CheckMenuItem(hMenu: HMENU; uIDCheckItem, uCheck: UINT): DWORD; stdcall;
  11602. function EnableMenuItem(hMenu: HMENU; uIDEnableItem, uEnable: UINT): BOOL; stdcall;
  11603. function GetSubMenu(hMenu: HMENU; nPos: Integer): HMENU; stdcall;
  11604. function GetMenuItemID(hMenu: HMENU; nPos: Integer): UINT; stdcall;
  11605. function GetMenuItemCount(hMenu: HMENU): Integer; stdcall;
  11606. function InsertMenuA(hMenu: HMENU; uPosition, uFlags, uIDNewItem: UINT;
  11607.   lpNewItem: PAnsiChar): BOOL; stdcall;
  11608. function InsertMenuW(hMenu: HMENU; uPosition, uFlags, uIDNewItem: UINT;
  11609.   lpNewItem: PWideChar): BOOL; stdcall;
  11610. function InsertMenu(hMenu: HMENU; uPosition, uFlags, uIDNewItem: UINT;
  11611.   lpNewItem: PChar): BOOL; stdcall;
  11612. function AppendMenuA(hMenu: HMENU; uFlags, uIDNewItem: UINT;
  11613.   lpNewItem: PAnsiChar): BOOL; stdcall;
  11614. function AppendMenuW(hMenu: HMENU; uFlags, uIDNewItem: UINT;
  11615.   lpNewItem: PWideChar): BOOL; stdcall;
  11616. function AppendMenu(hMenu: HMENU; uFlags, uIDNewItem: UINT;
  11617.   lpNewItem: PChar): BOOL; stdcall;
  11618. function ModifyMenuA(hMnu: HMENU; uPosition, uFlags, uIDNewItem: UINT;
  11619.   lpNewItem: PAnsiChar): BOOL; stdcall;
  11620. function ModifyMenuW(hMnu: HMENU; uPosition, uFlags, uIDNewItem: UINT;
  11621.   lpNewItem: PWideChar): BOOL; stdcall;
  11622. function ModifyMenu(hMnu: HMENU; uPosition, uFlags, uIDNewItem: UINT;
  11623.   lpNewItem: PChar): BOOL; stdcall;
  11624. function RemoveMenu(hMenu: HMENU; uPosition, uFlags: UINT): BOOL; stdcall;
  11625. function DeleteMenu(hMenu: HMENU; uPosition, uFlags: UINT): BOOL; stdcall;
  11626. function SetMenuItemBitmaps(hMenu: HMENU; uPosition, uFlags: UINT;
  11627.   hBitmapUnchecked: HBITMAP; hBitmapChecked: HBITMAP): BOOL; stdcall;
  11628. function GetMenuCheckMarkDimensions: Longint; stdcall;
  11629. function TrackPopupMenu(hMenu: HMENU; uFlags: UINT; x, y, nReserved: Integer;
  11630.   hWnd: HWND; prcRect: PRect): BOOL; stdcall;
  11631.  
  11632.  
  11633. const
  11634.   { return codes for WM_MENUCHAR }
  11635.   MNC_IGNORE = 0;
  11636.   MNC_CLOSE = 1;
  11637.   MNC_EXECUTE = 2;
  11638.   MNC_SELECT = 3;
  11639.  
  11640. type
  11641.   PTPMParams = ^TTPMParams;
  11642.   TTPMParams = packed record
  11643.     cbSize: UINT;     { Size of structure }
  11644.     rcExclude: TRect; { Screen coordinates of rectangle to exclude when positioning }
  11645.   end;
  11646.  
  11647. function TrackPopupMenuEx(hMenu: HMENU; Flags: UINT; x, y: Integer;
  11648.   Wnd: HWND; TPMParams: PTPMParams): BOOL; stdcall;
  11649.  
  11650. const
  11651.   MIIM_STATE = 1;
  11652.   MIIM_ID = 2;
  11653.   MIIM_SUBMENU = 4;
  11654.   MIIM_CHECKMARKS = 8;
  11655.   MIIM_TYPE = $10;
  11656.   MIIM_DATA = $20;
  11657.  
  11658. type
  11659.   PMenuItemInfoA = ^TMenuItemInfoA;
  11660.   PMenuItemInfoW = ^TMenuItemInfoW;
  11661.   PMenuItemInfo = PMenuItemInfoA;
  11662.   TMenuItemInfoA = packed record
  11663.     cbSize: UINT;
  11664.     fMask: UINT;
  11665.     fType: UINT;             { used if MIIM_TYPE}
  11666.     fState: UINT;            { used if MIIM_STATE}
  11667.     wID: UINT;               { used if MIIM_ID}
  11668.     hSubMenu: HMENU;         { used if MIIM_SUBMENU}
  11669.     hbmpChecked: HBITMAP;    { used if MIIM_CHECKMARKS}
  11670.     hbmpUnchecked: HBITMAP;  { used if MIIM_CHECKMARKS}
  11671.     dwItemData: DWORD;       { used if MIIM_DATA}
  11672.     dwTypeData: PAnsiChar;      { used if MIIM_TYPE}
  11673.     cch: UINT;               { used if MIIM_TYPE}
  11674.   end;
  11675.   TMenuItemInfoW = packed record
  11676.     cbSize: UINT;
  11677.     fMask: UINT;
  11678.     fType: UINT;             { used if MIIM_TYPE}
  11679.     fState: UINT;            { used if MIIM_STATE}
  11680.     wID: UINT;               { used if MIIM_ID}
  11681.     hSubMenu: HMENU;         { used if MIIM_SUBMENU}
  11682.     hbmpChecked: HBITMAP;    { used if MIIM_CHECKMARKS}
  11683.     hbmpUnchecked: HBITMAP;  { used if MIIM_CHECKMARKS}
  11684.     dwItemData: DWORD;       { used if MIIM_DATA}
  11685.     dwTypeData: PWideChar;      { used if MIIM_TYPE}
  11686.     cch: UINT;               { used if MIIM_TYPE}
  11687.   end;
  11688.   TMenuItemInfo = TMenuItemInfoA;
  11689.  
  11690. function InsertMenuItemA(p1: HMENU; p2: UINT; p3: BOOL; const p4: TMenuItemInfoA): BOOL; stdcall;
  11691. function InsertMenuItemW(p1: HMENU; p2: UINT; p3: BOOL; const p4: TMenuItemInfoW): BOOL; stdcall;
  11692. function InsertMenuItem(p1: HMENU; p2: UINT; p3: BOOL; const p4: TMenuItemInfo): BOOL; stdcall;
  11693. function GetMenuItemInfoA(p1: HMENU; p2: UINT; p3: BOOL; var p4: TMenuItemInfoA): BOOL; stdcall;
  11694. function GetMenuItemInfoW(p1: HMENU; p2: UINT; p3: BOOL; var p4: TMenuItemInfoW): BOOL; stdcall;
  11695. function GetMenuItemInfo(p1: HMENU; p2: UINT; p3: BOOL; var p4: TMenuItemInfo): BOOL; stdcall;
  11696. function SetMenuItemInfoA(p1: HMENU; p2: UINT; p3: BOOL; const p4: TMenuItemInfoA): BOOL; stdcall;
  11697. function SetMenuItemInfoW(p1: HMENU; p2: UINT; p3: BOOL; const p4: TMenuItemInfoW): BOOL; stdcall;
  11698. function SetMenuItemInfo(p1: HMENU; p2: UINT; p3: BOOL; const p4: TMenuItemInfo): BOOL; stdcall;
  11699.  
  11700. const
  11701.   GMDI_USEDISABLED = 1;
  11702.   GMDI_GOINTOPOPUPS = 2;
  11703.  
  11704. function GetMenuDefaultItem(hMenu: HMENU; fByPos, gmdiFlags: UINT): UINT; stdcall;
  11705. function SetMenuDefaultItem(hMenu: HMENU; uItem, fByPos: UINT): BOOL; stdcall;
  11706. function GetMenuItemRect(hWnd: HWND; hMenu: HMENU; uItem: UINT;
  11707.   var lprcItem: TRect): BOOL; stdcall;
  11708. function MenuItemFromPoint(hWnd: HWND; hMenu: HMENU; ptScreen: TPoint): BOOL; stdcall;
  11709.  
  11710. const
  11711.   { Flags for TrackPopupMenu }
  11712.   TPM_LEFTBUTTON = 0;
  11713.   TPM_RIGHTBUTTON = 2;
  11714.   TPM_LEFTALIGN = 0;
  11715.   TPM_CENTERALIGN = 4;
  11716.   TPM_RIGHTALIGN = 8;
  11717.   TPM_TOPALIGN = 0;
  11718.   TPM_VCENTERALIGN = $10;
  11719.   TPM_BOTTOMALIGN = $20;
  11720.  
  11721.   TPM_HORIZONTAL = 0;   { Horz alignment matters more }
  11722.   TPM_VERTICAL = $40;   { Vert alignment matters more }
  11723.   TPM_NONOTIFY = $80;   { Don't send any notification msgs }
  11724.   TPM_RETURNCMD = $100;
  11725.  
  11726.  
  11727. { Drag-and-drop support }
  11728.  
  11729. type
  11730.   PDropStruct = ^TDropStruct;
  11731.   TDropStruct = packed record
  11732.     hwndSource: HWND;
  11733.     hwndSink: HWND;
  11734.     wFmt: DWORD;
  11735.     dwData: DWORD;
  11736.     ptDrop: TPoint;
  11737.     dwControlData: DWORD;
  11738.   end;
  11739.  
  11740. const
  11741.   DOF_EXECUTABLE = 32769;
  11742.   DOF_DOCUMENT = 32770;
  11743.   DOF_DIRECTORY = 32771;
  11744.   DOF_MULTIPLE = 32772;
  11745.   DOF_PROGMAN = 1;
  11746.   DOF_SHELLDATA = 2;
  11747.  
  11748.   DO_DROPFILE = $454C4946;
  11749.   DO_PRINTFILE = $544E5250;
  11750.  
  11751. function DragObject(p1, p2: HWND; p3: UINT; p4: DWORD;
  11752.   p5: HICON): DWORD; stdcall;
  11753. function DragDetect(p1: HWND; p2: TPoint): BOOL; stdcall;
  11754. function DrawIcon(hDC: HDC; X, Y: Integer; hIcon: HICON): BOOL; stdcall;
  11755.  
  11756. const
  11757.   { DrawText() Format Flags }
  11758.   DT_TOP = 0;
  11759.   DT_LEFT = 0;
  11760.   DT_CENTER = 1;
  11761.   DT_RIGHT = 2;
  11762.   DT_VCENTER = 4;
  11763.   DT_BOTTOM = 8;
  11764.   DT_WORDBREAK = $10;
  11765.   DT_SINGLELINE = $20;
  11766.   DT_EXPANDTABS = $40;
  11767.   DT_TABSTOP = $80;
  11768.   DT_NOCLIP = $100;
  11769.   DT_EXTERNALLEADING = $200;
  11770.   DT_CALCRECT = $400;
  11771.   DT_NOPREFIX = $800;
  11772.   DT_INTERNAL = $1000;
  11773.  
  11774.   DT_EDITCONTROL = $2000;
  11775.   DT_PATH_ELLIPSIS = $4000;
  11776.   DT_END_ELLIPSIS = $8000;
  11777.   DT_MODIFYSTRING = $10000;
  11778.   DT_RTLREADING = $20000;
  11779.   DT_WORD_ELLIPSIS = $40000;
  11780.  
  11781. type
  11782.   PDrawTextParams = ^TDrawTextParams;
  11783.   TDrawTextParams = packed record
  11784.     cbSize: UINT;
  11785.     iTabLength: Integer;
  11786.     iLeftMargin: Integer;
  11787.     iRightMargin: Integer;
  11788.     uiLengthDrawn: UINT;
  11789.   end;
  11790.  
  11791. function DrawTextA(hDC: HDC; lpString: PAnsiChar; nCount: Integer;
  11792.   var lpRect: TRect; uFormat: UINT): Integer; stdcall;
  11793. function DrawTextW(hDC: HDC; lpString: PWideChar; nCount: Integer;
  11794.   var lpRect: TRect; uFormat: UINT): Integer; stdcall;
  11795. function DrawText(hDC: HDC; lpString: PChar; nCount: Integer;
  11796.   var lpRect: TRect; uFormat: UINT): Integer; stdcall;
  11797. function DrawTextExA(DC: HDC; lpchText: PAnsiChar; cchText: Integer; var p4: TRect;
  11798.   dwDTFormat: UINT; DTParams: PDrawTextParams): Integer; stdcall;
  11799. function DrawTextExW(DC: HDC; lpchText: PWideChar; cchText: Integer; var p4: TRect;
  11800.   dwDTFormat: UINT; DTParams: PDrawTextParams): Integer; stdcall;
  11801. function DrawTextEx(DC: HDC; lpchText: PChar; cchText: Integer; var p4: TRect;
  11802.   dwDTFormat: UINT; DTParams: PDrawTextParams): Integer; stdcall;
  11803. function GrayStringA(hDC: HDC; hBrush: HBRUSH; lpOutputFunc: TFNGrayStringProc;
  11804.   lpData: LPARAM; nCount, X, Y, nWidth, nHeight: Integer): BOOL; stdcall;
  11805. function GrayStringW(hDC: HDC; hBrush: HBRUSH; lpOutputFunc: TFNGrayStringProc;
  11806.   lpData: LPARAM; nCount, X, Y, nWidth, nHeight: Integer): BOOL; stdcall;
  11807. function GrayString(hDC: HDC; hBrush: HBRUSH; lpOutputFunc: TFNGrayStringProc;
  11808.   lpData: LPARAM; nCount, X, Y, nWidth, nHeight: Integer): BOOL; stdcall;
  11809.  
  11810.  
  11811. { Monolithic state-drawing routine }
  11812.  
  11813. const
  11814.   { Image type }
  11815.   DST_COMPLEX = 0;
  11816.   DST_TEXT = 1;
  11817.   DST_PREFIXTEXT = 2;
  11818.   DST_ICON = 3;
  11819.   DST_BITMAP = 4;
  11820.  
  11821.   { State type }
  11822.   DSS_NORMAL = 0;
  11823.   DSS_UNION = $10;     { Gray string appearance }
  11824.   DSS_DISABLED = $20;
  11825.   DSS_MONO = $80;
  11826.   DSS_RIGHT = $8000;
  11827.  
  11828. function DrawStateA(DC: HDC; p2: HBRUSH; p3: TFNDrawStateProc;
  11829.   p4: LPARAM; p5: WPARAM; p6, p7, p8, p9: Integer; p10: UINT): BOOL; stdcall;
  11830. function DrawStateW(DC: HDC; p2: HBRUSH; p3: TFNDrawStateProc;
  11831.   p4: LPARAM; p5: WPARAM; p6, p7, p8, p9: Integer; p10: UINT): BOOL; stdcall;
  11832. function DrawState(DC: HDC; p2: HBRUSH; p3: TFNDrawStateProc;
  11833.   p4: LPARAM; p5: WPARAM; p6, p7, p8, p9: Integer; p10: UINT): BOOL; stdcall;
  11834. function TabbedTextOutA(hDC: HDC; X, Y: Integer; lpString: PAnsiChar; nCount, nTabPositions: Integer;
  11835.   var lpnTabStopPositions; nTabOrigin: Integer): Longint; stdcall;
  11836. function TabbedTextOutW(hDC: HDC; X, Y: Integer; lpString: PWideChar; nCount, nTabPositions: Integer;
  11837.   var lpnTabStopPositions; nTabOrigin: Integer): Longint; stdcall;
  11838. function TabbedTextOut(hDC: HDC; X, Y: Integer; lpString: PChar; nCount, nTabPositions: Integer;
  11839.   var lpnTabStopPositions; nTabOrigin: Integer): Longint; stdcall;
  11840. function GetTabbedTextExtentA(hDC: HDC; lpString: PAnsiChar;
  11841.   nCount, nTabPositions: Integer; var lpnTabStopPositions): DWORD; stdcall;
  11842. function GetTabbedTextExtentW(hDC: HDC; lpString: PWideChar;
  11843.   nCount, nTabPositions: Integer; var lpnTabStopPositions): DWORD; stdcall;
  11844. function GetTabbedTextExtent(hDC: HDC; lpString: PChar;
  11845.   nCount, nTabPositions: Integer; var lpnTabStopPositions): DWORD; stdcall;
  11846. function UpdateWindow(hWnd: HWND): BOOL; stdcall;
  11847. function SetActiveWindow(hWnd: HWND): HWND; stdcall;
  11848. function GetForegroundWindow: HWND; stdcall;
  11849. function PaintDesktop(hdc: HDC): BOOL; stdcall;
  11850. function SetForegroundWindow(hWnd: HWND): BOOL; stdcall;
  11851. function WindowFromDC(hDC: HDC): HWND; stdcall;
  11852. function GetDC(hWnd: HWND): HDC; stdcall;
  11853. function GetDCEx(hWnd: HWND; hrgnClip: HRGN; flags: DWORD): HDC; stdcall;
  11854.  
  11855. const
  11856.   { GetDCEx() flags }
  11857.   DCX_WINDOW = 1;
  11858.   DCX_CACHE = 2;
  11859.   DCX_NORESETATTRS = 4;
  11860.   DCX_CLIPCHILDREN = 8;
  11861.   DCX_CLIPSIBLINGS = $10;
  11862.   DCX_PARENTCLIP = $20;
  11863.   DCX_EXCLUDERGN = $40;
  11864.   DCX_INTERSECTRGN = $80;
  11865.   DCX_EXCLUDEUPDATE = $100;
  11866.   DCX_INTERSECTUPDATE = $200;
  11867.   DCX_LOCKWINDOWUPDATE = $400;
  11868.   DCX_VALIDATE = $200000;
  11869.  
  11870. function GetWindowDC(hWnd: HWND): HDC; stdcall;
  11871. function ReleaseDC(hWnd: HWND; hDC: HDC): Integer; stdcall;
  11872. function BeginPaint(hWnd: HWND; var lpPaint: TPaintStruct): HDC; stdcall;
  11873. function EndPaint(hWnd: HWND; const lpPaint: TPaintStruct): BOOL; stdcall;
  11874. function GetUpdateRect(hWnd: HWND; var lpRect: TRect; bErase: BOOL): BOOL; stdcall;
  11875. function GetUpdateRgn(hWnd: HWND; hRgn: HRGN; bErase: BOOL): BOOL; stdcall;
  11876. function SetWindowRgn(hWnd: HWND; hRgn: HRGN; bRedraw: BOOL): BOOL; stdcall;
  11877. function GetWindowRgn(hWnd: HWND; hRgn: HRGN): BOOL; stdcall;
  11878. function ExcludeUpdateRgn(hDC: HDC; hWnd: HWND): BOOL; stdcall;
  11879. function InvalidateRect(hWnd: HWND; lpRect: PRect; bErase: BOOL): BOOL; stdcall;
  11880. function ValidateRect(hWnd: HWND; lpRect: PRect): BOOL; stdcall;
  11881. function InvalidateRgn(hWnd: HWND; hRgn: HRGN; bErase: BOOL): BOOL; stdcall;
  11882. function ValidateRgn(hWnd: HWND; hRgn: HRGN): BOOL; stdcall;
  11883. function RedrawWindow(hWnd: HWND; lprcUpdate: PRect; hrgnUpdate: HRGN; flags: UINT): BOOL; stdcall;
  11884.  
  11885. const
  11886.   { RedrawWindow() flags }
  11887.   RDW_INVALIDATE = 1;
  11888.   RDW_INTERNALPAINT = 2;
  11889.   RDW_ERASE = 4;
  11890.   RDW_VALIDATE = 8;
  11891.   RDW_NOINTERNALPAINT = $10;
  11892.   RDW_NOERASE = $20;
  11893.   RDW_NOCHILDREN = $40;
  11894.   RDW_ALLCHILDREN = $80;
  11895.   RDW_UPDATENOW = $100;
  11896.   RDW_ERASENOW = $200;
  11897.   RDW_FRAME = $400;
  11898.   RDW_NOFRAME = $800;
  11899.  
  11900.  
  11901. { LockWindowUpdate API }
  11902.  
  11903. function LockWindowUpdate(hWndLock: HWND): BOOL; stdcall;
  11904. function ScrollWindow(hWnd: HWND; XAmount, YAmount: Integer;
  11905.   Rect, ClipRect: PRect): BOOL; stdcall;
  11906. function ScrollDC(DC: HDC; DX, DY: Integer; var Scroll, Clip: TRect; Rgn: HRGN;
  11907.   Update: PRect): BOOL; stdcall;
  11908. function ScrollWindowEx(hWnd: HWND; dx, dy: Integer;
  11909.   prcScroll, prcClip: PRect;
  11910.   hrgnUpdate: HRGN; prcUpdate: PRect; flags: UINT): BOOL; stdcall;
  11911.  
  11912. const
  11913.   SW_SCROLLCHILDREN = 1;  { Scroll children within lprcScroll. }
  11914.   SW_INVALIDATE = 2;      { Invalidate after scrolling }
  11915.   SW_ERASE = 4;           { If SW_INVALIDATE, don't send WM_ERASEBACKGROUND }
  11916.  
  11917. function SetScrollPos(hWnd: HWND; nBar, nPos: Integer; bRedraw: BOOL): Integer; stdcall;
  11918. function GetScrollPos(hWnd: HWND; nBar: Integer): Integer; stdcall;
  11919. function SetScrollRange(hWnd: HWND; nBar, nMinPos, nMaxPos: Integer; bRedraw: BOOL): BOOL; stdcall;
  11920. function GetScrollRange(hWnd: HWND; nBar: Integer; var lpMinPos, lpMaxPos: Integer): BOOL; stdcall;
  11921. function ShowScrollBar(hWnd: HWND; wBar: Integer; bShow: BOOL): BOOL; stdcall;
  11922. function EnableScrollBar(hWnd: HWND; wSBflags, wArrows: UINT): BOOL; stdcall;
  11923.  
  11924.  
  11925. const
  11926.   { EnableScrollBar() flags }
  11927.   ESB_ENABLE_BOTH = 0;
  11928.   ESB_DISABLE_BOTH = 3;
  11929.   ESB_DISABLE_LEFT = 1;
  11930.   ESB_DISABLE_RIGHT = 2;
  11931.   ESB_DISABLE_UP = 1;
  11932.   ESB_DISABLE_DOWN = 2;
  11933.   ESB_DISABLE_LTUP = ESB_DISABLE_LEFT;
  11934.   ESB_DISABLE_RTDN = ESB_DISABLE_RIGHT;
  11935.  
  11936. function SetPropA(hWnd: HWND; lpString: PAnsiChar; hData: THandle): BOOL; stdcall;
  11937. function SetPropW(hWnd: HWND; lpString: PWideChar; hData: THandle): BOOL; stdcall;
  11938. function SetProp(hWnd: HWND; lpString: PChar; hData: THandle): BOOL; stdcall;
  11939. function GetPropA(hWnd: HWND; lpString: PAnsiChar): THandle; stdcall;
  11940. function GetPropW(hWnd: HWND; lpString: PWideChar): THandle; stdcall;
  11941. function GetProp(hWnd: HWND; lpString: PChar): THandle; stdcall;
  11942. function RemovePropA(hWnd: HWND; lpString: PAnsiChar): THandle; stdcall;
  11943. function RemovePropW(hWnd: HWND; lpString: PWideChar): THandle; stdcall;
  11944. function RemoveProp(hWnd: HWND; lpString: PChar): THandle; stdcall;
  11945. function EnumPropsExA(hWnd: HWND; lpEnumFunc: TFNPropEnumProcEx; lParam: LPARAM): Integer; stdcall;
  11946. function EnumPropsExW(hWnd: HWND; lpEnumFunc: TFNPropEnumProcEx; lParam: LPARAM): Integer; stdcall;
  11947. function EnumPropsEx(hWnd: HWND; lpEnumFunc: TFNPropEnumProcEx; lParam: LPARAM): Integer; stdcall;
  11948. function EnumPropsA(hWnd: HWND; lpEnumFunc: TFNPropEnumProc): Integer; stdcall;
  11949. function EnumPropsW(hWnd: HWND; lpEnumFunc: TFNPropEnumProc): Integer; stdcall;
  11950. function EnumProps(hWnd: HWND; lpEnumFunc: TFNPropEnumProc): Integer; stdcall;
  11951. function SetWindowTextA(hWnd: HWND; lpString: PAnsiChar): BOOL; stdcall;
  11952. function SetWindowTextW(hWnd: HWND; lpString: PWideChar): BOOL; stdcall;
  11953. function SetWindowText(hWnd: HWND; lpString: PChar): BOOL; stdcall;
  11954. function GetWindowTextA(hWnd: HWND; lpString: PAnsiChar; nMaxCount: Integer): Integer; stdcall;
  11955. function GetWindowTextW(hWnd: HWND; lpString: PWideChar; nMaxCount: Integer): Integer; stdcall;
  11956. function GetWindowText(hWnd: HWND; lpString: PChar; nMaxCount: Integer): Integer; stdcall;
  11957. function GetWindowTextLengthA(hWnd: HWND): Integer; stdcall;
  11958. function GetWindowTextLengthW(hWnd: HWND): Integer; stdcall;
  11959. function GetWindowTextLength(hWnd: HWND): Integer; stdcall;
  11960.  
  11961. function GetClientRect(hWnd: HWND; var lpRect: TRect): BOOL; stdcall;
  11962. function GetWindowRect(hWnd: HWND; var lpRect: TRect): BOOL; stdcall;
  11963. function AdjustWindowRect(var lpRect: TRect; dwStyle: DWORD; bMenu: BOOL): BOOL; stdcall;
  11964. function AdjustWindowRectEx(var lpRect: TRect; dwStyle: DWORD; bMenu: BOOL;
  11965.   dwExStyle: DWORD): BOOL; stdcall;
  11966.  
  11967. const
  11968.   HELPINFO_WINDOW = 1;
  11969.   HELPINFO_MENUITEM = 2;
  11970. type
  11971.   PHelpInfo = ^THelpInfo;
  11972.   THelpInfo = packed record       { Structure pointed to by lParam of WM_HELP }
  11973.     cbSize: UINT;          { Size in bytes of this struct  }
  11974.     iContextType: Integer; { Either HELPINFO_WINDOW or HELPINFO_MENUITEM }
  11975.     iCtrlId: Integer;      { Control Id or a Menu item Id. }
  11976.     hItemHandle: THandle;  { hWnd of control or hMenu.     }
  11977.     dwContextId: DWORD;    { Context Id associated with this item }
  11978.     MousePos: TPoint;      { Mouse Position in screen co-ordinates }
  11979.   end;
  11980.  
  11981. function SetWindowContextHelpId(hWnd: HWND; HelpID: DWORD): BOOL; stdcall;
  11982. function GetWindowContextHelpId(hWnd: HWND): DWORD; stdcall;
  11983. function SetMenuContextHelpId(hMenu: HMENU; HelpID: DWORD): BOOL; stdcall;
  11984. function GetMenuContextHelpId(hMenu: HMENU): DWORD; stdcall;
  11985.  
  11986. const
  11987.   { MessageBox() Flags }
  11988.   MB_OK = 0;
  11989.   MB_OKCANCEL = 1;
  11990.   MB_ABORTRETRYIGNORE = 2;
  11991.   MB_YESNOCANCEL = 3;
  11992.   MB_YESNO = 4;
  11993.   MB_RETRYCANCEL = 5;
  11994.   MB_ICONHAND = $10;
  11995.   MB_ICONQUESTION = $20;
  11996.   MB_ICONEXCLAMATION = 48;
  11997.   MB_ICONASTERISK = $40;
  11998.   MB_ICONWARNING = MB_ICONEXCLAMATION;
  11999.   MB_ICONERROR = MB_ICONHAND;
  12000.   MB_ICONINFORMATION = MB_ICONASTERISK;
  12001.   MB_ICONSTOP = MB_ICONHAND;
  12002.   MB_DEFBUTTON1 = 0;
  12003.   MB_DEFBUTTON2 = $100;
  12004.   MB_DEFBUTTON3 = $200;
  12005.   MB_DEFBUTTON4 = 768;
  12006.   MB_APPLMODAL = 0;
  12007.   MB_SYSTEMMODAL = $1000;
  12008.   MB_TASKMODAL = $2000;
  12009.   MB_HELP = $4000;      { Help Button }
  12010.   MB_RIGHT = $80000;
  12011.   MB_RTLREADING = $100000;
  12012.   MB_NOFOCUS = $8000;
  12013.   MB_SETFOREGROUND = $10000;
  12014.   MB_DEFAULT_DESKTOP_ONLY = $20000;
  12015.   MB_SERVICE_NOTIFICATION = $40000;
  12016.   MB_TYPEMASK = 15;
  12017.   MB_USERICON = 128;
  12018.   MB_ICONMASK = 240;
  12019.   MB_DEFMASK = 3840;
  12020.   MB_MODEMASK = 12288;
  12021.   MB_MISCMASK = 49152;
  12022.  
  12023. function MessageBoxA(hWnd: HWND; lpText, lpCaption: PAnsiChar; uType: UINT): Integer; stdcall;
  12024. function MessageBoxW(hWnd: HWND; lpText, lpCaption: PWideChar; uType: UINT): Integer; stdcall;
  12025. function MessageBox(hWnd: HWND; lpText, lpCaption: PChar; uType: UINT): Integer; stdcall;
  12026. function MessageBoxExA(hWnd: HWND; lpText, lpCaption: PAnsiChar;
  12027.   uType: UINT; wLanguageId: Word): Integer; stdcall;
  12028. function MessageBoxExW(hWnd: HWND; lpText, lpCaption: PWideChar;
  12029.   uType: UINT; wLanguageId: Word): Integer; stdcall;
  12030. function MessageBoxEx(hWnd: HWND; lpText, lpCaption: PChar;
  12031.   uType: UINT; wLanguageId: Word): Integer; stdcall;
  12032.  
  12033. const
  12034.   MB_TOPMOST = $40000;
  12035.  
  12036. type
  12037.   TPRMsgBoxCallback = procedure(var lpHelpInfo: THelpInfo);
  12038.  
  12039.   PMsgBoxParamsA = ^TMsgBoxParamsA;
  12040.   PMsgBoxParamsW = ^TMsgBoxParamsW;
  12041.   PMsgBoxParams = PMsgBoxParamsA;
  12042.   TMsgBoxParamsA = packed record
  12043.     cbSize: UINT;
  12044.     hwndOwner: HWND;
  12045.     hInstance: HINST;
  12046.     lpszText: PAnsiChar;
  12047.     lpszCaption: PAnsiChar;
  12048.     dwStyle: DWORD;
  12049.     lpszIcon: PAnsiChar;
  12050.     dwContextHelpId: DWORD;
  12051.     lpfnMsgBoxCallback: TPRMsgBoxCallback;
  12052.     dwLanguageId: DWORD;
  12053.   end;
  12054.   TMsgBoxParamsW = packed record
  12055.     cbSize: UINT;
  12056.     hwndOwner: HWND;
  12057.     hInstance: HINST;
  12058.     lpszText: PWideChar;
  12059.     lpszCaption: PWideChar;
  12060.     dwStyle: DWORD;
  12061.     lpszIcon: PWideChar;
  12062.     dwContextHelpId: DWORD;
  12063.     lpfnMsgBoxCallback: TPRMsgBoxCallback;
  12064.     dwLanguageId: DWORD;
  12065.   end;
  12066.   TMsgBoxParams = TMsgBoxParamsA;
  12067.  
  12068. function MessageBoxIndirectA(const MsgBoxParams: TMsgBoxParamsA): BOOL; stdcall;
  12069. function MessageBoxIndirectW(const MsgBoxParams: TMsgBoxParamsW): BOOL; stdcall;
  12070. function MessageBoxIndirect(const MsgBoxParams: TMsgBoxParams): BOOL; stdcall;
  12071.  
  12072. function MessageBeep(uType: UINT): BOOL; stdcall;
  12073. function ShowCursor(bShow: BOOL): Integer; stdcall;
  12074. function SetCursorPos(X, Y: Integer): BOOL; stdcall;
  12075. function SetCursor(hCursor: HICON): HCURSOR; stdcall;
  12076. function GetCursorPos(var lpPoint: TPoint): BOOL; stdcall;
  12077. function ClipCursor(lpRect: PRect): BOOL; stdcall;
  12078. function GetClipCursor(var lpRect: TRect): BOOL; stdcall;
  12079. function GetCursor: HCURSOR; stdcall;
  12080. function CreateCaret(hWnd: HWND; hBitmap: HBITMAP; nWidth, nHeight: Integer): BOOL; stdcall;
  12081. function GetCaretBlinkTime: UINT; stdcall;
  12082. function SetCaretBlinkTime(uMSeconds: UINT): BOOL; stdcall;
  12083. function DestroyCaret: BOOL; stdcall;
  12084. function HideCaret(hWnd: HWND): BOOL; stdcall;
  12085. function ShowCaret(hWnd: HWND): BOOL; stdcall;
  12086. function SetCaretPos(X, Y: Integer): BOOL; stdcall;
  12087. function GetCaretPos(var lpPoint: TPoint): BOOL; stdcall;
  12088. function ClientToScreen(hWnd: HWND; var lpPoint: TPoint): BOOL; stdcall;
  12089. function ScreenToClient(hWnd: HWND; var lpPoint: TPoint): BOOL; stdcall;
  12090. function MapWindowPoints(hWndFrom, hWndTo: HWND; var lpPoints; cPoints: UINT): Integer; stdcall;
  12091. function WindowFromPoint(Point: TPoint): HWND; stdcall;
  12092. function ChildWindowFromPoint(hWndParent: HWND; Point: TPoint): HWND; stdcall;
  12093.  
  12094. const
  12095.   CWP_ALL = 0;
  12096.   CWP_SKIPINVISIBLE = 1;
  12097.   CWP_SKIPDISABLED = 2;
  12098.   CWP_SKIPTRANSPARENT = 4;
  12099.  
  12100. function ChildWindowFromPointEx(hWnd: HWND; Point: TPoint; Flags: UINT): HWND; stdcall;
  12101.  
  12102. const
  12103.   { Color Types }
  12104.   CTLCOLOR_MSGBOX = 0;
  12105.   CTLCOLOR_EDIT = 1;
  12106.   CTLCOLOR_LISTBOX = 2;
  12107.   CTLCOLOR_BTN = 3;
  12108.   CTLCOLOR_DLG = 4;
  12109.   CTLCOLOR_SCROLLBAR = 5;
  12110.   CTLCOLOR_STATIC = 6;
  12111.   CTLCOLOR_MAX = 7;
  12112.  
  12113.   COLOR_SCROLLBAR = 0;
  12114.   COLOR_BACKGROUND = 1;
  12115.   COLOR_ACTIVECAPTION = 2;
  12116.   COLOR_INACTIVECAPTION = 3;
  12117.   COLOR_MENU = 4;
  12118.   COLOR_WINDOW = 5;
  12119.   COLOR_WINDOWFRAME = 6;
  12120.   COLOR_MENUTEXT = 7;
  12121.   COLOR_WINDOWTEXT = 8;
  12122.   COLOR_CAPTIONTEXT = 9;
  12123.   COLOR_ACTIVEBORDER = 10;
  12124.   COLOR_INACTIVEBORDER = 11;
  12125.   COLOR_APPWORKSPACE = 12;
  12126.   COLOR_HIGHLIGHT = 13;
  12127.   COLOR_HIGHLIGHTTEXT = 14;
  12128.   COLOR_BTNFACE = 15;
  12129.   COLOR_BTNSHADOW = $10;
  12130.   COLOR_GRAYTEXT = 17;
  12131.   COLOR_BTNTEXT = 18;
  12132.   COLOR_INACTIVECAPTIONTEXT = 19;
  12133.   COLOR_BTNHIGHLIGHT = 20;
  12134.  
  12135.   COLOR_3DDKSHADOW = 21;
  12136.   COLOR_3DLIGHT = 22;
  12137.   COLOR_INFOTEXT = 23;
  12138.   COLOR_INFOBK = 24;
  12139.   COLOR_ENDCOLORS = COLOR_INFOBK;
  12140.   COLOR_DESKTOP = COLOR_BACKGROUND;
  12141.   COLOR_3DFACE = COLOR_BTNFACE;
  12142.   COLOR_3DSHADOW = COLOR_BTNSHADOW;
  12143.   COLOR_3DHIGHLIGHT = COLOR_BTNHIGHLIGHT;
  12144.   COLOR_3DHILIGHT = COLOR_BTNHIGHLIGHT;
  12145.   COLOR_BTNHILIGHT = COLOR_BTNHIGHLIGHT;
  12146.  
  12147. function GetSysColor(nIndex: Integer): DWORD; stdcall;
  12148. function GetSysColorBrush(nIndex: Integer): HBRUSH; stdcall;
  12149. function SetSysColors(cElements: Integer; const lpaElements;
  12150.   const lpaRgbValues): BOOL; stdcall;
  12151. function DrawFocusRect(hDC: HDC; const lprc: TRect): BOOL; stdcall;
  12152. function FillRect(hDC: HDC; const lprc: TRect; hbr: HBRUSH): Integer; stdcall;
  12153. function FrameRect(hDC: HDC; const lprc: TRect; hbr: HBRUSH): Integer; stdcall;
  12154. function InvertRect(hDC: HDC; const lprc: TRect): BOOL; stdcall;
  12155. function SetRect(var lprc: TRect; xLeft, yTop, xRight, yBottom: Integer): BOOL; stdcall;
  12156. function SetRectEmpty(var lprc: TRect): BOOL; stdcall;
  12157. function CopyRect(var lprcDst: TRect; const lprcSrc: TRect): BOOL; stdcall;
  12158. function InflateRect(var lprc: TRect; dx, dy: Integer): BOOL; stdcall;
  12159. function IntersectRect(var lprcDst: TRect; const lprcSrc1, lprcSrc2: TRect): BOOL; stdcall;
  12160. function UnionRect(var lprcDst: TRect; const lprcSrc1, lprcSrc2: TRect): BOOL; stdcall;
  12161. function SubtractRect(var lprcDst: TRect; const lprcSrc1, lprcSrc2: TRect): BOOL; stdcall;
  12162. function OffsetRect(var lprc: TRect; dx, dy: Integer): BOOL; stdcall;
  12163. function IsRectEmpty(const lprc: TRect): BOOL; stdcall;
  12164. function EqualRect(const lprc1, lprc2: TRect): BOOL; stdcall;
  12165. function PtInRect(const lprc: TRect; pt: TPoint): BOOL; stdcall;
  12166. function GetWindowWord(hWnd: HWND; nIndex: Integer): Word; stdcall;
  12167. function SetWindowWord(hWnd: HWND; nIndex: Integer; wNewWord: Word): Word; stdcall;
  12168. function GetWindowLongA(hWnd: HWND; nIndex: Integer): Longint; stdcall;
  12169. function GetWindowLongW(hWnd: HWND; nIndex: Integer): Longint; stdcall;
  12170. function GetWindowLong(hWnd: HWND; nIndex: Integer): Longint; stdcall;
  12171. function SetWindowLongA(hWnd: HWND; nIndex: Integer; dwNewLong: Longint): Longint; stdcall;
  12172. function SetWindowLongW(hWnd: HWND; nIndex: Integer; dwNewLong: Longint): Longint; stdcall;
  12173. function SetWindowLong(hWnd: HWND; nIndex: Integer; dwNewLong: Longint): Longint; stdcall;
  12174. function GetClassWord(hWnd: HWND; nIndex: Integer): Word; stdcall;
  12175. function SetClassWord(hWnd: HWND; nIndex: Integer; wNewWord: Word): Word; stdcall;
  12176. function GetClassLongA(hWnd: HWND; nIndex: Integer): DWORD; stdcall;
  12177. function GetClassLongW(hWnd: HWND; nIndex: Integer): DWORD; stdcall;
  12178. function GetClassLong(hWnd: HWND; nIndex: Integer): DWORD; stdcall;
  12179. function SetClassLongA(hWnd: HWND; nIndex: Integer; dwNewLong: Longint): DWORD; stdcall;
  12180. function SetClassLongW(hWnd: HWND; nIndex: Integer; dwNewLong: Longint): DWORD; stdcall;
  12181. function SetClassLong(hWnd: HWND; nIndex: Integer; dwNewLong: Longint): DWORD; stdcall;
  12182. function GetDesktopWindow: HWND; stdcall;
  12183. function GetParent(hWnd: HWND): HWND; stdcall;
  12184. function SetParent(hWndChild, hWndNewParent: HWND): HWND; stdcall;
  12185. function EnumChildWindows(hWndParent: HWND; lpEnumFunc: TFNWndEnumProc;
  12186.   lParam: LPARAM): BOOL; stdcall;
  12187. function FindWindowA(lpClassName, lpWindowName: PAnsiChar): HWND; stdcall;
  12188. function FindWindowW(lpClassName, lpWindowName: PWideChar): HWND; stdcall;
  12189. function FindWindow(lpClassName, lpWindowName: PChar): HWND; stdcall;
  12190. function FindWindowExA(Parent, Child: HWND; ClassName, WindowName: PAnsiChar): HWND; stdcall;
  12191. function FindWindowExW(Parent, Child: HWND; ClassName, WindowName: PWideChar): HWND; stdcall;
  12192. function FindWindowEx(Parent, Child: HWND; ClassName, WindowName: PChar): HWND; stdcall;
  12193. function EnumWindows(lpEnumFunc: TFNWndEnumProc; lParam: LPARAM): BOOL; stdcall;
  12194. function EnumThreadWindows(dwThreadId: DWORD; lpfn: TFNWndEnumProc; lParam: LPARAM): BOOL; stdcall;
  12195. function EnumTaskWindows(hTask: THandle; lpfn: FARPROC; lParam: LPARAM): BOOL;
  12196. function GetClassNameA(hWnd: HWND; lpClassName: PAnsiChar; nMaxCount: Integer): Integer; stdcall;
  12197. function GetClassNameW(hWnd: HWND; lpClassName: PWideChar; nMaxCount: Integer): Integer; stdcall;
  12198. function GetClassName(hWnd: HWND; lpClassName: PChar; nMaxCount: Integer): Integer; stdcall;
  12199. function GetTopWindow(hWnd: HWND): HWND; stdcall;
  12200. function GetNextWindow(hWnd: HWND; uCmd: UINT): HWND; stdcall;
  12201. function GetWindowThreadProcessId(hWnd: HWND; lpdwProcessId: Pointer): DWORD; stdcall;
  12202. function GetWindowTask(hWnd: HWND): THandle;
  12203. function GetLastActivePopup(hWnd: HWND): HWND; stdcall;
  12204.  
  12205. const
  12206.   { GetWindow() Constants }
  12207.   GW_HWNDFIRST = 0;
  12208.   GW_HWNDLAST = 1;
  12209.   GW_HWNDNEXT = 2;
  12210.   GW_HWNDPREV = 3;
  12211.   GW_OWNER = 4;
  12212.   GW_CHILD = 5;
  12213.   GW_MAX = 5;
  12214.  
  12215. function GetWindow(hWnd: HWND; uCmd: UINT): HWND; stdcall;
  12216. function SetWindowsHookA(nFilterType: Integer; pfnFilterProc: TFNHookProc): HHOOK; stdcall;
  12217. function SetWindowsHookW(nFilterType: Integer; pfnFilterProc: TFNHookProc): HHOOK; stdcall;
  12218. function SetWindowsHook(nFilterType: Integer; pfnFilterProc: TFNHookProc): HHOOK; stdcall;
  12219. function SetWindowsHookExA(idHook: Integer; lpfn: TFNHookProc; hmod: HINST; dwThreadId: DWORD): HHOOK; stdcall;
  12220. function SetWindowsHookExW(idHook: Integer; lpfn: TFNHookProc; hmod: HINST; dwThreadId: DWORD): HHOOK; stdcall;
  12221. function SetWindowsHookEx(idHook: Integer; lpfn: TFNHookProc; hmod: HINST; dwThreadId: DWORD): HHOOK; stdcall;
  12222. function UnhookWindowsHook(nCode: Integer; pfnFilterProc: TFNHookProc): BOOL; stdcall;
  12223. function UnhookWindowsHookEx(hhk: HHOOK): BOOL; stdcall;
  12224. function CallNextHookEx(hhk: HHOOK; nCode: Integer; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
  12225.  
  12226. { Macros for source-level compatibility with old functions. }
  12227.  
  12228. function DefHookProc(nCode: Integer; wParam: WPARAM; lParam: LPARAM; phhk: FARPROC): LRESULT;
  12229.  
  12230. const
  12231. { Menu flags for AddCheckEnableMenuItem() }
  12232.  
  12233.   MF_INSERT = 0;
  12234.   MF_CHANGE = $80;
  12235.   MF_APPEND = $100;
  12236.   MF_DELETE = $200;
  12237.   MF_REMOVE = $1000;
  12238.  
  12239.   MF_BYCOMMAND = 0;
  12240.   MF_BYPOSITION = $400;
  12241.  
  12242.   MF_SEPARATOR = $800;
  12243.  
  12244.   MF_ENABLED = 0;
  12245.   MF_GRAYED = 1;
  12246.   MF_DISABLED = 2;
  12247.  
  12248.   MF_UNCHECKED = 0;
  12249.   MF_CHECKED = 8;
  12250.   MF_USECHECKBITMAPS = $200;
  12251.  
  12252.   MF_STRING = 0;
  12253.   MF_BITMAP = 4;
  12254.   MF_OWNERDRAW = $100;
  12255.  
  12256.   MF_POPUP = $10;
  12257.   MF_MENUBARBREAK = $20;
  12258.   MF_MENUBREAK = $40;
  12259.  
  12260.   MF_UNHILITE = 0;
  12261.   MF_HILITE = $80;
  12262.  
  12263.   MF_DEFAULT = $1000;
  12264.   MF_SYSMENU = $2000;
  12265.   MF_HELP = $4000;
  12266.   MF_RIGHTJUSTIFY = $4000;
  12267.  
  12268.   MF_MOUSESELECT = $8000;
  12269.   MF_END = $80;            { Obsolete -- only used by old RES files }
  12270.  
  12271.   MFT_STRING = MF_STRING;
  12272.   MFT_BITMAP = MF_BITMAP;
  12273.   MFT_MENUBARBREAK = MF_MENUBARBREAK;
  12274.   MFT_MENUBREAK = MF_MENUBREAK;
  12275.   MFT_OWNERDRAW = MF_OWNERDRAW;
  12276.   MFT_RADIOCHECK = $200;
  12277.   MFT_SEPARATOR = MF_SEPARATOR;
  12278.   MFT_RIGHTORDER = $2000;
  12279.   MFT_RIGHTJUSTIFY = MF_RIGHTJUSTIFY;
  12280.  
  12281.   { Menu flags for AddCheckEnableMenuItem() }
  12282.   MFS_GRAYED = 3;
  12283.   MFS_DISABLED = MFS_GRAYED;
  12284.   MFS_CHECKED = MF_CHECKED;
  12285.   MFS_HILITE = MF_HILITE;
  12286.   MFS_ENABLED = MF_ENABLED;
  12287.   MFS_UNCHECKED = MF_UNCHECKED;
  12288.   MFS_UNHILITE = MF_UNHILITE;
  12289.   MFS_DEFAULT = MF_DEFAULT;
  12290.  
  12291. function CheckMenuRadioItem(hMenu: HMENU; First, Last, Check, Flags: UINT): BOOL; stdcall;
  12292.  
  12293. type
  12294.   { Menu item resource format }
  12295.   PMenuItemTemplateHeader = ^TMenuItemTemplateHeader;
  12296.   TMenuItemTemplateHeader = packed record
  12297.     versionNumber: Word;
  12298.     offset: Word;
  12299.   end;
  12300.  
  12301.   PMenuItemTemplate = ^TMenuItemTemplate;
  12302.   TMenuItemTemplate = packed record {Version 0}
  12303.     mtOption: Word;
  12304.     mtID: Word;
  12305.     mtString: array[0..1] of WCHAR;
  12306.   end;
  12307.  
  12308.  
  12309. const
  12310.   { System Menu Command Values }
  12311.   SC_SIZE = 61440;
  12312.   SC_MOVE = 61456;
  12313.   SC_MINIMIZE = 61472;
  12314.   SC_MAXIMIZE = 61488;
  12315.   SC_NEXTWINDOW = 61504;
  12316.   SC_PREVWINDOW = 61520;
  12317.   SC_CLOSE = 61536;
  12318.   SC_VSCROLL = 61552;
  12319.   SC_HSCROLL = 61568;
  12320.   SC_MOUSEMENU = 61584;
  12321.   SC_KEYMENU = 61696;
  12322.   SC_ARRANGE = 61712;
  12323.   SC_RESTORE = 61728;
  12324.   SC_TASKLIST = 61744;
  12325.   SC_SCREENSAVE = 61760;
  12326.   SC_HOTKEY = 61776;
  12327.   SC_DEFAULT = 61792;
  12328.   SC_MONITORPOWER = 61808;
  12329.   SC_CONTEXTHELP = 61824;
  12330.   SC_SEPARATOR = 61455;
  12331.  
  12332.   { Obsolete names }
  12333.   SC_ICON = SC_MINIMIZE;
  12334.   SC_ZOOM = SC_MAXIMIZE;
  12335.  
  12336. { Resource Loading Routines }
  12337.  
  12338. function LoadBitmapA(hInstance: HINST; lpBitmapName: PAnsiChar): HBITMAP; stdcall;
  12339. function LoadBitmapW(hInstance: HINST; lpBitmapName: PAnsiChar): HBITMAP; stdcall;
  12340. function LoadBitmap(hInstance: HINST; lpBitmapName: PAnsiChar): HBITMAP; stdcall;
  12341. function LoadCursorA(hInstance: HINST; lpCursorName: PAnsiChar): HCURSOR; stdcall;
  12342. function LoadCursorW(hInstance: HINST; lpCursorName: PAnsiChar): HCURSOR; stdcall;
  12343. function LoadCursor(hInstance: HINST; lpCursorName: PAnsiChar): HCURSOR; stdcall;
  12344. function LoadCursorFromFileA(lpFileName: PAnsiChar): HCURSOR; stdcall;
  12345. function LoadCursorFromFileW(lpFileName: PAnsiChar): HCURSOR; stdcall;
  12346. function LoadCursorFromFile(lpFileName: PAnsiChar): HCURSOR; stdcall;
  12347. function CreateCursor(hInst: HINST; xHotSpot, yHotSpot, nWidth, nHeight: Integer;
  12348.   pvANDPlaneter, pvXORPlane: Pointer): HCURSOR; stdcall;
  12349. function DestroyCursor(hCursor: HICON): BOOL; stdcall;
  12350.  
  12351. const
  12352.   { Standard Cursor IDs }
  12353.   IDC_ARROW = MakeIntResource(32512);
  12354.   IDC_IBEAM = MakeIntResource(32513);
  12355.   IDC_WAIT = MakeIntResource(32514);
  12356.   IDC_CROSS = MakeIntResource(32515);
  12357.   IDC_UPARROW = MakeIntResource(32516);
  12358.   IDC_SIZE = MakeIntResource(32640);
  12359.   IDC_ICON = MakeIntResource(32641);
  12360.   IDC_SIZENWSE = MakeIntResource(32642);
  12361.   IDC_SIZENESW = MakeIntResource(32643);
  12362.   IDC_SIZEWE = MakeIntResource(32644);
  12363.   IDC_SIZENS = MakeIntResource(32645);
  12364.   IDC_SIZEALL = MakeIntResource(32646);
  12365.   IDC_NO = MakeIntResource(32648);
  12366.   IDC_APPSTARTING = MakeIntResource(32650);
  12367.   IDC_HELP = MakeIntResource(32651);
  12368.  
  12369. function SetSystemCursor(hcur: HICON; id: DWORD): BOOL; stdcall;
  12370.  
  12371. type
  12372.   PIconInfo = ^TIconInfo;
  12373.   TIconInfo = packed record
  12374.     fIcon: BOOL;
  12375.     xHotspot: DWORD;
  12376.     yHotspot: DWORD;
  12377.     hbmMask: HBITMAP;
  12378.     hbmColor: HBITMAP;
  12379.   end;
  12380.  
  12381. function LoadIconA(hInstance: HINST; lpIconName: PAnsiChar): HICON; stdcall;
  12382. function LoadIconW(hInstance: HINST; lpIconName: PWideChar): HICON; stdcall;
  12383. function LoadIcon(hInstance: HINST; lpIconName: PChar): HICON; stdcall;
  12384. function CreateIcon(hInstance: HINST; nWidth, nHeight: Integer;
  12385.   cPlanes, cBitsPixel: Byte; lpbANDbits, lpbXORbits: Pointer): HICON; stdcall;
  12386. function DestroyIcon(hIcon: HICON): BOOL; stdcall;
  12387. function LookupIconIdFromDirectory(presbits: PByte; fIcon: BOOL): Integer; stdcall;
  12388. function LookupIconIdFromDirectoryEx(presbits: PByte; fIcon: BOOL;
  12389.   cxDesired, cyDesired: Integer; Flags: UINT): Integer; stdcall;
  12390. function CreateIconFromResource(presbits: PByte; dwResSize: DWORD;
  12391.   fIcon: BOOL; dwVer: DWORD): HICON; stdcall;
  12392. function CreateIconFromResourceEx(presbits: PByte; dwResSize: DWORD;
  12393.   fIcon: BOOL; dwVer: DWORD; cxDesired, cyDesired: Integer; Flags: UINT): HICON; stdcall;
  12394.  
  12395.  
  12396. type
  12397.   { IconCursor header }
  12398.   PCursorShape = ^TCursorShape;
  12399.   TCursorShape = packed record
  12400.     xHotSpot: BOOL;
  12401.     yHotSpot: BOOL;
  12402.     cx: BOOL;
  12403.     cy: BOOL;
  12404.     cbWidth: BOOL;
  12405.     Planes: Byte;
  12406.     BitsPixel: Byte;
  12407.   end;
  12408.  
  12409. const
  12410.   IMAGE_BITMAP = 0;
  12411.   IMAGE_ICON = 1;
  12412.   IMAGE_CURSOR = 2;
  12413.   IMAGE_ENHMETAFILE = 3;
  12414.  
  12415.   LR_DEFAULTCOLOR = 0;
  12416.   LR_MONOCHROME = 1;
  12417.   LR_COLOR = 2;
  12418.   LR_COPYRETURNORG = 4;
  12419.   LR_COPYDELETEORG = 8;
  12420.   LR_LOADFROMFILE = $10;
  12421.   LR_LOADTRANSPARENT = $20;
  12422.   LR_DEFAULTSIZE = $40;
  12423.   LR_LOADREALSIZE = $80;
  12424.   LR_LOADMAP3DCOLORS = $1000;
  12425.   LR_CREATEDIBSECTION = $2000;
  12426.  
  12427. function LoadImageA(hInst: HINST; ImageName: PAnsiChar; ImageType: UINT; X, Y: Integer; Flags: UINT): THandle; stdcall;
  12428. function LoadImageW(hInst: HINST; ImageName: PWideChar; ImageType: UINT; X, Y: Integer; Flags: UINT): THandle; stdcall;
  12429. function LoadImage(hInst: HINST; ImageName: PChar; ImageType: UINT; X, Y: Integer; Flags: UINT): THandle; stdcall;
  12430. function CopyImage(hImage: THandle; ImageType: UINT; X, Y: Integer; Flags: UINT): THandle; stdcall;
  12431.  
  12432. const
  12433.   DI_MASK = 1;
  12434.   DI_IMAGE = 2;
  12435.   DI_NORMAL = 3;
  12436.   DI_COMPAT = 4;
  12437.   DI_DEFAULTSIZE = 8;
  12438.  
  12439. function DrawIconEx(hdc: HDC; xLeft, yTop: Integer; hIcon: HICON;
  12440.   cxWidth, cyWidth: Integer; istepIfAniCur: UINT;
  12441.   hbrFlickerFreeDraw: HBRUSH; diFlags: UINT): BOOL; stdcall;
  12442. function CreateIconIndirect(var piconinfo: TIconInfo): HICON; stdcall;
  12443. function CopyIcon(hIcon: HICON): HICON; stdcall;
  12444. function GetIconInfo(hIcon: HICON; var piconinfo: TIconInfo): BOOL; stdcall;
  12445.  
  12446. const
  12447.   RES_ICON = 1;
  12448.   RES_CURSOR = 2;
  12449.  
  12450.   { The ordinal number for the entry point of language drivers.
  12451.   ORD_LANGDRIVER = 1;
  12452.  
  12453.   { Standard Icon IDs }
  12454.   IDI_APPLICATION = MakeIntResource(32512);
  12455.   IDI_HAND = MakeIntResource(32513);
  12456.   IDI_QUESTION = MakeIntResource(32514);
  12457.   IDI_EXCLAMATION = MakeIntResource(32515);
  12458.   IDI_ASTERISK = MakeIntResource(32516);
  12459.   IDI_WINLOGO = MakeIntResource(32517);
  12460.   IDI_WARNING = IDI_EXCLAMATION;
  12461.   IDI_ERROR = IDI_HAND;
  12462.   IDI_INFORMATION = IDI_ASTERISK;
  12463.  
  12464. function LoadStringA(hInstance: HINST; uID: UINT; lpBuffer: PAnsiChar; nBufferMax: Integer): Integer; stdcall;
  12465. function LoadStringW(hInstance: HINST; uID: UINT; lpBuffer: PWideChar; nBufferMax: Integer): Integer; stdcall;
  12466. function LoadString(hInstance: HINST; uID: UINT; lpBuffer: PChar; nBufferMax: Integer): Integer; stdcall;
  12467.  
  12468. const
  12469.   { Dialog Box Command IDs }
  12470.   IDOK = 1;          ID_OK = IDOK;
  12471.   IDCANCEL = 2;      ID_CANCEL = IDCANCEL;
  12472.   IDABORT = 3;       ID_ABORT = IDABORT;
  12473.   IDRETRY = 4;       ID_RETRY = IDRETRY;
  12474.   IDIGNORE = 5;      ID_IGNORE = IDIGNORE;
  12475.   IDYES = 6;         ID_YES = IDYES;
  12476.   IDNO = 7;          ID_NO = IDNO;
  12477.   IDCLOSE = 8;       ID_CLOSE = IDCLOSE;
  12478.   IDHELP = 9;        ID_HELP = IDHELP;
  12479.  
  12480.  
  12481. { Control Manager Structures and Definitions }
  12482.  
  12483.   { Edit Control Styles }
  12484.   ES_LEFT = 0;
  12485.   ES_CENTER = 1;
  12486.   ES_RIGHT = 2;
  12487.   ES_MULTILINE = 4;
  12488.   ES_UPPERCASE = 8;
  12489.   ES_LOWERCASE = $10;
  12490.   ES_PASSWORD = $20;
  12491.   ES_AUTOVSCROLL = $40;
  12492.   ES_AUTOHSCROLL = $80;
  12493.   ES_NOHIDESEL = $100;
  12494.   ES_OEMCONVERT = $400;
  12495.   ES_READONLY = $800;
  12496.   ES_WANTRETURN = $1000;
  12497.   ES_NUMBER = $2000;
  12498.  
  12499.   { Edit control EM_SETMARGIN parameters }
  12500.   EC_LEFTMARGIN = 1;
  12501.   EC_RIGHTMARGIN = 2;
  12502.   EC_USEFONTINFO = 65535;
  12503.  
  12504.   { TFNEditWordBreakProc code values }
  12505.   WB_LEFT = 0;
  12506.   WB_RIGHT = 1;
  12507.   WB_ISDELIMITER = 2;
  12508.  
  12509.   { Button Control Styles }
  12510.   BS_PUSHBUTTON = 0;
  12511.   BS_DEFPUSHBUTTON = 1;
  12512.   BS_CHECKBOX = 2;
  12513.   BS_AUTOCHECKBOX = 3;
  12514.   BS_RADIOBUTTON = 4;
  12515.   BS_3STATE = 5;
  12516.   BS_AUTO3STATE = 6;
  12517.   BS_GROUPBOX = 7;
  12518.   BS_USERBUTTON = 8;
  12519.   BS_AUTORADIOBUTTON = 9;
  12520.   BS_OWNERDRAW = 11;
  12521.   BS_LEFTTEXT = $20;
  12522.   BS_TEXT = 0;
  12523.   BS_ICON = $40;
  12524.   BS_BITMAP = $80;
  12525.   BS_LEFT = $100;
  12526.   BS_RIGHT = $200;
  12527.   BS_CENTER = 768;
  12528.   BS_TOP = $400;
  12529.   BS_BOTTOM = $800;
  12530.   BS_VCENTER = 3072;
  12531.   BS_PUSHLIKE = $1000;
  12532.   BS_MULTILINE = $2000;
  12533.   BS_NOTIFY = $4000;
  12534.   BS_FLAT = $8000;
  12535.   BS_RIGHTBUTTON = BS_LEFTTEXT;
  12536.  
  12537.   BST_UNCHECKED = 0;
  12538.   BST_CHECKED = 1;
  12539.   BST_INDETERMINATE = 2;
  12540.   BST_PUSHED = 4;
  12541.   BST_FOCUS = 8;
  12542.  
  12543.   { Static Control Constants }
  12544.   SS_LEFT = 0;
  12545.   SS_CENTER = 1;
  12546.   SS_RIGHT = 2;
  12547.   SS_ICON = 3;
  12548.   SS_BLACKRECT = 4;
  12549.   SS_GRAYRECT = 5;
  12550.   SS_WHITERECT = 6;
  12551.   SS_BLACKFRAME = 7;
  12552.   SS_GRAYFRAME = 8;
  12553.   SS_WHITEFRAME = 9;
  12554.   SS_USERITEM = 10;
  12555.   SS_SIMPLE = 11;
  12556.   SS_LEFTNOWORDWRAP = 12;
  12557.   SS_BITMAP = 14;
  12558.   SS_OWNERDRAW = 13;
  12559.   SS_ENHMETAFILE = 15;
  12560.   SS_ETCHEDHORZ = $10;
  12561.   SS_ETCHEDVERT = 17;
  12562.   SS_ETCHEDFRAME = 18;
  12563.   SS_TYPEMASK = 31;
  12564.   SS_NOPREFIX = $80;      { Don't do "&" character translation }
  12565.   SS_NOTIFY = $100;
  12566.   SS_CENTERIMAGE = $200;
  12567.   SS_RIGHTJUST = $400;
  12568.   SS_REALSIZEIMAGE = $800;
  12569.   SS_SUNKEN = $1000;
  12570.  
  12571.   { Static Control Mesages }
  12572.   STM_SETICON = 368;
  12573.   STM_GETICON = 369;
  12574.   STM_SETIMAGE = 370;
  12575.   STM_GETIMAGE = 371;
  12576.   STN_CLICKED = 0;
  12577.   STN_DBLCLK = 1;
  12578.   STN_ENABLE = 2;
  12579.   STN_DISABLE = 3;
  12580.   STM_MSGMAX = 372;
  12581.  
  12582.   { Dialog window class }
  12583.   WC_DIALOG = MakeIntAtom($8002);
  12584.  
  12585.   { GetSetWindowWordLong offsets for use with WC_DIALOG windows }
  12586.   DWL_MSGRESULT = 0;
  12587.   DWL_DLGPROC = 4;
  12588.   DWL_USER = 8;
  12589.  
  12590. { Dialog Manager Routines }
  12591.  
  12592. function IsDialogMessageA(hDlg: HWND; var lpMsg: TMsg): BOOL; stdcall;
  12593. function IsDialogMessageW(hDlg: HWND; var lpMsg: TMsg): BOOL; stdcall;
  12594. function IsDialogMessage(hDlg: HWND; var lpMsg: TMsg): BOOL; stdcall;
  12595. function MapDialogRect(hDlg: HWND; var lpRect: TRect): BOOL; stdcall;
  12596. function DlgDirListA(hDlg: HWND; lpPathSpec: PAnsiChar;
  12597.   nIDListBox, nIDStaticPath: Integer; uFileType: UINT): Integer; stdcall;
  12598. function DlgDirListW(hDlg: HWND; lpPathSpec: PWideChar;
  12599.   nIDListBox, nIDStaticPath: Integer; uFileType: UINT): Integer; stdcall;
  12600. function DlgDirList(hDlg: HWND; lpPathSpec: PChar;
  12601.   nIDListBox, nIDStaticPath: Integer; uFileType: UINT): Integer; stdcall;
  12602.  
  12603. const
  12604.   { DlgDirList, DlgDirListComboBox flags values }
  12605.   DDL_READWRITE = 0;
  12606.   DDL_READONLY = 1;
  12607.   DDL_HIDDEN = 2;
  12608.   DDL_SYSTEM = 4;
  12609.   DDL_DIRECTORY = $10;
  12610.   DDL_ARCHIVE = $20;
  12611.  
  12612.   DDL_POSTMSGS = $2000;
  12613.   DDL_DRIVES = $4000;
  12614.   DDL_EXCLUSIVE = $8000;
  12615.  
  12616. function DlgDirSelectExA(hDlg: HWND; lpString: PAnsiChar; nCount, nIDListBox: Integer): BOOL; stdcall;
  12617. function DlgDirSelectExW(hDlg: HWND; lpString: PWideChar; nCount, nIDListBox: Integer): BOOL; stdcall;
  12618. function DlgDirSelectEx(hDlg: HWND; lpString: PChar; nCount, nIDListBox: Integer): BOOL; stdcall;
  12619. function DlgDirListComboBoxA(hDlg: HWND; lpPathSpec: PAnsiChar;
  12620.   nIDComboBox, nIDStaticPath: Integer; uFiletype: UINT): Integer; stdcall;
  12621. function DlgDirListComboBoxW(hDlg: HWND; lpPathSpec: PWideChar;
  12622.   nIDComboBox, nIDStaticPath: Integer; uFiletype: UINT): Integer; stdcall;
  12623. function DlgDirListComboBox(hDlg: HWND; lpPathSpec: PChar;
  12624.   nIDComboBox, nIDStaticPath: Integer; uFiletype: UINT): Integer; stdcall;
  12625. function DlgDirSelectComboBoxExA(hDlg: HWND; lpString: PAnsiChar;
  12626.   nCount, nIDComboBox: Integer): BOOL; stdcall;
  12627. function DlgDirSelectComboBoxExW(hDlg: HWND; lpString: PWideChar;
  12628.   nCount, nIDComboBox: Integer): BOOL; stdcall;
  12629. function DlgDirSelectComboBoxEx(hDlg: HWND; lpString: PChar;
  12630.   nCount, nIDComboBox: Integer): BOOL; stdcall;
  12631.  
  12632. const
  12633.   { Dialog Styles }
  12634.   DS_ABSALIGN = 1;
  12635.   DS_SYSMODAL = 2;
  12636.   DS_LOCALEDIT = $20;         { Edit items get Local storage. }
  12637.   DS_SETFONT = $40;           { User specified font for Dlg controls }
  12638.   DS_MODALFRAME = $80;        { Can be combined with WS_CAPTION  }
  12639.   DS_NOIDLEMSG = $100;        { WM_ENTERIDLE message will not be sent }
  12640.   DS_SETFOREGROUND = $200;    { not in win3.1 }
  12641.  
  12642.   DS_3DLOOK = 4;
  12643.   DS_FIXEDSYS = 8;
  12644.   DS_NOFAILCREATE = $10;
  12645.   DS_CONTROL = $400;
  12646.   DS_CENTER = $800;
  12647.   DS_CENTERMOUSE = $1000;
  12648.   DS_CONTEXTHELP = $2000;
  12649.  
  12650.   PSI_SETACTIVE = 1;
  12651.   PSI_KILLACTIVE = 2;
  12652.   PSI_APPLY = 3;
  12653.   PSI_RESET = 4;
  12654.   PSI_HASHELP = 5;
  12655.   PSI_HELP = 6;
  12656.  
  12657.   PSI_CHANGED = 1;
  12658.   PSI_GUISTART = 2;
  12659.   PSI_REBOOT = 3;
  12660.   PSI_GETSIBLINGS = 4;
  12661.  
  12662.   { Returned in HiWord() of DM_GETDEFID result if msg is supported }
  12663.   DC_HASDEFID = 21323;
  12664.  
  12665.   { Dialog Codes }
  12666.   DLGC_WANTARROWS = 1;         { Control wants arrow keys         }
  12667.   DLGC_WANTTAB = 2;            { Control wants tab keys           }
  12668.   DLGC_WANTALLKEYS = 4;        { Control wants all keys           }
  12669.   DLGC_WANTMESSAGE = 4;        { Pass message to control          }
  12670.   DLGC_HASSETSEL = 8;          { Understands EM_SETSEL message    }
  12671.   DLGC_DEFPUSHBUTTON = $10;    { Default pushbutton               }
  12672.   DLGC_UNDEFPUSHBUTTON = $20;  { Non-default pushbutton           }
  12673.   DLGC_RADIOBUTTON = $40;      { Radio button                     }
  12674.   DLGC_WANTCHARS = $80;        { Want WM_CHAR messages            }
  12675.   DLGC_STATIC = $100;          { Static item: don't include       }
  12676.   DLGC_BUTTON = $2000;         { Button item: can be checked      }
  12677.   LB_CTLCODE = 0;
  12678.  
  12679.   { Listbox Return Values }
  12680.   LB_OKAY = 0;
  12681.   LB_ERR = -1;
  12682.   LB_ERRSPACE = -2;
  12683.  
  12684.   { Listbox Styles }
  12685.   LBS_NOTIFY = 1;
  12686.   LBS_SORT = 2;
  12687.   LBS_NOREDRAW = 4;
  12688.   LBS_MULTIPLESEL = 8;
  12689.   LBS_OWNERDRAWFIXED = $10;
  12690.   LBS_OWNERDRAWVARIABLE = $20;
  12691.   LBS_HASSTRINGS = $40;
  12692.   LBS_USETABSTOPS = $80;
  12693.   LBS_NOINTEGRALHEIGHT = $100;
  12694.   LBS_MULTICOLUMN = $200;
  12695.   LBS_WANTKEYBOARDINPUT = $400;
  12696.   LBS_EXTENDEDSEL = $800;
  12697.   LBS_DISABLENOSCROLL = $1000;
  12698.   LBS_NODATA = $2000;
  12699.   LBS_NOSEL = $4000;
  12700.   LBS_STANDARD = (LBS_NOTIFY or LBS_SORT or WS_VSCROLL or WS_BORDER);
  12701.  
  12702.   { Combo Box return Values }
  12703.   CB_OKAY = 0;
  12704.   CB_ERR = -1;
  12705.   CB_ERRSPACE = -2;
  12706.  
  12707.   { Combo Box styles }
  12708.   CBS_SIMPLE = 1;
  12709.   CBS_DROPDOWN = 2;
  12710.   CBS_DROPDOWNLIST = 3;
  12711.   CBS_OWNERDRAWFIXED = $10;
  12712.   CBS_OWNERDRAWVARIABLE = $20;
  12713.   CBS_AUTOHSCROLL = $40;
  12714.   CBS_OEMCONVERT = $80;
  12715.   CBS_SORT = $100;
  12716.   CBS_HASSTRINGS = $200;
  12717.   CBS_NOINTEGRALHEIGHT = $400;
  12718.   CBS_DISABLENOSCROLL = $800;
  12719.   CBS_UPPERCASE = $2000;
  12720.   CBS_LOWERCASE = $4000;
  12721.  
  12722.   { Scroll Bar Styles }
  12723.   SBS_HORZ = 0;
  12724.   SBS_VERT = 1;
  12725.   SBS_TOPALIGN = 2;
  12726.   SBS_LEFTALIGN = 2;
  12727.   SBS_BOTTOMALIGN = 4;
  12728.   SBS_RIGHTALIGN = 4;
  12729.   SBS_SIZEBOXTOPLEFTALIGN = 2;
  12730.   SBS_SIZEBOXBOTTOMRIGHTALIGN = 4;
  12731.   SBS_SIZEBOX = 8;
  12732.   SBS_SIZEGRIP = $10;
  12733.  
  12734.   SIF_RANGE = 1;
  12735.   SIF_PAGE = 2;
  12736.   SIF_POS = 4;
  12737.   SIF_DISABLENOSCROLL = 8;
  12738.   SIF_TRACKPOS = $10;
  12739.   SIF_ALL = (SIF_RANGE or SIF_PAGE or SIF_POS or SIF_TRACKPOS);
  12740.  
  12741. type
  12742.   TScrollInfo = packed record
  12743.     cbSize: UINT;
  12744.     fMask: UINT;
  12745.     nMin: Integer;
  12746.     nMax: Integer;
  12747.     nPage: UINT;
  12748.     nPos: Integer;
  12749.     nTrackPos: Integer;
  12750.   end;
  12751.  
  12752. function SetScrollInfo(hWnd: HWND; BarFlag: Integer; const ScrollInfo: TScrollInfo; Redraw: BOOL): Integer; stdcall;
  12753. function GetScrollInfo(hWnd: HWND; BarFlag: Integer; var ScrollInfo: TScrollInfo): BOOL; stdcall;
  12754.  
  12755.  
  12756. const
  12757.   { MDI client style bits }
  12758.   MDIS_ALLCHILDSTYLES = 1;
  12759.  
  12760.   { wParam Flags for WM_MDITILE and WM_MDICASCADE messages. }
  12761.   MDITILE_VERTICAL = 0;       { not in win3.1  }
  12762.   MDITILE_HORIZONTAL = 1;     { not in win3.1  }
  12763.   MDITILE_SKIPDISABLED = 2;   { not in win3.1  }
  12764.  
  12765. type
  12766.   PMDICreateStructA = ^TMDICreateStructA;
  12767.   PMDICreateStructW = ^TMDICreateStructW;
  12768.   PMDICreateStruct = PMDICreateStructA;
  12769.   TMDICreateStructA = packed record
  12770.     szClass: PAnsiChar;
  12771.     szTitle: PAnsiChar;
  12772.     hOwner: THandle;
  12773.     x: Integer;
  12774.     y: Integer;
  12775.     cx: Integer;
  12776.     cy: Integer;
  12777.     style: DWORD;
  12778.     lParam: LPARAM;  { app-defined stuff }
  12779.   end;
  12780.   TMDICreateStructW = packed record
  12781.     szClass: PWideChar;
  12782.     szTitle: PWideChar;
  12783.     hOwner: THandle;
  12784.     x: Integer;
  12785.     y: Integer;
  12786.     cx: Integer;
  12787.     cy: Integer;
  12788.     style: DWORD;
  12789.     lParam: LPARAM;  { app-defined stuff }
  12790.   end;
  12791.   TMDICreateStruct = TMDICreateStructA;
  12792.  
  12793.   PClientCreateStruct = ^TClientCreateStruct;
  12794.   TClientCreateStruct = packed record
  12795.     hWindowMenu: THandle;
  12796.     idFirstChild: UINT;
  12797.   end;
  12798.  
  12799. function DefFrameProcA(hWnd, hWndMDIClient: HWND; uMsg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
  12800. function DefFrameProcW(hWnd, hWndMDIClient: HWND; uMsg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
  12801. function DefFrameProc(hWnd, hWndMDIClient: HWND; uMsg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
  12802. function DefMDIChildProcA(hWnd: HWND; uMsg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
  12803. function DefMDIChildProcW(hWnd: HWND; uMsg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
  12804. function DefMDIChildProc(hWnd: HWND; uMsg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
  12805. function TranslateMDISysAccel(hWndClient: HWND; const lpMsg: TMsg): BOOL; stdcall;
  12806. function ArrangeIconicWindows(hWnd: HWND): UINT; stdcall;
  12807. function CreateMDIWindowA(lpClassName, lpWindowName: PAnsiChar;
  12808.   dwStyle: DWORD; X, Y, nWidth, nHeight: Integer;
  12809.   hWndParent: HWND; hInstance: HINST; lParam: LPARAM): HWND; stdcall;
  12810. function CreateMDIWindowW(lpClassName, lpWindowName: PWideChar;
  12811.   dwStyle: DWORD; X, Y, nWidth, nHeight: Integer;
  12812.   hWndParent: HWND; hInstance: HINST; lParam: LPARAM): HWND; stdcall;
  12813. function CreateMDIWindow(lpClassName, lpWindowName: PChar;
  12814.   dwStyle: DWORD; X, Y, nWidth, nHeight: Integer;
  12815.   hWndParent: HWND; hInstance: HINST; lParam: LPARAM): HWND; stdcall;
  12816. function TileWindows(hwndParent: HWND; wHow: UINT; lpRect: PRect; cKids: UINT; lpKids: Pointer): Word; stdcall;
  12817. function CascadeWindows(hwndParent: HWND; wHow: UINT; lpRect: PRect; cKids: UINT; lpKids: Pointer): Word; stdcall;
  12818.  
  12819.  
  12820. { IME class support }
  12821.  
  12822. const
  12823.   { wParam for WM_IME_CONTROL }
  12824.   IMC_GETCANDIDATEPOS = 7;
  12825.   IMC_SETCANDIDATEPOS = 8;
  12826.   IMC_GETCOMPOSITIONFONT = 9;
  12827.   IMC_SETCOMPOSITIONFONT = $0A;
  12828.   IMC_GETCOMPOSITIONWINDOW = $0B;
  12829.   IMC_SETCOMPOSITIONWINDOW = $0C;
  12830.   IMC_GETSTATUSWINDOWPOS = $0F;
  12831.   IMC_SETSTATUSWINDOWPOS = $10;
  12832.   IMC_CLOSESTATUSWINDOW = $21;
  12833.   IMC_OPENSTATUSWINDOW = $22;
  12834.  
  12835.   { wParam of report message WM_IME_NOTIFY}
  12836.   IMN_CLOSESTATUSWINDOW = 1;
  12837.   IMN_OPENSTATUSWINDOW = 2;
  12838.   IMN_CHANGECANDIDATE = 3;
  12839.   IMN_CLOSECANDIDATE = 4;
  12840.   IMN_OPENCANDIDATE = 5;
  12841.   IMN_SETCONVERSIONMODE = 6;
  12842.   IMN_SETSENTENCEMODE = 7;
  12843.   IMN_SETOPENSTATUS = 8;
  12844.   IMN_SETCANDIDATEPOS = 9;
  12845.   IMN_SETCOMPOSITIONFONT = 10;
  12846.   IMN_SETCOMPOSITIONWINDOW = 11;
  12847.   IMN_SETSTATUSWINDOWPOS = 12;
  12848.   IMN_GUIDELINE = 13;
  12849.   IMN_PRIVATE = 14;
  12850.  
  12851. { Help support }
  12852.  
  12853. type
  12854.   HELPPOLY = DWORD;
  12855.   PMultiKeyHelpA = ^TMultiKeyHelpA;
  12856.   PMultiKeyHelpW = ^TMultiKeyHelpW;
  12857.   PMultiKeyHelp = PMultiKeyHelpA;
  12858.   TMultiKeyHelpA = packed record
  12859.     mkSize: DWORD;
  12860.     mkKeylist: AnsiChar;
  12861.     szKeyphrase: array[0..1] of AnsiChar;
  12862.   end;
  12863.   TMultiKeyHelpW = packed record
  12864.     mkSize: DWORD;
  12865.     mkKeylist: WideChar;
  12866.     szKeyphrase: array[0..1] of WideChar;
  12867.   end;
  12868.   TMultiKeyHelp = TMultiKeyHelpA;
  12869.  
  12870.   PHelpWinInfoA = ^THelpWinInfoA;
  12871.   PHelpWinInfoW = ^THelpWinInfoW;
  12872.   PHelpWinInfo = PHelpWinInfoA;
  12873.   THelpWinInfoA = packed record
  12874.     wStructSize: BOOL;
  12875.     x: BOOL;
  12876.     y: BOOL;
  12877.     dx: BOOL;
  12878.     dy: BOOL;
  12879.     wMax: BOOL;
  12880.     rgchMember: array[0..2] of AnsiChar;
  12881.   end;
  12882.   THelpWinInfoW = packed record
  12883.     wStructSize: BOOL;
  12884.     x: BOOL;
  12885.     y: BOOL;
  12886.     dx: BOOL;
  12887.     dy: BOOL;
  12888.     wMax: BOOL;
  12889.     rgchMember: array[0..2] of WideChar;
  12890.   end;
  12891.   THelpWinInfo = THelpWinInfoA;
  12892.  
  12893. const
  12894.   { Commands to pass to WinHelp() }
  12895.   HELP_CONTEXT = 1;       { Display topic in ulTopic  }
  12896.   HELP_QUIT = 2;          { Terminate help  }
  12897.   HELP_INDEX = 3;         { Display index  }
  12898.   HELP_CONTENTS = 3;
  12899.   HELP_HELPONHELP = 4;    { Display help on using help  }
  12900.   HELP_SETINDEX = 5;      { Set current Index for multi index help  }
  12901.   HELP_SETCONTENTS = 5;
  12902.   HELP_CONTEXTPOPUP = 8;
  12903.   HELP_FORCEFILE = 9;
  12904.   HELP_KEY = 257;         { Display topic for keyword in offabData  }
  12905.   HELP_COMMAND = 258;
  12906.   HELP_PARTIALKEY = 261;
  12907.   HELP_MULTIKEY = 513;
  12908.   HELP_SETWINPOS = 515;
  12909.   HELP_CONTEXTMENU = 10;
  12910.   HELP_FINDER = 11;
  12911.   HELP_WM_HELP = 12;
  12912.   HELP_SETPOPUP_POS = 13;
  12913.  
  12914.   HELP_TCARD = $8000;
  12915.   HELP_TCARD_DATA = $10;
  12916.   HELP_TCARD_OTHER_CALLER = 17;
  12917.  
  12918.   { These are in winhelp.h in Win95. }
  12919.   IDH_NO_HELP = 28440;
  12920.   IDH_MISSING_CONTEXT = 28441;      { Control doesn't have matching help context }
  12921.   IDH_GENERIC_HELP_BUTTON = 28442;  { Property sheet help button }
  12922.   IDH_OK = 28443;
  12923.   IDH_CANCEL = 28444;
  12924.   IDH_HELP = 28445;
  12925.  
  12926. function WinHelpA(hWndMain: HWND; lpszHelp: PAnsiChar; uCommand: UINT; dwData: DWORD): BOOL; stdcall;
  12927. function WinHelpW(hWndMain: HWND; lpszHelp: PWideChar; uCommand: UINT; dwData: DWORD): BOOL; stdcall;
  12928. function WinHelp(hWndMain: HWND; lpszHelp: PChar; uCommand: UINT; dwData: DWORD): BOOL; stdcall;
  12929.  
  12930. const
  12931.   { Parameter for SystemParametersInfo() }
  12932.   SPI_GETBEEP = 1;
  12933.   SPI_SETBEEP = 2;
  12934.   SPI_GETMOUSE = 3;
  12935.   SPI_SETMOUSE = 4;
  12936.   SPI_GETBORDER = 5;
  12937.   SPI_SETBORDER = 6;
  12938.   SPI_GETKEYBOARDSPEED = 10;
  12939.   SPI_SETKEYBOARDSPEED = 11;
  12940.   SPI_LANGDRIVER = 12;
  12941.   SPI_ICONHORIZONTALSPACING = 13;
  12942.   SPI_GETSCREENSAVETIMEOUT = 14;
  12943.   SPI_SETSCREENSAVETIMEOUT = 15;
  12944.   SPI_GETSCREENSAVEACTIVE = $10;
  12945.   SPI_SETSCREENSAVEACTIVE = 17;
  12946.   SPI_GETGRIDGRANULARITY = 18;
  12947.   SPI_SETGRIDGRANULARITY = 19;
  12948.   SPI_SETDESKWALLPAPER = 20;
  12949.   SPI_SETDESKPATTERN = 21;
  12950.   SPI_GETKEYBOARDDELAY = 22;
  12951.   SPI_SETKEYBOARDDELAY = 23;
  12952.   SPI_ICONVERTICALSPACING = 24;
  12953.   SPI_GETICONTITLEWRAP = 25;
  12954.   SPI_SETICONTITLEWRAP = 26;
  12955.   SPI_GETMENUDROPALIGNMENT = 27;
  12956.   SPI_SETMENUDROPALIGNMENT = 28;
  12957.   SPI_SETDOUBLECLKWIDTH = 29;
  12958.   SPI_SETDOUBLECLKHEIGHT = 30;
  12959.   SPI_GETICONTITLELOGFONT = 31;
  12960.   SPI_SETDOUBLECLICKTIME = $20;
  12961.   SPI_SETMOUSEBUTTONSWAP = 33;
  12962.   SPI_SETICONTITLELOGFONT = 34;
  12963.   SPI_GETFASTTASKSWITCH = 35;
  12964.   SPI_SETFASTTASKSWITCH = 36;
  12965.   SPI_SETDRAGFULLWINDOWS = 37;
  12966.   SPI_GETDRAGFULLWINDOWS = 38;
  12967.   SPI_GETNONCLIENTMETRICS = 41;
  12968.   SPI_SETNONCLIENTMETRICS = 42;
  12969.   SPI_GETMINIMIZEDMETRICS = 43;
  12970.   SPI_SETMINIMIZEDMETRICS = 44;
  12971.   SPI_GETICONMETRICS = 45;
  12972.   SPI_SETICONMETRICS = 46;
  12973.   SPI_SETWORKAREA = 47;
  12974.   SPI_GETWORKAREA = 48;
  12975.   SPI_SETPENWINDOWS = 49;
  12976.  
  12977.   SPI_GETHIGHCONTRAST = 66;
  12978.   SPI_SETHIGHCONTRAST = 67;
  12979.   SPI_GETKEYBOARDPREF = 68;
  12980.   SPI_SETKEYBOARDPREF = 69;
  12981.   SPI_GETSCREENREADER = 70;
  12982.   SPI_SETSCREENREADER = 71;
  12983.   SPI_GETANIMATION = 72;
  12984.   SPI_SETANIMATION = 73;
  12985.   SPI_GETFONTSMOOTHING = 74;
  12986.   SPI_SETFONTSMOOTHING = 75;
  12987.   SPI_SETDRAGWIDTH = 76;
  12988.   SPI_SETDRAGHEIGHT = 77;
  12989.   SPI_SETHANDHELD = 78;
  12990.   SPI_GETLOWPOWERTIMEOUT = 79;
  12991.   SPI_GETPOWEROFFTIMEOUT = 80;
  12992.   SPI_SETLOWPOWERTIMEOUT = 81;
  12993.   SPI_SETPOWEROFFTIMEOUT = 82;
  12994.   SPI_GETLOWPOWERACTIVE = 83;
  12995.   SPI_GETPOWEROFFACTIVE = 84;
  12996.   SPI_SETLOWPOWERACTIVE = 85;
  12997.   SPI_SETPOWEROFFACTIVE = 86;
  12998.   SPI_SETCURSORS = 87;
  12999.   SPI_SETICONS = 88;
  13000.   SPI_GETDEFAULTINPUTLANG = 89;
  13001.   SPI_SETDEFAULTINPUTLANG = 90;
  13002.   SPI_SETLANGTOGGLE = 91;
  13003.   SPI_GETWINDOWSEXTENSION = 92;
  13004.   SPI_SETMOUSETRAILS = 93;
  13005.   SPI_GETMOUSETRAILS = 94;
  13006.   SPI_SCREENSAVERRUNNING = 97;
  13007.   SPI_GETFILTERKEYS = 50;
  13008.   SPI_SETFILTERKEYS = 51;
  13009.   SPI_GETTOGGLEKEYS = 52;
  13010.   SPI_SETTOGGLEKEYS = 53;
  13011.   SPI_GETMOUSEKEYS = 54;
  13012.   SPI_SETMOUSEKEYS = 55;
  13013.   SPI_GETSHOWSOUNDS = 56;
  13014.   SPI_SETSHOWSOUNDS = 57;
  13015.   SPI_GETSTICKYKEYS = 58;
  13016.   SPI_SETSTICKYKEYS = 59;
  13017.   SPI_GETACCESSTIMEOUT = 60;
  13018.   SPI_SETACCESSTIMEOUT = 61;
  13019.   SPI_GETSERIALKEYS = 62;
  13020.   SPI_SETSERIALKEYS = 63;
  13021.   SPI_GETSOUNDSENTRY = $40;
  13022.   SPI_SETSOUNDSENTRY = 65;
  13023.  
  13024.   { Flags }
  13025.   SPIF_UPDATEINIFILE = 1;
  13026.   SPIF_SENDWININICHANGE = 2;
  13027.   SPIF_SENDCHANGE = SPIF_SENDWININICHANGE;
  13028.  
  13029.   METRICS_USEDEFAULT = -1;
  13030.  
  13031. type
  13032.   PNonClientMetrics = ^TNonClientMetrics;
  13033.   TNonClientMetrics = packed record
  13034.     cbSize: UINT;
  13035.     iBorderWidth: BOOL;
  13036.     iScrollWidth: BOOL;
  13037.     iScrollHeight: BOOL;
  13038.     iCaptionWidth: BOOL;
  13039.     iCaptionHeight: BOOL;
  13040.     lfCaptionFont: TLogFont;
  13041.     iSmCaptionWidth: BOOL;
  13042.     iSmCaptionHeight: BOOL;
  13043.     lfSmCaptionFont: TLogFont;
  13044.     iMenuWidth: BOOL;
  13045.     iMenuHeight: BOOL;
  13046.     lfMenuFont: TLogFont;
  13047.     lfStatusFont: TLogFont;
  13048.     lfMessageFont: TLogFont;
  13049.   end;
  13050.  
  13051. const
  13052.   ARW_BOTTOMLEFT = 0;
  13053.   ARW_BOTTOMRIGHT = 1;
  13054.   ARW_TOPLEFT = 2;
  13055.   ARW_TOPRIGHT = 3;
  13056.   ARW_STARTMASK = 3;
  13057.   ARW_STARTRIGHT = 1;
  13058.   ARW_STARTTOP = 2;
  13059.  
  13060.   ARW_LEFT = 0;
  13061.   ARW_RIGHT = 0;
  13062.   ARW_UP = 4;
  13063.   ARW_DOWN = 4;
  13064.   ARW_HIDE = 8;
  13065.   ARW_VALID = 15;
  13066.  
  13067. type
  13068.   PMinimizedMetrics = ^TMinimizedMetrics;
  13069.   TMinimizedMetrics = packed record
  13070.     cbSize: UINT;
  13071.     iWidth: BOOL;
  13072.     iHorzGap: BOOL;
  13073.     iVertGap: BOOL;
  13074.     iArrange: BOOL;
  13075.   end;
  13076.  
  13077.   PIconMetrics = ^TIconMetrics;
  13078.   TIconMetrics = packed record
  13079.     cbSize: UINT;
  13080.     iHorzSpacing: BOOL;
  13081.     iVertSpacing: BOOL;
  13082.     iTitleWrap: BOOL;
  13083.     lfFont: TLogFont;
  13084.   end;
  13085.  
  13086.   PAnimationInfo = ^TAnimationInfo;
  13087.   TAnimationInfo = packed record
  13088.     cbSize: UINT;
  13089.     iMinAnimate: BOOL;
  13090.   end;
  13091.  
  13092.  
  13093. type
  13094.   PSerialKeysA = ^TSerialKeysA;
  13095.   PSerialKeysW = ^TSerialKeysW;
  13096.   PSerialKeys = PSerialKeysA;
  13097.   TSerialKeysA = packed record
  13098.     cbSize: UINT;
  13099.     dwFlags: DWORD;
  13100.     lpszActivePort: PAnsiChar;
  13101.     lpszPort: PAnsiChar;
  13102.     iBaudRate: UINT;
  13103.     iPortState: UINT;
  13104.     iActive: UINT;
  13105.   end;
  13106.   TSerialKeysW = packed record
  13107.     cbSize: UINT;
  13108.     dwFlags: DWORD;
  13109.     lpszActivePort: PWideChar;
  13110.     lpszPort: PWideChar;
  13111.     iBaudRate: UINT;
  13112.     iPortState: UINT;
  13113.     iActive: UINT;
  13114.   end;
  13115.   TSerialKeys = TSerialKeysA;
  13116.  
  13117. const
  13118.   { flags for SERIALKEYS dwFlags field }
  13119.   SERKF_SERIALKEYSON = 1;
  13120.   SERKF_AVAILABLE = 2;
  13121.   SERKF_INDICATOR = 4;
  13122.  
  13123. type
  13124.   PHighContrastA = ^THighContrastA;
  13125.   PHighContrastW = ^THighContrastW;
  13126.   PHighContrast = PHighContrastA;
  13127.   THighContrastA = packed record
  13128.     cbSize: UINT;
  13129.     dwFlags: DWORD;
  13130.     lpszDefaultScheme: PAnsiChar;
  13131.   end;
  13132.   THighContrastW = packed record
  13133.     cbSize: UINT;
  13134.     dwFlags: DWORD;
  13135.     lpszDefaultScheme: PWideChar;
  13136.   end;
  13137.   THighContrast = THighContrastA;
  13138.  
  13139.  
  13140. const
  13141.   { flags for HIGHCONTRAST dwFlags field }
  13142.   HCF_HIGHCONTRASTON = 1;
  13143.   HCF_AVAILABLE = 2;
  13144.   HCF_HOTKEYACTIVE = 4;
  13145.   HCF_CONFIRMHOTKEY = 8;
  13146.   HCF_HOTKEYSOUND = $10;
  13147.   HCF_INDICATOR = $20;
  13148.   HCF_HOTKEYAVAILABLE = $40;
  13149.  
  13150.   { Flags for ChangeDisplaySettings }
  13151.   CDS_UPDATEREGISTRY = 1;
  13152.   CDS_TEST = 2;
  13153.   CDS_FULLSCREEN = 4;
  13154.  
  13155.   { Return values }
  13156.   DISP_CHANGE_SUCCESSFUL = 0;
  13157.   DISP_CHANGE_RESTART = 1;
  13158.  
  13159.   DISP_CHANGE_FAILED = -1;
  13160.   DISP_CHANGE_BADMODE = -2;
  13161.   DISP_CHANGE_NOTUPDATED = -3;
  13162.   DISP_CHANGE_BADFLAGS = -4;
  13163.  
  13164. function ChangeDisplaySettingsA(var lpDevMode: TDeviceModeA; dwFlags: DWORD): Longint; stdcall;
  13165. function ChangeDisplaySettingsW(var lpDevMode: TDeviceModeW; dwFlags: DWORD): Longint; stdcall;
  13166. function ChangeDisplaySettings(var lpDevMode: TDeviceMode; dwFlags: DWORD): Longint; stdcall;
  13167. function EnumDisplaySettingsA(lpszDeviceName: PAnsiChar; iModeNum: DWORD;
  13168.   var lpDevMode: TDeviceModeA): BOOL; stdcall;
  13169. function EnumDisplaySettingsW(lpszDeviceName: PWideChar; iModeNum: DWORD;
  13170.   var lpDevMode: TDeviceModeW): BOOL; stdcall;
  13171. function EnumDisplaySettings(lpszDeviceName: PChar; iModeNum: DWORD;
  13172.   var lpDevMode: TDeviceMode): BOOL; stdcall;
  13173. function SystemParametersInfoA(uiAction, uiParam: UINT;
  13174.   pvParam: Pointer; fWinIni: UINT): BOOL; stdcall;
  13175. function SystemParametersInfoW(uiAction, uiParam: UINT;
  13176.   pvParam: Pointer; fWinIni: UINT): BOOL; stdcall;
  13177. function SystemParametersInfo(uiAction, uiParam: UINT;
  13178.   pvParam: Pointer; fWinIni: UINT): BOOL; stdcall;
  13179.  
  13180. type
  13181.   { Accessibility support }
  13182.   PFilterKeys = ^TFilterKeys;
  13183.   TFilterKeys = packed record
  13184.     cbSize: UINT;
  13185.     dwFlags: DWORD;
  13186.     iWaitMSec: DWORD;       { Acceptance Delay}
  13187.     iDelayMSec: DWORD;      { Delay Until Repeat}
  13188.     iRepeatMSec: DWORD;     { Repeat Rate}
  13189.     iBounceMSec: DWORD;     { Debounce Time}
  13190.   end;
  13191.  
  13192.  
  13193. const
  13194.   { TFilterKeys dwFlags field }
  13195.   FKF_FILTERKEYSON = 1;
  13196.   FKF_AVAILABLE = 2;
  13197.   FKF_HOTKEYACTIVE = 4;
  13198.   FKF_CONFIRMHOTKEY = 8;
  13199.   FKF_HOTKEYSOUND = $10;
  13200.   FKF_INDICATOR = $20;
  13201.   FKF_CLICKON = $40;
  13202.  
  13203. type
  13204.   PStickyKeys = ^TStickyKeys;
  13205.   TStickyKeys = packed record
  13206.     cbSize: UINT;
  13207.     dwFlags: DWORD;
  13208.   end;
  13209.  
  13210. const
  13211.   { TStickyKeys dwFlags field }
  13212.   SKF_STICKYKEYSON = 1;
  13213.   SKF_AVAILABLE = 2;
  13214.   SKF_HOTKEYACTIVE = 4;
  13215.   SKF_CONFIRMHOTKEY = 8;
  13216.   SKF_HOTKEYSOUND = $10;
  13217.   SKF_INDICATOR = $20;
  13218.   SKF_AUDIBLEFEEDBACK = $40;
  13219.   SKF_TRISTATE = $80;
  13220.   SKF_TWOKEYSOFF = $100;
  13221.  
  13222. type
  13223.   PMouseKeys = ^TMouseKeys;
  13224.   TMouseKeys = packed record
  13225.     cbSize: UINT;
  13226.     dwFlags: DWORD;
  13227.     iMaxSpeed: DWORD;
  13228.     iTimeToMaxSpeed: DWORD;
  13229.     iCtrlSpeed: DWORD;
  13230.     dwReserved1: DWORD;
  13231.     dwReserved2: DWORD;
  13232.   end;
  13233.  
  13234. const
  13235.   { TMouseKeys dwFlags field }
  13236.   MKF_MOUSEKEYSON = 1;
  13237.   MKF_AVAILABLE = 2;
  13238.   MKF_HOTKEYACTIVE = 4;
  13239.   MKF_CONFIRMHOTKEY = 8;
  13240.   MKF_HOTKEYSOUND = $10;
  13241.   MKF_INDICATOR = $20;
  13242.   MKF_MODIFIERS = $40;
  13243.   MKF_REPLACENUMBERS = $80;
  13244.  
  13245. type
  13246.   PAccessTimeout = ^TAccessTimeout;
  13247.   TAccessTimeout = packed record
  13248.     cbSize: UINT;
  13249.     dwFlags: DWORD;
  13250.     iTimeOutMSec: DWORD;
  13251.   end;
  13252.  
  13253. const
  13254.   { TAccessTimeout dwFlags field }
  13255.   ATF_TIMEOUTON = 1;
  13256.   ATF_ONOFFFEEDBACK = 2;
  13257.  
  13258.   { values for TSoundsEntry iFSGrafEffect field }
  13259.   SSGF_NONE = 0;
  13260.   SSGF_DISPLAY = 3;
  13261.  
  13262.   { values for TSoundsEntry iFSTextEffect field }
  13263.   SSTF_NONE = 0;
  13264.   SSTF_CHARS = 1;
  13265.   SSTF_BORDER = 2;
  13266.   SSTF_DISPLAY = 3;
  13267.  
  13268.   { values for TSoundsEntry iWindowsEffect field }
  13269.   SSWF_NONE = 0;
  13270.   SSWF_TITLE = 1;
  13271.   SSWF_WINDOW = 2;
  13272.   SSWF_DISPLAY = 3;
  13273.   SSWF_CUSTOM = 4;
  13274.  
  13275. type
  13276.   PSoundsEntryA = ^TSoundsEntryA;
  13277.   PSoundsEntryW = ^TSoundsEntryW;
  13278.   PSoundsEntry = PSoundsEntryA;
  13279.   TSoundsEntryA = packed record
  13280.     cbSize: UINT;
  13281.     dwFlags: DWORD;
  13282.     iFSTextEffect: DWORD;
  13283.     iFSTextEffectMSec: DWORD;
  13284.     iFSTextEffectColorBits: DWORD;
  13285.     iFSGrafEffect: DWORD;
  13286.     iFSGrafEffectMSec: DWORD;
  13287.     iFSGrafEffectColor: DWORD;
  13288.     iWindowsEffect: DWORD;
  13289.     iWindowsEffectMSec: DWORD;
  13290.     lpszWindowsEffectDLL: PAnsiChar;
  13291.     iWindowsEffectOrdinal: DWORD;
  13292.   end;
  13293.   TSoundsEntryW = packed record
  13294.     cbSize: UINT;
  13295.     dwFlags: DWORD;
  13296.     iFSTextEffect: DWORD;
  13297.     iFSTextEffectMSec: DWORD;
  13298.     iFSTextEffectColorBits: DWORD;
  13299.     iFSGrafEffect: DWORD;
  13300.     iFSGrafEffectMSec: DWORD;
  13301.     iFSGrafEffectColor: DWORD;
  13302.     iWindowsEffect: DWORD;
  13303.     iWindowsEffectMSec: DWORD;
  13304.     lpszWindowsEffectDLL: PWideChar;
  13305.     iWindowsEffectOrdinal: DWORD;
  13306.   end;
  13307.   TSoundsEntry = TSoundsEntryA;
  13308.  
  13309. const
  13310.   { SOUNDSENTRY dwFlags field }
  13311.   SSF_SOUNDSENTRYON = 1;
  13312.   SSF_AVAILABLE = 2;
  13313.   SSF_INDICATOR = 4;
  13314.  
  13315.  
  13316. type
  13317.   PToggleKeys = ^TToggleKeys;
  13318.   TToggleKeys = packed record
  13319.     cbSize: UINT;
  13320.     dwFlags: DWORD;
  13321.   end;
  13322.  
  13323. const
  13324.   { TToggleKeys dwFlags field }
  13325.   TKF_TOGGLEKEYSON = 1;
  13326.   TKF_AVAILABLE = 2;
  13327.   TKF_HOTKEYACTIVE = 4;
  13328.   TKF_CONFIRMHOTKEY = 8;
  13329.   TKF_HOTKEYSOUND = $10;
  13330.   TKF_INDICATOR = $20;
  13331.  
  13332. procedure SetDebugErrorLevel(dwLevel: DWORD); stdcall;
  13333.  
  13334. const
  13335.   { SetLastErrorEx() types. }
  13336.   SLE_ERROR = 1;
  13337.   SLE_MINORERROR = 2;
  13338.   SLE_WARNING = 3;
  13339.  
  13340. procedure SetLastErrorEx(dwErrCode, dwType: DWORD); stdcall;
  13341.  
  13342.  
  13343. { Translated from WINNLS.H }
  13344.  
  13345. const
  13346.  
  13347. { String Length Maximums. }
  13348.  
  13349.   MAX_LEADBYTES = 12; { 5 ranges, 2 bytes ea., 0 term. }
  13350.   MAX_DEFAULTCHAR = 2; { single or double byte }
  13351.  
  13352. { MBCS and Unicode Translation Flags. }
  13353.  
  13354.   MB_PRECOMPOSED = 1; { use precomposed chars }
  13355.   MB_COMPOSITE = 2; { use composite chars }
  13356.   MB_USEGLYPHCHARS = 4; { use glyph chars, not ctrl chars }
  13357.  
  13358.   WC_DEFAULTCHECK = $100; { check for default char }
  13359.   WC_COMPOSITECHECK = $200; { convert composite to precomposed }
  13360.   WC_DISCARDNS = $10; { discard non-spacing chars }
  13361.   WC_SEPCHARS = $20; { generate separate chars }
  13362.   WC_DEFAULTCHAR = $40; { replace w default char }
  13363.  
  13364. { Character Type Flags. }
  13365.  
  13366.   CT_CTYPE1 = 1; { ctype 1 information }
  13367.   CT_CTYPE2 = 2; { ctype 2 information }
  13368.   CT_CTYPE3 = 4; { ctype 3 information }
  13369.  
  13370. { CType 1 Flag Bits. }
  13371.  
  13372.   C1_UPPER = 1; { upper case }
  13373.   C1_LOWER = 2; { lower case }
  13374.   C1_DIGIT = 4; { decimal digits }
  13375.   C1_SPACE = 8; { spacing characters }
  13376.   C1_PUNCT = $10; { punctuation characters }
  13377.   C1_CNTRL = $20; { control characters }
  13378.   C1_BLANK = $40; { blank characters }
  13379.   C1_XDIGIT = $80; { other digits }
  13380.   C1_ALPHA = $100; { any letter }
  13381.  
  13382. { CType 2 Flag Bits. }
  13383.  
  13384.   C2_LEFTTORIGHT = 1; { left to right }
  13385.   C2_RIGHTTOLEFT = 2; { right to left }
  13386.   C2_EUROPENUMBER = 3; { European number, digit }
  13387.   C2_EUROPESEPARATOR = 4; { European numeric separator }
  13388.   C2_EUROPETERMINATOR = 5; { European numeric terminator }
  13389.   C2_ARABICNUMBER = 6; { Arabic number }
  13390.   C2_COMMONSEPARATOR = 7; { common numeric separator }
  13391.   C2_BLOCKSEPARATOR = 8; { block separator }
  13392.   C2_SEGMENTSEPARATOR = 9; { segment separator }
  13393.   C2_WHITESPACE = 10; { white space }
  13394.   C2_OTHERNEUTRAL = 11; { other neutrals }
  13395.   C2_NOTAPPLICABLE = 0; { no implicit directionality }
  13396.  
  13397. { CType 3 Flag Bits. }
  13398.  
  13399.   C3_NONSPACING = 1; { nonspacing character }
  13400.   C3_DIACRITIC = 2; { diacritic mark }
  13401.   C3_VOWELMARK = 4; { vowel mark }
  13402.   C3_SYMBOL = 8; { symbols }
  13403.   C3_NOTAPPLICABLE = 0; { ctype 3 is not applicable }
  13404.  
  13405. { String Flags. }
  13406.  
  13407.   NORM_IGNORECASE = 1; { ignore case }
  13408.   NORM_IGNORENONSPACE = 2; { ignore nonspacing chars }
  13409.   NORM_IGNORESYMBOLS = 4; { ignore symbols }
  13410.   NORM_IGNOREKANATYPE = $10000;
  13411.   NORM_IGNOREWIDTH = $20000;
  13412.  
  13413. { Locale Independent Mapping Flags. }
  13414.  
  13415.   MAP_FOLDCZONE = $10; { fold compatibility zone chars }
  13416.   MAP_PRECOMPOSED = $20; { convert to precomposed chars }
  13417.   MAP_COMPOSITE = $40; { convert to composite chars }
  13418.   MAP_FOLDDIGITS = $80; { all digits to ASCII 0-9 }
  13419.  
  13420. { Locale Dependent Mapping Flags. }
  13421.  
  13422.   LCMAP_LOWERCASE = $100; { lower case letters }
  13423.   LCMAP_UPPERCASE = $200; { upper case letters }
  13424.   LCMAP_SORTKEY = $400; { WC sort key (normalize) }
  13425.   LCMAP_BYTEREV = $800; { byte reversal }
  13426.  
  13427. { Locale Enumeration Flags. }
  13428.  
  13429.   LCID_INSTALLED          = $00000001;  { installed locale ids }
  13430.   LCID_SUPPORTED          = $00000002;  { supported locale ids }
  13431.  
  13432. { Code Page Enumeration Flags. }
  13433.  
  13434.   CP_INSTALLED            = $00000001;  { installed code page ids }
  13435.   CP_SUPPORTED            = $00000002;  { supported code page ids }
  13436.  
  13437.  
  13438. { Sorting Flags.
  13439.  
  13440.      WORD Sort:    culturally correct sort
  13441.                    hyphen and apostrophe are special cased
  13442.                    example: "coop" and "co-op" will sort together in a list
  13443.  
  13444.                          co_op     <-------  underscore (symbol)
  13445.                          coat
  13446.                          comb
  13447.                          coop
  13448.                          co-op     <-------  hyphen (punctuation)
  13449.                          cork
  13450.                          went
  13451.                          were
  13452.                          we're     <-------  apostrophe (punctuation)
  13453.  
  13454.  
  13455.      STRING Sort:  hyphen and apostrophe will sort with all other symbols
  13456.  
  13457.                          co-op     <-------  hyphen (punctuation)
  13458.                          co_op     <-------  underscore (symbol)
  13459.                          coat
  13460.                          comb
  13461.                          coop
  13462.                          cork
  13463.                          we're     <-------  apostrophe (punctuation)
  13464.                          went
  13465.                          were
  13466.  }
  13467.  
  13468.   SORT_STRINGSORT = $1000; { use string sort method }
  13469.  
  13470. { Code Page Default Values. }
  13471.  
  13472.   CP_ACP = 0; { default to ANSI code page }
  13473.   CP_OEMCP = 1; { default to OEM  code page }
  13474.  
  13475. { Country Codes. }
  13476.  
  13477.   CTRY_DEFAULT = 0;
  13478.   CTRY_AUSTRALIA = 61; { Australia }
  13479.   CTRY_AUSTRIA = 43; { Austria }
  13480.   CTRY_BELGIUM = $20; { Belgium }
  13481.   CTRY_BRAZIL = 55; { Brazil }
  13482.   CTRY_CANADA = 2; { Canada }
  13483.   CTRY_DENMARK = 45; { Denmark }
  13484.   CTRY_FINLAND = 358; { Finland }
  13485.   CTRY_FRANCE = 33; { France }
  13486.   CTRY_GERMANY = 49; { Germany }
  13487.   CTRY_ICELAND = 354; { Iceland }
  13488.   CTRY_IRELAND = 353; { Ireland }
  13489.   CTRY_ITALY = 39; { Italy }
  13490.   CTRY_JAPAN = 81; { Japan }
  13491.   CTRY_MEXICO = 52; { Mexico }
  13492.   CTRY_NETHERLANDS = 31; { Netherlands }
  13493.   CTRY_NEW_ZEALAND = $40; { New Zealand }
  13494.   CTRY_NORWAY = 47; { Norway }
  13495.   CTRY_PORTUGAL = 351; { Portugal }
  13496.   CTRY_PRCHINA = 86; { PR China }
  13497.   CTRY_SOUTH_KOREA = 82; { South Korea }
  13498.   CTRY_SPAIN = 34; { Spain }
  13499.   CTRY_SWEDEN = 46; { Sweden }
  13500.   CTRY_SWITZERLAND = 41; { Switzerland }
  13501.   CTRY_TAIWAN = 886; { Taiwan }
  13502.   CTRY_UNITED_KINGDOM = 44; { United Kingdom }
  13503.   CTRY_UNITED_STATES = 1; { United States }
  13504.  
  13505. { Locale Types.
  13506.   These types are used for the GetLocaleInfoW NLS API routine. }
  13507.  
  13508. { LOCALE_NOUSEROVERRIDE is also used in GetTimeFormatW and GetDateFormatW. }
  13509.  
  13510.   LOCALE_NOUSEROVERRIDE = $80000000; { do not use user overrides }
  13511.   LOCALE_ILANGUAGE = 1; { language id }
  13512.   LOCALE_SLANGUAGE = 2; { localized name of language }
  13513.   LOCALE_SENGLANGUAGE = 4097; { English name of language }
  13514.   LOCALE_SABBREVLANGNAME = 3; { abbreviated language name }
  13515.   LOCALE_SNATIVELANGNAME = 4; { native name of language }
  13516.   LOCALE_ICOUNTRY = 5; { country code }
  13517.   LOCALE_SCOUNTRY = 6; { localized name of country }
  13518.   LOCALE_SENGCOUNTRY = 4098; { English name of country }
  13519.   LOCALE_SABBREVCTRYNAME = 7; { abbreviated country name }
  13520.   LOCALE_SNATIVECTRYNAME = 8; { native name of country }
  13521.   LOCALE_IDEFAULTLANGUAGE = 9; { default language id }
  13522.   LOCALE_IDEFAULTCOUNTRY = 10; { default country code }
  13523.   LOCALE_IDEFAULTCODEPAGE = 11; { default code page }
  13524.   LOCALE_SLIST = 12; { list item separator }
  13525.   LOCALE_IMEASURE = 13; { 0 = metric, 1 = US }
  13526.   LOCALE_SDECIMAL = 14; { decimal separator }
  13527.   LOCALE_STHOUSAND = 15; { thousand separator }
  13528.   LOCALE_SGROUPING = $10; { digit grouping }
  13529.   LOCALE_IDIGITS = 17; { number of fractional digits }
  13530.   LOCALE_ILZERO = 18; { leading zeros for decimal }
  13531.   LOCALE_SNATIVEDIGITS = 19; { native ascii 0-9 }
  13532.   LOCALE_SCURRENCY = 20; { local monetary symbol }
  13533.   LOCALE_SINTLSYMBOL = 21; { intl monetary symbol }
  13534.   LOCALE_SMONDECIMALSEP = 22; { monetary decimal separator }
  13535.   LOCALE_SMONTHOUSANDSEP = 23; { monetary thousand separator }
  13536.   LOCALE_SMONGROUPING = 24; { monetary grouping }
  13537.   LOCALE_ICURRDIGITS = 25; { # local monetary digits }
  13538.   LOCALE_IINTLCURRDIGITS = 26; { # intl monetary digits }
  13539.   LOCALE_ICURRENCY = 27; { positive currency mode }
  13540.   LOCALE_INEGCURR = 28; { negative currency mode }
  13541.   LOCALE_SDATE = 29; { date separator }
  13542.   LOCALE_STIME = 30; { time separator }
  13543.   LOCALE_SSHORTDATE = 31; { short date format string }
  13544.   LOCALE_SLONGDATE = $20; { long date format string }
  13545.   LOCALE_STIMEFORMAT = 4099; { time format string }
  13546.   LOCALE_IDATE = 33; { short date format ordering }
  13547.   LOCALE_ILDATE = 34; { long date format ordering }
  13548.   LOCALE_ITIME = 35; { time format specifier }
  13549.   LOCALE_ICENTURY = 36; { century format specifier }
  13550.   LOCALE_ITLZERO = 37; { leading zeros in time field }
  13551.   LOCALE_IDAYLZERO = 38; { leading zeros in day field }
  13552.   LOCALE_IMONLZERO = 39; { leading zeros in month field }
  13553.   LOCALE_S1159 = 40; { AM designator }
  13554.   LOCALE_S2359 = 41; { PM designator }
  13555.   LOCALE_SDAYNAME1 = 42; { long name for Monday }
  13556.   LOCALE_SDAYNAME2 = 43; { long name for Tuesday }
  13557.   LOCALE_SDAYNAME3 = 44; { long name for Wednesday }
  13558.   LOCALE_SDAYNAME4 = 45; { long name for Thursday }
  13559.   LOCALE_SDAYNAME5 = 46; { long name for Friday }
  13560.   LOCALE_SDAYNAME6 = 47; { long name for Saturday }
  13561.   LOCALE_SDAYNAME7 = 48; { long name for Sunday }
  13562.   LOCALE_SABBREVDAYNAME1 = 49; { abbreviated name for Monday }
  13563.   LOCALE_SABBREVDAYNAME2 = 50; { abbreviated name for Tuesday }
  13564.   LOCALE_SABBREVDAYNAME3 = 51; { abbreviated name for Wednesday }
  13565.   LOCALE_SABBREVDAYNAME4 = 52; { abbreviated name for Thursday }
  13566.   LOCALE_SABBREVDAYNAME5 = 53; { abbreviated name for Friday }
  13567.   LOCALE_SABBREVDAYNAME6 = 54; { abbreviated name for Saturday }
  13568.   LOCALE_SABBREVDAYNAME7 = 55; { abbreviated name for Sunday }
  13569.   LOCALE_SMONTHNAME1 = 56; { long name for January }
  13570.   LOCALE_SMONTHNAME2 = 57; { long name for February }
  13571.   LOCALE_SMONTHNAME3 = 58; { long name for March }
  13572.   LOCALE_SMONTHNAME4 = 59; { long name for April }
  13573.   LOCALE_SMONTHNAME5 = 60; { long name for May }
  13574.   LOCALE_SMONTHNAME6 = 61; { long name for June }
  13575.   LOCALE_SMONTHNAME7 = 62; { long name for July }
  13576.   LOCALE_SMONTHNAME8 = 63; { long name for August }
  13577.   LOCALE_SMONTHNAME9 = $40; { long name for September }
  13578.   LOCALE_SMONTHNAME10 = 65; { long name for October }
  13579.   LOCALE_SMONTHNAME11 = 66; { long name for November }
  13580.   LOCALE_SMONTHNAME12 = 67; { long name for December }
  13581.   LOCALE_SABBREVMONTHNAME1 = 68; { abbreviated name for January }
  13582.   LOCALE_SABBREVMONTHNAME2 = 69; { abbreviated name for February }
  13583.   LOCALE_SABBREVMONTHNAME3 = 70; { abbreviated name for March }
  13584.   LOCALE_SABBREVMONTHNAME4 = 71; { abbreviated name for April }
  13585.   LOCALE_SABBREVMONTHNAME5 = 72; { abbreviated name for May }
  13586.   LOCALE_SABBREVMONTHNAME6 = 73; { abbreviated name for June }
  13587.   LOCALE_SABBREVMONTHNAME7 = 74; { abbreviated name for July }
  13588.   LOCALE_SABBREVMONTHNAME8 = 75; { abbreviated name for August }
  13589.   LOCALE_SABBREVMONTHNAME9 = 76; { abbreviated name for September }
  13590.   LOCALE_SABBREVMONTHNAME10 = 77; { abbreviated name for October }
  13591.   LOCALE_SABBREVMONTHNAME11 = 78; { abbreviated name for November }
  13592.   LOCALE_SABBREVMONTHNAME12 = 79; { abbreviated name for December }
  13593.   LOCALE_SPOSITIVESIGN = 80; { positive sign }
  13594.   LOCALE_SNEGATIVESIGN = 81; { negative sign }
  13595.   LOCALE_IPOSSIGNPOSN = 82; { positive sign position }
  13596.   LOCALE_INEGSIGNPOSN = 83; { negative sign position }
  13597.   LOCALE_IPOSSYMPRECEDES = 84; { mon sym precedes pos amt }
  13598.   LOCALE_IPOSSEPBYSPACE = 85; { mon sym sep by space from pos amt }
  13599.   LOCALE_INEGSYMPRECEDES = 86; { mon sym precedes neg amt }
  13600.   LOCALE_INEGSEPBYSPACE = 87; { mon sym sep by space from neg amt }
  13601.  
  13602. { Time Flags for GetTimeFormatW. }
  13603.  
  13604.   TIME_NOMINUTESORSECONDS = 1; { do not use minutes or seconds }
  13605.   TIME_NOSECONDS = 2; { do not use seconds }
  13606.   TIME_NOTIMEMARKER = 4; { do not use time marker }
  13607.   TIME_FORCE24HOURFORMAT = 8; { always use 24 hour format }
  13608.  
  13609. { Date Flags for GetDateFormatW. }
  13610.  
  13611.   DATE_SHORTDATE = 1; { use short date picture }
  13612.   DATE_LONGDATE = 2; { use long date picture }
  13613.   DATE_USE_ALT_CALENDAR = 4;   { use alternate calendar (if any) }
  13614.  
  13615. { Calendar Types.
  13616.   These types are used for the GetALTCalendarInfoW NLS API routine. }
  13617.  
  13618.   CAL_ICALINTVALUE = 1;   { calendar type }
  13619.   CAL_SCALNAME = 2;   { native name of calendar }
  13620.   CAL_IYEAROFFSETRANGE = 3;   { starting years of eras }
  13621.   CAL_SERASTRING = 4;   { era name for IYearOffsetRanges }
  13622.   CAL_SSHORTDATE = 5;   { short date format string }
  13623.   CAL_SLONGDATE = 6;   { long date format string }
  13624.   CAL_SDAYNAME1 = 7;   { native name for Monday }
  13625.   CAL_SDAYNAME2 = 8;   { native name for Tuesday }
  13626.   CAL_SDAYNAME3 = 9;   { native name for Wednesday }
  13627.   CAL_SDAYNAME4 = 10;   { native name for Thursday }
  13628.   CAL_SDAYNAME5 = 11;   { native name for Friday }
  13629.   CAL_SDAYNAME6 = 12;   { native name for Saturday }
  13630.   CAL_SDAYNAME7 = 13;   { native name for Sunday }
  13631.   CAL_SABBREVDAYNAME1 = 14;   { abbreviated name for Monday }
  13632.   CAL_SABBREVDAYNAME2 = 15;   { abbreviated name for Tuesday }
  13633.   CAL_SABBREVDAYNAME3 = $10;   { abbreviated name for Wednesday }
  13634.   CAL_SABBREVDAYNAME4 = 17;   { abbreviated name for Thursday }
  13635.   CAL_SABBREVDAYNAME5 = 18;   { abbreviated name for Friday }
  13636.   CAL_SABBREVDAYNAME6 = 19;   { abbreviated name for Saturday }
  13637.   CAL_SABBREVDAYNAME7 = 20;   { abbreviated name for Sunday }
  13638.   CAL_SMONTHNAME1 = 21;   { native name for January }
  13639.   CAL_SMONTHNAME2 = 22;   { native name for February }
  13640.   CAL_SMONTHNAME3 = 23;   { native name for March }
  13641.   CAL_SMONTHNAME4 = 24;   { native name for April }
  13642.   CAL_SMONTHNAME5 = 25;   { native name for May }
  13643.   CAL_SMONTHNAME6 = 26;   { native name for June }
  13644.   CAL_SMONTHNAME7 = 27;   { native name for July }
  13645.   CAL_SMONTHNAME8 = 28;   { native name for August }
  13646.   CAL_SMONTHNAME9 = 29;   { native name for September }
  13647.   CAL_SMONTHNAME10 = 30;   { native name for October }
  13648.   CAL_SMONTHNAME11 = 31;   { native name for November }
  13649.   CAL_SMONTHNAME12 = $20;   { native name for December }
  13650.   CAL_SMONTHNAME13 = 33;   { native name for 13th month (if any) }
  13651.   CAL_SABBREVMONTHNAME1 = 34;   { abbreviated name for January }
  13652.   CAL_SABBREVMONTHNAME2 = 35;   { abbreviated name for February }
  13653.   CAL_SABBREVMONTHNAME3 = 36;   { abbreviated name for March }
  13654.   CAL_SABBREVMONTHNAME4 = 37;   { abbreviated name for April }
  13655.   CAL_SABBREVMONTHNAME5 = 38;   { abbreviated name for May }
  13656.   CAL_SABBREVMONTHNAME6 = 39;   { abbreviated name for June }
  13657.   CAL_SABBREVMONTHNAME7 = 40;   { abbreviated name for July }
  13658.   CAL_SABBREVMONTHNAME8 = 41;   { abbreviated name for August }
  13659.   CAL_SABBREVMONTHNAME9 = 42;   { abbreviated name for September }
  13660.   CAL_SABBREVMONTHNAME10 = 43;   { abbreviated name for October }
  13661.   CAL_SABBREVMONTHNAME11 = 44;   { abbreviated name for November }
  13662.   CAL_SABBREVMONTHNAME12 = 45;   { abbreviated name for December }
  13663.   CAL_SABBREVMONTHNAME13 = 46;   { abbreviated name for 13th month (if any) }
  13664.  
  13665. { Calendar Enumeration Value. }
  13666.  
  13667.   ENUM_ALL_CALENDARS = $FFFFFFFF;   { enumerate all calendars }
  13668.  
  13669. { Calendar ID Values. }
  13670.  
  13671.   CAL_GREGORIAN = 1;   { Gregorian (localized) calendar }
  13672.   CAL_GREGORIAN_US = 2;   { Gregorian (U.S.) calendar }
  13673.   CAL_JAPAN = 3;   { Japanese Emperor Era calendar }
  13674.   CAL_TAIWAN = 4;   { Republic of China Era calendar }
  13675.   CAL_KOREA = 5;   { Korean Tangun Era calendar }
  13676.  
  13677.  
  13678. type
  13679.   LCTYPE = DWORD;   { Locale type constant. }
  13680.   CALTYPE = DWORD;  { Calendar type constant. }
  13681.   CALID = DWORD;    { Calendar ID. }
  13682.  
  13683.   PCPInfo = ^TCPInfo;
  13684.   TCPInfo = packed record
  13685.     MaxCharSize: UINT;                       { max length (bytes) of a char }
  13686.     DefaultChar: array[0..MAX_DEFAULTCHAR - 1] of Byte; { default character }
  13687.     LeadByte: array[0..MAX_LEADBYTES - 1] of Byte;      { lead byte ranges }
  13688.   end;
  13689.  
  13690. type
  13691.   PNumberFmtA = ^TNumberFmtA;
  13692.   PNumberFmtW = ^TNumberFmtW;
  13693.   PNumberFmt = PNumberFmtA;
  13694.   TNumberFmtA = packed record
  13695.     NumDigits: UINT;        { number of decimal digits }
  13696.     LeadingZero: UINT;      { if leading zero in decimal fields }
  13697.     Grouping: UINT;         { group size left of decimal }
  13698.     lpDecimalSep: PAnsiChar;   { ptr to decimal separator string }
  13699.     lpThousandSep: PAnsiChar;  { ptr to thousand separator string }
  13700.     NegativeOrder: UINT;    { negative number ordering }
  13701.   end;
  13702.   TNumberFmtW = packed record
  13703.     NumDigits: UINT;        { number of decimal digits }
  13704.     LeadingZero: UINT;      { if leading zero in decimal fields }
  13705.     Grouping: UINT;         { group size left of decimal }
  13706.     lpDecimalSep: PWideChar;   { ptr to decimal separator string }
  13707.     lpThousandSep: PWideChar;  { ptr to thousand separator string }
  13708.     NegativeOrder: UINT;    { negative number ordering }
  13709.   end;
  13710.   TNumberFmt = TNumberFmtA;
  13711.  
  13712.   PCurrencyFmtA = ^TCurrencyFmtA;
  13713.   PCurrencyFmtW = ^TCurrencyFmtW;
  13714.   PCurrencyFmt = PCurrencyFmtA;
  13715.   TCurrencyFmtA = packed record
  13716.     NumDigits: UINT;           { number of decimal digits }
  13717.     LeadingZero: UINT;         { if leading zero in decimal fields }
  13718.     Grouping: UINT;            { group size left of decimal }
  13719.     lpDecimalSep: PAnsiChar;      { ptr to decimal separator string }
  13720.     lpThousandSep: PAnsiChar;     { ptr to thousand separator string }
  13721.     NegativeOrder: UINT;       { negative currency ordering }
  13722.     PositiveOrder: UINT;       { positive currency ordering }
  13723.     lpCurrencySymbol: PAnsiChar;  { ptr to currency symbol string }
  13724.   end;
  13725.   TCurrencyFmtW = packed record
  13726.     NumDigits: UINT;           { number of decimal digits }
  13727.     LeadingZero: UINT;         { if leading zero in decimal fields }
  13728.     Grouping: UINT;            { group size left of decimal }
  13729.     lpDecimalSep: PWideChar;      { ptr to decimal separator string }
  13730.     lpThousandSep: PWideChar;     { ptr to thousand separator string }
  13731.     NegativeOrder: UINT;       { negative currency ordering }
  13732.     PositiveOrder: UINT;       { positive currency ordering }
  13733.     lpCurrencySymbol: PWideChar;  { ptr to currency symbol string }
  13734.   end;
  13735.   TCurrencyFmt = TCurrencyFmtA;
  13736.  
  13737. { Enumeration function constants. }
  13738.  
  13739. {$IFDEF STRICT}
  13740.   TFNLocaleEnumProc = function (p1: LPTSTR): BOOL stdcall;
  13741.   TFNCodepageEnumProc = function (p1: LPTSTR): BOOL stdcall;
  13742.   TFNDateFmtEnumProc = function (p1: LPTSTR): BOOL stdcall;
  13743.   TFNTimeFmtEnumProc = function (p1: LPTSTR): BOOL stdcall;
  13744.   TFNCalInfoEnumProc = function (p1: LPTSTR): BOOL stdcall;
  13745. {$ELSE}
  13746.   TFNLocaleEnumProc = TFarProc;
  13747.   TFNCodepageEnumProc = TFarProc;
  13748.   TFNDateFmtEnumProc = TFarProc;
  13749.   TFNTimeFmtEnumProc = TFarProc;
  13750.   TFNCalInfoEnumProc = TFarProc;
  13751. {$ENDIF}
  13752.  
  13753.  
  13754. { Code Page Dependent APIs. }
  13755.  
  13756. function IsValidCodePage(CodePage: UINT): BOOL; stdcall;
  13757. function GetACP: UINT; stdcall;
  13758. function GetOEMCP: UINT; stdcall;
  13759. function GetCPInfo(CodePage: UINT; var lpCPInfo: TCPInfo): BOOL; stdcall;
  13760. function IsDBCSLeadByte(TestChar: Byte): BOOL; stdcall;
  13761. function IsDBCSLeadByteEx(CodePage: UINT; TestChar: Byte): BOOL; stdcall;
  13762. function MultiByteToWideChar(CodePage: UINT; dwFlags: DWORD;
  13763.   const lpMultiByteStr: LPCSTR; cchMultiByte: Integer;
  13764.   lpWideCharStr: LPWSTR; cchWideChar: Integer): Integer; stdcall;
  13765. function WideCharToMultiByte(CodePage: UINT; dwFlags: DWORD;
  13766.   lpWideCharStr: LPWSTR; cchWideChar: Integer; lpMultiByteStr: LPSTR;
  13767.   cchMultiByte: Integer; lpDefaultChar: LPCSTR; lpUsedDefaultChar: PBOOL): Integer; stdcall;
  13768.  
  13769. { Locale Dependent APIs. }
  13770.  
  13771. function CompareStringA(Locale: LCID; dwCmpFlags: DWORD; lpString1: PAnsiChar;
  13772.   cchCount1: Integer; lpString2: PAnsiChar; cchCount2: Integer): Integer; stdcall;
  13773. function CompareStringW(Locale: LCID; dwCmpFlags: DWORD; lpString1: PWideChar;
  13774.   cchCount1: Integer; lpString2: PWideChar; cchCount2: Integer): Integer; stdcall;
  13775. function CompareString(Locale: LCID; dwCmpFlags: DWORD; lpString1: PChar;
  13776.   cchCount1: Integer; lpString2: PChar; cchCount2: Integer): Integer; stdcall;
  13777. function LCMapStringA(Locale: LCID; dwMapFlags: DWORD; lpSrcStr: PAnsiChar;
  13778.   cchSrc: Integer; lpDestStr: PAnsiChar; cchDest: Integer): Integer; stdcall;
  13779. function LCMapStringW(Locale: LCID; dwMapFlags: DWORD; lpSrcStr: PWideChar;
  13780.   cchSrc: Integer; lpDestStr: PWideChar; cchDest: Integer): Integer; stdcall;
  13781. function LCMapString(Locale: LCID; dwMapFlags: DWORD; lpSrcStr: PChar;
  13782.   cchSrc: Integer; lpDestStr: PChar; cchDest: Integer): Integer; stdcall;
  13783. function GetLocaleInfoA(Locale: LCID; LCType: LCTYPE; lpLCData: PAnsiChar; cchData: Integer): Integer; stdcall;
  13784. function GetLocaleInfoW(Locale: LCID; LCType: LCTYPE; lpLCData: PWideChar; cchData: Integer): Integer; stdcall;
  13785. function GetLocaleInfo(Locale: LCID; LCType: LCTYPE; lpLCData: PChar; cchData: Integer): Integer; stdcall;
  13786. function SetLocaleInfoA(Locale: LCID; LCType: LCTYPE; lpLCData: PAnsiChar): BOOL; stdcall;
  13787. function SetLocaleInfoW(Locale: LCID; LCType: LCTYPE; lpLCData: PWideChar): BOOL; stdcall;
  13788. function SetLocaleInfo(Locale: LCID; LCType: LCTYPE; lpLCData: PChar): BOOL; stdcall;
  13789. function GetTimeFormatA(Locale: LCID; dwFlags: DWORD; lpTime: PSystemTime;
  13790.   lpFormat: PAnsiChar; lpTimeStr: PAnsiChar; cchTime: Integer): Integer; stdcall;
  13791. function GetTimeFormatW(Locale: LCID; dwFlags: DWORD; lpTime: PSystemTime;
  13792.   lpFormat: PWideChar; lpTimeStr: PWideChar; cchTime: Integer): Integer; stdcall;
  13793. function GetTimeFormat(Locale: LCID; dwFlags: DWORD; lpTime: PSystemTime;
  13794.   lpFormat: PChar; lpTimeStr: PChar; cchTime: Integer): Integer; stdcall;
  13795. function GetDateFormatA(Locale: LCID; dwFlags: DWORD; lpDate: PSystemTime;
  13796.   lpFormat: PAnsiChar; lpDateStr: PAnsiChar; cchDate: Integer): Integer; stdcall;
  13797. function GetDateFormatW(Locale: LCID; dwFlags: DWORD; lpDate: PSystemTime;
  13798.   lpFormat: PWideChar; lpDateStr: PWideChar; cchDate: Integer): Integer; stdcall;
  13799. function GetDateFormat(Locale: LCID; dwFlags: DWORD; lpDate: PSystemTime;
  13800.   lpFormat: PChar; lpDateStr: PChar; cchDate: Integer): Integer; stdcall;
  13801. function GetNumberFormatA(Locale: LCID; dwFlags: DWORD; lpValue: PAnsiChar;
  13802.   lpFormat: PNumberFmtA; lpNumberStr: PAnsiChar; cchNumber: Integer): Integer; stdcall;
  13803. function GetNumberFormatW(Locale: LCID; dwFlags: DWORD; lpValue: PWideChar;
  13804.   lpFormat: PNumberFmtW; lpNumberStr: PWideChar; cchNumber: Integer): Integer; stdcall;
  13805. function GetNumberFormat(Locale: LCID; dwFlags: DWORD; lpValue: PChar;
  13806.   lpFormat: PNumberFmt; lpNumberStr: PChar; cchNumber: Integer): Integer; stdcall;
  13807. function GetCurrencyFormatA(Locale: LCID; dwFlags: DWORD; lpValue: PAnsiChar;
  13808.   lpFormat: PCurrencyFmtA; lpCurrencyStr: PAnsiChar; cchCurrency: Integer): Integer; stdcall;
  13809. function GetCurrencyFormatW(Locale: LCID; dwFlags: DWORD; lpValue: PWideChar;
  13810.   lpFormat: PCurrencyFmtW; lpCurrencyStr: PWideChar; cchCurrency: Integer): Integer; stdcall;
  13811. function GetCurrencyFormat(Locale: LCID; dwFlags: DWORD; lpValue: PChar;
  13812.   lpFormat: PCurrencyFmt; lpCurrencyStr: PChar; cchCurrency: Integer): Integer; stdcall;
  13813. function EnumCalendarInfoA(lpCalInfoEnumProc: TFNCalInfoEnumProc; Locale: LCID;
  13814.   Calendar: CALID; CalType: CALTYPE): BOOL; stdcall;
  13815. function EnumCalendarInfoW(lpCalInfoEnumProc: TFNCalInfoEnumProc; Locale: LCID;
  13816.   Calendar: CALID; CalType: CALTYPE): BOOL; stdcall;
  13817. function EnumCalendarInfo(lpCalInfoEnumProc: TFNCalInfoEnumProc; Locale: LCID;
  13818.   Calendar: CALID; CalType: CALTYPE): BOOL; stdcall;
  13819. function EnumTimeFormatsA(lpTimeFmtEnumProc: TFNTimeFmtEnumProc;
  13820.   Locale: LCID; dwFlags: DWORD): BOOL; stdcall;
  13821. function EnumTimeFormatsW(lpTimeFmtEnumProc: TFNTimeFmtEnumProc;
  13822.   Locale: LCID; dwFlags: DWORD): BOOL; stdcall;
  13823. function EnumTimeFormats(lpTimeFmtEnumProc: TFNTimeFmtEnumProc;
  13824.   Locale: LCID; dwFlags: DWORD): BOOL; stdcall;
  13825. function EnumDateFormatsA(lpDateFmtEnumProc: TFNDateFmtEnumProc;
  13826.   Locale: LCID; dwFlags: DWORD): BOOL; stdcall;
  13827. function EnumDateFormatsW(lpDateFmtEnumProc: TFNDateFmtEnumProc;
  13828.   Locale: LCID; dwFlags: DWORD): BOOL; stdcall;
  13829. function EnumDateFormats(lpDateFmtEnumProc: TFNDateFmtEnumProc;
  13830.   Locale: LCID; dwFlags: DWORD): BOOL; stdcall;
  13831. function IsValidLocale(Locale: LCID; dwFlags: DWORD): BOOL; stdcall;
  13832. function ConvertDefaultLocale(Locale: LCID): LCID; stdcall;
  13833. function GetThreadLocale: LCID; stdcall;
  13834. function SetThreadLocale(Locale: LCID): BOOL; stdcall;
  13835. function GetSystemDefaultLangID: LANGID; stdcall;
  13836. function GetUserDefaultLangID: LANGID; stdcall;
  13837. function GetSystemDefaultLCID: LCID; stdcall;
  13838. function GetUserDefaultLCID: LCID; stdcall;
  13839.  
  13840. { Locale Independent APIs. }
  13841.  
  13842. function GetStringTypeExA(Locale: LCID; dwInfoType: DWORD;
  13843.   lpSrcStr: PAnsiChar; cchSrc: Integer; var lpCharType): BOOL; stdcall;
  13844. function GetStringTypeExW(Locale: LCID; dwInfoType: DWORD;
  13845.   lpSrcStr: PWideChar; cchSrc: Integer; var lpCharType): BOOL; stdcall;
  13846. function GetStringTypeEx(Locale: LCID; dwInfoType: DWORD;
  13847.   lpSrcStr: PChar; cchSrc: Integer; var lpCharType): BOOL; stdcall;
  13848.  
  13849. {  NOTE: The parameters for GetStringTypeA and GetStringTypeW are
  13850.          NOT the same.  The W version was shipped in NT 3.1.  The
  13851.          A version was then shipped in 16-bit OLE with the wrong
  13852.          parameters (ported from Chicago).  To be compatible, we
  13853.          must break the relationship between the A and W versions
  13854.          of GetStringType.  There will be NO function call for the
  13855.          generic GetStringType.
  13856.  
  13857.          GetStringTypeEx (above) should be used instead. }
  13858.  
  13859. function GetStringTypeA(Locale: LCID; dwInfoType: DWORD; const lpSrcStr: LPCSTR; cchSrc: BOOL; var lpCharType: Word): BOOL;
  13860. function GetStringTypeW(dwInfoType: DWORD; const lpSrcStr: WCHAR; cchSrc: BOOL; var lpCharType: Word): BOOL;
  13861.  
  13862. function FoldStringA(dwMapFlags: DWORD; lpSrcStr: PAnsiChar; cchSrc: Integer;
  13863.   lpDestStr: PAnsiChar; cchDest: Integer): Integer; stdcall;
  13864. function FoldStringW(dwMapFlags: DWORD; lpSrcStr: PWideChar; cchSrc: Integer;
  13865.   lpDestStr: PWideChar; cchDest: Integer): Integer; stdcall;
  13866. function FoldString(dwMapFlags: DWORD; lpSrcStr: PChar; cchSrc: Integer;
  13867.   lpDestStr: PChar; cchDest: Integer): Integer; stdcall;
  13868. function EnumSystemLocalesA(lpLocaleEnumProc: TFNLocaleEnumProc; dwFlags: DWORD): BOOL; stdcall;
  13869. function EnumSystemLocalesW(lpLocaleEnumProc: TFNLocaleEnumProc; dwFlags: DWORD): BOOL; stdcall;
  13870. function EnumSystemLocales(lpLocaleEnumProc: TFNLocaleEnumProc; dwFlags: DWORD): BOOL; stdcall;
  13871. function EnumSystemCodePagesA(lpCodePageEnumProc: TFNCodepageEnumProc; dwFlags: DWORD): BOOL; stdcall;
  13872. function EnumSystemCodePagesW(lpCodePageEnumProc: TFNCodepageEnumProc; dwFlags: DWORD): BOOL; stdcall;
  13873. function EnumSystemCodePages(lpCodePageEnumProc: TFNCodepageEnumProc; dwFlags: DWORD): BOOL; stdcall;
  13874.  
  13875.  
  13876. { Translated from WINCON.H }
  13877.  
  13878. { This module contains the public data structures, data types,
  13879.     and procedures exported by the NT console subsystem. }
  13880.  
  13881. type
  13882.   PCoord = ^TCoord;
  13883.   TCoord = packed record
  13884.     X: SHORT;
  13885.     Y: SHORT;
  13886.   end;
  13887.  
  13888.   PSmallRect = ^TSmallRect;
  13889.   TSmallRect = packed record
  13890.     Left: SHORT;
  13891.     Top: SHORT;
  13892.     Right: SHORT;
  13893.     Bottom: SHORT;
  13894.   end;
  13895.  
  13896.   PKeyEventRecord = ^TKeyEventRecord;
  13897.   TKeyEventRecord = packed record
  13898.     bKeyDown: BOOL;
  13899.     wRepeatCount: Word;
  13900.     wVirtualKeyCode: Word;
  13901.     wVirtualScanCode: Word;
  13902.     case Integer of
  13903.       0: (
  13904.         UnicodeChar: WCHAR);
  13905.       1: (
  13906.         AsciiChar: CHAR;
  13907.         dwControlKeyState: DWORD);
  13908.   end;
  13909.  
  13910. const
  13911. { ControlKeyState flags }
  13912.  
  13913.   RIGHT_ALT_PRESSED = 1;     { the right alt key is pressed. }
  13914.   LEFT_ALT_PRESSED = 2;     { the left alt key is pressed. }
  13915.   RIGHT_CTRL_PRESSED = 4;     { the right ctrl key is pressed. }
  13916.   LEFT_CTRL_PRESSED = 8;     { the left ctrl key is pressed. }
  13917.   SHIFT_PRESSED = $10;     { the shift key is pressed. }
  13918.   NUMLOCK_ON = $20;     { the numlock light is on. }
  13919.   SCROLLLOCK_ON = $40;     { the scrolllock light is on. }
  13920.   CAPSLOCK_ON = $80;     { the capslock light is on. }
  13921.   ENHANCED_KEY = $100;     { the key is enhanced. }
  13922.  
  13923. type
  13924.   PMouseEventRecord = ^TMouseEventRecord;
  13925.   TMouseEventRecord = packed record
  13926.     dwMousePosition: TCoord;
  13927.     dwButtonState: DWORD;
  13928.     dwControlKeyState: DWORD;
  13929.     dwEventFlags: DWORD;
  13930.   end;
  13931.  
  13932. const
  13933. { ButtonState flags }
  13934.  
  13935.   FROM_LEFT_1ST_BUTTON_PRESSED = 1;
  13936.   RIGHTMOST_BUTTON_PRESSED = 2;
  13937.   FROM_LEFT_2ND_BUTTON_PRESSED = 4;
  13938.   FROM_LEFT_3RD_BUTTON_PRESSED = 8;
  13939.   FROM_LEFT_4TH_BUTTON_PRESSED = $10;
  13940.  
  13941. { EventFlags }
  13942.  
  13943.   MOUSE_MOVED = 1;
  13944.   DOUBLE_CLICK = 2;
  13945.  
  13946. type
  13947.   PWindowBufferSizeRecord = ^TWindowBufferSizeRecord;
  13948.   TWindowBufferSizeRecord = packed record
  13949.     dwSize: TCoord;
  13950.   end;
  13951.  
  13952.   PMenuEventRecord = ^TMenuEventRecord;
  13953.   TMenuEventRecord = packed record
  13954.     dwCommandId: UINT;
  13955.   end;
  13956.  
  13957.   PFocusEventRecord = ^TFocusEventRecord;
  13958.   TFocusEventRecord = packed record
  13959.     bSetFocus: BOOL;
  13960.   end;
  13961.  
  13962.   PInputRecord = ^TInputRecord;
  13963.   TInputRecord = record
  13964.     EventType: Word;
  13965.     case Integer of
  13966.       0: (KeyEvent: TKeyEventRecord);
  13967.       1: (MouseEvent: TMouseEventRecord);
  13968.       2: (WindowBufferSizeEvent: TWindowBufferSizeRecord);
  13969.       3: (MenuEvent: TMenuEventRecord);
  13970.       4: (FocusEvent: TFocusEventRecord);
  13971.   end;
  13972.  
  13973.  
  13974. const
  13975. {  EventType flags: }
  13976.  
  13977.   KEY_EVENT = 1;       { Event contains key event record}
  13978.   _MOUSE_EVENT = 2;  { Renamed }   { Event contains mouse event record }
  13979.   WINDOW_BUFFER_SIZE_EVENT = 4;  { Event contains window change event record }
  13980.   MENU_EVENT = 8;     { Event contains menu event record }
  13981.   FOCUS_EVENT = $10;  { event contains focus change }
  13982.  
  13983. type
  13984.   PCharInfo = ^TCharInfo;
  13985.   TCharInfo = packed record
  13986.     case Integer of
  13987.       0: (
  13988.         UnicodeChar: WCHAR);
  13989.       1: (
  13990.         AsciiChar: CHAR;
  13991.         Attributes: Word);
  13992.   end;  
  13993.  
  13994. const
  13995. { Attributes flags:}
  13996.  
  13997.   FOREGROUND_BLUE = 1;    { text color contains blue.}
  13998.   FOREGROUND_GREEN = 2;     { text color contains green. }
  13999.   FOREGROUND_RED = 4;     { text color contains red. }
  14000.   FOREGROUND_INTENSITY = 8;     { text color is intensified. }
  14001.   BACKGROUND_BLUE = $10;     { background color contains blue. }
  14002.   BACKGROUND_GREEN = $20;     { background color contains green. }
  14003.   BACKGROUND_RED = $40;     { background color contains red. }
  14004.   BACKGROUND_INTENSITY = $80;     { background color is intensified. }
  14005.  
  14006. type
  14007.   PConsoleScreenBufferInfo = ^TConsoleScreenBufferInfo;
  14008.   TConsoleScreenBufferInfo = packed record
  14009.     dwSize: TCoord;
  14010.     dwCursorPosition: TCoord;
  14011.     wAttributes: Word;
  14012.     srWindow: TSmallRect;
  14013.     dwMaximumWindowSize: TCoord;
  14014.   end;
  14015.  
  14016.   PConsoleCursorInfo = ^TConsoleCursorInfo;
  14017.   TConsoleCursorInfo = packed record
  14018.     dwSize: DWORD;
  14019.     bVisible: BOOL;
  14020.   end;
  14021.  
  14022. {$IFDEF STRICT}
  14023.   TFNHandlerRoutine = function (CtrlType: DWORD): BOOL stdcall;
  14024. {$ELSE}
  14025.   TFNHandlerRoutine = TFarProc;
  14026. {$ENDIF}
  14027.  
  14028. const
  14029.   CTRL_C_EVENT = 0;
  14030.   CTRL_BREAK_EVENT = 1;
  14031.   CTRL_CLOSE_EVENT = 2;
  14032.   { 3 is reserved! }
  14033.   { 4 is reserved! }
  14034.  
  14035.   CTRL_LOGOFF_EVENT = 5;
  14036.   CTRL_SHUTDOWN_EVENT = 6;
  14037.   ENABLE_PROCESSED_INPUT = 1;     {  Input Mode flags: }
  14038.   ENABLE_LINE_INPUT = 2;
  14039.   ENABLE_ECHO_INPUT = 4;
  14040.   ENABLE_WINDOW_INPUT = 8;
  14041.   ENABLE_MOUSE_INPUT = $10;
  14042.   ENABLE_PROCESSED_OUTPUT = 1;     { Output Mode flags: }
  14043.   ENABLE_WRAP_AT_EOL_OUTPUT = 2;
  14044.  
  14045. { direct API definitions. }
  14046. function PeekConsoleInputA(hConsoleInput: THandle; var lpBuffer: TInputRecord;
  14047.   nLength: DWORD; var lpNumberOfEventsRead: DWORD): BOOL; stdcall;
  14048. function PeekConsoleInputW(hConsoleInput: THandle; var lpBuffer: TInputRecord;
  14049.   nLength: DWORD; var lpNumberOfEventsRead: DWORD): BOOL; stdcall;
  14050. function PeekConsoleInput(hConsoleInput: THandle; var lpBuffer: TInputRecord;
  14051.   nLength: DWORD; var lpNumberOfEventsRead: DWORD): BOOL; stdcall;
  14052. function ReadConsoleInputA(hConsoleInput: THandle; var lpBuffer: TInputRecord;
  14053.   nLength: DWORD; var lpNumberOfEventsRead: DWORD): BOOL; stdcall;
  14054. function ReadConsoleInputW(hConsoleInput: THandle; var lpBuffer: TInputRecord;
  14055.   nLength: DWORD; var lpNumberOfEventsRead: DWORD): BOOL; stdcall;
  14056. function ReadConsoleInput(hConsoleInput: THandle; var lpBuffer: TInputRecord;
  14057.   nLength: DWORD; var lpNumberOfEventsRead: DWORD): BOOL; stdcall;
  14058. function WriteConsoleInputA(hConsoleInput: THandle; const lpBuffer: TInputRecord;
  14059.   nLength: DWORD; var lpNumberOfEventsWritten: DWORD): BOOL; stdcall;
  14060. function WriteConsoleInputW(hConsoleInput: THandle; const lpBuffer: TInputRecord;
  14061.   nLength: DWORD; var lpNumberOfEventsWritten: DWORD): BOOL; stdcall;
  14062. function WriteConsoleInput(hConsoleInput: THandle; const lpBuffer: TInputRecord;
  14063.   nLength: DWORD; var lpNumberOfEventsWritten: DWORD): BOOL; stdcall;
  14064. function ReadConsoleOutputA(hConsoleOutput: THandle; lpBuffer: Pointer;
  14065.   dwBufferSize, dwBufferCoord: TCoord; var lpReadRegion: TSmallRect): BOOL; stdcall;
  14066. function ReadConsoleOutputW(hConsoleOutput: THandle; lpBuffer: Pointer;
  14067.   dwBufferSize, dwBufferCoord: TCoord; var lpReadRegion: TSmallRect): BOOL; stdcall;
  14068. function ReadConsoleOutput(hConsoleOutput: THandle; lpBuffer: Pointer;
  14069.   dwBufferSize, dwBufferCoord: TCoord; var lpReadRegion: TSmallRect): BOOL; stdcall;
  14070. function WriteConsoleOutputA(hConsoleOutput: THandle; lpBuffer: Pointer;
  14071.   dwBufferSize, dwBufferCoord: TCoord; var lpWriteRegion: TSmallRect): BOOL; stdcall;
  14072. function WriteConsoleOutputW(hConsoleOutput: THandle; lpBuffer: Pointer;
  14073.   dwBufferSize, dwBufferCoord: TCoord; var lpWriteRegion: TSmallRect): BOOL; stdcall;
  14074. function WriteConsoleOutput(hConsoleOutput: THandle; lpBuffer: Pointer;
  14075.   dwBufferSize, dwBufferCoord: TCoord; var lpWriteRegion: TSmallRect): BOOL; stdcall;
  14076. function ReadConsoleOutputCharacterA(hConsoleOutput: THandle; lpCharacter: PAnsiChar;
  14077.   nLength: DWORD; dwReadCoord: TCoord; var lpNumberOfCharsRead: DWORD): BOOL; stdcall;
  14078. function ReadConsoleOutputCharacterW(hConsoleOutput: THandle; lpCharacter: PAnsiChar;
  14079.   nLength: DWORD; dwReadCoord: TCoord; var lpNumberOfCharsRead: DWORD): BOOL; stdcall;
  14080. function ReadConsoleOutputCharacter(hConsoleOutput: THandle; lpCharacter: PAnsiChar;
  14081.   nLength: DWORD; dwReadCoord: TCoord; var lpNumberOfCharsRead: DWORD): BOOL; stdcall;
  14082. function ReadConsoleOutputAttribute(hConsoleOutput: THandle; lpAttribute: Pointer;
  14083.   nLength: DWORD; dwReadCoord: TCoord; var lpNumberOfAttrsRead: DWORD): BOOL; stdcall;
  14084. function WriteConsoleOutputCharacterA(hConsoleOutput: THandle;lpCharacter: PAnsiChar;
  14085.   nLength: DWORD; dwWriteCoord: TCoord; var lpNumberOfCharsWritten: DWORD): BOOL; stdcall;
  14086. function WriteConsoleOutputCharacterW(hConsoleOutput: THandle;lpCharacter: PWideChar;
  14087.   nLength: DWORD; dwWriteCoord: TCoord; var lpNumberOfCharsWritten: DWORD): BOOL; stdcall;
  14088. function WriteConsoleOutputCharacter(hConsoleOutput: THandle;lpCharacter: PChar;
  14089.   nLength: DWORD; dwWriteCoord: TCoord; var lpNumberOfCharsWritten: DWORD): BOOL; stdcall;
  14090. function WriteConsoleOutputAttribute(hConsoleOutput: THandle; lpAttribute: Pointer;
  14091.   nLength: DWORD; dwWriteCoord: TCoord; var lpNumberOfAttrsWritten: DWORD): BOOL; stdcall;
  14092. function FillConsoleOutputCharacterA(hConsoleOutput: THandle; cCharacter: AnsiChar;
  14093.   nLength: DWORD; dwWriteCoord: TCoord; var lpNumberOfCharsWritten: DWORD): BOOL; stdcall;
  14094. function FillConsoleOutputCharacterW(hConsoleOutput: THandle; cCharacter: WideChar;
  14095.   nLength: DWORD; dwWriteCoord: TCoord; var lpNumberOfCharsWritten: DWORD): BOOL; stdcall;
  14096. function FillConsoleOutputCharacter(hConsoleOutput: THandle; cCharacter: Char;
  14097.   nLength: DWORD; dwWriteCoord: TCoord; var lpNumberOfCharsWritten: DWORD): BOOL; stdcall;
  14098. function FillConsoleOutputAttribute(hConsoleOutput: THandle; wAttribute: Word;
  14099.   nLength: DWORD; dwWriteCoord: TCoord; var lpNumberOfAttrsWritten: DWORD): BOOL; stdcall;
  14100. function GetConsoleMode(hConsoleHandle: THandle; var lpMode: DWORD): BOOL; stdcall;
  14101. function GetNumberOfConsoleInputEvents(hConsoleInput: THandle;
  14102.   var lpNumberOfEvents: DWORD): BOOL; stdcall;
  14103. function GetConsoleScreenBufferInfo(hConsoleOutput: THandle;
  14104.   var lpConsoleScreenBufferInfo: TConsoleScreenBufferInfo): BOOL; stdcall;
  14105. function GetLargestConsoleWindowSize(hConsoleOutput: THandle): TCoord; stdcall;
  14106. function GetConsoleCursorInfo(hConsoleOutput: THandle;
  14107.   var lpConsoleCursorInfo: TConsoleCursorInfo): BOOL; stdcall;
  14108. function GetNumberOfConsoleMouseButtons(var lpNumberOfMouseButtons: DWORD): BOOL; stdcall;
  14109. function SetConsoleMode(hConsoleHandle: THandle; dwMode: DWORD): BOOL; stdcall;
  14110. function SetConsoleActiveScreenBuffer(hConsoleOutput: THandle): BOOL; stdcall;
  14111. function FlushConsoleInputBuffer(hConsoleInput: THandle): BOOL; stdcall;
  14112. function SetConsoleScreenBufferSize(hConsoleOutput: THandle; dwSize: TCoord): BOOL; stdcall;
  14113. function SetConsoleCursorPosition(hConsoleOutput: THandle; dwCursorPosition: TCoord): BOOL; stdcall;
  14114. function SetConsoleCursorInfo(hConsoleOutput: THandle;
  14115.   const lpConsoleCursorInfo: TConsoleCursorInfo): BOOL; stdcall;
  14116. function ScrollConsoleScreenBufferA(hConsoleOutput: THandle;
  14117.   const lpScrollRectangle: TSmallRect; lpClipRectangle: PSmallRect;
  14118.   dwDestinationOrigin: TCoord; var lpFill: TCharInfo): BOOL; stdcall;
  14119. function ScrollConsoleScreenBufferW(hConsoleOutput: THandle;
  14120.   const lpScrollRectangle: TSmallRect; lpClipRectangle: PSmallRect;
  14121.   dwDestinationOrigin: TCoord; var lpFill: TCharInfo): BOOL; stdcall;
  14122. function ScrollConsoleScreenBuffer(hConsoleOutput: THandle;
  14123.   const lpScrollRectangle: TSmallRect; lpClipRectangle: PSmallRect;
  14124.   dwDestinationOrigin: TCoord; var lpFill: TCharInfo): BOOL; stdcall;
  14125. function SetConsoleWindowInfo(hConsoleOutput: THandle; bAbsolute: BOOL;
  14126.   const lpConsoleWindow: TSmallRect): BOOL; stdcall;
  14127. function SetConsoleTextAttribute(hConsoleOutput: THandle; wAttributes: Word): BOOL; stdcall;
  14128. function SetConsoleCtrlHandler(HandlerRoutine: TFNHandlerRoutine; Add: BOOL): BOOL; stdcall;
  14129. function GenerateConsoleCtrlEvent(dwCtrlEvent: DWORD; dwProcessGroupId: DWORD): BOOL; stdcall;
  14130. function AllocConsole: BOOL; stdcall;
  14131. function FreeConsole: BOOL; stdcall;
  14132. function GetConsoleTitleA(lpConsoleTitle: PAnsiChar; nSize: DWORD): DWORD; stdcall;
  14133. function GetConsoleTitleW(lpConsoleTitle: PWideChar; nSize: DWORD): DWORD; stdcall;
  14134. function GetConsoleTitle(lpConsoleTitle: PChar; nSize: DWORD): DWORD; stdcall;
  14135. function SetConsoleTitleA(lpConsoleTitle: PAnsiChar): BOOL; stdcall;
  14136. function SetConsoleTitleW(lpConsoleTitle: PWideChar): BOOL; stdcall;
  14137. function SetConsoleTitle(lpConsoleTitle: PChar): BOOL; stdcall;
  14138. function ReadConsoleA(hConsoleInput: THandle; lpBuffer: Pointer;
  14139.   nNumberOfCharsToRead: DWORD; var lpNumberOfCharsRead: DWORD; lpReserved: Pointer): BOOL; stdcall;
  14140. function ReadConsoleW(hConsoleInput: THandle; lpBuffer: Pointer;
  14141.   nNumberOfCharsToRead: DWORD; var lpNumberOfCharsRead: DWORD; lpReserved: Pointer): BOOL; stdcall;
  14142. function ReadConsole(hConsoleInput: THandle; lpBuffer: Pointer;
  14143.   nNumberOfCharsToRead: DWORD; var lpNumberOfCharsRead: DWORD; lpReserved: Pointer): BOOL; stdcall;
  14144. function WriteConsoleA(hConsoleOutput: THandle; const lpBuffer: Pointer;
  14145.   nNumberOfCharsToWrite: DWORD; var lpNumberOfCharsWritten: DWORD; lpReserved: Pointer): BOOL; stdcall;
  14146. function WriteConsoleW(hConsoleOutput: THandle; const lpBuffer: Pointer;
  14147.   nNumberOfCharsToWrite: DWORD; var lpNumberOfCharsWritten: DWORD; lpReserved: Pointer): BOOL; stdcall;
  14148. function WriteConsole(hConsoleOutput: THandle; const lpBuffer: Pointer;
  14149.   nNumberOfCharsToWrite: DWORD; var lpNumberOfCharsWritten: DWORD; lpReserved: Pointer): BOOL; stdcall;
  14150.  
  14151. const
  14152.   CONSOLE_TEXTMODE_BUFFER = 1;
  14153.  
  14154. function CreateConsoleScreenBuffer(dwDesiredAccess, dwShareMode: DWORD;
  14155.   lpSecurityAttributes: PSecurityAttributes; dwFlags: DWORD; lpScreenBufferData: Pointer): THandle; stdcall;
  14156. function GetConsoleCP: UINT; stdcall;
  14157. function SetConsoleCP(wCodePageID: UINT): BOOL; stdcall;
  14158. function GetConsoleOutputCP: UINT; stdcall;
  14159. function SetConsoleOutputCP(wCodePageID: UINT): BOOL; stdcall;
  14160.  
  14161.  
  14162. { Translated from WINVER.H }
  14163.  
  14164. { Version management functions, types, and definitions
  14165.   Include file for VER.DLL.  This library is designed to allow version
  14166.   stamping of Windows executable files and of special .VER files for
  14167.   DOS executable files. }
  14168.  
  14169. const
  14170. { Symbols }
  14171.  
  14172.   VS_FILE_INFO = RT_VERSION;
  14173.   VS_VERSION_INFO = 1;
  14174.   VS_USER_DEFINED = 100;
  14175.  
  14176. { VS_VERSION.dwFileFlags }
  14177.  
  14178.   VS_FFI_SIGNATURE = $FEEF04BD;
  14179.   VS_FFI_STRUCVERSION = $10000;
  14180.   VS_FFI_FILEFLAGSMASK = 63;
  14181.  
  14182. { VS_VERSION.dwFileFlags }
  14183.  
  14184.   VS_FF_DEBUG = 1;
  14185.   VS_FF_PRERELEASE = 2;
  14186.   VS_FF_PATCHED = 4;
  14187.   VS_FF_PRIVATEBUILD = 8;
  14188.   VS_FF_INFOINFERRED = $10;
  14189.   VS_FF_SPECIALBUILD = $20;
  14190.  
  14191. { VS_VERSION.dwFileOS }
  14192.  
  14193.   VOS_UNKNOWN = 0;
  14194.   VOS_DOS = $10000;
  14195.   VOS_OS216 = $20000;
  14196.   VOS_OS232 = $30000;
  14197.   VOS_NT = $40000;
  14198.  
  14199.   VOS__BASE = 0;
  14200.   VOS__WINDOWS16 = 1;
  14201.   VOS__PM16 = 2;
  14202.   VOS__PM32 = 3;
  14203.   VOS__WINDOWS32 = 4;
  14204.  
  14205.   VOS_DOS_WINDOWS16 = $10001;
  14206.   VOS_DOS_WINDOWS32 = $10004;
  14207.   VOS_OS216_PM16 = $20002;
  14208.   VOS_OS232_PM32 = $30003;
  14209.   VOS_NT_WINDOWS32 = $40004;
  14210.  
  14211. { VS_VERSION.dwFileType }
  14212.  
  14213.   VFT_UNKNOWN = 0;
  14214.   VFT_APP = 1;
  14215.   VFT_DLL = 2;
  14216.   VFT_DRV = 3;
  14217.   VFT_FONT = 4;
  14218.   VFT_VXD = 5;
  14219.   VFT_STATIC_LIB = 7;
  14220.  
  14221. { VS_VERSION.dwFileSubtype for VFT_WINDOWS_DRV }
  14222.  
  14223.   VFT2_UNKNOWN = 0;
  14224.   VFT2_DRV_PRINTER = 1;
  14225.   VFT2_DRV_KEYBOARD = 2;
  14226.   VFT2_DRV_LANGUAGE = 3;
  14227.   VFT2_DRV_DISPLAY = 4;
  14228.   VFT2_DRV_MOUSE = 5;
  14229.   VFT2_DRV_NETWORK = 6;
  14230.   VFT2_DRV_SYSTEM = 7;
  14231.   VFT2_DRV_INSTALLABLE = 8;
  14232.   VFT2_DRV_SOUND = 9;
  14233.   VFT2_DRV_COMM = 10;
  14234.   VFT2_DRV_INPUTMETHOD = 11;
  14235.  
  14236. { VS_VERSION.dwFileSubtype for VFT_WINDOWS_FONT }
  14237.  
  14238.   VFT2_FONT_RASTER = 1;
  14239.   VFT2_FONT_VECTOR = 2;
  14240.   VFT2_FONT_TRUETYPE = 3;
  14241.  
  14242. { VerFindFile() flags }
  14243.  
  14244.   VFFF_ISSHAREDFILE = 1;
  14245.  
  14246.   VFF_CURNEDEST = 1;
  14247.   VFF_FILEINUSE = 2;
  14248.   VFF_BUFFTOOSMALL = 4;
  14249.  
  14250. { VerInstallFile() flags }
  14251.  
  14252.   VIFF_FORCEINSTALL = 1;
  14253.   VIFF_DONTDELETEOLD = 2;
  14254.  
  14255.   VIF_TEMPFILE = 1;
  14256.   VIF_MISMATCH = 2;
  14257.   VIF_SRCOLD = 4;
  14258.  
  14259.   VIF_DIFFLANG = 8;
  14260.   VIF_DIFFCODEPG = $10;
  14261.   VIF_DIFFTYPE = $20;
  14262.  
  14263.   VIF_WRITEPROT = $40;
  14264.   VIF_FILEINUSE = $80;
  14265.   VIF_OUTOFSPACE = $100;
  14266.   VIF_ACCESSVIOLATION = $200;
  14267.   VIF_SHARINGVIOLATION = $400;
  14268.   VIF_CANNOTCREATE = $800;
  14269.   VIF_CANNOTDELETE = $1000;
  14270.   VIF_CANNOTRENAME = $2000;
  14271.   VIF_CANNOTDELETECUR = $4000;
  14272.   VIF_OUTOFMEMORY = $8000;
  14273.  
  14274.   VIF_CANNOTREADSRC = $10000;
  14275.   VIF_CANNOTREADDST = $20000;
  14276.  
  14277.   VIF_BUFFTOOSMALL = $40000;
  14278.  
  14279. type
  14280.   PVSFixedFileInfo = ^TVSFixedFileInfo;
  14281.   TVSFixedFileInfo = packed record
  14282.     dwSignature: DWORD;        { e.g. $feef04bd }
  14283.     dwStrucVersion: DWORD;     { e.g. $00000042 = "0.42" }
  14284.     dwFileVersionMS: DWORD;    { e.g. $00030075 = "3.75" }
  14285.     dwFileVersionLS: DWORD;    { e.g. $00000031 = "0.31" }
  14286.     dwProductVersionMS: DWORD; { e.g. $00030010 = "3.10" }
  14287.     dwProductVersionLS: DWORD; { e.g. $00000031 = "0.31" }
  14288.     dwFileFlagsMask: DWORD;    { = $3F for version "0.42" }
  14289.     dwFileFlags: DWORD;        { e.g. VFF_DEBUG | VFF_PRERELEASE }
  14290.     dwFileOS: DWORD;           { e.g. VOS_DOS_WINDOWS16 }
  14291.     dwFileType: DWORD;         { e.g. VFT_DRIVER }
  14292.     dwFileSubtype: DWORD;      { e.g. VFT2_DRV_KEYBOARD }
  14293.     dwFileDateMS: DWORD;       { e.g. 0 }
  14294.     dwFileDateLS: DWORD;       { e.g. 0 }
  14295.   end;
  14296.  
  14297. function VerFindFileA(uFlags: DWORD; szFileName, szWinDir, szAppDir, szCurDir: PAnsiChar;
  14298.   var lpuCurDirLen: UINT; szDestDir: PAnsiChar; var lpuDestDirLen: UINT): DWORD; stdcall;
  14299. function VerFindFileW(uFlags: DWORD; szFileName, szWinDir, szAppDir, szCurDir: PWideChar;
  14300.   var lpuCurDirLen: UINT; szDestDir: PWideChar; var lpuDestDirLen: UINT): DWORD; stdcall;
  14301. function VerFindFile(uFlags: DWORD; szFileName, szWinDir, szAppDir, szCurDir: PChar;
  14302.   var lpuCurDirLen: UINT; szDestDir: PChar; var lpuDestDirLen: UINT): DWORD; stdcall;
  14303. function VerInstallFileA(uFlags: DWORD;
  14304.   szSrcFileName, szDestFileName, szSrcDir, szDestDir, szCurDir, szTmpFile: PAnsiChar;
  14305.   var lpuTmpFileLen: UINT): DWORD; stdcall;
  14306. function VerInstallFileW(uFlags: DWORD;
  14307.   szSrcFileName, szDestFileName, szSrcDir, szDestDir, szCurDir, szTmpFile: PWideChar;
  14308.   var lpuTmpFileLen: UINT): DWORD; stdcall;
  14309. function VerInstallFile(uFlags: DWORD;
  14310.   szSrcFileName, szDestFileName, szSrcDir, szDestDir, szCurDir, szTmpFile: PChar;
  14311.   var lpuTmpFileLen: UINT): DWORD; stdcall;
  14312.  
  14313. function GetFileVersionInfoSizeA(lptstrFilename: PAnsiChar; var lpdwHandle: DWORD): DWORD; stdcall;
  14314. function GetFileVersionInfoSizeW(lptstrFilename: PWideChar; var lpdwHandle: DWORD): DWORD; stdcall;
  14315. function GetFileVersionInfoSize(lptstrFilename: PChar; var lpdwHandle: DWORD): DWORD; stdcall;
  14316. function GetFileVersionInfoA(lptstrFilename: PAnsiChar; dwHandle, dwLen: DWORD;
  14317.   lpData: Pointer): BOOL; stdcall;
  14318. function GetFileVersionInfoW(lptstrFilename: PWideChar; dwHandle, dwLen: DWORD;
  14319.   lpData: Pointer): BOOL; stdcall;
  14320. function GetFileVersionInfo(lptstrFilename: PChar; dwHandle, dwLen: DWORD;
  14321.   lpData: Pointer): BOOL; stdcall;
  14322. function VerLanguageNameA(wLang: DWORD; szLang: PAnsiChar; nSize: DWORD): DWORD; stdcall;
  14323. function VerLanguageNameW(wLang: DWORD; szLang: PWideChar; nSize: DWORD): DWORD; stdcall;
  14324. function VerLanguageName(wLang: DWORD; szLang: PChar; nSize: DWORD): DWORD; stdcall;
  14325. function VerQueryValueA(pBlock: Pointer; lpSubBlock: PAnsiChar;
  14326.   var lplpBuffer: Pointer; var puLen: UINT): BOOL; stdcall;
  14327. function VerQueryValueW(pBlock: Pointer; lpSubBlock: PWideChar;
  14328.   var lplpBuffer: Pointer; var puLen: UINT): BOOL; stdcall;
  14329. function VerQueryValue(pBlock: Pointer; lpSubBlock: PChar;
  14330.   var lplpBuffer: Pointer; var puLen: UINT): BOOL; stdcall;
  14331.  
  14332.  
  14333. { Translated from WINREG.H }
  14334.  
  14335. { This module contains the function prototypes and constant, type and
  14336.    structure definitions for the Windows 32-Bit Registry API. }
  14337.  
  14338. type
  14339.   REGSAM = ACCESS_MASK;  { Requested Key access mask type. }
  14340.  
  14341. {$IFDEF STRICT}
  14342.   HKEY__ = packed record
  14343.     unused: BOOL;
  14344.   end;
  14345.   HKEY = ^HKEY__;
  14346. {$ELSE}
  14347.   HKEY = Integer;
  14348. {$ENDIF}
  14349.   PHKEY = ^HKEY;
  14350.  
  14351. const
  14352. { Reserved Key Handles. }
  14353.  
  14354.   HKEY_CLASSES_ROOT     = $80000000;
  14355.   HKEY_CURRENT_USER     = $80000001;
  14356.   HKEY_LOCAL_MACHINE    = $80000002;
  14357.   HKEY_USERS            = $80000003;
  14358.   HKEY_PERFORMANCE_DATA = $80000004;
  14359.   HKEY_CURRENT_CONFIG   = $80000005;
  14360.   HKEY_DYN_DATA         = $80000006;
  14361.  
  14362.  
  14363.   PROVIDER_KEEPS_VALUE_LENGTH = 1;
  14364.  
  14365. type
  14366.   PValContext = ^TValContext;
  14367.   TValContext = packed record
  14368.     valuelen: Integer;       { the total length of this value }
  14369.     value_context: Pointer;  { provider's context }
  14370.     val_buff_ptr: Pointer;   { where in the ouput buffer the value is }
  14371.   end;
  14372.  
  14373.  
  14374. type
  14375. { Provider supplied value/context.}
  14376.   PPValueA = ^TPValueA;
  14377.   PPValueW = ^TPValueW;
  14378.   PPValue = PPValueA;
  14379.   TPValueA = packed record
  14380.     pv_valuename: PAnsiChar;           { The value name pointer }
  14381.     pv_valuelen: BOOL;
  14382.     pv_value_context: Pointer;
  14383.     pv_type: DWORD;
  14384.   end;
  14385.   TPValueW = packed record
  14386.     pv_valuename: PWideChar;           { The value name pointer }
  14387.     pv_valuelen: BOOL;
  14388.     pv_value_context: Pointer;
  14389.     pv_type: DWORD;
  14390.   end;
  14391.   TPValue = TPValueA;
  14392.  
  14393. {$IFDEF STRICT}
  14394.   TFNQueryHandler = function (keycontext: Pointer; const val_list: TValContext;
  14395.     num_vals: DWORD; outputbuffer: Pointer; var total_outlen: DWORD;
  14396.     input_blen: DWORD): DWORD stdcall;
  14397. {$ELSE}
  14398.   TFNQueryHandler = TFarProc;
  14399. {$ENDIF}
  14400.   PFNQueryHandler = ^TFNQueryHandler;
  14401.  
  14402.   PProviderInfo = ^TProviderInfo;
  14403.   TProviderInfo = packed record
  14404.     pi_R0_1val: PFNQueryHandler;
  14405.     pi_R0_allvals: PFNQueryHandler;
  14406.     pi_R3_1val: PFNQueryHandler;
  14407.     pi_R3_allvals: PFNQueryHandler;
  14408.     pi_flags: DWORD;              { capability flags (none defined yet). }
  14409.     pi_key_context: Pointer;
  14410.   end;
  14411.   TRegProvider = TProviderInfo;
  14412.   PProvider = PProviderInfo;
  14413.  
  14414.   PValueEntA = ^TValueEntA;
  14415.   PValueEntW = ^TValueEntW;
  14416.   PValueEnt = PValueEntA;
  14417.   TValueEntA = packed record
  14418.     ve_valuename: PAnsiChar;
  14419.     ve_valuelen: DWORD;
  14420.     ve_valueptr: DWORD;
  14421.     ve_type: DWORD;
  14422.   end;
  14423.   TValueEntW = packed record
  14424.     ve_valuename: PWideChar;
  14425.     ve_valuelen: DWORD;
  14426.     ve_valueptr: DWORD;
  14427.     ve_type: DWORD;
  14428.   end;
  14429.   TValueEnt = TValueEntA;
  14430.   TValEnt = TValueEnt;
  14431.   PValEnt = PValueEnt;
  14432.  
  14433.  
  14434. { Default values for parameters that do not exist in the Win 3.1
  14435.   compatible APIs. }
  14436.  
  14437. function RegCloseKey(hKey: HKEY): Longint; stdcall;
  14438.  
  14439. function RegConnectRegistryA(lpMachineName: PAnsiChar; hKey: HKEY;
  14440.   var phkResult: HKEY): Longint; stdcall;
  14441. function RegConnectRegistryW(lpMachineName: PWideChar; hKey: HKEY;
  14442.   var phkResult: HKEY): Longint; stdcall;
  14443. function RegConnectRegistry(lpMachineName: PChar; hKey: HKEY;
  14444.   var phkResult: HKEY): Longint; stdcall;
  14445. function RegCreateKeyA(hKey: HKEY; lpSubKey: PAnsiChar;
  14446.   var phkResult: HKEY): Longint; stdcall;
  14447. function RegCreateKeyW(hKey: HKEY; lpSubKey: PWideChar;
  14448.   var phkResult: HKEY): Longint; stdcall;
  14449. function RegCreateKey(hKey: HKEY; lpSubKey: PChar;
  14450.   var phkResult: HKEY): Longint; stdcall;
  14451. function RegCreateKeyExA(hKey: HKEY; lpSubKey: PAnsiChar;
  14452.   Reserved: DWORD; lpClass: PAnsiChar; dwOptions: DWORD; samDesired: REGSAM;
  14453.   lpSecurityAttributes: PSecurityAttributes; var phkResult: HKEY;
  14454.   lpdwDisposition: PDWORD): Longint; stdcall;
  14455. function RegCreateKeyExW(hKey: HKEY; lpSubKey: PWideChar;
  14456.   Reserved: DWORD; lpClass: PWideChar; dwOptions: DWORD; samDesired: REGSAM;
  14457.   lpSecurityAttributes: PSecurityAttributes; var phkResult: HKEY;
  14458.   lpdwDisposition: PDWORD): Longint; stdcall;
  14459. function RegCreateKeyEx(hKey: HKEY; lpSubKey: PChar;
  14460.   Reserved: DWORD; lpClass: PChar; dwOptions: DWORD; samDesired: REGSAM;
  14461.   lpSecurityAttributes: PSecurityAttributes; var phkResult: HKEY;
  14462.   lpdwDisposition: PDWORD): Longint; stdcall;
  14463. function RegDeleteKeyA(hKey: HKEY; lpSubKey: PAnsiChar): Longint; stdcall;
  14464. function RegDeleteKeyW(hKey: HKEY; lpSubKey: PWideChar): Longint; stdcall;
  14465. function RegDeleteKey(hKey: HKEY; lpSubKey: PChar): Longint; stdcall;
  14466. function RegDeleteValueA(hKey: HKEY; lpValueName: PAnsiChar): Longint; stdcall;
  14467. function RegDeleteValueW(hKey: HKEY; lpValueName: PWideChar): Longint; stdcall;
  14468. function RegDeleteValue(hKey: HKEY; lpValueName: PChar): Longint; stdcall;
  14469. function RegEnumKeyA(hKey: HKEY; dwIndex: DWORD; lpName: PAnsiChar; cbName: DWORD): Longint; stdcall;
  14470. function RegEnumKeyW(hKey: HKEY; dwIndex: DWORD; lpName: PWideChar; cbName: DWORD): Longint; stdcall;
  14471. function RegEnumKey(hKey: HKEY; dwIndex: DWORD; lpName: PChar; cbName: DWORD): Longint; stdcall;
  14472. function RegEnumKeyExA(hKey: HKEY; dwIndex: DWORD; lpName: PAnsiChar;
  14473.   var lpcbName: DWORD; lpReserved: Pointer; lpClass: PAnsiChar;
  14474.   lpcbClass: PDWORD; lpftLastWriteTime: PFileTime): Longint; stdcall;
  14475. function RegEnumKeyExW(hKey: HKEY; dwIndex: DWORD; lpName: PWideChar;
  14476.   var lpcbName: DWORD; lpReserved: Pointer; lpClass: PWideChar;
  14477.   lpcbClass: PDWORD; lpftLastWriteTime: PFileTime): Longint; stdcall;
  14478. function RegEnumKeyEx(hKey: HKEY; dwIndex: DWORD; lpName: PChar;
  14479.   var lpcbName: DWORD; lpReserved: Pointer; lpClass: PChar;
  14480.   lpcbClass: PDWORD; lpftLastWriteTime: PFileTime): Longint; stdcall;
  14481. function RegEnumValueA(hKey: HKEY; dwIndex: DWORD; lpValueName: PChar;
  14482.   var lpcbValueName: DWORD; lpReserved: Pointer; lpType: PDWORD;
  14483.   lpData: PByte; lpcbData: PDWORD): Longint; stdcall;
  14484. function RegEnumValueW(hKey: HKEY; dwIndex: DWORD; lpValueName: PChar;
  14485.   var lpcbValueName: DWORD; lpReserved: Pointer; lpType: PDWORD;
  14486.   lpData: PByte; lpcbData: PDWORD): Longint; stdcall;
  14487. function RegEnumValue(hKey: HKEY; dwIndex: DWORD; lpValueName: PChar;
  14488.   var lpcbValueName: DWORD; lpReserved: Pointer; lpType: PDWORD;
  14489.   lpData: PByte; lpcbData: PDWORD): Longint; stdcall;
  14490. function RegFlushKey(hKey: HKEY): Longint; stdcall;
  14491. function RegGetKeySecurity(hKey: HKEY; SecurityInformation: SECURITY_INFORMATION;
  14492.   pSecurityDescriptor: PSecurityDescriptor; var lpcbSecurityDescriptor: DWORD): Longint; stdcall;
  14493. function RegLoadKeyA(hKey: HKEY; lpSubKey, lpFile: PAnsiChar): Longint; stdcall;
  14494. function RegLoadKeyW(hKey: HKEY; lpSubKey, lpFile: PWideChar): Longint; stdcall;
  14495. function RegLoadKey(hKey: HKEY; lpSubKey, lpFile: PChar): Longint; stdcall;
  14496. function RegNotifyChangeKeyValue(hKey: HKEY; bWatchSubtree: BOOL;
  14497.   dwNotifyFilter: DWORD; hEvent: THandle; fAsynchronus: BOOL): Longint; stdcall;
  14498. function RegOpenKeyA(hKey: HKEY; lpSubKey: PAnsiChar; var phkResult: HKEY): Longint; stdcall;
  14499. function RegOpenKeyW(hKey: HKEY; lpSubKey: PWideChar; var phkResult: HKEY): Longint; stdcall;
  14500. function RegOpenKey(hKey: HKEY; lpSubKey: PChar; var phkResult: HKEY): Longint; stdcall;
  14501. function RegOpenKeyExA(hKey: HKEY; lpSubKey: PAnsiChar;
  14502.   ulOptions: DWORD; samDesired: REGSAM; var phkResult: HKEY): Longint; stdcall;
  14503. function RegOpenKeyExW(hKey: HKEY; lpSubKey: PWideChar;
  14504.   ulOptions: DWORD; samDesired: REGSAM; var phkResult: HKEY): Longint; stdcall;
  14505. function RegOpenKeyEx(hKey: HKEY; lpSubKey: PChar;
  14506.   ulOptions: DWORD; samDesired: REGSAM; var phkResult: HKEY): Longint; stdcall;
  14507. function RegQueryInfoKeyA(hKey: HKEY; lpClass: PChar;
  14508.   lpcbClass: PDWORD; lpReserved: Pointer;
  14509.   lpcSubKeys, lpcbMaxSubKeyLen, lpcbMaxClassLen, lpcValues,
  14510.   lpcbMaxValueNameLen, lpcbMaxValueLen, lpcbSecurityDescriptor: PDWORD;
  14511.   lpftLastWriteTime: PFileTime): Longint; stdcall;
  14512. function RegQueryInfoKeyW(hKey: HKEY; lpClass: PChar;
  14513.   lpcbClass: PDWORD; lpReserved: Pointer;
  14514.   lpcSubKeys, lpcbMaxSubKeyLen, lpcbMaxClassLen, lpcValues,
  14515.   lpcbMaxValueNameLen, lpcbMaxValueLen, lpcbSecurityDescriptor: PDWORD;
  14516.   lpftLastWriteTime: PFileTime): Longint; stdcall;
  14517. function RegQueryInfoKey(hKey: HKEY; lpClass: PChar;
  14518.   lpcbClass: PDWORD; lpReserved: Pointer;
  14519.   lpcSubKeys, lpcbMaxSubKeyLen, lpcbMaxClassLen, lpcValues,
  14520.   lpcbMaxValueNameLen, lpcbMaxValueLen, lpcbSecurityDescriptor: PDWORD;
  14521.   lpftLastWriteTime: PFileTime): Longint; stdcall;
  14522. function RegQueryValueA(hKey: HKEY; lpSubKey: PAnsiChar;
  14523.   lpValue: PAnsiChar; var lpcbValue: Longint): Longint; stdcall;
  14524. function RegQueryValueW(hKey: HKEY; lpSubKey: PWideChar;
  14525.   lpValue: PWideChar; var lpcbValue: Longint): Longint; stdcall;
  14526. function RegQueryValue(hKey: HKEY; lpSubKey: PChar;
  14527.   lpValue: PChar; var lpcbValue: Longint): Longint; stdcall;
  14528. function RegQueryMultipleValuesA(hKey: HKEY; var ValList;
  14529.   NumVals: DWORD; lpValueBuf: PAnsiChar; var ldwTotsize: DWORD): Longint; stdcall;
  14530. function RegQueryMultipleValuesW(hKey: HKEY; var ValList;
  14531.   NumVals: DWORD; lpValueBuf: PWideChar; var ldwTotsize: DWORD): Longint; stdcall;
  14532. function RegQueryMultipleValues(hKey: HKEY; var ValList;
  14533.   NumVals: DWORD; lpValueBuf: PChar; var ldwTotsize: DWORD): Longint; stdcall;
  14534. function RegQueryValueExA(hKey: HKEY; lpValueName: PAnsiChar;
  14535.   lpReserved: Pointer; lpType: PDWORD; lpData: PByte; lpcbData: PDWORD): Longint; stdcall;
  14536. function RegQueryValueExW(hKey: HKEY; lpValueName: PWideChar;
  14537.   lpReserved: Pointer; lpType: PDWORD; lpData: PByte; lpcbData: PDWORD): Longint; stdcall;
  14538. function RegQueryValueEx(hKey: HKEY; lpValueName: PChar;
  14539.   lpReserved: Pointer; lpType: PDWORD; lpData: PByte; lpcbData: PDWORD): Longint; stdcall;
  14540. function RegReplaceKeyA(hKey: HKEY; lpSubKey: PAnsiChar;
  14541.    lpNewFile: PAnsiChar; lpOldFile: PAnsiChar): Longint; stdcall;
  14542. function RegReplaceKeyW(hKey: HKEY; lpSubKey: PWideChar;
  14543.    lpNewFile: PWideChar; lpOldFile: PWideChar): Longint; stdcall;
  14544. function RegReplaceKey(hKey: HKEY; lpSubKey: PChar;
  14545.    lpNewFile: PChar; lpOldFile: PChar): Longint; stdcall;
  14546. function RegRestoreKeyA(hKey: HKEY; lpFile: PAnsiChar; dwFlags: DWORD): Longint; stdcall;
  14547. function RegRestoreKeyW(hKey: HKEY; lpFile: PWideChar; dwFlags: DWORD): Longint; stdcall;
  14548. function RegRestoreKey(hKey: HKEY; lpFile: PChar; dwFlags: DWORD): Longint; stdcall;
  14549. function RegSaveKeyA(hKey: HKEY; lpFile: PAnsiChar;
  14550.   lpSecurityAttributes: PSecurityAttributes): Longint; stdcall;
  14551. function RegSaveKeyW(hKey: HKEY; lpFile: PWideChar;
  14552.   lpSecurityAttributes: PSecurityAttributes): Longint; stdcall;
  14553. function RegSaveKey(hKey: HKEY; lpFile: PChar;
  14554.   lpSecurityAttributes: PSecurityAttributes): Longint; stdcall;
  14555. function RegSetKeySecurity(hKey: HKEY; SecurityInformation: SECURITY_INFORMATION;
  14556.   pSecurityDescriptor: PSECURITY_DESCRIPTOR): Longint; stdcall;
  14557. function RegSetValueA(hKey: HKEY; lpSubKey: PAnsiChar;
  14558.   dwType: DWORD; lpData: PAnsiChar; cbData: DWORD): Longint; stdcall;
  14559. function RegSetValueW(hKey: HKEY; lpSubKey: PWideChar;
  14560.   dwType: DWORD; lpData: PWideChar; cbData: DWORD): Longint; stdcall;
  14561. function RegSetValue(hKey: HKEY; lpSubKey: PChar;
  14562.   dwType: DWORD; lpData: PChar; cbData: DWORD): Longint; stdcall;
  14563. function RegSetValueExA(hKey: HKEY; lpValueName: PAnsiChar;
  14564.   Reserved: DWORD; dwType: DWORD; lpData: Pointer; cbData: DWORD): Longint; stdcall;
  14565. function RegSetValueExW(hKey: HKEY; lpValueName: PWideChar;
  14566.   Reserved: DWORD; dwType: DWORD; lpData: Pointer; cbData: DWORD): Longint; stdcall;
  14567. function RegSetValueEx(hKey: HKEY; lpValueName: PChar;
  14568.   Reserved: DWORD; dwType: DWORD; lpData: Pointer; cbData: DWORD): Longint; stdcall;
  14569. function RegUnLoadKeyA(hKey: HKEY; lpSubKey: PAnsiChar): Longint; stdcall;
  14570. function RegUnLoadKeyW(hKey: HKEY; lpSubKey: PWideChar): Longint; stdcall;
  14571. function RegUnLoadKey(hKey: HKEY; lpSubKey: PChar): Longint; stdcall;
  14572.  
  14573. { Remoteable System Shutdown APIs }
  14574.  
  14575. function InitiateSystemShutdownA(lpMachineName, lpMessage: PAnsiChar;
  14576.   dwTimeout: DWORD; bForceAppsClosed, bRebootAfterShutdown: BOOL): BOOL; stdcall;
  14577. function InitiateSystemShutdownW(lpMachineName, lpMessage: PWideChar;
  14578.   dwTimeout: DWORD; bForceAppsClosed, bRebootAfterShutdown: BOOL): BOOL; stdcall;
  14579. function InitiateSystemShutdown(lpMachineName, lpMessage: PChar;
  14580.   dwTimeout: DWORD; bForceAppsClosed, bRebootAfterShutdown: BOOL): BOOL; stdcall;
  14581. function AbortSystemShutdownA(lpMachineName: PAnsiChar): BOOL; stdcall;
  14582. function AbortSystemShutdownW(lpMachineName: PWideChar): BOOL; stdcall;
  14583. function AbortSystemShutdown(lpMachineName: PChar): BOOL; stdcall;
  14584.  
  14585.  
  14586. { Translated from WINNETWK.H }
  14587.  
  14588. const
  14589. { Network types }
  14590.  
  14591.   WNNC_NET_MSNET = $10000;
  14592.   WNNC_NET_LANMAN = $20000;
  14593.   WNNC_NET_NETWARE = $30000;
  14594.   WNNC_NET_VINES = $40000;
  14595.   WNNC_NET_10NET = $50000;
  14596.   WNNC_NET_LOCUS = $60000;
  14597.   WNNC_NET_SUN_PC_NFS = $70000;
  14598.   WNNC_NET_LANSTEP = $80000;
  14599.   WNNC_NET_9TILES = $90000;
  14600.   WNNC_NET_LANTASTIC = $A0000;
  14601.   WNNC_NET_AS400 = $B0000;
  14602.   WNNC_NET_FTP_NFS = $C0000;
  14603.   WNNC_NET_PATHWORKS = $D0000;
  14604.   WNNC_NET_LIFENET = $E0000;
  14605.   WNNC_NET_POWERLAN = $F0000;
  14606.   WNNC_NET_BWNFS = $100000;
  14607.   WNNC_NET_COGENT = $110000;
  14608.   WNNC_NET_FARALLON = $120000;
  14609.   WNNC_NET_APPLETALK = $130000;
  14610.  
  14611. { Network Resources. }
  14612.  
  14613.   RESOURCE_CONNECTED = 1;
  14614.   RESOURCE_GLOBALNET = 2;
  14615.   RESOURCE_REMEMBERED = 3;
  14616.   RESOURCE_RECENT = 4;
  14617.   RESOURCE_CONTEXT = 5;
  14618.  
  14619.   RESOURCETYPE_ANY = 0;
  14620.   RESOURCETYPE_DISK = 1;
  14621.   RESOURCETYPE_PRINT = 2;
  14622.   RESOURCETYPE_RESERVED = 8;
  14623.   RESOURCETYPE_UNKNOWN = $FFFFFFFF;
  14624.  
  14625.   RESOURCEUSAGE_CONNECTABLE = 1;
  14626.   RESOURCEUSAGE_CONTAINER = 2;
  14627.   RESOURCEUSAGE_NOLOCALDEVICE = 4;
  14628.   RESOURCEUSAGE_SIBLING = 8;
  14629.  
  14630.   RESOURCEUSAGE_ALL = (RESOURCEUSAGE_CONNECTABLE or RESOURCEUSAGE_CONTAINER);
  14631.   RESOURCEUSAGE_RESERVED = $80000000;
  14632.  
  14633.   RESOURCEDISPLAYTYPE_GENERIC = 0;
  14634.   RESOURCEDISPLAYTYPE_DOMAIN = 1;
  14635.   RESOURCEDISPLAYTYPE_SERVER = 2;
  14636.   RESOURCEDISPLAYTYPE_SHARE = 3;
  14637.   RESOURCEDISPLAYTYPE_FILE = 4;
  14638.   RESOURCEDISPLAYTYPE_GROUP = 5;
  14639.   RESOURCEDISPLAYTYPE_NETWORK = 6;
  14640.   RESOURCEDISPLAYTYPE_ROOT = 7;
  14641.   RESOURCEDISPLAYTYPE_SHAREADMIN = 8;
  14642.   RESOURCEDISPLAYTYPE_DIRECTORY = 9;
  14643.   RESOURCEDISPLAYTYPE_TREE = 10;
  14644.  
  14645. type
  14646.   PNetResourceA = ^TNetResourceA;
  14647.   PNetResourceW = ^TNetResourceW;
  14648.   PNetResource = PNetResourceA;
  14649.   TNetResourceA = packed record
  14650.     dwScope: DWORD;
  14651.     dwType: DWORD;
  14652.     dwDisplayType: DWORD;
  14653.     dwUsage: DWORD;
  14654.     lpLocalName: PAnsiChar;
  14655.     lpRemoteName: PAnsiChar;
  14656.     lpComment: PAnsiChar;
  14657.     lpProvider: PAnsiChar;
  14658.   end;
  14659.   TNetResourceW = packed record
  14660.     dwScope: DWORD;
  14661.     dwType: DWORD;
  14662.     dwDisplayType: DWORD;
  14663.     dwUsage: DWORD;
  14664.     lpLocalName: PWideChar;
  14665.     lpRemoteName: PWideChar;
  14666.     lpComment: PWideChar;
  14667.     lpProvider: PWideChar;
  14668.   end;
  14669.   TNetResource = TNetResourceA;
  14670.  
  14671. const
  14672. { Network Connections. }
  14673.  
  14674.   NETPROPERTY_PERSISTENT = 1;
  14675.  
  14676.   CONNECT_UPDATE_PROFILE = 1;
  14677.   CONNECT_UPDATE_RECENT = 2;
  14678.   CONNECT_TEMPORARY = 4;
  14679.   CONNECT_INTERACTIVE = 8;
  14680.   CONNECT_PROMPT = $10;
  14681.   CONNECT_NEED_DRIVE = $20;
  14682.   CONNECT_REFCOUNT = $40;
  14683.   CONNECT_REDIRECT = $80;
  14684.   CONNECT_LOCALDRIVE = $100;
  14685.   CONNECT_CURRENT_MEDIA = $200;
  14686.  
  14687. function WNetAddConnectionA(lpRemoteName, lpPassword, lpLocalName: PAnsiChar): DWORD; stdcall;
  14688. function WNetAddConnectionW(lpRemoteName, lpPassword, lpLocalName: PWideChar): DWORD; stdcall;
  14689. function WNetAddConnection(lpRemoteName, lpPassword, lpLocalName: PChar): DWORD; stdcall;
  14690. function WNetAddConnection2A(var lpNetResource: TNetResourceA;
  14691.   lpPassword, lpUserName: PAnsiChar; dwFlags: DWORD): DWORD; stdcall;
  14692. function WNetAddConnection2W(var lpNetResource: TNetResourceW;
  14693.   lpPassword, lpUserName: PWideChar; dwFlags: DWORD): DWORD; stdcall;
  14694. function WNetAddConnection2(var lpNetResource: TNetResource;
  14695.   lpPassword, lpUserName: PChar; dwFlags: DWORD): DWORD; stdcall;
  14696. function WNetAddConnection3A(hwndOwner: HWND; var lpNetResource: TNetResourceA;
  14697.   lpPassword, lpUserName: PAnsiChar; dwFlags: DWORD): DWORD; stdcall;
  14698. function WNetAddConnection3W(hwndOwner: HWND; var lpNetResource: TNetResourceW;
  14699.   lpPassword, lpUserName: PWideChar; dwFlags: DWORD): DWORD; stdcall;
  14700. function WNetAddConnection3(hwndOwner: HWND; var lpNetResource: TNetResource;
  14701.   lpPassword, lpUserName: PChar; dwFlags: DWORD): DWORD; stdcall;
  14702. function WNetCancelConnectionA(lpName: PAnsiChar; fForce: BOOL): DWORD; stdcall;
  14703. function WNetCancelConnectionW(lpName: PWideChar; fForce: BOOL): DWORD; stdcall;
  14704. function WNetCancelConnection(lpName: PChar; fForce: BOOL): DWORD; stdcall;
  14705. function WNetCancelConnection2A(lpName: PAnsiChar; dwFlags: DWORD; fForce: BOOL): DWORD; stdcall;
  14706. function WNetCancelConnection2W(lpName: PWideChar; dwFlags: DWORD; fForce: BOOL): DWORD; stdcall;
  14707. function WNetCancelConnection2(lpName: PChar; dwFlags: DWORD; fForce: BOOL): DWORD; stdcall;
  14708. function WNetGetConnectionA(lpLocalName: PAnsiChar;
  14709.   lpRemoteName: PAnsiChar; var lpnLength: DWORD): DWORD; stdcall;
  14710. function WNetGetConnectionW(lpLocalName: PWideChar;
  14711.   lpRemoteName: PWideChar; var lpnLength: DWORD): DWORD; stdcall;
  14712. function WNetGetConnection(lpLocalName: PChar;
  14713.   lpRemoteName: PChar; var lpnLength: DWORD): DWORD; stdcall;
  14714. function WNetUseConnectionA(hwndOwner: HWND;
  14715.   var lpNetResource: TNetResourceA; lpUserID: PAnsiChar;
  14716.   lpPassword: PAnsiChar; dwFlags: DWORD; lpAccessName: PAnsiChar;
  14717.   var lpBufferSize: DWORD; var lpResult: DWORD): DWORD; stdcall;
  14718. function WNetUseConnectionW(hwndOwner: HWND;
  14719.   var lpNetResource: TNetResourceW; lpUserID: PWideChar;
  14720.   lpPassword: PWideChar; dwFlags: DWORD; lpAccessName: PWideChar;
  14721.   var lpBufferSize: DWORD; var lpResult: DWORD): DWORD; stdcall;
  14722. function WNetUseConnection(hwndOwner: HWND;
  14723.   var lpNetResource: TNetResource; lpUserID: PChar;
  14724.   lpPassword: PChar; dwFlags: DWORD; lpAccessName: PChar;
  14725.   var lpBufferSize: DWORD; var lpResult: DWORD): DWORD; stdcall;
  14726. function WNetSetConnectionA(lpName: PAnsiChar; dwProperties: DWORD; pvValues: Pointer): DWORD; stdcall;
  14727. function WNetSetConnectionW(lpName: PWideChar; dwProperties: DWORD; pvValues: Pointer): DWORD; stdcall;
  14728. function WNetSetConnection(lpName: PChar; dwProperties: DWORD; pvValues: Pointer): DWORD; stdcall;
  14729.  
  14730. { Network Connection Dialogs. }
  14731.  
  14732. function WNetConnectionDialog(hwnd: HWND; dwType: DWORD): DWORD; stdcall;
  14733. function WNetDisconnectDialog(hwnd: HWND; dwType: DWORD): DWORD; stdcall;
  14734.  
  14735. type
  14736.   PConnectDlgStruct = ^TConnectDlgStruct;
  14737.   TConnectDlgStruct = packed record
  14738.     cbStructure: DWORD;          { size of this structure in bytes }
  14739.     hwndOwner: HWND;             { owner window for the dialog }
  14740.     lpConnRes: PNetResource;     { Requested Resource info    }
  14741.     dwFlags: DWORD;              { flags (see below) }
  14742.     dwDevNum: DWORD;             { number of devices connected to }
  14743.   end;
  14744.  
  14745. const
  14746.   CONNDLG_RO_PATH = 1;    { Resource path should be read-only     }
  14747.   CONNDLG_CONN_POINT = 2; { Netware -style movable connection point enabled  }
  14748.   CONNDLG_USE_MRU = 4;    { Use MRU combobox   }
  14749.   CONNDLG_HIDE_BOX = 8;   { Hide persistent connect checkbox   }
  14750.  
  14751.   { NOTE:  Set at most ONE of the below flags.  If neither flag is set,
  14752.            then the persistence is set to whatever the user chose during
  14753.            a previous connection }
  14754.  
  14755.   CONNDLG_PERSIST = $10;       { Force persistent connection  }
  14756.   CONNDLG_NOT_PERSIST = $20;   { Force connection NOT persistent  }
  14757.  
  14758. function WNetConnectionDialog1A(var lpConnDlgStruct: TConnectDlgStruct): DWORD; stdcall;
  14759. function WNetConnectionDialog1W(var lpConnDlgStruct: TConnectDlgStruct): DWORD; stdcall;
  14760. function WNetConnectionDialog1(var lpConnDlgStruct: TConnectDlgStruct): DWORD; stdcall;
  14761.  
  14762. type
  14763.   PDiscDlgStructA = ^TDiscDlgStructA;
  14764.   PDiscDlgStructW = ^TDiscDlgStructW;
  14765.   PDiscDlgStruct = PDiscDlgStructA;
  14766.   TDiscDlgStructA = packed record
  14767.     cbStructure: DWORD;       { size of this structure in bytes }
  14768.     hwndOwner: HWND;          { owner window for the dialog }
  14769.     lpLocalName: PAnsiChar;       { local device name }
  14770.     lpRemoteName: PAnsiChar;      { network resource name }
  14771.     dwFlags: DWORD;
  14772.   end;
  14773.   TDiscDlgStructW = packed record
  14774.     cbStructure: DWORD;       { size of this structure in bytes }
  14775.     hwndOwner: HWND;          { owner window for the dialog }
  14776.     lpLocalName: PWideChar;       { local device name }
  14777.     lpRemoteName: PWideChar;      { network resource name }
  14778.     dwFlags: DWORD;
  14779.   end;
  14780.   TDiscDlgStruct = TDiscDlgStructA;
  14781.  
  14782. const
  14783.   DISC_UPDATE_PROFILE = 1;
  14784.   DISC_NO_FORCE = $40;
  14785.  
  14786. function WNetDisconnectDialog1A(var lpConnDlgStruct: TDiscDlgStructA): DWORD; stdcall;
  14787. function WNetDisconnectDialog1W(var lpConnDlgStruct: TDiscDlgStructW): DWORD; stdcall;
  14788. function WNetDisconnectDialog1(var lpConnDlgStruct: TDiscDlgStruct): DWORD; stdcall;
  14789.  
  14790. { Network Browsing. }
  14791.  
  14792. function WNetOpenEnumA(dwScope, dwType, dwUsage: DWORD;
  14793.   lpNetResource: PNetResourceA; var lphEnum: THandle): DWORD; stdcall;
  14794. function WNetOpenEnumW(dwScope, dwType, dwUsage: DWORD;
  14795.   lpNetResource: PNetResourceW; var lphEnum: THandle): DWORD; stdcall;
  14796. function WNetOpenEnum(dwScope, dwType, dwUsage: DWORD;
  14797.   lpNetResource: PNetResource; var lphEnum: THandle): DWORD; stdcall;
  14798. function WNetEnumResourceA(hEnum: THandle; var lpcCount: DWORD;
  14799.   lpBuffer: Pointer; var lpBufferSize: DWORD): DWORD; stdcall;
  14800. function WNetEnumResourceW(hEnum: THandle; var lpcCount: DWORD;
  14801.   lpBuffer: Pointer; var lpBufferSize: DWORD): DWORD; stdcall;
  14802. function WNetEnumResource(hEnum: THandle; var lpcCount: DWORD;
  14803.   lpBuffer: Pointer; var lpBufferSize: DWORD): DWORD; stdcall;
  14804. function WNetCloseEnum(hEnum: THandle): DWORD; stdcall;
  14805.  
  14806. const
  14807. { Universal Naming. }
  14808.  
  14809.   UNIVERSAL_NAME_INFO_LEVEL = 1;
  14810.   REMOTE_NAME_INFO_LEVEL = 2;
  14811.  
  14812. type
  14813.   PUniversalNameInfoA = ^TUniversalNameInfoA;
  14814.   PUniversalNameInfoW = ^TUniversalNameInfoW;
  14815.   PUniversalNameInfo = PUniversalNameInfoA;
  14816.   TUniversalNameInfoA = packed record
  14817.     lpUniversalName: PAnsiChar;
  14818.   end;
  14819.   TUniversalNameInfoW = packed record
  14820.     lpUniversalName: PWideChar;
  14821.   end;
  14822.   TUniversalNameInfo = TUniversalNameInfoA;
  14823.  
  14824.   PRemoteNameInfoA = ^TRemoteNameInfoA;
  14825.   PRemoteNameInfoW = ^TRemoteNameInfoW;
  14826.   PRemoteNameInfo = PRemoteNameInfoA;
  14827.   TRemoteNameInfoA = packed record
  14828.     lpUniversalName: PAnsiChar;
  14829.     lpConnectionName: PAnsiChar;
  14830.     lpRemainingPath: PAnsiChar;
  14831.   end;
  14832.   TRemoteNameInfoW = packed record
  14833.     lpUniversalName: PWideChar;
  14834.     lpConnectionName: PWideChar;
  14835.     lpRemainingPath: PWideChar;
  14836.   end;
  14837.   TRemoteNameInfo = TRemoteNameInfoA;
  14838.  
  14839. function WNetGetUniversalNameA(lpLocalPath: PAnsiChar; dwInfoLevel: DWORD;
  14840.   lpBuffer: Pointer; var lpBufferSize: DWORD): DWORD; stdcall;
  14841. function WNetGetUniversalNameW(lpLocalPath: PWideChar; dwInfoLevel: DWORD;
  14842.   lpBuffer: Pointer; var lpBufferSize: DWORD): DWORD; stdcall;
  14843. function WNetGetUniversalName(lpLocalPath: PChar; dwInfoLevel: DWORD;
  14844.   lpBuffer: Pointer; var lpBufferSize: DWORD): DWORD; stdcall;
  14845.  
  14846. { Authentication and Logon/Logoff }
  14847.  
  14848. function WNetGetUserA(lpName: PAnsiChar; lpUserName: PAnsiChar; var lpnLength: DWORD): DWORD; stdcall;
  14849. function WNetGetUserW(lpName: PWideChar; lpUserName: PWideChar; var lpnLength: DWORD): DWORD; stdcall;
  14850. function WNetGetUser(lpName: PChar; lpUserName: PChar; var lpnLength: DWORD): DWORD; stdcall;
  14851.  
  14852. const
  14853.   WNFMT_MULTILINE = 1;
  14854.   WNFMT_ABBREVIATED = 2;
  14855.   WNFMT_INENUM = $10;
  14856.   WNFMT_CONNECTION = $20;
  14857.  
  14858. function WNetGetProviderNameA(dwNetType: DWORD; lpProviderName: PAnsiChar;
  14859.   var lpBufferSize: DWORD): DWORD; stdcall;
  14860. function WNetGetProviderNameW(dwNetType: DWORD; lpProviderName: PWideChar;
  14861.   var lpBufferSize: DWORD): DWORD; stdcall;
  14862. function WNetGetProviderName(dwNetType: DWORD; lpProviderName: PChar;
  14863.   var lpBufferSize: DWORD): DWORD; stdcall;
  14864.  
  14865. type
  14866.   PNetInfoStruct = ^TNetInfoStruct;
  14867.   TNetInfoStruct = packed record
  14868.     cbStructure: DWORD;
  14869.     dwProviderVersion: DWORD;
  14870.     dwStatus: DWORD;
  14871.     dwCharacteristics: DWORD;
  14872.     dwHandle: DWORD;
  14873.     wNetType: Word;
  14874.     dwPrinters: DWORD;
  14875.     dwDrives: DWORD;
  14876.   end;
  14877.  
  14878. const
  14879.   NETINFO_DLL16 = 1;      { Provider running as 16 bit Winnet Driver  }
  14880.   NETINFO_DISKRED = 4;    { Provider requires disk redirections to connect  }
  14881.   NETINFO_PRINTERRED = 8; { Provider requires printer redirections to connect  }
  14882.  
  14883. function WNetGetNetworkInformationA(lpProvider: PAnsiChar;
  14884.   var lpNetInfoStruct: TNetInfoStruct): DWORD; stdcall;
  14885. function WNetGetNetworkInformationW(lpProvider: PWideChar;
  14886.   var lpNetInfoStruct: TNetInfoStruct): DWORD; stdcall;
  14887. function WNetGetNetworkInformation(lpProvider: PChar;
  14888.   var lpNetInfoStruct: TNetInfoStruct): DWORD; stdcall;
  14889.  
  14890. type
  14891. { User Profiles }
  14892. {$IFDEF STRICT}
  14893.   TFNGetProfilePath = function (pszUsername: LPCTSTR; pszBuffer: LPTSTR;
  14894.     cbBuffer: UINT): UINT stdcall;
  14895.   TFNReconcileProfile = function (pszCentralFile: LPCTSTR; pszLocalFile: LPCTSTR;
  14896.     dwFlags: DWORD): UINT stdcall;
  14897. {$ELSE}
  14898.   TFNGetProfilePath = TFarProc;
  14899.   TFNReconcileProfile = TFarProc;
  14900. {$ENDIF}
  14901.  
  14902.  
  14903. const
  14904.   RP_LOGON = 1;    { if set, do for logon, else for logoff }
  14905.   RP_INIFILE = 2;  { if set, reconcile .INI file, else reg. hive }
  14906.  
  14907. type
  14908. { Policies }
  14909.  
  14910. {$IFDEF STRICT}
  14911.   TFNProcessPolicies = function (pszPath: LPCTSTR; pszUsername: LPCTSTR;
  14912.     pszComputerName: LPCTSTR; dwFlags: DWORD): BOOL stdcall;
  14913. {$ELSE}
  14914.   TFNProcessPolicies = TFarProc;
  14915. {$ENDIF}
  14916.  
  14917. const
  14918.   PP_DISPLAYERRORS = 1;  { if set, display error messages, else fail silently if error }
  14919.  
  14920. { Error handling }
  14921.  
  14922. function WNetGetLastErrorA(var lpError: DWORD; lpErrorBuf: PAnsiChar;
  14923.   nErrorBufSize: DWORD; lpNameBuf: PAnsiChar; nNameBufSize: DWORD): DWORD; stdcall;
  14924. function WNetGetLastErrorW(var lpError: DWORD; lpErrorBuf: PWideChar;
  14925.   nErrorBufSize: DWORD; lpNameBuf: PWideChar; nNameBufSize: DWORD): DWORD; stdcall;
  14926. function WNetGetLastError(var lpError: DWORD; lpErrorBuf: PChar;
  14927.   nErrorBufSize: DWORD; lpNameBuf: PChar; nNameBufSize: DWORD): DWORD; stdcall;
  14928.  
  14929.  
  14930. const
  14931. { STATUS CODES }
  14932. { General }
  14933.  
  14934.   WN_SUCCESS = NO_ERROR;
  14935.   WN_NO_ERROR = NO_ERROR;
  14936.   WN_NOT_SUPPORTED = ERROR_NOT_SUPPORTED;
  14937.   WN_CANCEL = ERROR_CANCELLED;
  14938.   WN_RETRY = ERROR_RETRY;
  14939.   WN_NET_ERROR = ERROR_UNEXP_NET_ERR;
  14940.   WN_MORE_DATA = ERROR_MORE_DATA;
  14941.   WN_BAD_POINTER = ERROR_INVALID_ADDRESS;
  14942.   WN_BAD_VALUE = ERROR_INVALID_PARAMETER;
  14943.   WN_BAD_USER = ERROR_BAD_USERNAME;
  14944.   WN_BAD_PASSWORD = ERROR_INVALID_PASSWORD;
  14945.   WN_ACCESS_DENIED = ERROR_ACCESS_DENIED;
  14946.   WN_FUNCTION_BUSY = ERROR_BUSY;
  14947.   WN_WINDOWS_ERROR = ERROR_UNEXP_NET_ERR;
  14948.   WN_OUT_OF_MEMORY = ERROR_NOT_ENOUGH_MEMORY;
  14949.   WN_NO_NETWORK = ERROR_NO_NETWORK;
  14950.   WN_EXTENDED_ERROR = ERROR_EXTENDED_ERROR;
  14951.   WN_BAD_LEVEL = ERROR_INVALID_LEVEL;
  14952.   WN_BAD_HANDLE = ERROR_INVALID_HANDLE;
  14953.   WN_NOT_INITIALIZING = ERROR_ALREADY_INITIALIZED;
  14954.   WN_NO_MORE_DEVICES = ERROR_NO_MORE_DEVICES;
  14955.  
  14956. { Connection }
  14957.  
  14958.   WN_NOT_CONNECTED = ERROR_NOT_CONNECTED;
  14959.   WN_OPEN_FILES = ERROR_OPEN_FILES;
  14960.   WN_DEVICE_IN_USE = ERROR_DEVICE_IN_USE;
  14961.   WN_BAD_NETNAME = ERROR_BAD_NET_NAME;
  14962.   WN_BAD_LOCALNAME = ERROR_BAD_DEVICE;
  14963.   WN_ALREADY_CONNECTED = ERROR_ALREADY_ASSIGNED;
  14964.   WN_DEVICE_ERROR = ERROR_GEN_FAILURE;
  14965.   WN_CONNECTION_CLOSED = ERROR_CONNECTION_UNAVAIL;
  14966.   WN_NO_NET_OR_BAD_PATH = ERROR_NO_NET_OR_BAD_PATH;
  14967.   WN_BAD_PROVIDER = ERROR_BAD_PROVIDER;
  14968.   WN_CANNOT_OPEN_PROFILE = ERROR_CANNOT_OPEN_PROFILE;
  14969.   WN_BAD_PROFILE = ERROR_BAD_PROFILE;
  14970.   WN_BAD_DEV_TYPE = ERROR_BAD_DEV_TYPE;
  14971.   WN_DEVICE_ALREADY_REMEMBERED = ERROR_DEVICE_ALREADY_REMEMBERED;
  14972.  
  14973. { Enumeration }
  14974.  
  14975.   WN_NO_MORE_ENTRIES = ERROR_NO_MORE_ITEMS;
  14976.   WN_NOT_CONTAINER = ERROR_NOT_CONTAINER;
  14977.  
  14978. { Authentication }
  14979.  
  14980.   WN_NOT_AUTHENTICATED = ERROR_NOT_AUTHENTICATED;
  14981.   WN_NOT_LOGGED_ON = ERROR_NOT_LOGGED_ON;
  14982.   WN_NOT_VALIDATED = ERROR_NO_LOGON_SERVERS;
  14983.  
  14984. type
  14985. { For Shell }
  14986.   PNetConnectInfoStruct = ^TNetConnectInfoStruct;
  14987.   TNetConnectInfoStruct = packed record
  14988.     cbStructure: DWORD;
  14989.     dwFlags: DWORD;
  14990.     dwSpeed: DWORD;
  14991.     dwDelay: DWORD;
  14992.     dwOptDataSize: DWORD;
  14993.   end;
  14994.  
  14995. const
  14996.   WNCON_FORNETCARD = 1;
  14997.   WNCON_NOTROUTED = 2;
  14998.   WNCON_SLOWLINK = 4;
  14999.   WNCON_DYNAMIC = 8;
  15000.  
  15001. function MultinetGetConnectionPerformanceA(lpNetResource: PNetResourceA;
  15002.   lpNetConnectInfoStruc: PNetConnectInfoStruct): DWORD; stdcall;
  15003. function MultinetGetConnectionPerformanceW(lpNetResource: PNetResourceW;
  15004.   lpNetConnectInfoStruc: PNetConnectInfoStruct): DWORD; stdcall;
  15005. function MultinetGetConnectionPerformance(lpNetResource: PNetResource;
  15006.   lpNetConnectInfoStruc: PNetConnectInfoStruct): DWORD; stdcall;
  15007.  
  15008. { Translated from DDE.H }  
  15009.  
  15010. const
  15011.   WM_DDE_FIRST      = $03E0;
  15012.   WM_DDE_INITIATE   = WM_DDE_FIRST;
  15013.   WM_DDE_TERMINATE  = WM_DDE_FIRST+1;
  15014.   WM_DDE_ADVISE     = WM_DDE_FIRST+2;
  15015.   WM_DDE_UNADVISE   = WM_DDE_FIRST+3;
  15016.   WM_DDE_ACK        = WM_DDE_FIRST+4;
  15017.   WM_DDE_DATA       = WM_DDE_FIRST+5;
  15018.   WM_DDE_REQUEST    = WM_DDE_FIRST+6;
  15019.   WM_DDE_POKE       = WM_DDE_FIRST+7;
  15020.   WM_DDE_EXECUTE    = WM_DDE_FIRST+8;
  15021.   WM_DDE_LAST       = WM_DDE_FIRST+8;
  15022.  
  15023. { Constants used for a WM_DDE_ACK message sent in responce to a WM_DDE_DATA
  15024.   WM_DDE_REQUEST, WM_DDE_POKE, WM_DDE_ADVISE, or WM_DDE_UNADVISE message.
  15025.   For example
  15026.     if lParam and dde_Ack <> 0 then ...
  15027. }
  15028.  
  15029. type
  15030.   PDDEAck = ^TDDEAck;
  15031.   TDDEAck = packed record
  15032. (*
  15033.     unsigned bAppReturnCode:8,
  15034.              reserved:6,
  15035.              fBusy:1,
  15036.              fAck:1;
  15037. *)
  15038.     Flags: Word;
  15039.   end;
  15040.  
  15041. const
  15042.   dde_AppReturnCode = $00FF;
  15043.   dde_Busy          = $4000;
  15044.   dde_Ack           = $8000;
  15045.  
  15046. { Record for the  WM_DDE_ADVISE Options parameter (LoWord(lParam)) }
  15047.  
  15048. type
  15049.   PDDEAdvise = ^TDDEAdvise;
  15050.   TDDEAdvise = packed record
  15051. (*
  15052.     unsigned reserved:14,
  15053.              fDeferUpd:1,
  15054.              fAckReq:1;
  15055. *)
  15056.     Flags: Word;
  15057.     cfFormat: SmallInt;
  15058.   end;
  15059.  
  15060. const
  15061.   dde_DeferUpd     = $4000;
  15062.   dde_AckReq       = $8000;
  15063.  
  15064. { Record for the hData parameter of a WM_DDE_DATA message (LoWord(lParam)).
  15065.   The actual size of this record depends on the size of the Value
  15066.   array. }
  15067.  
  15068. type
  15069.   PDDEData = ^TDDEData;
  15070.   TDDEData = packed record
  15071. (*  unsigned unused:12,
  15072.              fResponse:1,
  15073.              fRelease:1,
  15074.              reserved:1,
  15075.              fAckReq:1;
  15076. *)
  15077.     Flags: Word;
  15078.     cfFormat: SmallInt;
  15079.     Value: array[0..0] of Byte;
  15080.   end;
  15081.  
  15082. const
  15083.   dde_Response = $1000;
  15084.   dde_Release  = $2000;
  15085.  
  15086. { Record for the hData parameter of the WM_DDE_POKE record (LoWord(lParam)).
  15087.   The actual size of this record depends on the size of the Value array. }
  15088.  
  15089. type
  15090.   PDDEPoke = ^TDDEPoke;
  15091.   TDDEPoke = packed record
  15092. (*  unsigned unused:13,
  15093.              fRelease:1,
  15094.              fReserved:2;
  15095. *)
  15096.     Flags: Word;
  15097.     cfFormat: SmallInt;
  15098.     Value: array[0..0] of Byte;
  15099.   end;
  15100.  
  15101. { DDE Security }
  15102.  
  15103. function DdeSetQualityOfService(hWndClient: HWnd; const pqosNew: TSecurityQualityOfService;
  15104.   pqosPrev: PSecurityQualityOfService): BOOL; stdcall;
  15105. function ImpersonateDdeClientWindow(hWndClient: HWnd; hWndServer: HWnd): BOOL; stdcall;
  15106.  
  15107. { DDE message packing APIs }
  15108. function PackDDElParam(msg: UINT; uiLo: UINT; uiHi: UINT): Longint; stdcall;
  15109. function UnpackDDElParam(msg: UINT; lParam: Longint; puiLo: PUINT; puiHi: PUINT): BOOL; stdcall;
  15110. function FreeDDElParam(msg: UINT; lParam: Longint): BOOL; stdcall;
  15111. function ReuseDDElParam(lParam: Longint; msgIn: UINT; msgOut: UINT; uiLo: UINT; uiHi: UINT): Longint; stdcall;
  15112.  
  15113. const
  15114.   advapi32 = 'advapi32.dll';
  15115.   kernel32 = 'kernel32.dll';
  15116.   mpr      = 'mpr.dll';
  15117.   version  = 'version.dll';
  15118.   comctl32 = 'comctl32.dll';
  15119.   gdi32    = 'gdi32.dll';
  15120.   opengl32 = 'opengl32.dll';
  15121.   user32   = 'user32.dll';
  15122.  
  15123.  
  15124. implementation
  15125.  
  15126. { Externals from advapi32.dll }
  15127.  
  15128. function AbortSystemShutdownA; external advapi32 name 'AbortSystemShutdownA';
  15129. function AbortSystemShutdownW; external advapi32 name 'AbortSystemShutdownW';
  15130. function AbortSystemShutdown; external advapi32 name 'AbortSystemShutdownA';
  15131. function AccessCheck; external advapi32 name 'AccessCheck';
  15132. function AccessCheckAndAuditAlarmA; external advapi32 name 'AccessCheckAndAuditAlarmA';
  15133. function AccessCheckAndAuditAlarmW; external advapi32 name 'AccessCheckAndAuditAlarmW';
  15134. function AccessCheckAndAuditAlarm; external advapi32 name 'AccessCheckAndAuditAlarmA';
  15135. function AddAccessAllowedAce; external advapi32 name 'AddAccessAllowedAce';
  15136. function AddAccessDeniedAce; external advapi32 name 'AddAccessDeniedAce';
  15137. function AddAce; external advapi32 name 'AddAce';
  15138. function AddAuditAccessAce; external advapi32 name 'AddAuditAccessAce';
  15139. function AdjustTokenGroups; external advapi32 name 'AdjustTokenGroups';
  15140. function AdjustTokenPrivileges; external advapi32 name 'AdjustTokenPrivileges';
  15141. function AllocateAndInitializeSid; external advapi32 name 'AllocateAndInitializeSid';
  15142. function AllocateLocallyUniqueId; external advapi32 name 'AllocateLocallyUniqueId';
  15143. function AreAllAccessesGranted; external advapi32 name 'AreAllAccessesGranted';
  15144. function AreAnyAccessesGranted; external advapi32 name 'AreAnyAccessesGranted';
  15145. function BackupEventLogA; external advapi32 name 'BackupEventLogA';
  15146. function BackupEventLogW; external advapi32 name 'BackupEventLogW';
  15147. function BackupEventLog; external advapi32 name 'BackupEventLogA';
  15148. function ClearEventLogA; external advapi32 name 'ClearEventLogA';
  15149. function ClearEventLogW; external advapi32 name 'ClearEventLogW';
  15150. function ClearEventLog; external advapi32 name 'ClearEventLogA';
  15151. function CloseEventLog; external advapi32 name 'CloseEventLog';
  15152. function CopySid; external advapi32 name 'CopySid';
  15153. function CreatePrivateObjectSecurity; external advapi32 name 'CreatePrivateObjectSecurity';
  15154. function CreateProcessAsUserA; external advapi32 name 'CreateProcessAsUserA';
  15155. function CreateProcessAsUserW; external advapi32 name 'CreateProcessAsUserW';
  15156. function CreateProcessAsUser; external advapi32 name 'CreateProcessAsUserA';
  15157. function DeleteAce; external advapi32 name 'DeleteAce';
  15158. function DeregisterEventSource; external advapi32 name 'DeregisterEventSource';
  15159. function DestroyPrivateObjectSecurity; external advapi32 name 'DestroyPrivateObjectSecurity';
  15160. function DuplicateToken; external advapi32 name 'DuplicateToken';
  15161. function EqualPrefixSid; external advapi32 name 'EqualPrefixSid';
  15162. function EqualSid; external advapi32 name 'EqualSid';
  15163. function FindFirstFreeAce; external advapi32 name 'FindFirstFreeAce';
  15164. function FreeSid; external advapi32 name 'FreeSid';
  15165. function GetAce; external advapi32 name 'GetAce';
  15166. function GetAclInformation; external advapi32 name 'GetAclInformation';
  15167. function GetFileSecurityA; external advapi32 name 'GetFileSecurityA';
  15168. function GetFileSecurityW; external advapi32 name 'GetFileSecurityW';
  15169. function GetFileSecurity; external advapi32 name 'GetFileSecurityA';
  15170. function GetKernelObjectSecurity; external advapi32 name 'GetKernelObjectSecurity';
  15171. function GetLengthSid; external advapi32 name 'GetLengthSid';
  15172. function GetNumberOfEventLogRecords; external advapi32 name 'GetNumberOfEventLogRecords';
  15173. function GetOldestEventLogRecord; external advapi32 name 'GetOldestEventLogRecord';
  15174. function GetPrivateObjectSecurity; external advapi32 name 'GetPrivateObjectSecurity';
  15175. function GetSecurityDescriptorControl; external advapi32 name 'GetSecurityDescriptorControl';
  15176. function GetSecurityDescriptorDacl; external advapi32 name 'GetSecurityDescriptorDacl';
  15177. function GetSecurityDescriptorGroup; external advapi32 name 'GetSecurityDescriptorGroup';
  15178. function GetSecurityDescriptorLength; external advapi32 name 'GetSecurityDescriptorLength';
  15179. function GetSecurityDescriptorOwner; external advapi32 name 'GetSecurityDescriptorOwner';
  15180. function GetSecurityDescriptorSacl; external advapi32 name 'GetSecurityDescriptorSacl';
  15181. function GetSidIdentifierAuthority; external advapi32 name 'GetSidIdentifierAuthority';
  15182. function GetSidLengthRequired; external advapi32 name 'GetSidLengthRequired';
  15183. function GetSidSubAuthority; external advapi32 name 'GetSidSubAuthority';
  15184. function GetSidSubAuthorityCount; external advapi32 name 'GetSidSubAuthorityCount';
  15185. function GetTokenInformation; external advapi32 name 'GetTokenInformation';
  15186. function GetUserNameA; external advapi32 name 'GetUserNameA';
  15187. function GetUserNameW; external advapi32 name 'GetUserNameW';
  15188. function GetUserName; external advapi32 name 'GetUserNameA';
  15189. function ImpersonateLoggedOnUser; external advapi32 name 'ImpersonateLoggedOnUser';
  15190. function ImpersonateNamedPipeClient; external advapi32 name 'ImpersonateNamedPipeClient';
  15191. function ImpersonateSelf; external advapi32 name 'ImpersonateSelf';
  15192. function InitializeAcl; external advapi32 name 'InitializeAcl';
  15193. function InitializeSecurityDescriptor; external advapi32 name 'InitializeSecurityDescriptor';
  15194. function InitializeSid; external advapi32 name 'InitializeSid';
  15195. function InitiateSystemShutdownA; external advapi32 name 'InitiateSystemShutdownA';
  15196. function InitiateSystemShutdownW; external advapi32 name 'InitiateSystemShutdownW';
  15197. function InitiateSystemShutdown; external advapi32 name 'InitiateSystemShutdownA';
  15198. function IsTextUnicode; external advapi32 name 'IsTextUnicode';
  15199. function IsValidAcl; external advapi32 name 'IsValidAcl';
  15200. function IsValidSecurityDescriptor; external advapi32 name 'IsValidSecurityDescriptor';
  15201. function IsValidSid; external advapi32 name 'IsValidSid';
  15202. function LogonUserA; external advapi32 name 'LogonUserA';
  15203. function LogonUserW; external advapi32 name 'LogonUserW';
  15204. function LogonUser; external advapi32 name 'LogonUserA';
  15205. function LookupAccountNameA; external advapi32 name 'LookupAccountNameA';
  15206. function LookupAccountNameW; external advapi32 name 'LookupAccountNameW';
  15207. function LookupAccountName; external advapi32 name 'LookupAccountNameA';
  15208. function LookupAccountSidA; external advapi32 name 'LookupAccountSidA';
  15209. function LookupAccountSidW; external advapi32 name 'LookupAccountSidW';
  15210. function LookupAccountSid; external advapi32 name 'LookupAccountSidA';
  15211. function LookupPrivilegeDisplayNameA; external advapi32 name 'LookupPrivilegeDisplayNameA';
  15212. function LookupPrivilegeDisplayNameW; external advapi32 name 'LookupPrivilegeDisplayNameW';
  15213. function LookupPrivilegeDisplayName; external advapi32 name 'LookupPrivilegeDisplayNameA';
  15214. function LookupPrivilegeNameA; external advapi32 name 'LookupPrivilegeNameA';
  15215. function LookupPrivilegeNameW; external advapi32 name 'LookupPrivilegeNameW';
  15216. function LookupPrivilegeName; external advapi32 name 'LookupPrivilegeNameA';
  15217. function LookupPrivilegeValueA; external advapi32 name 'LookupPrivilegeValueA';
  15218. function LookupPrivilegeValueW; external advapi32 name 'LookupPrivilegeValueW';
  15219. function LookupPrivilegeValue; external advapi32 name 'LookupPrivilegeValueA';
  15220. function MakeAbsoluteSD; external advapi32 name 'MakeAbsoluteSD';
  15221. function MakeSelfRelativeSD; external advapi32 name 'MakeSelfRelativeSD';
  15222. procedure MapGenericMask; external advapi32 name 'MapGenericMask';
  15223. function NotifyChangeEventLog; external advapi32 name 'NotifyChangeEventLog';
  15224. function ObjectCloseAuditAlarmA; external advapi32 name 'ObjectCloseAuditAlarmA';
  15225. function ObjectCloseAuditAlarmW; external advapi32 name 'ObjectCloseAuditAlarmW';
  15226. function ObjectCloseAuditAlarm; external advapi32 name 'ObjectCloseAuditAlarmA';
  15227. function ObjectOpenAuditAlarmA; external advapi32 name 'ObjectOpenAuditAlarmA';
  15228. function ObjectOpenAuditAlarmW; external advapi32 name 'ObjectOpenAuditAlarmW';
  15229. function ObjectOpenAuditAlarm; external advapi32 name 'ObjectOpenAuditAlarmA';
  15230. function ObjectPrivilegeAuditAlarmA; external advapi32 name 'ObjectPrivilegeAuditAlarmA';
  15231. function ObjectPrivilegeAuditAlarmW; external advapi32 name 'ObjectPrivilegeAuditAlarmW';
  15232. function ObjectPrivilegeAuditAlarm; external advapi32 name 'ObjectPrivilegeAuditAlarmA';
  15233. function OpenBackupEventLogA; external advapi32 name 'OpenBackupEventLogA';
  15234. function OpenBackupEventLogW; external advapi32 name 'OpenBackupEventLogW';
  15235. function OpenBackupEventLog; external advapi32 name 'OpenBackupEventLogA';
  15236. function OpenEventLogA; external advapi32 name 'OpenEventLogA';
  15237. function OpenEventLogW; external advapi32 name 'OpenEventLogW';
  15238. function OpenEventLog; external advapi32 name 'OpenEventLogA';
  15239. function OpenProcessToken; external advapi32 name 'OpenProcessToken';
  15240. function OpenThreadToken; external advapi32 name 'OpenThreadToken';
  15241. function PrivilegeCheck; external advapi32 name 'PrivilegeCheck';
  15242. function PrivilegedServiceAuditAlarmA; external advapi32 name 'PrivilegedServiceAuditAlarmA';
  15243. function PrivilegedServiceAuditAlarmW; external advapi32 name 'PrivilegedServiceAuditAlarmW';
  15244. function PrivilegedServiceAuditAlarm; external advapi32 name 'PrivilegedServiceAuditAlarmA';
  15245. function ReadEventLogA; external advapi32 name 'ReadEventLogA';
  15246. function ReadEventLogW; external advapi32 name 'ReadEventLogW';
  15247. function ReadEventLog; external advapi32 name 'ReadEventLogA';
  15248. function RegCloseKey; external advapi32 name 'RegCloseKey';
  15249. function RegConnectRegistryA; external advapi32 name 'RegConnectRegistryA';
  15250. function RegConnectRegistryW; external advapi32 name 'RegConnectRegistryW';
  15251. function RegConnectRegistry; external advapi32 name 'RegConnectRegistryA';
  15252. function RegCreateKeyA; external advapi32 name 'RegCreateKeyA';
  15253. function RegCreateKeyW; external advapi32 name 'RegCreateKeyW';
  15254. function RegCreateKey; external advapi32 name 'RegCreateKeyA';
  15255. function RegCreateKeyExA; external advapi32 name 'RegCreateKeyExA';
  15256. function RegCreateKeyExW; external advapi32 name 'RegCreateKeyExW';
  15257. function RegCreateKeyEx; external advapi32 name 'RegCreateKeyExA';
  15258. function RegDeleteKeyA; external advapi32 name 'RegDeleteKeyA';
  15259. function RegDeleteKeyW; external advapi32 name 'RegDeleteKeyW';
  15260. function RegDeleteKey; external advapi32 name 'RegDeleteKeyA';
  15261. function RegDeleteValueA; external advapi32 name 'RegDeleteValueA';
  15262. function RegDeleteValueW; external advapi32 name 'RegDeleteValueW';
  15263. function RegDeleteValue; external advapi32 name 'RegDeleteValueA';
  15264. function RegEnumKeyExA; external advapi32 name 'RegEnumKeyExA';
  15265. function RegEnumKeyExW; external advapi32 name 'RegEnumKeyExW';
  15266. function RegEnumKeyEx; external advapi32 name 'RegEnumKeyExA';
  15267. function RegEnumKeyA; external advapi32 name 'RegEnumKeyA';
  15268. function RegEnumKeyW; external advapi32 name 'RegEnumKeyW';
  15269. function RegEnumKey; external advapi32 name 'RegEnumKeyA';
  15270. function RegEnumValueA; external advapi32 name 'RegEnumValueA';
  15271. function RegEnumValueW; external advapi32 name 'RegEnumValueW';
  15272. function RegEnumValue; external advapi32 name 'RegEnumValueA';
  15273. function RegFlushKey; external advapi32 name 'RegFlushKey';
  15274. function RegGetKeySecurity; external advapi32 name 'RegGetKeySecurity';
  15275. function RegLoadKeyA; external advapi32 name 'RegLoadKeyA';
  15276. function RegLoadKeyW; external advapi32 name 'RegLoadKeyW';
  15277. function RegLoadKey; external advapi32 name 'RegLoadKeyA';
  15278. function RegNotifyChangeKeyValue; external advapi32 name 'RegNotifyChangeKeyValue';
  15279. function RegOpenKeyA; external advapi32 name 'RegOpenKeyA';
  15280. function RegOpenKeyW; external advapi32 name 'RegOpenKeyW';
  15281. function RegOpenKey; external advapi32 name 'RegOpenKeyA';
  15282. function RegOpenKeyExA; external advapi32 name 'RegOpenKeyExA';
  15283. function RegOpenKeyExW; external advapi32 name 'RegOpenKeyExW';
  15284. function RegOpenKeyEx; external advapi32 name 'RegOpenKeyExA';
  15285. function RegQueryInfoKeyA; external advapi32 name 'RegQueryInfoKeyA';
  15286. function RegQueryInfoKeyW; external advapi32 name 'RegQueryInfoKeyW';
  15287. function RegQueryInfoKey; external advapi32 name 'RegQueryInfoKeyA';
  15288. function RegQueryMultipleValuesA; external advapi32 name 'RegQueryMultipleValuesA';
  15289. function RegQueryMultipleValuesW; external advapi32 name 'RegQueryMultipleValuesW';
  15290. function RegQueryMultipleValues; external advapi32 name 'RegQueryMultipleValuesA';
  15291. function RegQueryValueA; external advapi32 name 'RegQueryValueA';
  15292. function RegQueryValueW; external advapi32 name 'RegQueryValueW';
  15293. function RegQueryValue; external advapi32 name 'RegQueryValueA';
  15294. function RegQueryValueExA; external advapi32 name 'RegQueryValueExA';
  15295. function RegQueryValueExW; external advapi32 name 'RegQueryValueExW';
  15296. function RegQueryValueEx; external advapi32 name 'RegQueryValueExA';
  15297. function RegReplaceKeyA; external advapi32 name 'RegReplaceKeyA';
  15298. function RegReplaceKeyW; external advapi32 name 'RegReplaceKeyW';
  15299. function RegReplaceKey; external advapi32 name 'RegReplaceKeyA';
  15300. function RegRestoreKeyA; external advapi32 name 'RegRestoreKeyA';
  15301. function RegRestoreKeyW; external advapi32 name 'RegRestoreKeyW';
  15302. function RegRestoreKey; external advapi32 name 'RegRestoreKeyA';
  15303. function RegSaveKeyA; external advapi32 name 'RegSaveKeyA';
  15304. function RegSaveKeyW; external advapi32 name 'RegSaveKeyW';
  15305. function RegSaveKey; external advapi32 name 'RegSaveKeyA';
  15306. function RegSetKeySecurity; external advapi32 name 'RegSetKeySecurity';
  15307. function RegSetValueA; external advapi32 name 'RegSetValueA';
  15308. function RegSetValueW; external advapi32 name 'RegSetValueW';
  15309. function RegSetValue; external advapi32 name 'RegSetValueA';
  15310. function RegSetValueExA; external advapi32 name 'RegSetValueExA';
  15311. function RegSetValueExW; external advapi32 name 'RegSetValueExW';
  15312. function RegSetValueEx; external advapi32 name 'RegSetValueExA';
  15313. function RegUnLoadKeyA; external advapi32 name 'RegUnLoadKeyA';
  15314. function RegUnLoadKeyW; external advapi32 name 'RegUnLoadKeyW';
  15315. function RegUnLoadKey; external advapi32 name 'RegUnLoadKeyA';
  15316. function RegisterEventSourceA; external advapi32 name 'RegisterEventSourceA';
  15317. function RegisterEventSourceW; external advapi32 name 'RegisterEventSourceW';
  15318. function RegisterEventSource; external advapi32 name 'RegisterEventSourceA';
  15319. function ReportEventA; external advapi32 name 'ReportEventA';
  15320. function ReportEventW; external advapi32 name 'ReportEventW';
  15321. function ReportEvent; external advapi32 name 'ReportEventA';
  15322. function RevertToSelf; external advapi32 name 'RevertToSelf';
  15323. function SetAclInformation; external advapi32 name 'SetAclInformation';
  15324. function SetFileSecurityA; external advapi32 name 'SetFileSecurityA';
  15325. function SetFileSecurityW; external advapi32 name 'SetFileSecurityW';
  15326. function SetFileSecurity; external advapi32 name 'SetFileSecurityA';
  15327. function SetKernelObjectSecurity; external advapi32 name 'SetKernelObjectSecurity';
  15328. function SetPrivateObjectSecurity; external advapi32 name 'SetPrivateObjectSecurity';
  15329. function SetSecurityDescriptorDacl; external advapi32 name 'SetSecurityDescriptorDacl';
  15330. function SetSecurityDescriptorGroup; external advapi32 name 'SetSecurityDescriptorGroup';
  15331. function SetSecurityDescriptorOwner; external advapi32 name 'SetSecurityDescriptorOwner';
  15332. function SetSecurityDescriptorSacl; external advapi32 name 'SetSecurityDescriptorSacl';
  15333. function SetThreadToken; external advapi32 name 'SetThreadToken';
  15334. function SetTokenInformation; external advapi32 name 'SetTokenInformation';
  15335.  
  15336.  
  15337. { Externals from kernel32.dll }
  15338.  
  15339. function AddAtomA; external kernel32 name 'AddAtomA';
  15340. function AddAtomW; external kernel32 name 'AddAtomW';
  15341. function AddAtom; external kernel32 name 'AddAtomA';
  15342. function AllocConsole; external kernel32 name 'AllocConsole';
  15343. function AreFileApisANSI; external kernel32 name 'AreFileApisANSI';
  15344. function BackupRead; external kernel32 name 'BackupRead';
  15345. function BackupSeek; external kernel32 name 'BackupSeek';
  15346. function BackupWrite; external kernel32 name 'BackupWrite';
  15347. function Beep; external kernel32 name 'Beep';
  15348. function BeginUpdateResourceA; external kernel32 name 'BeginUpdateResourceA';
  15349. function BeginUpdateResourceW; external kernel32 name 'BeginUpdateResourceW';
  15350. function BeginUpdateResource; external kernel32 name 'BeginUpdateResourceA';
  15351. function BuildCommDCBA; external kernel32 name 'BuildCommDCBA';
  15352. function BuildCommDCBW; external kernel32 name 'BuildCommDCBW';
  15353. function BuildCommDCB; external kernel32 name 'BuildCommDCBA';
  15354. function BuildCommDCBAndTimeoutsA; external kernel32 name 'BuildCommDCBAndTimeoutsA';
  15355. function BuildCommDCBAndTimeoutsW; external kernel32 name 'BuildCommDCBAndTimeoutsW';
  15356. function BuildCommDCBAndTimeouts; external kernel32 name 'BuildCommDCBAndTimeoutsA';
  15357. function CallNamedPipeA; external kernel32 name 'CallNamedPipeA';
  15358. function CallNamedPipeW; external kernel32 name 'CallNamedPipeW';
  15359. function CallNamedPipe; external kernel32 name 'CallNamedPipeA';
  15360. function ClearCommBreak; external kernel32 name 'ClearCommBreak';
  15361. function ClearCommError; external kernel32 name 'ClearCommError';
  15362. function CloseHandle; external kernel32 name 'CloseHandle';
  15363. function CommConfigDialogA; external kernel32 name 'CommConfigDialogA';
  15364. function CommConfigDialogW; external kernel32 name 'CommConfigDialogW';
  15365. function CommConfigDialog; external kernel32 name 'CommConfigDialogA';
  15366. function CompareFileTime; external kernel32 name 'CompareFileTime';
  15367. function CompareStringA; external kernel32 name 'CompareStringA';
  15368. function CompareStringW; external kernel32 name 'CompareStringW';
  15369. function CompareString; external kernel32 name 'CompareStringA';
  15370. function ConnectNamedPipe; external kernel32 name 'ConnectNamedPipe';
  15371. function ContinueDebugEvent; external kernel32 name 'ContinueDebugEvent';
  15372. function ConvertDefaultLocale; external kernel32 name 'ConvertDefaultLocale';
  15373. function CopyFileA; external kernel32 name 'CopyFileA';
  15374. function CopyFileW; external kernel32 name 'CopyFileW';
  15375. function CopyFile; external kernel32 name 'CopyFileA';
  15376. function CreateConsoleScreenBuffer; external kernel32 name 'CreateConsoleScreenBuffer';
  15377. function CreateDirectoryA; external kernel32 name 'CreateDirectoryA';
  15378. function CreateDirectoryW; external kernel32 name 'CreateDirectoryW';
  15379. function CreateDirectory; external kernel32 name 'CreateDirectoryA';
  15380. function CreateDirectoryExA; external kernel32 name 'CreateDirectoryExA';
  15381. function CreateDirectoryExW; external kernel32 name 'CreateDirectoryExW';
  15382. function CreateDirectoryEx; external kernel32 name 'CreateDirectoryExA';
  15383. function CreateEventA; external kernel32 name 'CreateEventA';
  15384. function CreateEventW; external kernel32 name 'CreateEventW';
  15385. function CreateEvent; external kernel32 name 'CreateEventA';
  15386. function CreateFileA; external kernel32 name 'CreateFileA';
  15387. function CreateFileW; external kernel32 name 'CreateFileW';
  15388. function CreateFile; external kernel32 name 'CreateFileA';
  15389. function CreateFileMappingA; external kernel32 name 'CreateFileMappingA';
  15390. function CreateFileMappingW; external kernel32 name 'CreateFileMappingW';
  15391. function CreateFileMapping; external kernel32 name 'CreateFileMappingA';
  15392. function CreateIoCompletionPort; external kernel32 name 'CreateIoCompletionPort';
  15393. function CreateMailslotA; external kernel32 name 'CreateMailslotA';
  15394. function CreateMailslotW; external kernel32 name 'CreateMailslotW';
  15395. function CreateMailslot; external kernel32 name 'CreateMailslotA';
  15396. function CreateMutexA; external kernel32 name 'CreateMutexA';
  15397. function CreateMutexW; external kernel32 name 'CreateMutexW';
  15398. function CreateMutex; external kernel32 name 'CreateMutexA';
  15399. function CreateNamedPipeA; external kernel32 name 'CreateNamedPipeA';
  15400. function CreateNamedPipeW; external kernel32 name 'CreateNamedPipeW';
  15401. function CreateNamedPipe; external kernel32 name 'CreateNamedPipeA';
  15402. function CreatePipe; external kernel32 name 'CreatePipe';
  15403. function CreateProcessA; external kernel32 name 'CreateProcessA';
  15404. function CreateProcessW; external kernel32 name 'CreateProcessW';
  15405. function CreateProcess; external kernel32 name 'CreateProcessA';
  15406. function CreateRemoteThread; external kernel32 name 'CreateRemoteThread';
  15407. function CreateSemaphoreA; external kernel32 name 'CreateSemaphoreA';
  15408. function CreateSemaphoreW; external kernel32 name 'CreateSemaphoreW';
  15409. function CreateSemaphore; external kernel32 name 'CreateSemaphoreA';
  15410. function CreateTapePartition; external kernel32 name 'CreateTapePartition';
  15411. function CreateThread; external kernel32 name 'CreateThread';
  15412. function DebugActiveProcess; external kernel32 name 'DebugActiveProcess';
  15413. procedure DebugBreak; external kernel32 name 'DebugBreak';
  15414. function DefineDosDeviceA; external kernel32 name 'DefineDosDeviceA';
  15415. function DefineDosDeviceW; external kernel32 name 'DefineDosDeviceW';
  15416. function DefineDosDevice; external kernel32 name 'DefineDosDeviceA';
  15417. function DeleteAtom; external kernel32 name 'DeleteAtom';
  15418. procedure DeleteCriticalSection; external kernel32 name 'DeleteCriticalSection';
  15419. function DeleteFileA; external kernel32 name 'DeleteFileA';
  15420. function DeleteFileW; external kernel32 name 'DeleteFileW';
  15421. function DeleteFile; external kernel32 name 'DeleteFileA';
  15422. function DeviceIoControl; external kernel32 name 'DeviceIoControl';
  15423. function DisableThreadLibraryCalls; external kernel32 name 'DisableThreadLibraryCalls';
  15424. function DisconnectNamedPipe; external kernel32 name 'DisconnectNamedPipe';
  15425. function DosDateTimeToFileTime; external kernel32 name 'DosDateTimeToFileTime';
  15426. function DuplicateHandle; external kernel32 name 'DuplicateHandle';
  15427. function EndUpdateResourceA; external kernel32 name 'EndUpdateResourceA';
  15428. function EndUpdateResourceW; external kernel32 name 'EndUpdateResourceW';
  15429. function EndUpdateResource; external kernel32 name 'EndUpdateResourceA';
  15430. procedure EnterCriticalSection; external kernel32 name 'EnterCriticalSection';
  15431. function EnumCalendarInfoA; external kernel32 name 'EnumCalendarInfoA';
  15432. function EnumCalendarInfoW; external kernel32 name 'EnumCalendarInfoW';
  15433. function EnumCalendarInfo; external kernel32 name 'EnumCalendarInfoA';
  15434. function EnumDateFormatsA; external kernel32 name 'EnumDateFormatsA';
  15435. function EnumDateFormatsW; external kernel32 name 'EnumDateFormatsW';
  15436. function EnumDateFormats; external kernel32 name 'EnumDateFormatsA';
  15437. function EnumResourceLanguagesA; external kernel32 name 'EnumResourceLanguagesA';
  15438. function EnumResourceLanguagesW; external kernel32 name 'EnumResourceLanguagesW';
  15439. function EnumResourceLanguages; external kernel32 name 'EnumResourceLanguagesA';
  15440. function EnumResourceNamesA; external kernel32 name 'EnumResourceNamesA';
  15441. function EnumResourceNamesW; external kernel32 name 'EnumResourceNamesW';
  15442. function EnumResourceNames; external kernel32 name 'EnumResourceNamesA';
  15443. function EnumResourceTypesA; external kernel32 name 'EnumResourceTypesA';
  15444. function EnumResourceTypesW; external kernel32 name 'EnumResourceTypesW';
  15445. function EnumResourceTypes; external kernel32 name 'EnumResourceTypesA';
  15446. function EnumSystemCodePagesA; external kernel32 name 'EnumSystemCodePagesA';
  15447. function EnumSystemCodePagesW; external kernel32 name 'EnumSystemCodePagesW';
  15448. function EnumSystemCodePages; external kernel32 name 'EnumSystemCodePagesA';
  15449. function EnumSystemLocalesA; external kernel32 name 'EnumSystemLocalesA';
  15450. function EnumSystemLocalesW; external kernel32 name 'EnumSystemLocalesW';
  15451. function EnumSystemLocales; external kernel32 name 'EnumSystemLocalesA';
  15452. function EnumTimeFormatsA; external kernel32 name 'EnumTimeFormatsA';
  15453. function EnumTimeFormatsW; external kernel32 name 'EnumTimeFormatsW';
  15454. function EnumTimeFormats; external kernel32 name 'EnumTimeFormatsA';
  15455. function EraseTape; external kernel32 name 'EraseTape';
  15456. function EscapeCommFunction; external kernel32 name 'EscapeCommFunction';
  15457. procedure ExitProcess; external kernel32 name 'ExitProcess';
  15458. procedure ExitThread; external kernel32 name 'ExitThread';
  15459. function ExpandEnvironmentStringsA; external kernel32 name 'ExpandEnvironmentStringsA';
  15460. function ExpandEnvironmentStringsW; external kernel32 name 'ExpandEnvironmentStringsW';
  15461. function ExpandEnvironmentStrings; external kernel32 name 'ExpandEnvironmentStringsA';
  15462. procedure FatalAppExitA; external kernel32 name 'FatalAppExitA';
  15463. procedure FatalAppExitW; external kernel32 name 'FatalAppExitW';
  15464. procedure FatalAppExit; external kernel32 name 'FatalAppExitA';
  15465. procedure FatalExit; external kernel32 name 'FatalExit';
  15466. function FileTimeToDosDateTime; external kernel32 name 'FileTimeToDosDateTime';
  15467. function FileTimeToLocalFileTime; external kernel32 name 'FileTimeToLocalFileTime';
  15468. function FileTimeToSystemTime; external kernel32 name 'FileTimeToSystemTime';
  15469. function FillConsoleOutputAttribute; external kernel32 name 'FillConsoleOutputAttribute';
  15470. function FillConsoleOutputCharacterA; external kernel32 name 'FillConsoleOutputCharacterA';
  15471. function FillConsoleOutputCharacterW; external kernel32 name 'FillConsoleOutputCharacterW';
  15472. function FillConsoleOutputCharacter; external kernel32 name 'FillConsoleOutputCharacterA';
  15473. function FindAtomA; external kernel32 name 'FindAtomA';
  15474. function FindAtomW; external kernel32 name 'FindAtomW';
  15475. function FindAtom; external kernel32 name 'FindAtomA';
  15476. function FindClose; external kernel32 name 'FindClose';
  15477. function FindCloseChangeNotification; external kernel32 name 'FindCloseChangeNotification';
  15478. function FindFirstChangeNotificationA; external kernel32 name 'FindFirstChangeNotificationA';
  15479. function FindFirstChangeNotificationW; external kernel32 name 'FindFirstChangeNotificationW';
  15480. function FindFirstChangeNotification; external kernel32 name 'FindFirstChangeNotificationA';
  15481. function FindFirstFileA; external kernel32 name 'FindFirstFileA';
  15482. function FindFirstFileW; external kernel32 name 'FindFirstFileW';
  15483. function FindFirstFile; external kernel32 name 'FindFirstFileA';
  15484. function FindNextChangeNotification; external kernel32 name 'FindNextChangeNotification';
  15485. function FindNextFileA; external kernel32 name 'FindNextFileA';
  15486. function FindNextFileW; external kernel32 name 'FindNextFileW';
  15487. function FindNextFile; external kernel32 name 'FindNextFileA';
  15488. function FindResourceA; external kernel32 name 'FindResourceA';
  15489. function FindResourceW; external kernel32 name 'FindResourceW';
  15490. function FindResource; external kernel32 name 'FindResourceA';
  15491. function FindResourceExA; external kernel32 name 'FindResourceExA';
  15492. function FindResourceExW; external kernel32 name 'FindResourceExW';
  15493. function FindResourceEx; external kernel32 name 'FindResourceExA';
  15494. function FlushConsoleInputBuffer; external kernel32 name 'FlushConsoleInputBuffer';
  15495. function FlushFileBuffers; external kernel32 name 'FlushFileBuffers';
  15496. function FlushInstructionCache; external kernel32 name 'FlushInstructionCache';
  15497. function FlushViewOfFile; external kernel32 name 'FlushViewOfFile';
  15498. function FoldStringA; external kernel32 name 'FoldStringA';
  15499. function FoldStringW; external kernel32 name 'FoldStringW';
  15500. function FoldString; external kernel32 name 'FoldStringA';
  15501. function FormatMessageA; external kernel32 name 'FormatMessageA';
  15502. function FormatMessageW; external kernel32 name 'FormatMessageW';
  15503. function FormatMessage; external kernel32 name 'FormatMessageA';
  15504. function FreeConsole; external kernel32 name 'FreeConsole';
  15505. function FreeEnvironmentStringsA; external kernel32 name 'FreeEnvironmentStringsA';
  15506. function FreeEnvironmentStringsW; external kernel32 name 'FreeEnvironmentStringsW';
  15507. function FreeEnvironmentStrings; external kernel32 name 'FreeEnvironmentStringsA';
  15508. function FreeLibrary; external kernel32 name 'FreeLibrary';
  15509. procedure FreeLibraryAndExitThread; external kernel32 name 'FreeLibraryAndExitThread';
  15510. function InterlockedIncrement; external kernel32 name 'InterlockedIncrement';
  15511. function InterlockedDecrement; external kernel32 name 'InterlockedDecrement';
  15512. function InterlockedExchange; external kernel32 name 'InterlockedExchange';
  15513. function FreeResource; external kernel32 name 'FreeResource';
  15514. function GenerateConsoleCtrlEvent; external kernel32 name 'GenerateConsoleCtrlEvent';
  15515. function GetACP; external kernel32 name 'GetACP';
  15516. function GetAtomNameA; external kernel32 name 'GetAtomNameA';
  15517. function GetAtomNameW; external kernel32 name 'GetAtomNameW';
  15518. function GetAtomName; external kernel32 name 'GetAtomNameA';
  15519. function GetBinaryTypeA; external kernel32 name 'GetBinaryTypeA';
  15520. function GetBinaryTypeW; external kernel32 name 'GetBinaryTypeW';
  15521. function GetBinaryType; external kernel32 name 'GetBinaryTypeA';
  15522. function GetCPInfo; external kernel32 name 'GetCPInfo';
  15523. function GetCommandLineA; external kernel32 name 'GetCommandLineA';
  15524. function GetCommandLineW; external kernel32 name 'GetCommandLineW';
  15525. function GetCommandLine; external kernel32 name 'GetCommandLineA';
  15526. function GetCommConfig; external kernel32 name 'GetCommConfig';
  15527. function GetCommMask; external kernel32 name 'GetCommMask';
  15528. function GetCommModemStatus; external kernel32 name 'GetCommModemStatus';
  15529. function GetCommProperties; external kernel32 name 'GetCommProperties';
  15530. function GetCommState; external kernel32 name 'GetCommState';
  15531. function GetCommTimeouts; external kernel32 name 'GetCommTimeouts';
  15532. function GetCompressedFileSizeA; external kernel32 name 'GetCompressedFileSizeA';
  15533. function GetCompressedFileSizeW; external kernel32 name 'GetCompressedFileSizeW';
  15534. function GetCompressedFileSize; external kernel32 name 'GetCompressedFileSizeA';
  15535. function GetComputerNameA; external kernel32 name 'GetComputerNameA';
  15536. function GetComputerNameW; external kernel32 name 'GetComputerNameW';
  15537. function GetComputerName; external kernel32 name 'GetComputerNameA';
  15538. function GetConsoleCP; external kernel32 name 'GetConsoleCP';
  15539. function GetConsoleCursorInfo; external kernel32 name 'GetConsoleCursorInfo';
  15540. function GetConsoleMode; external kernel32 name 'GetConsoleMode';
  15541. function GetConsoleOutputCP; external kernel32 name 'GetConsoleOutputCP';
  15542. function GetConsoleScreenBufferInfo; external kernel32 name 'GetConsoleScreenBufferInfo';
  15543. function GetConsoleTitleA; external kernel32 name 'GetConsoleTitleA';
  15544. function GetConsoleTitleW; external kernel32 name 'GetConsoleTitleW';
  15545. function GetConsoleTitle; external kernel32 name 'GetConsoleTitleA';
  15546. function GetCurrencyFormatA; external kernel32 name 'GetCurrencyFormatA';
  15547. function GetCurrencyFormatW; external kernel32 name 'GetCurrencyFormatW';
  15548. function GetCurrencyFormat; external kernel32 name 'GetCurrencyFormatA';
  15549. function GetCurrentDirectoryA; external kernel32 name 'GetCurrentDirectoryA';
  15550. function GetCurrentDirectoryW; external kernel32 name 'GetCurrentDirectoryW';
  15551. function GetCurrentDirectory; external kernel32 name 'GetCurrentDirectoryA';
  15552. function GetCurrentProcess; external kernel32 name 'GetCurrentProcess';
  15553. function GetCurrentProcessId; external kernel32 name 'GetCurrentProcessId';
  15554. function GetCurrentThread; external kernel32 name 'GetCurrentThread';
  15555. function GetCurrentThreadId; external kernel32 name 'GetCurrentThreadId';
  15556. function GetDateFormatA; external kernel32 name 'GetDateFormatA';
  15557. function GetDateFormatW; external kernel32 name 'GetDateFormatW';
  15558. function GetDateFormat; external kernel32 name 'GetDateFormatA';
  15559. function GetDefaultCommConfigA; external kernel32 name 'GetDefaultCommConfigA';
  15560. function GetDefaultCommConfigW; external kernel32 name 'GetDefaultCommConfigW';
  15561. function GetDefaultCommConfig; external kernel32 name 'GetDefaultCommConfigA';
  15562. function GetDiskFreeSpaceA; external kernel32 name 'GetDiskFreeSpaceA';
  15563. function GetDiskFreeSpaceW; external kernel32 name 'GetDiskFreeSpaceW';
  15564. function GetDiskFreeSpace; external kernel32 name 'GetDiskFreeSpaceA';
  15565. function GetDriveTypeA; external kernel32 name 'GetDriveTypeA';
  15566. function GetDriveTypeW; external kernel32 name 'GetDriveTypeW';
  15567. function GetDriveType; external kernel32 name 'GetDriveTypeA';
  15568. function GetEnvironmentStringsA; external kernel32 name 'GetEnvironmentStringsA';
  15569. function GetEnvironmentStringsW; external kernel32 name 'GetEnvironmentStringsW';
  15570. function GetEnvironmentStrings; external kernel32 name 'GetEnvironmentStringsA';
  15571. function GetEnvironmentVariableA; external kernel32 name 'GetEnvironmentVariableA';
  15572. function GetEnvironmentVariableW; external kernel32 name 'GetEnvironmentVariableW';
  15573. function GetEnvironmentVariable; external kernel32 name 'GetEnvironmentVariableA';
  15574. function GetExitCodeProcess; external kernel32 name 'GetExitCodeProcess';
  15575. function GetExitCodeThread; external kernel32 name 'GetExitCodeThread';
  15576. function GetFileAttributesA; external kernel32 name 'GetFileAttributesA';
  15577. function GetFileAttributesW; external kernel32 name 'GetFileAttributesW';
  15578. function GetFileAttributes; external kernel32 name 'GetFileAttributesA';
  15579. function GetFileInformationByHandle; external kernel32 name 'GetFileInformationByHandle';
  15580. function GetFileSize; external kernel32 name 'GetFileSize';
  15581. function GetFileTime; external kernel32 name 'GetFileTime';
  15582. function GetFileType; external kernel32 name 'GetFileType';
  15583. function GetFullPathNameA; external kernel32 name 'GetFullPathNameA';
  15584. function GetFullPathNameW; external kernel32 name 'GetFullPathNameW';
  15585. function GetFullPathName; external kernel32 name 'GetFullPathNameA';
  15586. function GetHandleInformation; external kernel32 name 'GetHandleInformation';
  15587. function GetLargestConsoleWindowSize; external kernel32 name 'GetLargestConsoleWindowSize';
  15588. function GetLastError; external kernel32 name 'GetLastError';
  15589. procedure GetLocalTime; external kernel32 name 'GetLocalTime';
  15590. function GetLocaleInfoA; external kernel32 name 'GetLocaleInfoA';
  15591. function GetLocaleInfoW; external kernel32 name 'GetLocaleInfoW';
  15592. function GetLocaleInfo; external kernel32 name 'GetLocaleInfoA';
  15593. function GetLogicalDriveStringsA; external kernel32 name 'GetLogicalDriveStringsA';
  15594. function GetLogicalDriveStringsW; external kernel32 name 'GetLogicalDriveStringsW';
  15595. function GetLogicalDriveStrings; external kernel32 name 'GetLogicalDriveStringsA';
  15596. function GetLogicalDrives; external kernel32 name 'GetLogicalDrives';
  15597. function GetMailslotInfo; external kernel32 name 'GetMailslotInfo';
  15598. function GetModuleFileNameA; external kernel32 name 'GetModuleFileNameA';
  15599. function GetModuleFileNameW; external kernel32 name 'GetModuleFileNameW';
  15600. function GetModuleFileName; external kernel32 name 'GetModuleFileNameA';
  15601. function GetModuleHandleA; external kernel32 name 'GetModuleHandleA';
  15602. function GetModuleHandleW; external kernel32 name 'GetModuleHandleW';
  15603. function GetModuleHandle; external kernel32 name 'GetModuleHandleA';
  15604. function GetNamedPipeHandleStateA; external kernel32 name 'GetNamedPipeHandleStateA';
  15605. function GetNamedPipeHandleStateW; external kernel32 name 'GetNamedPipeHandleStateW';
  15606. function GetNamedPipeHandleState; external kernel32 name 'GetNamedPipeHandleStateA';
  15607. function GetNamedPipeInfo; external kernel32 name 'GetNamedPipeInfo';
  15608. function GetNumberFormatA; external kernel32 name 'GetNumberFormatA';
  15609. function GetNumberFormatW; external kernel32 name 'GetNumberFormatW';
  15610. function GetNumberFormat; external kernel32 name 'GetNumberFormatA';
  15611. function GetNumberOfConsoleInputEvents; external kernel32 name 'GetNumberOfConsoleInputEvents';
  15612. function GetNumberOfConsoleMouseButtons; external kernel32 name 'GetNumberOfConsoleMouseButtons';
  15613. function GetOEMCP; external kernel32 name 'GetOEMCP';
  15614. function GetOverlappedResult; external kernel32 name 'GetOverlappedResult';
  15615. function GetPriorityClass; external kernel32 name 'GetPriorityClass';
  15616. function GetPrivateProfileIntA; external kernel32 name 'GetPrivateProfileIntA';
  15617. function GetPrivateProfileIntW; external kernel32 name 'GetPrivateProfileIntW';
  15618. function GetPrivateProfileInt; external kernel32 name 'GetPrivateProfileIntA';
  15619. function GetPrivateProfileSectionA; external kernel32 name 'GetPrivateProfileSectionA';
  15620. function GetPrivateProfileSectionW; external kernel32 name 'GetPrivateProfileSectionW';
  15621. function GetPrivateProfileSection; external kernel32 name 'GetPrivateProfileSectionA';
  15622. function GetPrivateProfileSectionNamesA; external kernel32 name 'GetPrivateProfileSectionNamesA';
  15623. function GetPrivateProfileSectionNamesW; external kernel32 name 'GetPrivateProfileSectionNamesW';
  15624. function GetPrivateProfileSectionNames; external kernel32 name 'GetPrivateProfileSectionNamesA';
  15625. function GetPrivateProfileStringA; external kernel32 name 'GetPrivateProfileStringA';
  15626. function GetPrivateProfileStringW; external kernel32 name 'GetPrivateProfileStringW';
  15627. function GetPrivateProfileString; external kernel32 name 'GetPrivateProfileStringA';
  15628. function GetProcAddress; external kernel32 name 'GetProcAddress';
  15629. function GetProcessAffinityMask; external kernel32 name 'GetProcessAffinityMask';
  15630. function GetProcessHeap; external kernel32 name 'GetProcessHeap';
  15631. function GetProcessHeaps; external kernel32 name 'GetProcessHeaps';
  15632. function GetProcessShutdownParameters; external kernel32 name 'GetProcessShutdownParameters';
  15633. function GetProcessTimes; external kernel32 name 'GetProcessTimes';
  15634. function GetProcessVersion; external kernel32 name 'GetProcessVersion';
  15635. function GetProcessWorkingSetSize; external kernel32 name 'GetProcessWorkingSetSize';
  15636. function GetProfileIntA; external kernel32 name 'GetProfileIntA';
  15637. function GetProfileIntW; external kernel32 name 'GetProfileIntW';
  15638. function GetProfileInt; external kernel32 name 'GetProfileIntA';
  15639. function GetProfileSectionA; external kernel32 name 'GetProfileSectionA';
  15640. function GetProfileSectionW; external kernel32 name 'GetProfileSectionW';
  15641. function GetProfileSection; external kernel32 name 'GetProfileSectionA';
  15642. function GetProfileStringA; external kernel32 name 'GetProfileStringA';
  15643. function GetProfileStringW; external kernel32 name 'GetProfileStringW';
  15644. function GetProfileString; external kernel32 name 'GetProfileStringA';
  15645. function GetQueuedCompletionStatus; external kernel32 name 'GetQueuedCompletionStatus';
  15646. function GetShortPathNameA; external kernel32 name 'GetShortPathNameA';
  15647. function GetShortPathNameW; external kernel32 name 'GetShortPathNameW';
  15648. function GetShortPathName; external kernel32 name 'GetShortPathNameA';
  15649. procedure GetStartupInfoA; external kernel32 name 'GetStartupInfoA';
  15650. procedure GetStartupInfoW; external kernel32 name 'GetStartupInfoW';
  15651. procedure GetStartupInfo; external kernel32 name 'GetStartupInfoA';
  15652. function GetStdHandle; external kernel32 name 'GetStdHandle';
  15653. function GetStringTypeExA; external kernel32 name 'GetStringTypeExA';
  15654. function GetStringTypeExW; external kernel32 name 'GetStringTypeExW';
  15655. function GetStringTypeEx; external kernel32 name 'GetStringTypeExA';
  15656. function GetStringTypeA; external kernel32 name 'GetStringTypeA';
  15657. function GetStringTypeW; external kernel32 name 'GetStringTypeW';
  15658. function GetSystemDefaultLCID; external kernel32 name 'GetSystemDefaultLCID';
  15659. function GetSystemDefaultLangID; external kernel32 name 'GetSystemDefaultLangID';
  15660. function GetSystemDirectoryA; external kernel32 name 'GetSystemDirectoryA';
  15661. function GetSystemDirectoryW; external kernel32 name 'GetSystemDirectoryW';
  15662. function GetSystemDirectory; external kernel32 name 'GetSystemDirectoryA';
  15663. procedure GetSystemInfo; external kernel32 name 'GetSystemInfo';
  15664. function GetSystemPowerStatus; external kernel32 name 'GetSystemPowerStatus';
  15665. procedure GetSystemTime; external kernel32 name 'GetSystemTime';
  15666. procedure GetSystemTimeAsFileTime; external kernel32 name 'GetSystemTimeAsFileTime';
  15667. function GetSystemTimeAdjustment; external kernel32 name 'GetSystemTimeAdjustment';
  15668. function GetTapeParameters; external kernel32 name 'GetTapeParameters';
  15669. function GetTapePosition; external kernel32 name 'GetTapePosition';
  15670. function GetTapeStatus; external kernel32 name 'GetTapeStatus';
  15671. function GetTempFileNameA; external kernel32 name 'GetTempFileNameA';
  15672. function GetTempFileNameW; external kernel32 name 'GetTempFileNameW';
  15673. function GetTempFileName; external kernel32 name 'GetTempFileNameA';
  15674. function GetTempPathA; external kernel32 name 'GetTempPathA';
  15675. function GetTempPathW; external kernel32 name 'GetTempPathW';
  15676. function GetTempPath; external kernel32 name 'GetTempPathA';
  15677. function GetThreadContext; external kernel32 name 'GetThreadContext';
  15678. function GetThreadLocale; external kernel32 name 'GetThreadLocale';
  15679. function GetThreadPriority; external kernel32 name 'GetThreadPriority';
  15680. function GetThreadSelectorEntry; external kernel32 name 'GetThreadSelectorEntry';
  15681. function GetThreadTimes; external kernel32 name 'GetThreadTimes';
  15682. function GetTickCount; external kernel32 name 'GetTickCount';
  15683. function GetTimeFormatA; external kernel32 name 'GetTimeFormatA';
  15684. function GetTimeFormatW; external kernel32 name 'GetTimeFormatW';
  15685. function GetTimeFormat; external kernel32 name 'GetTimeFormatA';
  15686. function GetTimeZoneInformation; external kernel32 name 'GetTimeZoneInformation';
  15687. function GetUserDefaultLCID; external kernel32 name 'GetUserDefaultLCID';
  15688. function GetUserDefaultLangID; external kernel32 name 'GetUserDefaultLangID';
  15689. function GetVersion; external kernel32 name 'GetVersion';
  15690. function GetVersionExA; external kernel32 name 'GetVersionExA';
  15691. function GetVersionExW; external kernel32 name 'GetVersionExW';
  15692. function GetVersionEx; external kernel32 name 'GetVersionExA';
  15693. function GetVolumeInformationA; external kernel32 name 'GetVolumeInformationA';
  15694. function GetVolumeInformationW; external kernel32 name 'GetVolumeInformationW';
  15695. function GetVolumeInformation; external kernel32 name 'GetVolumeInformationA';
  15696. function GetWindowsDirectoryA; external kernel32 name 'GetWindowsDirectoryA';
  15697. function GetWindowsDirectoryW; external kernel32 name 'GetWindowsDirectoryW';
  15698. function GetWindowsDirectory; external kernel32 name 'GetWindowsDirectoryA';
  15699. function GlobalAddAtomA; external kernel32 name 'GlobalAddAtomA';
  15700. function GlobalAddAtomW; external kernel32 name 'GlobalAddAtomW';
  15701. function GlobalAddAtom; external kernel32 name 'GlobalAddAtomA';
  15702. function GlobalAlloc; external kernel32 name 'GlobalAlloc';
  15703. function GlobalCompact; external kernel32 name 'GlobalCompact';
  15704. function GlobalDeleteAtom; external kernel32 name 'GlobalDeleteAtom';
  15705. function GlobalFindAtomA; external kernel32 name 'GlobalFindAtomA';
  15706. function GlobalFindAtomW; external kernel32 name 'GlobalFindAtomW';
  15707. function GlobalFindAtom; external kernel32 name 'GlobalFindAtomA';
  15708. procedure GlobalFix; external kernel32 name 'GlobalFix';
  15709. function GlobalFlags; external kernel32 name 'GlobalFlags';
  15710. function GlobalFree; external kernel32 name 'GlobalFree';
  15711. function GlobalGetAtomNameA; external kernel32 name 'GlobalGetAtomNameA';
  15712. function GlobalGetAtomNameW; external kernel32 name 'GlobalGetAtomNameW';
  15713. function GlobalGetAtomName; external kernel32 name 'GlobalGetAtomNameA';
  15714. function GlobalLock; external kernel32 name 'GlobalLock';
  15715. function GlobalHandle; external kernel32 name 'GlobalHandle';
  15716. procedure GlobalMemoryStatus; external kernel32 name 'GlobalMemoryStatus';
  15717. function GlobalReAlloc; external kernel32 name 'GlobalReAlloc';
  15718. function GlobalSize; external kernel32 name 'GlobalSize';
  15719. function GlobalUnWire; external kernel32 name 'GlobalUnWire';
  15720. procedure GlobalUnfix; external kernel32 name 'GlobalUnfix';
  15721. function GlobalUnlock; external kernel32 name 'GlobalUnlock';
  15722. function GlobalWire; external kernel32 name 'GlobalWire';
  15723. function HeapAlloc; external kernel32 name 'HeapAlloc';
  15724. function HeapCompact; external kernel32 name 'HeapCompact';
  15725. function HeapCreate; external kernel32 name 'HeapCreate';
  15726. function HeapDestroy; external kernel32 name 'HeapDestroy';
  15727. function HeapFree; external kernel32 name 'HeapFree';
  15728. function HeapLock; external kernel32 name 'HeapLock';
  15729. function HeapReAlloc; external kernel32 name 'HeapReAlloc';
  15730. function HeapSize; external kernel32 name 'HeapSize';
  15731. function HeapUnlock; external kernel32 name 'HeapUnlock';
  15732. function HeapValidate; external kernel32 name 'HeapValidate';
  15733. function HeapWalk; external kernel32 name 'HeapWalk';
  15734. function InitAtomTable; external kernel32 name 'InitAtomTable';
  15735. procedure InitializeCriticalSection; external kernel32 name 'InitializeCriticalSection';
  15736. function IsBadCodePtr; external kernel32 name 'IsBadCodePtr';
  15737. function IsBadHugeReadPtr; external kernel32 name 'IsBadHugeReadPtr';
  15738. function IsBadHugeWritePtr; external kernel32 name 'IsBadHugeWritePtr';
  15739. function IsBadReadPtr; external kernel32 name 'IsBadReadPtr';
  15740. function IsBadStringPtrA; external kernel32 name 'IsBadStringPtrA';
  15741. function IsBadStringPtrW; external kernel32 name 'IsBadStringPtrW';
  15742. function IsBadStringPtr; external kernel32 name 'IsBadStringPtrA';
  15743. function IsBadWritePtr; external kernel32 name 'IsBadWritePtr';
  15744. function IsDBCSLeadByte; external kernel32 name 'IsDBCSLeadByte';
  15745. function IsDBCSLeadByteEx; external kernel32 name 'IsDBCSLeadByteEx';
  15746. function IsValidCodePage; external kernel32 name 'IsValidCodePage';
  15747. function IsValidLocale; external kernel32 name 'IsValidLocale';
  15748. function LCMapStringA; external kernel32 name 'LCMapStringA';
  15749. function LCMapStringW; external kernel32 name 'LCMapStringW';
  15750. function LCMapString; external kernel32 name 'LCMapStringA';
  15751. procedure LeaveCriticalSection; external kernel32 name 'LeaveCriticalSection';
  15752. function LoadLibraryA; external kernel32 name 'LoadLibraryA';
  15753. function LoadLibraryW; external kernel32 name 'LoadLibraryW';
  15754. function LoadLibrary; external kernel32 name 'LoadLibraryA';
  15755. function LoadLibraryExA; external kernel32 name 'LoadLibraryExA';
  15756. function LoadLibraryExW; external kernel32 name 'LoadLibraryExW';
  15757. function LoadLibraryEx; external kernel32 name 'LoadLibraryExA';
  15758. function LoadModule; external kernel32 name 'LoadModule';
  15759. function LoadResource; external kernel32 name 'LoadResource';
  15760. function LocalAlloc; external kernel32 name 'LocalAlloc';
  15761. function LocalCompact; external kernel32 name 'LocalCompact';
  15762. function LocalFileTimeToFileTime; external kernel32 name 'LocalFileTimeToFileTime';
  15763. function LocalFlags; external kernel32 name 'LocalFlags';
  15764. function LocalFree; external kernel32 name 'LocalFree';
  15765. function LocalLock; external kernel32 name 'LocalLock';
  15766. function LocalReAlloc; external kernel32 name 'LocalReAlloc';
  15767. function LocalShrink; external kernel32 name 'LocalShrink';
  15768. function LocalSize; external kernel32 name 'LocalSize';
  15769. function LocalUnlock; external kernel32 name 'LocalUnlock';
  15770. function LockFile; external kernel32 name 'LockFile';
  15771. function LockFileEx; external kernel32 name 'LockFileEx';
  15772. function LockResource; external kernel32 name 'LockResource';
  15773. function MapViewOfFile; external kernel32 name 'MapViewOfFile';
  15774. function MapViewOfFileEx; external kernel32 name 'MapViewOfFileEx';
  15775. function MoveFileA; external kernel32 name 'MoveFileA';
  15776. function MoveFileW; external kernel32 name 'MoveFileW';
  15777. function MoveFile; external kernel32 name 'MoveFileA';
  15778. function MoveFileExA; external kernel32 name 'MoveFileExA';
  15779. function MoveFileExW; external kernel32 name 'MoveFileExW';
  15780. function MoveFileEx; external kernel32 name 'MoveFileExA';
  15781. function MulDiv; external kernel32 name 'MulDiv';
  15782. function MultiByteToWideChar; external kernel32 name 'MultiByteToWideChar';
  15783. function OpenEventA; external kernel32 name 'OpenEventA';
  15784. function OpenEventW; external kernel32 name 'OpenEventW';
  15785. function OpenEvent; external kernel32 name 'OpenEventA';
  15786. function OpenFile; external kernel32 name 'OpenFile';
  15787. function OpenFileMappingA; external kernel32 name 'OpenFileMappingA';
  15788. function OpenFileMappingW; external kernel32 name 'OpenFileMappingW';
  15789. function OpenFileMapping; external kernel32 name 'OpenFileMappingA';
  15790. function OpenMutexA; external kernel32 name 'OpenMutexA';
  15791. function OpenMutexW; external kernel32 name 'OpenMutexW';
  15792. function OpenMutex; external kernel32 name 'OpenMutexA';
  15793. function OpenProcess; external kernel32 name 'OpenProcess';
  15794. function OpenSemaphoreA; external kernel32 name 'OpenSemaphoreA';
  15795. function OpenSemaphoreW; external kernel32 name 'OpenSemaphoreW';
  15796. function OpenSemaphore; external kernel32 name 'OpenSemaphoreA';
  15797. procedure OutputDebugStringA; external kernel32 name 'OutputDebugStringA';
  15798. procedure OutputDebugStringW; external kernel32 name 'OutputDebugStringW';
  15799. procedure OutputDebugString; external kernel32 name 'OutputDebugStringA';
  15800. function PeekConsoleInputA; external kernel32 name 'PeekConsoleInputA';
  15801. function PeekConsoleInputW; external kernel32 name 'PeekConsoleInputW';
  15802. function PeekConsoleInput; external kernel32 name 'PeekConsoleInputA';
  15803. function PeekNamedPipe; external kernel32 name 'PeekNamedPipe';
  15804. function PostQueuedCompletionStatus; external kernel32 name 'PostQueuedCompletionStatus';
  15805. function PrepareTape; external kernel32 name 'PrepareTape';
  15806. function PulseEvent; external kernel32 name 'PulseEvent';
  15807. function PurgeComm; external kernel32 name 'PurgeComm';
  15808. function QueryDosDeviceA; external kernel32 name 'QueryDosDeviceA';
  15809. function QueryDosDeviceW; external kernel32 name 'QueryDosDeviceW';
  15810. function QueryDosDevice; external kernel32 name 'QueryDosDeviceA';
  15811. function QueryPerformanceCounter; external kernel32 name 'QueryPerformanceCounter';
  15812. function QueryPerformanceFrequency; external kernel32 name 'QueryPerformanceFrequency';
  15813. procedure RaiseException; external kernel32 name 'RaiseException';
  15814. function ReadConsoleA; external kernel32 name 'ReadConsoleA';
  15815. function ReadConsoleW; external kernel32 name 'ReadConsoleW';
  15816. function ReadConsole; external kernel32 name 'ReadConsoleA';
  15817. function ReadConsoleInputA; external kernel32 name 'ReadConsoleInputA';
  15818. function ReadConsoleInputW; external kernel32 name 'ReadConsoleInputW';
  15819. function ReadConsoleInput; external kernel32 name 'ReadConsoleInputA';
  15820. function ReadConsoleOutputA; external kernel32 name 'ReadConsoleOutputA';
  15821. function ReadConsoleOutputW; external kernel32 name 'ReadConsoleOutputW';
  15822. function ReadConsoleOutput; external kernel32 name 'ReadConsoleOutputA';
  15823. function ReadConsoleOutputAttribute; external kernel32 name 'ReadConsoleOutputAttribute';
  15824. function ReadConsoleOutputCharacterA; external kernel32 name 'ReadConsoleOutputCharacterA';
  15825. function ReadConsoleOutputCharacterW; external kernel32 name 'ReadConsoleOutputCharacterW';
  15826. function ReadConsoleOutputCharacter; external kernel32 name 'ReadConsoleOutputCharacterA';
  15827. function ReadFile; external kernel32 name 'ReadFile';
  15828. function ReadFileEx; external kernel32 name 'ReadFileEx';
  15829. function ReadProcessMemory; external kernel32 name 'ReadProcessMemory';
  15830. function ReleaseMutex; external kernel32 name 'ReleaseMutex';
  15831. function ReleaseSemaphore; external kernel32 name 'ReleaseSemaphore';
  15832. function RemoveDirectoryA; external kernel32 name 'RemoveDirectoryA';
  15833. function RemoveDirectoryW; external kernel32 name 'RemoveDirectoryW';
  15834. function RemoveDirectory; external kernel32 name 'RemoveDirectoryA';
  15835. function ResetEvent; external kernel32 name 'ResetEvent';
  15836. function ResumeThread; external kernel32 name 'ResumeThread';
  15837. function ScrollConsoleScreenBufferA; external kernel32 name 'ScrollConsoleScreenBufferA';
  15838. function ScrollConsoleScreenBufferW; external kernel32 name 'ScrollConsoleScreenBufferW';
  15839. function ScrollConsoleScreenBuffer; external kernel32 name 'ScrollConsoleScreenBufferA';
  15840. function SearchPathA; external kernel32 name 'SearchPathA';
  15841. function SearchPathW; external kernel32 name 'SearchPathW';
  15842. function SearchPath; external kernel32 name 'SearchPathA';
  15843. function SetCommBreak; external kernel32 name 'SetCommBreak';
  15844. function SetCommConfig; external kernel32 name 'SetCommConfig';
  15845. function SetCommMask; external kernel32 name 'SetCommMask';
  15846. function SetCommState; external kernel32 name 'SetCommState';
  15847. function SetCommTimeouts; external kernel32 name 'SetCommTimeouts';
  15848. function SetComputerNameA; external kernel32 name 'SetComputerNameA';
  15849. function SetComputerNameW; external kernel32 name 'SetComputerNameW';
  15850. function SetComputerName; external kernel32 name 'SetComputerNameA';
  15851. function SetConsoleActiveScreenBuffer; external kernel32 name 'SetConsoleActiveScreenBuffer';
  15852. function SetConsoleCP; external kernel32 name 'SetConsoleCP';
  15853. function SetConsoleCtrlHandler; external kernel32 name 'SetConsoleCtrlHandler';
  15854. function SetConsoleCursorInfo; external kernel32 name 'SetConsoleCursorInfo';
  15855. function SetConsoleCursorPosition; external kernel32 name 'SetConsoleCursorPosition';
  15856. function SetConsoleMode; external kernel32 name 'SetConsoleMode';
  15857. function SetConsoleOutputCP; external kernel32 name 'SetConsoleOutputCP';
  15858. function SetConsoleScreenBufferSize; external kernel32 name 'SetConsoleScreenBufferSize';
  15859. function SetConsoleTextAttribute; external kernel32 name 'SetConsoleTextAttribute';
  15860. function SetConsoleTitleA; external kernel32 name 'SetConsoleTitleA';
  15861. function SetConsoleTitleW; external kernel32 name 'SetConsoleTitleW';
  15862. function SetConsoleTitle; external kernel32 name 'SetConsoleTitleA';
  15863. function SetConsoleWindowInfo; external kernel32 name 'SetConsoleWindowInfo';
  15864. function SetCurrentDirectoryA; external kernel32 name 'SetCurrentDirectoryA';
  15865. function SetCurrentDirectoryW; external kernel32 name 'SetCurrentDirectoryW';
  15866. function SetCurrentDirectory; external kernel32 name 'SetCurrentDirectoryA';
  15867. function SetDefaultCommConfigA; external kernel32 name 'SetDefaultCommConfigA';
  15868. function SetDefaultCommConfigW; external kernel32 name 'SetDefaultCommConfigW';
  15869. function SetDefaultCommConfig; external kernel32 name 'SetDefaultCommConfigA';
  15870. function SetEndOfFile; external kernel32 name 'SetEndOfFile';
  15871. function SetEnvironmentVariableA; external kernel32 name 'SetEnvironmentVariableA';
  15872. function SetEnvironmentVariableW; external kernel32 name 'SetEnvironmentVariableW';
  15873. function SetEnvironmentVariable; external kernel32 name 'SetEnvironmentVariableA';
  15874. function SetErrorMode; external kernel32 name 'SetErrorMode';
  15875. function SetEvent; external kernel32 name 'SetEvent';
  15876. procedure SetFileApisToANSI; external kernel32 name 'SetFileApisToANSI';
  15877. procedure SetFileApisToOEM; external kernel32 name 'SetFileApisToOEM';
  15878. function SetFileAttributesA; external kernel32 name 'SetFileAttributesA';
  15879. function SetFileAttributesW; external kernel32 name 'SetFileAttributesW';
  15880. function SetFileAttributes; external kernel32 name 'SetFileAttributesA';
  15881. function SetFilePointer; external kernel32 name 'SetFilePointer';
  15882. function SetFileTime; external kernel32 name 'SetFileTime';
  15883. function SetHandleCount; external kernel32 name 'SetHandleCount';
  15884. function SetHandleInformation; external kernel32 name 'SetHandleInformation';
  15885. procedure SetLastError; external kernel32 name 'SetLastError';
  15886. function SetLocalTime; external kernel32 name 'SetLocalTime';
  15887. function SetLocaleInfoA; external kernel32 name 'SetLocaleInfoA';
  15888. function SetLocaleInfoW; external kernel32 name 'SetLocaleInfoW';
  15889. function SetLocaleInfo; external kernel32 name 'SetLocaleInfoA';
  15890. function SetMailslotInfo; external kernel32 name 'SetMailslotInfo';
  15891. function SetNamedPipeHandleState; external kernel32 name 'SetNamedPipeHandleState';
  15892. function SetPriorityClass; external kernel32 name 'SetPriorityClass';
  15893. function SetProcessShutdownParameters; external kernel32 name 'SetProcessShutdownParameters';
  15894. function SetProcessWorkingSetSize; external kernel32 name 'SetProcessWorkingSetSize';
  15895. function SetStdHandle; external kernel32 name 'SetStdHandle';
  15896. function SetSystemPowerState; external kernel32 name 'SetSystemPowerState';
  15897. function SetSystemTime; external kernel32 name 'SetSystemTime';
  15898. function SetSystemTimeAdjustment; external kernel32 name 'SetSystemTimeAdjustment';
  15899. function SetTapeParameters; external kernel32 name 'SetTapeParameters';
  15900. function SetTapePosition; external kernel32 name 'SetTapePosition';
  15901. function SetThreadAffinityMask; external kernel32 name 'SetThreadAffinityMask';
  15902. function SetThreadContext; external kernel32 name 'SetThreadContext';
  15903. function SetThreadLocale; external kernel32 name 'SetThreadLocale';
  15904. function SetThreadPriority; external kernel32 name 'SetThreadPriority';
  15905. function SetTimeZoneInformation; external kernel32 name 'SetTimeZoneInformation';
  15906. function SetUnhandledExceptionFilter; external kernel32 name 'SetUnhandledExceptionFilter';
  15907. function SetVolumeLabelA; external kernel32 name 'SetVolumeLabelA';
  15908. function SetVolumeLabelW; external kernel32 name 'SetVolumeLabelW';
  15909. function SetVolumeLabel; external kernel32 name 'SetVolumeLabelA';
  15910. function SetupComm; external kernel32 name 'SetupComm';
  15911. function SizeofResource; external kernel32 name 'SizeofResource';
  15912. procedure Sleep; external kernel32 name 'Sleep';
  15913. function SleepEx; external kernel32 name 'SleepEx';
  15914. function SuspendThread; external kernel32 name 'SuspendThread';
  15915. function SystemTimeToFileTime; external kernel32 name 'SystemTimeToFileTime';
  15916. function SystemTimeToTzSpecificLocalTime; external kernel32 name 'SystemTimeToTzSpecificLocalTime';
  15917. function TerminateProcess; external kernel32 name 'TerminateProcess';
  15918. function TerminateThread; external kernel32 name 'TerminateThread';
  15919. function TlsAlloc; external kernel32 name 'TlsAlloc';
  15920. function TlsFree; external kernel32 name 'TlsFree';
  15921. function TlsGetValue; external kernel32 name 'TlsGetValue';
  15922. function TlsSetValue; external kernel32 name 'TlsSetValue';
  15923. function TransactNamedPipe; external kernel32 name 'TransactNamedPipe';
  15924. function TransmitCommChar; external kernel32 name 'TransmitCommChar';
  15925. function UnhandledExceptionFilter; external kernel32 name 'UnhandledExceptionFilter';
  15926. function UnlockFile; external kernel32 name 'UnlockFile';
  15927. function UnlockFileEx; external kernel32 name 'UnlockFileEx';
  15928. function UnmapViewOfFile; external kernel32 name 'UnmapViewOfFile';
  15929. function UpdateResourceA; external kernel32 name 'UpdateResourceA';
  15930. function UpdateResourceW; external kernel32 name 'UpdateResourceW';
  15931. function UpdateResource; external kernel32 name 'UpdateResourceA';
  15932. function VerLanguageNameA; external kernel32 name 'VerLanguageNameA';
  15933. function VerLanguageNameW; external kernel32 name 'VerLanguageNameW';
  15934. function VerLanguageName; external kernel32 name 'VerLanguageNameA';
  15935. function VirtualAlloc; external kernel32 name 'VirtualAlloc';
  15936. function VirtualFree; external kernel32 name 'VirtualFree';
  15937. function VirtualLock; external kernel32 name 'VirtualLock';
  15938. function VirtualProtect; external kernel32 name 'VirtualProtect';
  15939. function VirtualProtectEx; external kernel32 name 'VirtualProtectEx';
  15940. function VirtualQuery; external kernel32 name 'VirtualQuery';
  15941. function VirtualQueryEx; external kernel32 name 'VirtualQueryEx';
  15942. function VirtualUnlock; external kernel32 name 'VirtualUnlock';
  15943. function WaitCommEvent; external kernel32 name 'WaitCommEvent';
  15944. function WaitForDebugEvent; external kernel32 name 'WaitForDebugEvent';
  15945. function WaitForMultipleObjects; external kernel32 name 'WaitForMultipleObjects';
  15946. function WaitForMultipleObjectsEx; external kernel32 name 'WaitForMultipleObjectsEx';
  15947. function WaitForSingleObject; external kernel32 name 'WaitForSingleObject';
  15948. function WaitForSingleObjectEx; external kernel32 name 'WaitForSingleObjectEx';
  15949. function WaitNamedPipeA; external kernel32 name 'WaitNamedPipeA';
  15950. function WaitNamedPipeW; external kernel32 name 'WaitNamedPipeW';
  15951. function WaitNamedPipe; external kernel32 name 'WaitNamedPipeA';
  15952. function WideCharToMultiByte; external kernel32 name 'WideCharToMultiByte';
  15953. function WinExec; external kernel32 name 'WinExec';
  15954. function WriteConsoleA; external kernel32 name 'WriteConsoleA';
  15955. function WriteConsoleW; external kernel32 name 'WriteConsoleW';
  15956. function WriteConsole; external kernel32 name 'WriteConsoleA';
  15957. function WriteConsoleInputA; external kernel32 name 'WriteConsoleInputA';
  15958. function WriteConsoleInputW; external kernel32 name 'WriteConsoleInputW';
  15959. function WriteConsoleInput; external kernel32 name 'WriteConsoleInputA';
  15960. function WriteConsoleOutputA; external kernel32 name 'WriteConsoleOutputA';
  15961. function WriteConsoleOutputW; external kernel32 name 'WriteConsoleOutputW';
  15962. function WriteConsoleOutput; external kernel32 name 'WriteConsoleOutputA';
  15963. function WriteConsoleOutputAttribute; external kernel32 name 'WriteConsoleOutputAttribute';
  15964. function WriteConsoleOutputCharacterA; external kernel32 name 'WriteConsoleOutputCharacterA';
  15965. function WriteConsoleOutputCharacterW; external kernel32 name 'WriteConsoleOutputCharacterW';
  15966. function WriteConsoleOutputCharacter; external kernel32 name 'WriteConsoleOutputCharacterA';
  15967. function WriteFile; external kernel32 name 'WriteFile';
  15968. function WriteFileEx; external kernel32 name 'WriteFileEx';
  15969. function WritePrivateProfileSectionA; external kernel32 name 'WritePrivateProfileSectionA';
  15970. function WritePrivateProfileSectionW; external kernel32 name 'WritePrivateProfileSectionW';
  15971. function WritePrivateProfileSection; external kernel32 name 'WritePrivateProfileSectionA';
  15972. function WritePrivateProfileStringA; external kernel32 name 'WritePrivateProfileStringA';
  15973. function WritePrivateProfileStringW; external kernel32 name 'WritePrivateProfileStringW';
  15974. function WritePrivateProfileString; external kernel32 name 'WritePrivateProfileStringA';
  15975. function WriteProcessMemory; external kernel32 name 'WriteProcessMemory';
  15976. function WriteProfileSectionA; external kernel32 name 'WriteProfileSectionA';
  15977. function WriteProfileSectionW; external kernel32 name 'WriteProfileSectionW';
  15978. function WriteProfileSection; external kernel32 name 'WriteProfileSectionA';
  15979. function WriteProfileStringA; external kernel32 name 'WriteProfileStringA';
  15980. function WriteProfileStringW; external kernel32 name 'WriteProfileStringW';
  15981. function WriteProfileString; external kernel32 name 'WriteProfileStringA';
  15982. function WriteTapemark; external kernel32 name 'WriteTapemark';
  15983. function _hread; external kernel32 name '_hread';
  15984. function _hwrite; external kernel32 name '_hwrite';
  15985. function _lclose; external kernel32 name '_lclose';
  15986. function _lcreat; external kernel32 name '_lcreat';
  15987. function _llseek; external kernel32 name '_llseek';
  15988. function _lopen; external kernel32 name '_lopen';
  15989. function _lread; external kernel32 name '_lread';
  15990. function _lwrite; external kernel32 name '_lwrite';
  15991. function lstrcatA; external kernel32 name 'lstrcatA';
  15992. function lstrcatW; external kernel32 name 'lstrcatW';
  15993. function lstrcat; external kernel32 name 'lstrcatA';
  15994. function lstrcmpA; external kernel32 name 'lstrcmpA';
  15995. function lstrcmpW; external kernel32 name 'lstrcmpW';
  15996. function lstrcmp; external kernel32 name 'lstrcmpA';
  15997. function lstrcmpiA; external kernel32 name 'lstrcmpiA';
  15998. function lstrcmpiW; external kernel32 name 'lstrcmpiW';
  15999. function lstrcmpi; external kernel32 name 'lstrcmpiA';
  16000. function lstrcpyA; external kernel32 name 'lstrcpyA';
  16001. function lstrcpyW; external kernel32 name 'lstrcpyW';
  16002. function lstrcpy; external kernel32 name 'lstrcpyA';
  16003. function lstrcpynA; external kernel32 name 'lstrcpynA';
  16004. function lstrcpynW; external kernel32 name 'lstrcpynW';
  16005. function lstrcpyn; external kernel32 name 'lstrcpynA';
  16006. function lstrlenA; external kernel32 name 'lstrlenA';
  16007. function lstrlenW; external kernel32 name 'lstrlenW';
  16008. function lstrlen; external kernel32 name 'lstrlenA';
  16009.  
  16010.  
  16011. { Externals from mpr.dll }
  16012.  
  16013. function MultinetGetConnectionPerformanceA; external mpr name 'MultinetGetConnectionPerformanceA';
  16014. function MultinetGetConnectionPerformanceW; external mpr name 'MultinetGetConnectionPerformanceW';
  16015. function MultinetGetConnectionPerformance; external mpr name 'MultinetGetConnectionPerformanceA';
  16016. function WNetAddConnection2A; external mpr name 'WNetAddConnection2A';
  16017. function WNetAddConnection2W; external mpr name 'WNetAddConnection2W';
  16018. function WNetAddConnection2; external mpr name 'WNetAddConnection2A';
  16019. function WNetAddConnection3A; external mpr name 'WNetAddConnection3A';
  16020. function WNetAddConnection3W; external mpr name 'WNetAddConnection3W';
  16021. function WNetAddConnection3; external mpr name 'WNetAddConnection3A';
  16022. function WNetAddConnectionA; external mpr name 'WNetAddConnectionA';
  16023. function WNetAddConnectionW; external mpr name 'WNetAddConnectionW';
  16024. function WNetAddConnection; external mpr name 'WNetAddConnectionA';
  16025. function WNetCancelConnection2A; external mpr name 'WNetCancelConnection2A';
  16026. function WNetCancelConnection2W; external mpr name 'WNetCancelConnection2W';
  16027. function WNetCancelConnection2; external mpr name 'WNetCancelConnection2A';
  16028. function WNetCancelConnectionA; external mpr name 'WNetCancelConnectionA';
  16029. function WNetCancelConnectionW; external mpr name 'WNetCancelConnectionW';
  16030. function WNetCancelConnection; external mpr name 'WNetCancelConnectionA';
  16031. function WNetCloseEnum; external mpr name 'WNetCloseEnum';
  16032. function WNetConnectionDialog1A; external mpr name 'WNetConnectionDialog1A';
  16033. function WNetConnectionDialog1W; external mpr name 'WNetConnectionDialog1W';
  16034. function WNetConnectionDialog1; external mpr name 'WNetConnectionDialog1A';
  16035. function WNetConnectionDialog; external mpr name 'WNetConnectionDialog';
  16036. function WNetDisconnectDialog1A; external mpr name 'WNetDisconnectDialog1A';
  16037. function WNetDisconnectDialog1W; external mpr name 'WNetDisconnectDialog1W';
  16038. function WNetDisconnectDialog1; external mpr name 'WNetDisconnectDialog1A';
  16039. function WNetDisconnectDialog; external mpr name 'WNetDisconnectDialog';
  16040. function WNetEnumResourceA; external mpr name 'WNetEnumResourceA';
  16041. function WNetEnumResourceW; external mpr name 'WNetEnumResourceW';
  16042. function WNetEnumResource; external mpr name 'WNetEnumResourceA';
  16043. function WNetGetConnectionA; external mpr name 'WNetGetConnectionA';
  16044. function WNetGetConnectionW; external mpr name 'WNetGetConnectionW';
  16045. function WNetGetConnection; external mpr name 'WNetGetConnectionA';
  16046. function WNetGetLastErrorA; external mpr name 'WNetGetLastErrorA';
  16047. function WNetGetLastErrorW; external mpr name 'WNetGetLastErrorW';
  16048. function WNetGetLastError; external mpr name 'WNetGetLastErrorA';
  16049. function WNetGetNetworkInformationA; external mpr name 'WNetGetNetworkInformationA';
  16050. function WNetGetNetworkInformationW; external mpr name 'WNetGetNetworkInformationW';
  16051. function WNetGetNetworkInformation; external mpr name 'WNetGetNetworkInformationA';
  16052. function WNetGetProviderNameA; external mpr name 'WNetGetProviderNameA';
  16053. function WNetGetProviderNameW; external mpr name 'WNetGetProviderNameW';
  16054. function WNetGetProviderName; external mpr name 'WNetGetProviderNameA';
  16055. function WNetGetUniversalNameA; external mpr name 'WNetGetUniversalNameA';
  16056. function WNetGetUniversalNameW; external mpr name 'WNetGetUniversalNameW';
  16057. function WNetGetUniversalName; external mpr name 'WNetGetUniversalNameA';
  16058. function WNetGetUserA; external mpr name 'WNetGetUserA';
  16059. function WNetGetUserW; external mpr name 'WNetGetUserW';
  16060. function WNetGetUser; external mpr name 'WNetGetUserA';
  16061. function WNetOpenEnumA; external mpr name 'WNetOpenEnumA';
  16062. function WNetOpenEnumW; external mpr name 'WNetOpenEnumW';
  16063. function WNetOpenEnum; external mpr name 'WNetOpenEnumA';
  16064. function WNetSetConnectionA; external mpr name 'WNetSetConnectionA';
  16065. function WNetSetConnectionW; external mpr name 'WNetSetConnectionW';
  16066. function WNetSetConnection; external mpr name 'WNetSetConnectionA';
  16067. function WNetUseConnectionA; external mpr name 'WNetUseConnectionA';
  16068. function WNetUseConnectionW; external mpr name 'WNetUseConnectionW';
  16069. function WNetUseConnection; external mpr name 'WNetUseConnectionA';
  16070.  
  16071.  
  16072. { Externals from version.dll }
  16073.  
  16074. function GetFileVersionInfoA; external version name 'GetFileVersionInfoA';
  16075. function GetFileVersionInfoW; external version name 'GetFileVersionInfoW';
  16076. function GetFileVersionInfo; external version name 'GetFileVersionInfoA';
  16077. function GetFileVersionInfoSizeA; external version name 'GetFileVersionInfoSizeA';
  16078. function GetFileVersionInfoSizeW; external version name 'GetFileVersionInfoSizeW';
  16079. function GetFileVersionInfoSize; external version name 'GetFileVersionInfoSizeA';
  16080. function VerFindFileA; external version name 'VerFindFileA';
  16081. function VerFindFileW; external version name 'VerFindFileW';
  16082. function VerFindFile; external version name 'VerFindFileA';
  16083. function VerInstallFileA; external version name 'VerInstallFileA';
  16084. function VerInstallFileW; external version name 'VerInstallFileW';
  16085. function VerInstallFile; external version name 'VerInstallFileA';
  16086. function VerQueryValueA; external version name 'VerQueryValueA';
  16087. function VerQueryValueW; external version name 'VerQueryValueW';
  16088. function VerQueryValue; external version name 'VerQueryValueA';
  16089.  
  16090. { Externals from comctl32.dll }
  16091.  
  16092. function GetPrivateProfileStructA; external comctl32 name 'GetPrivateProfileStructA';
  16093. function GetPrivateProfileStructW; external comctl32 name 'GetPrivateProfileStructW';
  16094. function GetPrivateProfileStruct; external comctl32 name 'GetPrivateProfileStructA';
  16095. function WritePrivateProfileStructA; external comctl32 name 'WritePrivateProfileStructA';
  16096. function WritePrivateProfileStructW; external comctl32 name 'WritePrivateProfileStructW';
  16097. function WritePrivateProfileStruct; external comctl32 name 'WritePrivateProfileStructA';
  16098.  
  16099.  
  16100. { Externals from gdi32.dll }
  16101.  
  16102. function AbortDoc; external gdi32 name 'AbortDoc';
  16103. function AbortPath; external gdi32 name 'AbortPath';
  16104. function AddFontResourceA; external gdi32 name 'AddFontResourceA';
  16105. function AddFontResourceW; external gdi32 name 'AddFontResourceW';
  16106. function AddFontResource; external gdi32 name 'AddFontResourceA';
  16107. function AngleArc; external gdi32 name 'AngleArc';
  16108. function AnimatePalette; external gdi32 name 'AnimatePalette';
  16109. function Arc; external gdi32 name 'Arc';
  16110. function ArcTo; external gdi32 name 'ArcTo';
  16111. function BeginPath; external gdi32 name 'BeginPath';
  16112. function BitBlt; external gdi32 name 'BitBlt';
  16113. function CancelDC; external gdi32 name 'CancelDC';
  16114. function CheckColorsInGamut; external gdi32 name 'CheckColorsInGamut';
  16115. function ChoosePixelFormat; external gdi32 name 'ChoosePixelFormat';
  16116. function Chord; external gdi32 name 'Chord';
  16117. function CloseEnhMetaFile; external gdi32 name 'CloseEnhMetaFile';
  16118. function CloseFigure; external gdi32 name 'CloseFigure';
  16119. function CloseMetaFile; external gdi32 name 'CloseMetaFile';
  16120. function ColorMatchToTarget; external gdi32 name 'ColorMatchToTarget';
  16121. function CombineRgn; external gdi32 name 'CombineRgn';
  16122. function CombineTransform; external gdi32 name 'CombineTransform';
  16123. function CopyEnhMetaFileA; external gdi32 name 'CopyEnhMetaFileA';
  16124. function CopyEnhMetaFileW; external gdi32 name 'CopyEnhMetaFileW';
  16125. function CopyEnhMetaFile; external gdi32 name 'CopyEnhMetaFileA';
  16126. function CopyMetaFileA; external gdi32 name 'CopyMetaFileA';
  16127. function CopyMetaFileW; external gdi32 name 'CopyMetaFileW';
  16128. function CopyMetaFile; external gdi32 name 'CopyMetaFileA';
  16129. function CreateBitmap; external gdi32 name 'CreateBitmap';
  16130. function CreateBitmapIndirect; external gdi32 name 'CreateBitmapIndirect';
  16131. function CreateBrushIndirect; external gdi32 name 'CreateBrushIndirect';
  16132. function CreateColorSpaceA; external gdi32 name 'CreateColorSpaceA';
  16133. function CreateColorSpaceW; external gdi32 name 'CreateColorSpaceW';
  16134. function CreateColorSpace; external gdi32 name 'CreateColorSpaceA';
  16135. function CreateCompatibleBitmap; external gdi32 name 'CreateCompatibleBitmap';
  16136. function CreateCompatibleDC; external gdi32 name 'CreateCompatibleDC';
  16137. function CreateDCA; external gdi32 name 'CreateDCA';
  16138. function CreateDCW; external gdi32 name 'CreateDCW';
  16139. function CreateDC; external gdi32 name 'CreateDCA';
  16140. function CreateDIBPatternBrush; external gdi32 name 'CreateDIBPatternBrush';
  16141. function CreateDIBPatternBrushPt; external gdi32 name 'CreateDIBPatternBrushPt';
  16142. function CreateDIBSection; external gdi32 name 'CreateDIBSection';
  16143. function CreateDIBitmap; external gdi32 name 'CreateDIBitmap';
  16144. function CreateDiscardableBitmap; external gdi32 name 'CreateDiscardableBitmap';
  16145. function CreateEllipticRgn; external gdi32 name 'CreateEllipticRgn';
  16146. function CreateEllipticRgnIndirect; external gdi32 name 'CreateEllipticRgnIndirect';
  16147. function CreateEnhMetaFileA; external gdi32 name 'CreateEnhMetaFileA';
  16148. function CreateEnhMetaFileW; external gdi32 name 'CreateEnhMetaFileW';
  16149. function CreateEnhMetaFile; external gdi32 name 'CreateEnhMetaFileA';
  16150. function CreateFontA; external gdi32 name 'CreateFontA';
  16151. function CreateFontW; external gdi32 name 'CreateFontW';
  16152. function CreateFont; external gdi32 name 'CreateFontA';
  16153. function CreateFontIndirectA; external gdi32 name 'CreateFontIndirectA';
  16154. function CreateFontIndirectW; external gdi32 name 'CreateFontIndirectW';
  16155. function CreateFontIndirect; external gdi32 name 'CreateFontIndirectA';
  16156. function CreateHalftonePalette; external gdi32 name 'CreateHalftonePalette';
  16157. function CreateHatchBrush; external gdi32 name 'CreateHatchBrush';
  16158. function CreateICA; external gdi32 name 'CreateICA';
  16159. function CreateICW; external gdi32 name 'CreateICW';
  16160. function CreateIC; external gdi32 name 'CreateICA';
  16161. function CreateMetaFileA; external gdi32 name 'CreateMetaFileA';
  16162. function CreateMetaFileW; external gdi32 name 'CreateMetaFileW';
  16163. function CreateMetaFile; external gdi32 name 'CreateMetaFileA';
  16164. function CreatePalette; external gdi32 name 'CreatePalette';
  16165. function CreatePatternBrush; external gdi32 name 'CreatePatternBrush';
  16166. function CreatePen; external gdi32 name 'CreatePen';
  16167. function CreatePenIndirect; external gdi32 name 'CreatePenIndirect';
  16168. function CreatePolyPolygonRgn; external gdi32 name 'CreatePolyPolygonRgn';
  16169. function CreatePolygonRgn; external gdi32 name 'CreatePolygonRgn';
  16170. function CreateRectRgn; external gdi32 name 'CreateRectRgn';
  16171. function CreateRectRgnIndirect; external gdi32 name 'CreateRectRgnIndirect';
  16172. function CreateRoundRectRgn; external gdi32 name 'CreateRoundRectRgn';
  16173. function CreateScalableFontResourceA; external gdi32 name 'CreateScalableFontResourceA';
  16174. function CreateScalableFontResourceW; external gdi32 name 'CreateScalableFontResourceW';
  16175. function CreateScalableFontResource; external gdi32 name 'CreateScalableFontResourceA';
  16176. function CreateSolidBrush; external gdi32 name 'CreateSolidBrush';
  16177. function DPtoLP; external gdi32 name 'DPtoLP';
  16178. function DeleteColorSpace; external gdi32 name 'DeleteColorSpace';
  16179. function DeleteDC; external gdi32 name 'DeleteDC';
  16180. function DeleteEnhMetaFile; external gdi32 name 'DeleteEnhMetaFile';
  16181. function DeleteMetaFile; external gdi32 name 'DeleteMetaFile';
  16182. function DeleteObject; external gdi32 name 'DeleteObject';
  16183. function DescribePixelFormat; external gdi32 name 'DescribePixelFormat';
  16184. function DeviceCapabilitiesA; external gdi32 name 'DeviceCapabilitiesA';
  16185. function DeviceCapabilitiesW; external gdi32 name 'DeviceCapabilitiesW';
  16186. function DeviceCapabilities; external gdi32 name 'DeviceCapabilitiesA';
  16187. function DrawEscape; external gdi32 name 'DrawEscape';
  16188. function Ellipse; external gdi32 name 'Ellipse';
  16189. function EndDoc; external gdi32 name 'EndDoc';
  16190. function EndPage; external gdi32 name 'EndPage';
  16191. function EndPath; external gdi32 name 'EndPath';
  16192. function EnumEnhMetaFile; external gdi32 name 'EnumEnhMetaFile';
  16193. function EnumFontFamiliesA; external gdi32 name 'EnumFontFamiliesA';
  16194. function EnumFontFamiliesW; external gdi32 name 'EnumFontFamiliesW';
  16195. function EnumFontFamilies; external gdi32 name 'EnumFontFamiliesA';
  16196. function EnumFontFamiliesExA; external gdi32 name 'EnumFontFamiliesExA';
  16197. function EnumFontFamiliesExW; external gdi32 name 'EnumFontFamiliesExW';
  16198. function EnumFontFamiliesEx; external gdi32 name 'EnumFontFamiliesExA';
  16199. function EnumFontsA; external gdi32 name 'EnumFontsA';
  16200. function EnumFontsW; external gdi32 name 'EnumFontsW';
  16201. function EnumFonts; external gdi32 name 'EnumFontsA';
  16202. function EnumICMProfilesA; external gdi32 name 'EnumICMProfilesA';
  16203. function EnumICMProfilesW; external gdi32 name 'EnumICMProfilesW';
  16204. function EnumICMProfiles; external gdi32 name 'EnumICMProfilesA';
  16205. function EnumMetaFile; external gdi32 name 'EnumMetaFile';
  16206. function EnumObjects; external gdi32 name 'EnumObjects';
  16207. function EqualRgn; external gdi32 name 'EqualRgn';
  16208. function Escape; external gdi32 name 'Escape';
  16209. function ExcludeClipRect; external gdi32 name 'ExcludeClipRect';
  16210. function ExtCreatePen; external gdi32 name 'ExtCreatePen';
  16211. function ExtCreateRegion; external gdi32 name 'ExtCreateRegion';
  16212. function ExtEscape; external gdi32 name 'ExtEscape';
  16213. function ExtFloodFill; external gdi32 name 'ExtFloodFill';
  16214. function ExtSelectClipRgn; external gdi32 name 'ExtSelectClipRgn';
  16215. function ExtTextOutA; external gdi32 name 'ExtTextOutA';
  16216. function ExtTextOutW; external gdi32 name 'ExtTextOutW';
  16217. function ExtTextOut; external gdi32 name 'ExtTextOutA';
  16218. function FillPath; external gdi32 name 'FillPath';
  16219. function FillRgn; external gdi32 name 'FillRgn';
  16220. function FlattenPath; external gdi32 name 'FlattenPath';
  16221. function FloodFill; external gdi32 name 'FloodFill';
  16222. function FrameRgn; external gdi32 name 'FrameRgn';
  16223. function GdiComment; external gdi32 name 'GdiComment';
  16224. function GdiFlush; external gdi32 name 'GdiFlush';
  16225. function GdiGetBatchLimit; external gdi32 name 'GdiGetBatchLimit';
  16226. function GdiSetBatchLimit; external gdi32 name 'GdiSetBatchLimit';
  16227. function GetArcDirection; external gdi32 name 'GetArcDirection';
  16228. function GetAspectRatioFilterEx; external gdi32 name 'GetAspectRatioFilterEx';
  16229. function GetBitmapBits; external gdi32 name 'GetBitmapBits';
  16230. function GetBitmapDimensionEx; external gdi32 name 'GetBitmapDimensionEx';
  16231. function GetBkColor; external gdi32 name 'GetBkColor';
  16232. function GetBkMode; external gdi32 name 'GetBkMode';
  16233. function GetBoundsRect; external gdi32 name 'GetBoundsRect';
  16234. function GetBrushOrgEx; external gdi32 name 'GetBrushOrgEx';
  16235. function GetCharABCWidthsA; external gdi32 name 'GetCharABCWidthsA';
  16236. function GetCharABCWidthsW; external gdi32 name 'GetCharABCWidthsW';
  16237. function GetCharABCWidths; external gdi32 name 'GetCharABCWidthsA';
  16238. function GetCharABCWidthsFloatA; external gdi32 name 'GetCharABCWidthsFloatA';
  16239. function GetCharABCWidthsFloatW; external gdi32 name 'GetCharABCWidthsFloatW';
  16240. function GetCharABCWidthsFloat; external gdi32 name 'GetCharABCWidthsFloatA';
  16241. function GetCharWidth32A; external gdi32 name 'GetCharWidth32A';
  16242. function GetCharWidth32W; external gdi32 name 'GetCharWidth32W';
  16243. function GetCharWidth32; external gdi32 name 'GetCharWidth32A';
  16244. function GetCharWidthA; external gdi32 name 'GetCharWidthA';
  16245. function GetCharWidthW; external gdi32 name 'GetCharWidthW';
  16246. function GetCharWidth; external gdi32 name 'GetCharWidthA';
  16247. function GetCharWidthFloatA; external gdi32 name 'GetCharWidthFloatA';
  16248. function GetCharWidthFloatW; external gdi32 name 'GetCharWidthFloatW';
  16249. function GetCharWidthFloat; external gdi32 name 'GetCharWidthFloatA';
  16250. function GetCharacterPlacementA; external gdi32 name 'GetCharacterPlacementA';
  16251. function GetCharacterPlacementW; external gdi32 name 'GetCharacterPlacementW';
  16252. function GetCharacterPlacement; external gdi32 name 'GetCharacterPlacementA';
  16253. function GetClipBox; external gdi32 name 'GetClipBox';
  16254. function GetClipRgn; external gdi32 name 'GetClipRgn';
  16255. function GetColorAdjustment; external gdi32 name 'GetColorAdjustment';
  16256. function GetColorSpace; external gdi32 name 'GetColorSpace';
  16257. function GetCurrentObject; external gdi32 name 'GetCurrentObject';
  16258. function GetCurrentPositionEx; external gdi32 name 'GetCurrentPositionEx';
  16259. function GetDCOrgEx; external gdi32 name 'GetDCOrgEx';
  16260. function GetDIBColorTable; external gdi32 name 'GetDIBColorTable';
  16261. function GetDIBits; external gdi32 name 'GetDIBits';
  16262. function GetDeviceCaps; external gdi32 name 'GetDeviceCaps';
  16263. function GetDeviceGammaRamp; external gdi32 name 'GetDeviceGammaRamp';
  16264. function GetEnhMetaFileA; external gdi32 name 'GetEnhMetaFileA';
  16265. function GetEnhMetaFileW; external gdi32 name 'GetEnhMetaFileW';
  16266. function GetEnhMetaFile; external gdi32 name 'GetEnhMetaFileA';
  16267. function GetEnhMetaFileBits; external gdi32 name 'GetEnhMetaFileBits';
  16268. function GetEnhMetaFileDescriptionA; external gdi32 name 'GetEnhMetaFileDescriptionA';
  16269. function GetEnhMetaFileDescriptionW; external gdi32 name 'GetEnhMetaFileDescriptionW';
  16270. function GetEnhMetaFileDescription; external gdi32 name 'GetEnhMetaFileDescriptionA';
  16271. function GetEnhMetaFileHeader; external gdi32 name 'GetEnhMetaFileHeader';
  16272. function GetEnhMetaFilePaletteEntries; external gdi32 name 'GetEnhMetaFilePaletteEntries';
  16273. function GetFontData; external gdi32 name 'GetFontData';
  16274. function GetFontLanguageInfo; external gdi32 name 'GetFontLanguageInfo';
  16275. function GetGlyphOutlineA; external gdi32 name 'GetGlyphOutlineA';
  16276. function GetGlyphOutlineW; external gdi32 name 'GetGlyphOutlineW';
  16277. function GetGlyphOutline; external gdi32 name 'GetGlyphOutlineA';
  16278. function GetGraphicsMode; external gdi32 name 'GetGraphicsMode';
  16279. function GetICMProfileA; external gdi32 name 'GetICMProfileA';
  16280. function GetICMProfileW; external gdi32 name 'GetICMProfileW';
  16281. function GetICMProfile; external gdi32 name 'GetICMProfileA';
  16282. function GetKerningPairs; external gdi32 name 'GetKerningPairs';
  16283. function GetLogColorSpaceA; external gdi32 name 'GetLogColorSpaceA';
  16284. function GetLogColorSpaceW; external gdi32 name 'GetLogColorSpaceW';
  16285. function GetLogColorSpace; external gdi32 name 'GetLogColorSpaceA';
  16286. function GetMapMode; external gdi32 name 'GetMapMode';
  16287. function GetMetaFileA; external gdi32 name 'GetMetaFileA';
  16288. function GetMetaFileW; external gdi32 name 'GetMetaFileW';
  16289. function GetMetaFile; external gdi32 name 'GetMetaFileA';
  16290. function GetMetaFileBitsEx; external gdi32 name 'GetMetaFileBitsEx';
  16291. function GetMetaRgn; external gdi32 name 'GetMetaRgn';
  16292. function GetMiterLimit; external gdi32 name 'GetMiterLimit';
  16293. function GetNearestColor; external gdi32 name 'GetNearestColor';
  16294. function GetNearestPaletteIndex; external gdi32 name 'GetNearestPaletteIndex';
  16295. function GetObjectA; external gdi32 name 'GetObjectA';
  16296. function GetObjectW; external gdi32 name 'GetObjectW';
  16297. function GetObject; external gdi32 name 'GetObjectA';
  16298. function GetObjectType; external gdi32 name 'GetObjectType';
  16299. function GetOutlineTextMetricsA; external gdi32 name 'GetOutlineTextMetricsA';
  16300. function GetOutlineTextMetricsW; external gdi32 name 'GetOutlineTextMetricsW';
  16301. function GetOutlineTextMetrics; external gdi32 name 'GetOutlineTextMetricsA';
  16302. function GetPaletteEntries; external gdi32 name 'GetPaletteEntries';
  16303. function GetPath; external gdi32 name 'GetPath';
  16304. function GetPixel; external gdi32 name 'GetPixel';
  16305. function GetPixelFormat; external gdi32 name 'GetPixelFormat';
  16306. function GetPolyFillMode; external gdi32 name 'GetPolyFillMode';
  16307. function GetROP2; external gdi32 name 'GetROP2';
  16308. function GetRasterizerCaps; external gdi32 name 'GetRasterizerCaps';
  16309. function GetRegionData; external gdi32 name 'GetRegionData';
  16310. function GetRgnBox; external gdi32 name 'GetRgnBox';
  16311. function GetStockObject; external gdi32 name 'GetStockObject';
  16312. function GetStretchBltMode; external gdi32 name 'GetStretchBltMode';
  16313. function GetSystemPaletteEntries; external gdi32 name 'GetSystemPaletteEntries';
  16314. function GetSystemPaletteUse; external gdi32 name 'GetSystemPaletteUse';
  16315. function GetTextAlign; external gdi32 name 'GetTextAlign';
  16316. function GetTextCharacterExtra; external gdi32 name 'GetTextCharacterExtra';
  16317. function GetTextCharset; external gdi32 name 'GetTextCharset';
  16318. function GetTextCharsetInfo; external gdi32 name 'GetTextCharsetInfo';
  16319. function GetTextColor; external gdi32 name 'GetTextColor';
  16320. function GetTextExtentExPointA; external gdi32 name 'GetTextExtentExPointA';
  16321. function GetTextExtentExPointW; external gdi32 name 'GetTextExtentExPointW';
  16322. function GetTextExtentExPoint; external gdi32 name 'GetTextExtentExPointA';
  16323. function GetTextExtentPoint32A; external gdi32 name 'GetTextExtentPoint32A';
  16324. function GetTextExtentPoint32W; external gdi32 name 'GetTextExtentPoint32W';
  16325. function GetTextExtentPoint32; external gdi32 name 'GetTextExtentPoint32A';
  16326. function GetTextExtentPointA; external gdi32 name 'GetTextExtentPointA';
  16327. function GetTextExtentPointW; external gdi32 name 'GetTextExtentPointW';
  16328. function GetTextExtentPoint; external gdi32 name 'GetTextExtentPointA';
  16329. function GetTextFaceA; external gdi32 name 'GetTextFaceA';
  16330. function GetTextFaceW; external gdi32 name 'GetTextFaceW';
  16331. function GetTextFace; external gdi32 name 'GetTextFaceA';
  16332. function GetTextMetricsA; external gdi32 name 'GetTextMetricsA';
  16333. function GetTextMetricsW; external gdi32 name 'GetTextMetricsW';
  16334. function GetTextMetrics; external gdi32 name 'GetTextMetricsA';
  16335. function GetViewportExtEx; external gdi32 name 'GetViewportExtEx';
  16336. function GetViewportOrgEx; external gdi32 name 'GetViewportOrgEx';
  16337. function GetWinMetaFileBits; external gdi32 name 'GetWinMetaFileBits';
  16338. function GetWindowExtEx; external gdi32 name 'GetWindowExtEx';
  16339. function GetWindowOrgEx; external gdi32 name 'GetWindowOrgEx';
  16340. function GetWorldTransform; external gdi32 name 'GetWorldTransform';
  16341. function IntersectClipRect; external gdi32 name 'IntersectClipRect';
  16342. function InvertRgn; external gdi32 name 'InvertRgn';
  16343. function LPtoDP; external gdi32 name 'LPtoDP';
  16344. function LineDDA; external gdi32 name 'LineDDA';
  16345. function LineTo; external gdi32 name 'LineTo';
  16346. function MaskBlt; external gdi32 name 'MaskBlt';
  16347. function ModifyWorldTransform; external gdi32 name 'ModifyWorldTransform';
  16348. function MoveToEx; external gdi32 name 'MoveToEx';
  16349. function OffsetClipRgn; external gdi32 name 'OffsetClipRgn';
  16350. function OffsetRgn; external gdi32 name 'OffsetRgn';
  16351. function OffsetViewportOrgEx; external gdi32 name 'OffsetViewportOrgEx';
  16352. function OffsetWindowOrgEx; external gdi32 name 'OffsetWindowOrgEx';
  16353. function PaintRgn; external gdi32 name 'PaintRgn';
  16354. function PatBlt; external gdi32 name 'PatBlt';
  16355. function PathToRegion; external gdi32 name 'PathToRegion';
  16356. function Pie; external gdi32 name 'Pie';
  16357. function PlayEnhMetaFile; external gdi32 name 'PlayEnhMetaFile';
  16358. function PlayEnhMetaFileRecord; external gdi32 name 'PlayEnhMetaFileRecord';
  16359. function PlayMetaFile; external gdi32 name 'PlayMetaFile';
  16360. function PlayMetaFileRecord; external gdi32 name 'PlayMetaFileRecord';
  16361. function PlgBlt; external gdi32 name 'PlgBlt';
  16362. function PolyBezier; external gdi32 name 'PolyBezier';
  16363. function PolyBezierTo; external gdi32 name 'PolyBezierTo';
  16364. function PolyDraw; external gdi32 name 'PolyDraw';
  16365. function PolyPolygon; external gdi32 name 'PolyPolygon';
  16366. function PolyPolyline; external gdi32 name 'PolyPolyline';
  16367. function PolyTextOutA; external gdi32 name 'PolyTextOutA';
  16368. function PolyTextOutW; external gdi32 name 'PolyTextOutW';
  16369. function PolyTextOut; external gdi32 name 'PolyTextOutA';
  16370. function Polygon; external gdi32 name 'Polygon';
  16371. function Polyline; external gdi32 name 'Polyline';
  16372. function PolylineTo; external gdi32 name 'PolylineTo';
  16373. function PtInRegion; external gdi32 name 'PtInRegion';
  16374. function PtVisible; external gdi32 name 'PtVisible';
  16375. function RealizePalette; external gdi32 name 'RealizePalette';
  16376. function RectInRegion; external gdi32 name 'RectInRegion';
  16377. function RectVisible; external gdi32 name 'RectVisible';
  16378. function Rectangle; external gdi32 name 'Rectangle';
  16379. function RemoveFontResourceA; external gdi32 name 'RemoveFontResourceA';
  16380. function RemoveFontResourceW; external gdi32 name 'RemoveFontResourceW';
  16381. function RemoveFontResource; external gdi32 name 'RemoveFontResourceA';
  16382. function ResetDCA; external gdi32 name 'ResetDCA';
  16383. function ResetDCW; external gdi32 name 'ResetDCW';
  16384. function ResetDC; external gdi32 name 'ResetDCA';
  16385. function ResizePalette; external gdi32 name 'ResizePalette';
  16386. function RestoreDC; external gdi32 name 'RestoreDC';
  16387. function RoundRect; external gdi32 name 'RoundRect';
  16388. function SaveDC; external gdi32 name 'SaveDC';
  16389. function ScaleViewportExtEx; external gdi32 name 'ScaleViewportExtEx';
  16390. function ScaleWindowExtEx; external gdi32 name 'ScaleWindowExtEx';
  16391. function SelectClipPath; external gdi32 name 'SelectClipPath';
  16392. function SelectClipRgn; external gdi32 name 'SelectClipRgn';
  16393. function SelectObject; external gdi32 name 'SelectObject';
  16394. function SelectPalette; external gdi32 name 'SelectPalette';
  16395. function SetAbortProc; external gdi32 name 'SetAbortProc';
  16396. function SetArcDirection; external gdi32 name 'SetArcDirection';
  16397. function SetBitmapBits; external gdi32 name 'SetBitmapBits';
  16398. function SetBitmapDimensionEx; external gdi32 name 'SetBitmapDimensionEx';
  16399. function SetBkColor; external gdi32 name 'SetBkColor';
  16400. function SetBkMode; external gdi32 name 'SetBkMode';
  16401. function SetBoundsRect; external gdi32 name 'SetBoundsRect';
  16402. function SetBrushOrgEx; external gdi32 name 'SetBrushOrgEx';
  16403. function SetColorAdjustment; external gdi32 name 'SetColorAdjustment';
  16404. function SetColorSpace; external gdi32 name 'SetColorSpace';
  16405. function SetDIBColorTable; external gdi32 name 'SetDIBColorTable';
  16406. function SetDIBits; external gdi32 name 'SetDIBits';
  16407. function SetDIBitsToDevice; external gdi32 name 'SetDIBitsToDevice';
  16408. function SetDeviceGammaRamp; external gdi32 name 'SetDeviceGammaRamp';
  16409. function SetEnhMetaFileBits; external gdi32 name 'SetEnhMetaFileBits';
  16410. function SetGraphicsMode; external gdi32 name 'SetGraphicsMode';
  16411. function SetICMMode; external gdi32 name 'SetICMMode';
  16412. function SetICMProfileA; external gdi32 name 'SetICMProfileA';
  16413. function SetICMProfileW; external gdi32 name 'SetICMProfileW';
  16414. function SetICMProfile; external gdi32 name 'SetICMProfileA';
  16415. function SetMapMode; external gdi32 name 'SetMapMode';
  16416. function SetMapperFlags; external gdi32 name 'SetMapperFlags';
  16417. function SetMetaFileBitsEx; external gdi32 name 'SetMetaFileBitsEx';
  16418. function SetMetaRgn; external gdi32 name 'SetMetaRgn';
  16419. function SetMiterLimit; external gdi32 name 'SetMiterLimit';
  16420. function SetPaletteEntries; external gdi32 name 'SetPaletteEntries';
  16421. function SetPixel; external gdi32 name 'SetPixel';
  16422. function SetPixelFormat; external gdi32 name 'SetPixelFormat';
  16423. function SetPixelV; external gdi32 name 'SetPixelV';
  16424. function SetPolyFillMode; external gdi32 name 'SetPolyFillMode';
  16425. function SetROP2; external gdi32 name 'SetROP2';
  16426. function SetRectRgn; external gdi32 name 'SetRectRgn';
  16427. function SetStretchBltMode; external gdi32 name 'SetStretchBltMode';
  16428. function SetSystemPaletteUse; external gdi32 name 'SetSystemPaletteUse';
  16429. function SetTextAlign; external gdi32 name 'SetTextAlign';
  16430. function SetTextColor; external gdi32 name 'SetTextColor';
  16431. function SetTextCharacterExtra; external gdi32 name 'SetTextCharacterExtra';
  16432. function SetTextJustification; external gdi32 name 'SetTextJustification';
  16433. function SetViewportExtEx; external gdi32 name 'SetViewportExtEx';
  16434. function SetViewportOrgEx; external gdi32 name 'SetViewportOrgEx';
  16435. function SetWinMetaFileBits; external gdi32 name 'SetWinMetaFileBits';
  16436. function SetWindowExtEx; external gdi32 name 'SetWindowExtEx';
  16437. function SetWindowOrgEx; external gdi32 name 'SetWindowOrgEx';
  16438. function SetWorldTransform; external gdi32 name 'SetWorldTransform';
  16439. function StartDocA; external gdi32 name 'StartDocA';
  16440. function StartDocW; external gdi32 name 'StartDocW';
  16441. function StartDoc; external gdi32 name 'StartDocA';
  16442. function StartPage; external gdi32 name 'StartPage';
  16443. function StretchBlt; external gdi32 name 'StretchBlt';
  16444. function StretchDIBits; external gdi32 name 'StretchDIBits';
  16445. function StrokeAndFillPath; external gdi32 name 'StrokeAndFillPath';
  16446. function StrokePath; external gdi32 name 'StrokePath';
  16447. function SwapBuffers; external gdi32 name 'SwapBuffers';
  16448. function TextOutA; external gdi32 name 'TextOutA';
  16449. function TextOutW; external gdi32 name 'TextOutW';
  16450. function TextOut; external gdi32 name 'TextOutA';
  16451. function UnrealizeObject; external gdi32 name 'UnrealizeObject';
  16452. function UpdateColors; external gdi32 name 'UpdateColors';
  16453. function WidenPath; external gdi32 name 'WidenPath';
  16454.  
  16455.  
  16456. { Externals from opengl32.dll }
  16457.  
  16458. function wglCreateContext; external opengl32 name 'wglCreateContext';
  16459. function wglDeleteContext; external opengl32 name 'wglDeleteContext';
  16460. function wglGetCurrentContext; external opengl32 name 'wglGetCurrentContext';
  16461. function wglGetCurrentDC; external opengl32 name 'wglGetCurrentDC';
  16462. function wglMakeCurrent; external opengl32 name 'wglMakeCurrent';
  16463. function wglShareLists; external opengl32 name 'wglShareLists';
  16464. function wglUseFontBitmapsA; external opengl32 name 'wglUseFontBitmapsA';
  16465. function wglUseFontBitmapsW; external opengl32 name 'wglUseFontBitmapsW';
  16466. function wglUseFontBitmaps; external opengl32 name 'wglUseFontBitmapsA';
  16467.  
  16468.  
  16469. { Externals from user32.dll }
  16470.  
  16471. function ActivateKeyboardLayout; external user32 name 'ActivateKeyboardLayout';
  16472. function AdjustWindowRect; external user32 name 'AdjustWindowRect';
  16473. function AdjustWindowRectEx; external user32 name 'AdjustWindowRectEx';
  16474. function AnsiToOem; external user32 name 'CharToOemA';
  16475. function AnsiToOemBuff; external user32 name 'CharToOemBuffA';
  16476. function AnsiUpper; external user32 name 'CharUpperA';
  16477. function AnsiUpperBuff; external user32 name 'CharUpperBuffA';
  16478. function AnsiLower; external user32 name 'CharLowerA';
  16479. function AnsiLowerBuff; external user32 name 'CharLowerBuffA';
  16480. function AnsiNext; external user32 name 'CharNextA';
  16481. function AnsiPrev; external user32 name 'CharPrevA';
  16482. function AnyPopup; external user32 name 'AnyPopup';
  16483. function AppendMenuA; external user32 name 'AppendMenuA';
  16484. function AppendMenuW; external user32 name 'AppendMenuW';
  16485. function AppendMenu; external user32 name 'AppendMenuA';
  16486. function ArrangeIconicWindows; external user32 name 'ArrangeIconicWindows';
  16487. function AttachThreadInput; external user32 name 'AttachThreadInput';
  16488. function BeginDeferWindowPos; external user32 name 'BeginDeferWindowPos';
  16489. function BeginPaint; external user32 name 'BeginPaint';
  16490. function BringWindowToTop; external user32 name 'BringWindowToTop';
  16491. function BroadcastSystemMessage; external user32 name 'BroadcastSystemMessage';
  16492. function CallMsgFilterA; external user32 name 'CallMsgFilterA';
  16493. function CallMsgFilterW; external user32 name 'CallMsgFilterW';
  16494. function CallMsgFilter; external user32 name 'CallMsgFilterA';
  16495. function CallNextHookEx; external user32 name 'CallNextHookEx';
  16496. function CallWindowProcA; external user32 name 'CallWindowProcA';
  16497. function CallWindowProcW; external user32 name 'CallWindowProcW';
  16498. function CallWindowProc; external user32 name 'CallWindowProcA';
  16499. function CascadeWindows; external user32 name 'CascadeWindows';
  16500. function ChangeClipboardChain; external user32 name 'ChangeClipboardChain';
  16501. function ChangeDisplaySettingsA; external user32 name 'ChangeDisplaySettingsA';
  16502. function ChangeDisplaySettingsW; external user32 name 'ChangeDisplaySettingsW';
  16503. function ChangeDisplaySettings; external user32 name 'ChangeDisplaySettingsA';
  16504. function ChangeMenuA; external user32 name 'ChangeMenuA';
  16505. function ChangeMenuW; external user32 name 'ChangeMenuW';
  16506. function ChangeMenu; external user32 name 'ChangeMenuA';
  16507. function CharLowerA; external user32 name 'CharLowerA';
  16508. function CharLowerW; external user32 name 'CharLowerW';
  16509. function CharLower; external user32 name 'CharLowerA';
  16510. function CharLowerBuffA; external user32 name 'CharLowerBuffA';
  16511. function CharLowerBuffW; external user32 name 'CharLowerBuffW';
  16512. function CharLowerBuff; external user32 name 'CharLowerBuffA';
  16513. function CharNextA; external user32 name 'CharNextA';
  16514. function CharNextW; external user32 name 'CharNextW';
  16515. function CharNext; external user32 name 'CharNextA';
  16516. function CharNextEx; external user32 name 'CharNextExA';
  16517. function CharPrevA; external user32 name 'CharPrevA';
  16518. function CharPrevW; external user32 name 'CharPrevW';
  16519. function CharPrev; external user32 name 'CharPrevA';
  16520. function CharPrevEx; external user32 name 'CharPrevExA';
  16521. function CharToOemA; external user32 name 'CharToOemA';
  16522. function CharToOemW; external user32 name 'CharToOemW';
  16523. function CharToOem; external user32 name 'CharToOemA';
  16524. function CharToOemBuffA; external user32 name 'CharToOemBuffA';
  16525. function CharToOemBuffW; external user32 name 'CharToOemBuffW';
  16526. function CharToOemBuff; external user32 name 'CharToOemBuffA';
  16527. function CharUpperA; external user32 name 'CharUpperA';
  16528. function CharUpperW; external user32 name 'CharUpperW';
  16529. function CharUpper; external user32 name 'CharUpperA';
  16530. function CharUpperBuffA; external user32 name 'CharUpperBuffA';
  16531. function CharUpperBuffW; external user32 name 'CharUpperBuffW';
  16532. function CharUpperBuff; external user32 name 'CharUpperBuffA';
  16533. function CheckDlgButton; external user32 name 'CheckDlgButton';
  16534. function CheckMenuItem; external user32 name 'CheckMenuItem';
  16535. function CheckMenuRadioItem; external user32 name 'CheckMenuRadioItem';
  16536. function CheckRadioButton; external user32 name 'CheckRadioButton';
  16537. function ChildWindowFromPoint; external user32 name 'ChildWindowFromPoint';
  16538. function ChildWindowFromPointEx; external user32 name 'ChildWindowFromPointEx';
  16539. function ClientToScreen; external user32 name 'ClientToScreen';
  16540. function ClipCursor; external user32 name 'ClipCursor';
  16541. function CloseClipboard; external user32 name 'CloseClipboard';
  16542. function CloseDesktop; external user32 name 'CloseDesktop';
  16543. function CloseWindow; external user32 name 'CloseWindow';
  16544. function CloseWindowStation; external user32 name 'CloseWindowStation';
  16545. function CopyAcceleratorTableA; external user32 name 'CopyAcceleratorTableA';
  16546. function CopyAcceleratorTableW; external user32 name 'CopyAcceleratorTableW';
  16547. function CopyAcceleratorTable; external user32 name 'CopyAcceleratorTableA';
  16548. function CopyIcon; external user32 name 'CopyIcon';
  16549. function CopyImage; external user32 name 'CopyImage';
  16550. function CopyRect; external user32 name 'CopyRect';
  16551. function CountClipboardFormats; external user32 name 'CountClipboardFormats';
  16552. function CreateAcceleratorTableA; external user32 name 'CreateAcceleratorTableA';
  16553. function CreateAcceleratorTableW; external user32 name 'CreateAcceleratorTableW';
  16554. function CreateAcceleratorTable; external user32 name 'CreateAcceleratorTableA';
  16555. function CreateCaret; external user32 name 'CreateCaret';
  16556. function CreateCursor; external user32 name 'CreateCursor';
  16557. function CreateDesktopA; external user32 name 'CreateDesktopA';
  16558. function CreateDesktopW; external user32 name 'CreateDesktopW';
  16559. function CreateDesktop; external user32 name 'CreateDesktopA';
  16560. function CreateDialogIndirectParamA; external user32 name 'CreateDialogIndirectParamA';
  16561. function CreateDialogIndirectParamW; external user32 name 'CreateDialogIndirectParamW';
  16562. function CreateDialogIndirectParam; external user32 name 'CreateDialogIndirectParamA';
  16563. function CreateDialogParamA; external user32 name 'CreateDialogParamA';
  16564. function CreateDialogParamW; external user32 name 'CreateDialogParamW';
  16565. function CreateDialogParam; external user32 name 'CreateDialogParamA';
  16566. function CreateIcon; external user32 name 'CreateIcon';
  16567. function CreateIconFromResource; external user32 name 'CreateIconFromResource';
  16568. function CreateIconFromResourceEx; external user32 name 'CreateIconFromResourceEx';
  16569. function CreateIconIndirect; external user32 name 'CreateIconIndirect';
  16570. function CreateMDIWindowA; external user32 name 'CreateMDIWindowA';
  16571. function CreateMDIWindowW; external user32 name 'CreateMDIWindowW';
  16572. function CreateMDIWindow; external user32 name 'CreateMDIWindowA';
  16573. function CreateMenu; external user32 name 'CreateMenu';
  16574. function CreatePopupMenu; external user32 name 'CreatePopupMenu';
  16575. function CreateWindowExA; external user32 name 'CreateWindowExA';
  16576. function CreateWindowExW; external user32 name 'CreateWindowExW';
  16577. function CreateWindowEx; external user32 name 'CreateWindowExA';
  16578. function CreateWindowStationA; external user32 name 'CreateWindowStationA';
  16579. function CreateWindowStationW; external user32 name 'CreateWindowStationW';
  16580. function CreateWindowStation; external user32 name 'CreateWindowStationA';
  16581. function DdeSetQualityOfService; external user32 name 'DdeSetQualityOfService';
  16582. function DefDlgProcA; external user32 name 'DefDlgProcA';
  16583. function DefDlgProcW; external user32 name 'DefDlgProcW';
  16584. function DefDlgProc; external user32 name 'DefDlgProcA';
  16585. function DefFrameProcA; external user32 name 'DefFrameProcA';
  16586. function DefFrameProcW; external user32 name 'DefFrameProcW';
  16587. function DefFrameProc; external user32 name 'DefFrameProcA';
  16588. function DefMDIChildProcA; external user32 name 'DefMDIChildProcA';
  16589. function DefMDIChildProcW; external user32 name 'DefMDIChildProcW';
  16590. function DefMDIChildProc; external user32 name 'DefMDIChildProcA';
  16591. function DefWindowProcA; external user32 name 'DefWindowProcA';
  16592. function DefWindowProcW; external user32 name 'DefWindowProcW';
  16593. function DefWindowProc; external user32 name 'DefWindowProcA';
  16594. function DeferWindowPos; external user32 name 'DeferWindowPos';
  16595. function DeleteMenu; external user32 name 'DeleteMenu';
  16596. function DestroyAcceleratorTable; external user32 name 'DestroyAcceleratorTable';
  16597. function DestroyCaret; external user32 name 'DestroyCaret';
  16598. function DestroyCursor; external user32 name 'DestroyCursor';
  16599. function DestroyIcon; external user32 name 'DestroyIcon';
  16600. function DestroyMenu; external user32 name 'DestroyMenu';
  16601. function DestroyWindow; external user32 name 'DestroyWindow';
  16602. function DialogBoxIndirectParamA; external user32 name 'DialogBoxIndirectParamA';
  16603. function DialogBoxIndirectParamW; external user32 name 'DialogBoxIndirectParamW';
  16604. function DialogBoxIndirectParam; external user32 name 'DialogBoxIndirectParamA';
  16605. function DialogBoxParamA; external user32 name 'DialogBoxParamA';
  16606. function DialogBoxParamW; external user32 name 'DialogBoxParamW';
  16607. function DialogBoxParam; external user32 name 'DialogBoxParamA';
  16608. function DispatchMessageA; external user32 name 'DispatchMessageA';
  16609. function DispatchMessageW; external user32 name 'DispatchMessageW';
  16610. function DispatchMessage; external user32 name 'DispatchMessageA';
  16611. function DlgDirListA; external user32 name 'DlgDirListA';
  16612. function DlgDirListW; external user32 name 'DlgDirListW';
  16613. function DlgDirList; external user32 name 'DlgDirListA';
  16614. function DlgDirListComboBoxA; external user32 name 'DlgDirListComboBoxA';
  16615. function DlgDirListComboBoxW; external user32 name 'DlgDirListComboBoxW';
  16616. function DlgDirListComboBox; external user32 name 'DlgDirListComboBoxA';
  16617. function DlgDirSelectComboBoxExA; external user32 name 'DlgDirSelectComboBoxExA';
  16618. function DlgDirSelectComboBoxExW; external user32 name 'DlgDirSelectComboBoxExW';
  16619. function DlgDirSelectComboBoxEx; external user32 name 'DlgDirSelectComboBoxExA';
  16620. function DlgDirSelectExA; external user32 name 'DlgDirSelectExA';
  16621. function DlgDirSelectExW; external user32 name 'DlgDirSelectExW';
  16622. function DlgDirSelectEx; external user32 name 'DlgDirSelectExA';
  16623. function DragDetect; external user32 name 'DragDetect';
  16624. function DragObject; external user32 name 'DragObject';
  16625. function DrawAnimatedRects; external user32 name 'DrawAnimatedRects';
  16626. function DrawCaption; external user32 name 'DrawCaption';
  16627. function DrawEdge; external user32 name 'DrawEdge';
  16628. function DrawFocusRect; external user32 name 'DrawFocusRect';
  16629. function DrawFrameControl; external user32 name 'DrawFrameControl';
  16630. function DrawIcon; external user32 name 'DrawIcon';
  16631. function DrawIconEx; external user32 name 'DrawIconEx';
  16632. function DrawMenuBar; external user32 name 'DrawMenuBar';
  16633. function DrawStateA; external user32 name 'DrawStateA';
  16634. function DrawStateW; external user32 name 'DrawStateW';
  16635. function DrawState; external user32 name 'DrawStateA';
  16636. function DrawTextA; external user32 name 'DrawTextA';
  16637. function DrawTextW; external user32 name 'DrawTextW';
  16638. function DrawText; external user32 name 'DrawTextA';
  16639. function DrawTextExA; external user32 name 'DrawTextExA';
  16640. function DrawTextExW; external user32 name 'DrawTextExW';
  16641. function DrawTextEx; external user32 name 'DrawTextExA';
  16642. function EmptyClipboard; external user32 name 'EmptyClipboard';
  16643. function EnableMenuItem; external user32 name 'EnableMenuItem';
  16644. function EnableScrollBar; external user32 name 'EnableScrollBar';
  16645. function EnableWindow; external user32 name 'EnableWindow';
  16646. function EndDeferWindowPos; external user32 name 'EndDeferWindowPos';
  16647. function EndDialog; external user32 name 'EndDialog';
  16648. function EndPaint; external user32 name 'EndPaint';
  16649. function EnumChildWindows; external user32 name 'EnumChildWindows';
  16650. function EnumClipboardFormats; external user32 name 'EnumClipboardFormats';
  16651. function EnumDesktopsA; external user32 name 'EnumDesktopsA';
  16652. function EnumDesktopsW; external user32 name 'EnumDesktopsW';
  16653. function EnumDesktops; external user32 name 'EnumDesktopsA';
  16654. function EnumDesktopWindows; external user32 name 'EnumDesktopWindows';
  16655. function EnumDisplaySettingsA; external user32 name 'EnumDisplaySettingsA';
  16656. function EnumDisplaySettingsW; external user32 name 'EnumDisplaySettingsW';
  16657. function EnumDisplaySettings; external user32 name 'EnumDisplaySettingsA';
  16658. function EnumPropsA; external user32 name 'EnumPropsA';
  16659. function EnumPropsW; external user32 name 'EnumPropsW';
  16660. function EnumProps; external user32 name 'EnumPropsA';
  16661. function EnumPropsExA; external user32 name 'EnumPropsExA';
  16662. function EnumPropsExW; external user32 name 'EnumPropsExW';
  16663. function EnumPropsEx; external user32 name 'EnumPropsExA';
  16664. function EnumThreadWindows; external user32 name 'EnumThreadWindows';
  16665. function EnumWindowStationsA; external user32 name 'EnumWindowStationsA';
  16666. function EnumWindowStationsW; external user32 name 'EnumWindowStationsW';
  16667. function EnumWindowStations; external user32 name 'EnumWindowStationsA';
  16668. function EnumWindows; external user32 name 'EnumWindows';
  16669. function EqualRect; external user32 name 'EqualRect';
  16670. function ExcludeUpdateRgn; external user32 name 'ExcludeUpdateRgn';
  16671. function ExitWindowsEx; external user32 name 'ExitWindowsEx';
  16672. function FillRect; external user32 name 'FillRect';
  16673. function FindWindowA; external user32 name 'FindWindowA';
  16674. function FindWindowW; external user32 name 'FindWindowW';
  16675. function FindWindow; external user32 name 'FindWindowA';
  16676. function FindWindowExA; external user32 name 'FindWindowExA';
  16677. function FindWindowExW; external user32 name 'FindWindowExW';
  16678. function FindWindowEx; external user32 name 'FindWindowExA';
  16679. function FlashWindow; external user32 name 'FlashWindow';
  16680. function FrameRect; external user32 name 'FrameRect';
  16681. function FreeDDElParam; external user32 name 'FreeDDElParam';
  16682. function GetActiveWindow; external user32 name 'GetActiveWindow';
  16683. function GetAsyncKeyState; external user32 name 'GetAsyncKeyState';
  16684. function GetCapture; external user32 name 'GetCapture';
  16685. function GetCaretBlinkTime; external user32 name 'GetCaretBlinkTime';
  16686. function GetCaretPos; external user32 name 'GetCaretPos';
  16687. function GetClassInfoA; external user32 name 'GetClassInfoA';
  16688. function GetClassInfoW; external user32 name 'GetClassInfoW';
  16689. function GetClassInfo; external user32 name 'GetClassInfoA';
  16690. function GetClassInfoExA; external user32 name 'GetClassInfoExA';
  16691. function GetClassInfoExW; external user32 name 'GetClassInfoExW';
  16692. function GetClassInfoEx; external user32 name 'GetClassInfoExA';
  16693. function GetClassLongA; external user32 name 'GetClassLongA';
  16694. function GetClassLongW; external user32 name 'GetClassLongW';
  16695. function GetClassLong; external user32 name 'GetClassLongA';
  16696. function GetClassNameA; external user32 name 'GetClassNameA';
  16697. function GetClassNameW; external user32 name 'GetClassNameW';
  16698. function GetClassName; external user32 name 'GetClassNameA';
  16699. function GetClassWord; external user32 name 'GetClassWord';
  16700. function GetClientRect; external user32 name 'GetClientRect';
  16701. function GetClipCursor; external user32 name 'GetClipCursor';
  16702. function GetClipboardData; external user32 name 'GetClipboardData';
  16703. function GetClipboardFormatNameA; external user32 name 'GetClipboardFormatNameA';
  16704. function GetClipboardFormatNameW; external user32 name 'GetClipboardFormatNameW';
  16705. function GetClipboardFormatName; external user32 name 'GetClipboardFormatNameA';
  16706. function GetClipboardOwner; external user32 name 'GetClipboardOwner';
  16707. function GetClipboardViewer; external user32 name 'GetClipboardViewer';
  16708. function GetCursor; external user32 name 'GetCursor';
  16709. function GetCursorPos; external user32 name 'GetCursorPos';
  16710. function GetDC; external user32 name 'GetDC';
  16711. function GetDCEx; external user32 name 'GetDCEx';
  16712. function GetDesktopWindow; external user32 name 'GetDesktopWindow';
  16713. function GetDialogBaseUnits; external user32 name 'GetDialogBaseUnits';
  16714. function GetDlgCtrlID; external user32 name 'GetDlgCtrlID';
  16715. function GetDlgItem; external user32 name 'GetDlgItem';
  16716. function GetDlgItemInt; external user32 name 'GetDlgItemInt';
  16717. function GetDlgItemTextA; external user32 name 'GetDlgItemTextA';
  16718. function GetDlgItemTextW; external user32 name 'GetDlgItemTextW';
  16719. function GetDlgItemText; external user32 name 'GetDlgItemTextA';
  16720. function GetDoubleClickTime; external user32 name 'GetDoubleClickTime';
  16721. function GetFocus; external user32 name 'GetFocus';
  16722. function GetForegroundWindow; external user32 name 'GetForegroundWindow';
  16723. function GetIconInfo; external user32 name 'GetIconInfo';
  16724. function GetInputState; external user32 name 'GetInputState';
  16725. function GetKBCodePage; external user32 name 'GetKBCodePage';
  16726. function GetKeyNameTextA; external user32 name 'GetKeyNameTextA';
  16727. function GetKeyNameTextW; external user32 name 'GetKeyNameTextW';
  16728. function GetKeyNameText; external user32 name 'GetKeyNameTextA';
  16729. function GetKeyState; external user32 name 'GetKeyState';
  16730. function GetKeyboardLayout; external user32 name 'GetKeyboardLayout';
  16731. function GetKeyboardLayoutList; external user32 name 'GetKeyboardLayoutList';
  16732. function GetKeyboardLayoutNameA; external user32 name 'GetKeyboardLayoutNameA';
  16733. function GetKeyboardLayoutNameW; external user32 name 'GetKeyboardLayoutNameW';
  16734. function GetKeyboardLayoutName; external user32 name 'GetKeyboardLayoutNameA';
  16735. function GetKeyboardState; external user32 name 'GetKeyboardState';
  16736. function GetKeyboardType; external user32 name 'GetKeyboardType';
  16737. function GetLastActivePopup; external user32 name 'GetLastActivePopup';
  16738. function GetMenu; external user32 name 'GetMenu';
  16739. function GetMenuCheckMarkDimensions; external user32 name 'GetMenuCheckMarkDimensions';
  16740. function GetMenuContextHelpId; external user32 name 'GetMenuContextHelpId';
  16741. function GetMenuDefaultItem; external user32 name 'GetMenuDefaultItem';
  16742. function GetMenuItemCount; external user32 name 'GetMenuItemCount';
  16743. function GetMenuItemID; external user32 name 'GetMenuItemID';
  16744. function GetMenuItemInfoA; external user32 name 'GetMenuItemInfoA';
  16745. function GetMenuItemInfoW; external user32 name 'GetMenuItemInfoW';
  16746. function GetMenuItemInfo; external user32 name 'GetMenuItemInfoA';
  16747. function GetMenuItemRect; external user32 name 'GetMenuItemRect';
  16748. function GetMenuState; external user32 name 'GetMenuState';
  16749. function GetMenuStringA; external user32 name 'GetMenuStringA';
  16750. function GetMenuStringW; external user32 name 'GetMenuStringW';
  16751. function GetMenuString; external user32 name 'GetMenuStringA';
  16752. function GetMessageA; external user32 name 'GetMessageA';
  16753. function GetMessageW; external user32 name 'GetMessageW';
  16754. function GetMessage; external user32 name 'GetMessageA';
  16755. function GetMessageExtraInfo; external user32 name 'GetMessageExtraInfo';
  16756. function GetMessagePos; external user32 name 'GetMessagePos';
  16757. function GetMessageTime; external user32 name 'GetMessageTime';
  16758. function GetNextDlgGroupItem; external user32 name 'GetNextDlgGroupItem';
  16759. function GetNextDlgTabItem; external user32 name 'GetNextDlgTabItem';
  16760. function GetNextWindow; external user32 name 'GetWindow';
  16761. function GetOpenClipboardWindow; external user32 name 'GetOpenClipboardWindow';
  16762. function GetParent; external user32 name 'GetParent';
  16763. function GetPriorityClipboardFormat; external user32 name 'GetPriorityClipboardFormat';
  16764. function GetProcessWindowStation; external user32 name 'GetProcessWindowStation';
  16765. function GetPropA; external user32 name 'GetPropA';
  16766. function GetPropW; external user32 name 'GetPropW';
  16767. function GetProp; external user32 name 'GetPropA';
  16768. function GetQueueStatus; external user32 name 'GetQueueStatus';
  16769. function GetScrollInfo; external user32 name 'GetScrollInfo';
  16770. function GetScrollPos; external user32 name 'GetScrollPos';
  16771. function GetScrollRange; external user32 name 'GetScrollRange';
  16772. function GetSubMenu; external user32 name 'GetSubMenu';
  16773. function GetSysColor; external user32 name 'GetSysColor';
  16774. function GetSysColorBrush; external user32 name 'GetSysColorBrush';
  16775. function GetSystemMenu; external user32 name 'GetSystemMenu';
  16776. function GetSystemMetrics; external user32 name 'GetSystemMetrics';
  16777. function GetTabbedTextExtentA; external user32 name 'GetTabbedTextExtentA';
  16778. function GetTabbedTextExtentW; external user32 name 'GetTabbedTextExtentW';
  16779. function GetTabbedTextExtent; external user32 name 'GetTabbedTextExtentA';
  16780. function GetThreadDesktop; external user32 name 'GetThreadDesktop';
  16781. function GetTopWindow; external user32 name 'GetTopWindow';
  16782. function GetUpdateRect; external user32 name 'GetUpdateRect';
  16783. function GetUpdateRgn; external user32 name 'GetUpdateRgn';
  16784. function GetUserObjectInformationA; external user32 name 'GetUserObjectInformationA';
  16785. function GetUserObjectInformationW; external user32 name 'GetUserObjectInformationW';
  16786. function GetUserObjectInformation; external user32 name 'GetUserObjectInformationA';
  16787. function GetUserObjectSecurity; external user32 name 'GetUserObjectSecurity';
  16788. function GetWindow; external user32 name 'GetWindow';
  16789. function GetWindowContextHelpId; external user32 name 'GetWindowContextHelpId';
  16790. function GetWindowDC; external user32 name 'GetWindowDC';
  16791. function GetWindowLongA; external user32 name 'GetWindowLongA';
  16792. function GetWindowLongW; external user32 name 'GetWindowLongW';
  16793. function GetWindowLong; external user32 name 'GetWindowLongA';
  16794. function GetWindowPlacement; external user32 name 'GetWindowPlacement';
  16795. function GetWindowRect; external user32 name 'GetWindowRect';
  16796. function GetWindowRgn; external user32 name 'GetWindowRgn';
  16797. function GetWindowTextA; external user32 name 'GetWindowTextA';
  16798. function GetWindowTextW; external user32 name 'GetWindowTextW';
  16799. function GetWindowText; external user32 name 'GetWindowTextA';
  16800. function GetWindowTextLengthA; external user32 name 'GetWindowTextLengthA';
  16801. function GetWindowTextLengthW; external user32 name 'GetWindowTextLengthW';
  16802. function GetWindowTextLength; external user32 name 'GetWindowTextLengthA';
  16803. function GetWindowThreadProcessId; external user32 name 'GetWindowThreadProcessId';
  16804. function GetWindowWord; external user32 name 'GetWindowWord';
  16805. function GrayStringA; external user32 name 'GrayStringA';
  16806. function GrayStringW; external user32 name 'GrayStringW';
  16807. function GrayString; external user32 name 'GrayStringA';
  16808. function HideCaret; external user32 name 'HideCaret';
  16809. function HiliteMenuItem; external user32 name 'HiliteMenuItem';
  16810. function ImpersonateDdeClientWindow; external user32 name 'ImpersonateDdeClientWindow';
  16811. function InSendMessage; external user32 name 'InSendMessage';
  16812. function InflateRect; external user32 name 'InflateRect';
  16813. function InsertMenuA; external user32 name 'InsertMenuA';
  16814. function InsertMenuW; external user32 name 'InsertMenuW';
  16815. function InsertMenu; external user32 name 'InsertMenuA';
  16816. function InsertMenuItemA; external user32 name 'InsertMenuItemA';
  16817. function InsertMenuItemW; external user32 name 'InsertMenuItemW';
  16818. function InsertMenuItem; external user32 name 'InsertMenuItemA';
  16819. function IntersectRect; external user32 name 'IntersectRect';
  16820. function InvalidateRect; external user32 name 'InvalidateRect';
  16821. function InvalidateRgn; external user32 name 'InvalidateRgn';
  16822. function InvertRect; external user32 name 'InvertRect';
  16823. function IsCharAlphaA; external user32 name 'IsCharAlphaA';
  16824. function IsCharAlphaW; external user32 name 'IsCharAlphaW';
  16825. function IsCharAlpha; external user32 name 'IsCharAlphaA';
  16826. function IsCharAlphaNumericA; external user32 name 'IsCharAlphaNumericA';
  16827. function IsCharAlphaNumericW; external user32 name 'IsCharAlphaNumericW';
  16828. function IsCharAlphaNumeric; external user32 name 'IsCharAlphaNumericA';
  16829. function IsCharLowerA; external user32 name 'IsCharLowerA';
  16830. function IsCharLowerW; external user32 name 'IsCharLowerW';
  16831. function IsCharLower; external user32 name 'IsCharLowerA';
  16832. function IsCharUpperA; external user32 name 'IsCharUpperA';
  16833. function IsCharUpperW; external user32 name 'IsCharUpperW';
  16834. function IsCharUpper; external user32 name 'IsCharUpperA';
  16835. function IsChild; external user32 name 'IsChild';
  16836. function IsClipboardFormatAvailable; external user32 name 'IsClipboardFormatAvailable';
  16837. function IsDialogMessageA; external user32 name 'IsDialogMessageA';
  16838. function IsDialogMessageW; external user32 name 'IsDialogMessageW';
  16839. function IsDialogMessage; external user32 name 'IsDialogMessageA';
  16840. function IsDlgButtonChecked; external user32 name 'IsDlgButtonChecked';
  16841. function IsIconic; external user32 name 'IsIconic';
  16842. function IsMenu; external user32 name 'IsMenu';
  16843. function IsRectEmpty; external user32 name 'IsRectEmpty';
  16844. function IsWindow; external user32 name 'IsWindow';
  16845. function IsWindowEnabled; external user32 name 'IsWindowEnabled';
  16846. function IsWindowUnicode; external user32 name 'IsWindowUnicode';
  16847. function IsWindowVisible; external user32 name 'IsWindowVisible';
  16848. function IsZoomed; external user32 name 'IsZoomed';
  16849. function KillTimer; external user32 name 'KillTimer';
  16850. function LoadAcceleratorsA; external user32 name 'LoadAcceleratorsA';
  16851. function LoadAcceleratorsW; external user32 name 'LoadAcceleratorsW';
  16852. function LoadAccelerators; external user32 name 'LoadAcceleratorsA';
  16853. function LoadBitmapA; external user32 name 'LoadBitmapA';
  16854. function LoadBitmapW; external user32 name 'LoadBitmapW';
  16855. function LoadBitmap; external user32 name 'LoadBitmapA';
  16856. function LoadCursorA; external user32 name 'LoadCursorA';
  16857. function LoadCursorW; external user32 name 'LoadCursorW';
  16858. function LoadCursor; external user32 name 'LoadCursorA';
  16859. function LoadCursorFromFileA; external user32 name 'LoadCursorFromFileA';
  16860. function LoadCursorFromFileW; external user32 name 'LoadCursorFromFileW';
  16861. function LoadCursorFromFile; external user32 name 'LoadCursorFromFileA';
  16862. function LoadIconA; external user32 name 'LoadIconA';
  16863. function LoadIconW; external user32 name 'LoadIconW';
  16864. function LoadIcon; external user32 name 'LoadIconA';
  16865. function LoadImageA; external user32 name 'LoadImageA';
  16866. function LoadImageW; external user32 name 'LoadImageW';
  16867. function LoadImage; external user32 name 'LoadImageA';
  16868. function LoadKeyboardLayoutA; external user32 name 'LoadKeyboardLayoutA';
  16869. function LoadKeyboardLayoutW; external user32 name 'LoadKeyboardLayoutW';
  16870. function LoadKeyboardLayout; external user32 name 'LoadKeyboardLayoutA';
  16871. function LoadMenuA; external user32 name 'LoadMenuA';
  16872. function LoadMenuW; external user32 name 'LoadMenuW';
  16873. function LoadMenu; external user32 name 'LoadMenuA';
  16874. function LoadMenuIndirectA; external user32 name 'LoadMenuIndirectA';
  16875. function LoadMenuIndirectW; external user32 name 'LoadMenuIndirectW';
  16876. function LoadMenuIndirect; external user32 name 'LoadMenuIndirectA';
  16877. function LoadStringA; external user32 name 'LoadStringA';
  16878. function LoadStringW; external user32 name 'LoadStringW';
  16879. function LoadString; external user32 name 'LoadStringA';
  16880. function LockWindowUpdate; external user32 name 'LockWindowUpdate';
  16881. function LookupIconIdFromDirectory; external user32 name 'LookupIconIdFromDirectory';
  16882. function LookupIconIdFromDirectoryEx; external user32 name 'LookupIconIdFromDirectoryEx';
  16883. function MapDialogRect; external user32 name 'MapDialogRect';
  16884. function MapVirtualKeyA; external user32 name 'MapVirtualKeyA';
  16885. function MapVirtualKeyW; external user32 name 'MapVirtualKeyW';
  16886. function MapVirtualKey; external user32 name 'MapVirtualKeyA';
  16887. function MapVirtualKeyExA; external user32 name 'MapVirtualKeyExA';
  16888. function MapVirtualKeyExW; external user32 name 'MapVirtualKeyExW';
  16889. function MapVirtualKeyEx; external user32 name 'MapVirtualKeyExA';
  16890. function MapWindowPoints; external user32 name 'MapWindowPoints';
  16891. function MenuItemFromPoint; external user32 name 'MenuItemFromPoint';
  16892. function MessageBeep; external user32 name 'MessageBeep';
  16893. function MessageBoxA; external user32 name 'MessageBoxA';
  16894. function MessageBoxW; external user32 name 'MessageBoxW';
  16895. function MessageBox; external user32 name 'MessageBoxA';
  16896. function MessageBoxExA; external user32 name 'MessageBoxExA';
  16897. function MessageBoxExW; external user32 name 'MessageBoxExW';
  16898. function MessageBoxEx; external user32 name 'MessageBoxExA';
  16899. function MessageBoxIndirectA; external user32 name 'MessageBoxIndirectA';
  16900. function MessageBoxIndirectW; external user32 name 'MessageBoxIndirectW';
  16901. function MessageBoxIndirect; external user32 name 'MessageBoxIndirectA';
  16902. function ModifyMenuA; external user32 name 'ModifyMenuA';
  16903. function ModifyMenuW; external user32 name 'ModifyMenuW';
  16904. function ModifyMenu; external user32 name 'ModifyMenuA';
  16905. function MoveWindow; external user32 name 'MoveWindow';
  16906. function MsgWaitForMultipleObjects; external user32 name 'MsgWaitForMultipleObjects';
  16907. function OemKeyScan; external user32 name 'OemKeyScan';
  16908. function OemToAnsi; external user32 name 'OemToCharA';
  16909. function OemToAnsiBuff; external user32 name 'OemToCharBuffA';
  16910. function OemToCharA; external user32 name 'OemToCharA';
  16911. function OemToCharW; external user32 name 'OemToCharW';
  16912. function OemToChar; external user32 name 'OemToCharA';
  16913. function OemToCharBuffA; external user32 name 'OemToCharBuffA';
  16914. function OemToCharBuffW; external user32 name 'OemToCharBuffW';
  16915. function OemToCharBuff; external user32 name 'OemToCharBuffA';
  16916. function OffsetRect; external user32 name 'OffsetRect';
  16917. function OpenClipboard; external user32 name 'OpenClipboard';
  16918. function OpenDesktopA; external user32 name 'OpenDesktopA';
  16919. function OpenDesktopW; external user32 name 'OpenDesktopW';
  16920. function OpenDesktop; external user32 name 'OpenDesktopA';
  16921. function OpenIcon; external user32 name 'OpenIcon';
  16922. function OpenInputDesktop; external user32 name 'OpenInputDesktop';
  16923. function OpenWindowStationA; external user32 name 'OpenWindowStationA';
  16924. function OpenWindowStationW; external user32 name 'OpenWindowStationW';
  16925. function OpenWindowStation; external user32 name 'OpenWindowStationA';
  16926. function PackDDElParam; external user32 name 'PackDDElParam';
  16927. function PaintDesktop; external user32 name 'PaintDesktop';
  16928. function PeekMessageA; external user32 name 'PeekMessageA';
  16929. function PeekMessageW; external user32 name 'PeekMessageW';
  16930. function PeekMessage; external user32 name 'PeekMessageA';
  16931. function PostMessageA; external user32 name 'PostMessageA';
  16932. function PostMessageW; external user32 name 'PostMessageW';
  16933. function PostMessage; external user32 name 'PostMessageA';
  16934. procedure PostQuitMessage; external user32 name 'PostQuitMessage';
  16935. function PostThreadMessageA; external user32 name 'PostThreadMessageA';
  16936. function PostThreadMessageW; external user32 name 'PostThreadMessageW';
  16937. function PostThreadMessage; external user32 name 'PostThreadMessageA';
  16938. function PtInRect; external user32 name 'PtInRect';
  16939. function RedrawWindow; external user32 name 'RedrawWindow';
  16940. function RegisterClassA; external user32 name 'RegisterClassA';
  16941. function RegisterClassW; external user32 name 'RegisterClassW';
  16942. function RegisterClass; external user32 name 'RegisterClassA';
  16943. function RegisterClassExA; external user32 name 'RegisterClassExA';
  16944. function RegisterClassExW; external user32 name 'RegisterClassExW';
  16945. function RegisterClassEx; external user32 name 'RegisterClassExA';
  16946. function RegisterClipboardFormatA; external user32 name 'RegisterClipboardFormatA';
  16947. function RegisterClipboardFormatW; external user32 name 'RegisterClipboardFormatW';
  16948. function RegisterClipboardFormat; external user32 name 'RegisterClipboardFormatA';
  16949. function RegisterHotKey; external user32 name 'RegisterHotKey';
  16950. function RegisterWindowMessageA; external user32 name 'RegisterWindowMessageA';
  16951. function RegisterWindowMessageW; external user32 name 'RegisterWindowMessageW';
  16952. function RegisterWindowMessage; external user32 name 'RegisterWindowMessageA';
  16953. function ReleaseCapture; external user32 name 'ReleaseCapture';
  16954. function ReleaseDC; external user32 name 'ReleaseDC';
  16955. function RemoveMenu; external user32 name 'RemoveMenu';
  16956. function RemovePropA; external user32 name 'RemovePropA';
  16957. function RemovePropW; external user32 name 'RemovePropW';
  16958. function RemoveProp; external user32 name 'RemovePropA';
  16959. function ReplyMessage; external user32 name 'ReplyMessage';
  16960. function ReuseDDElParam; external user32 name 'ReuseDDElParam';
  16961. function ScreenToClient; external user32 name 'ScreenToClient';
  16962. function ScrollDC; external user32 name 'ScrollDC';
  16963. function ScrollWindow; external user32 name 'ScrollWindow';
  16964. function ScrollWindowEx; external user32 name 'ScrollWindowEx';
  16965. function SendDlgItemMessageA; external user32 name 'SendDlgItemMessageA';
  16966. function SendDlgItemMessageW; external user32 name 'SendDlgItemMessageW';
  16967. function SendDlgItemMessage; external user32 name 'SendDlgItemMessageA';
  16968. function SendMessageA; external user32 name 'SendMessageA';
  16969. function SendMessageW; external user32 name 'SendMessageW';
  16970. function SendMessage; external user32 name 'SendMessageA';
  16971. function SendMessageCallbackA; external user32 name 'SendMessageCallbackA';
  16972. function SendMessageCallbackW; external user32 name 'SendMessageCallbackW';
  16973. function SendMessageCallback; external user32 name 'SendMessageCallbackA';
  16974. function SendMessageTimeoutA; external user32 name 'SendMessageTimeoutA';
  16975. function SendMessageTimeoutW; external user32 name 'SendMessageTimeoutW';
  16976. function SendMessageTimeout; external user32 name 'SendMessageTimeoutA';
  16977. function SendNotifyMessageA; external user32 name 'SendNotifyMessageA';
  16978. function SendNotifyMessageW; external user32 name 'SendNotifyMessageW';
  16979. function SendNotifyMessage; external user32 name 'SendNotifyMessageA';
  16980. function SetActiveWindow; external user32 name 'SetActiveWindow';
  16981. function SetCapture; external user32 name 'SetCapture';
  16982. function SetCaretBlinkTime; external user32 name 'SetCaretBlinkTime';
  16983. function SetCaretPos; external user32 name 'SetCaretPos';
  16984. function SetClassLongA; external user32 name 'SetClassLongA';
  16985. function SetClassLongW; external user32 name 'SetClassLongW';
  16986. function SetClassLong; external user32 name 'SetClassLongA';
  16987. function SetClassWord; external user32 name 'SetClassWord';
  16988. function SetClipboardData; external user32 name 'SetClipboardData';
  16989. function SetClipboardViewer; external user32 name 'SetClipboardViewer';
  16990. function SetCursor; external user32 name 'SetCursor';
  16991. function SetCursorPos; external user32 name 'SetCursorPos';
  16992. procedure SetDebugErrorLevel; external user32 name 'SetDebugErrorLevel';
  16993. function SetDlgItemInt; external user32 name 'SetDlgItemInt';
  16994. function SetDlgItemTextA; external user32 name 'SetDlgItemTextA';
  16995. function SetDlgItemTextW; external user32 name 'SetDlgItemTextW';
  16996. function SetDlgItemText; external user32 name 'SetDlgItemTextA';
  16997. function SetDoubleClickTime; external user32 name 'SetDoubleClickTime';
  16998. function SetFocus; external user32 name 'SetFocus';
  16999. function SetForegroundWindow; external user32 name 'SetForegroundWindow';
  17000. function SetKeyboardState; external user32 name 'SetKeyboardState';
  17001. procedure SetLastErrorEx; external user32 name 'SetLastErrorEx';
  17002. function SetMenu; external user32 name 'SetMenu';
  17003. function SetMenuContextHelpId; external user32 name 'SetMenuContextHelpId';
  17004. function SetMenuDefaultItem; external user32 name 'SetMenuDefaultItem';
  17005. function SetMenuItemBitmaps; external user32 name 'SetMenuItemBitmaps';
  17006. function SetMenuItemInfoA; external user32 name 'SetMenuItemInfoA';
  17007. function SetMenuItemInfoW; external user32 name 'SetMenuItemInfoW';
  17008. function SetMenuItemInfo; external user32 name 'SetMenuItemInfoA';
  17009. function SetMessageExtraInfo; external user32 name 'SetMessageExtraInfo';
  17010. function SetMessageQueue; external user32 name 'SetMessageQueue';
  17011. function SetParent; external user32 name 'SetParent';
  17012. function SetProcessWindowStation; external user32 name 'SetProcessWindowStation';
  17013. function SetPropA; external user32 name 'SetPropA';
  17014. function SetPropW; external user32 name 'SetPropW';
  17015. function SetProp; external user32 name 'SetPropA';
  17016. function SetRect; external user32 name 'SetRect';
  17017. function SetRectEmpty; external user32 name 'SetRectEmpty';
  17018. function SetScrollInfo; external user32 name 'SetScrollInfo';
  17019. function SetScrollPos; external user32 name 'SetScrollPos';
  17020. function SetScrollRange; external user32 name 'SetScrollRange';
  17021. function SetSysColors; external user32 name 'SetSysColors';
  17022. function SetSystemCursor; external user32 name 'SetSystemCursor';
  17023. function SetThreadDesktop; external user32 name 'SetThreadDesktop';
  17024. function SetTimer; external user32 name 'SetTimer';
  17025. function SetUserObjectInformationA; external user32 name 'SetUserObjectInformationA';
  17026. function SetUserObjectInformationW; external user32 name 'SetUserObjectInformationW';
  17027. function SetUserObjectInformation; external user32 name 'SetUserObjectInformationA';
  17028. function SetUserObjectSecurity; external user32 name 'SetUserObjectSecurity';
  17029. function SetWindowContextHelpId; external user32 name 'SetWindowContextHelpId';
  17030. function SetWindowLongA; external user32 name 'SetWindowLongA';
  17031. function SetWindowLongW; external user32 name 'SetWindowLongW';
  17032. function SetWindowLong; external user32 name 'SetWindowLongA';
  17033. function SetWindowPlacement; external user32 name 'SetWindowPlacement';
  17034. function SetWindowPos; external user32 name 'SetWindowPos';
  17035. function SetWindowTextA; external user32 name 'SetWindowTextA';
  17036. function SetWindowTextW; external user32 name 'SetWindowTextW';
  17037. function SetWindowText; external user32 name 'SetWindowTextA';
  17038. function SetWindowWord; external user32 name 'SetWindowWord';
  17039. function SetWindowsHookA; external user32 name 'SetWindowsHookA';
  17040. function SetWindowsHookW; external user32 name 'SetWindowsHookW';
  17041. function SetWindowsHook; external user32 name 'SetWindowsHookA';
  17042. function SetWindowsHookExA; external user32 name 'SetWindowsHookExA';
  17043. function SetWindowsHookExW; external user32 name 'SetWindowsHookExW';
  17044. function SetWindowsHookEx; external user32 name 'SetWindowsHookExA';
  17045. function SetWindowRgn; external user32 name 'SetWindowRgn';
  17046. function ShowCaret; external user32 name 'ShowCaret';
  17047. function ShowCursor; external user32 name 'ShowCursor';
  17048. function ShowOwnedPopups; external user32 name 'ShowOwnedPopups';
  17049. function ShowScrollBar; external user32 name 'ShowScrollBar';
  17050. function ShowWindow; external user32 name 'ShowWindow';
  17051. function ShowWindowAsync; external user32 name 'ShowWindowAsync';
  17052. function SubtractRect; external user32 name 'SubtractRect';
  17053. function SwapMouseButton; external user32 name 'SwapMouseButton';
  17054. function SwitchDesktop; external user32 name 'SwitchDesktop';
  17055. function SystemParametersInfoA; external user32 name 'SystemParametersInfoA';
  17056. function SystemParametersInfoW; external user32 name 'SystemParametersInfoW';
  17057. function SystemParametersInfo; external user32 name 'SystemParametersInfoA';
  17058. function TabbedTextOutA; external user32 name 'TabbedTextOutA';
  17059. function TabbedTextOutW; external user32 name 'TabbedTextOutW';
  17060. function TabbedTextOut; external user32 name 'TabbedTextOutA';
  17061. function TileWindows; external user32 name 'TileWindows';
  17062. function ToAscii; external user32 name 'ToAscii';
  17063. function ToAsciiEx; external user32 name 'ToAsciiEx';
  17064. function ToUnicode; external user32 name 'ToUnicode';
  17065. function ToUnicodeEx; external user32 name 'ToUnicodeEx';
  17066. function TrackPopupMenu; external user32 name 'TrackPopupMenu';
  17067. function TrackPopupMenuEx; external user32 name 'TrackPopupMenuEx';
  17068. function TranslateAcceleratorA; external user32 name 'TranslateAcceleratorA';
  17069. function TranslateAcceleratorW; external user32 name 'TranslateAcceleratorW';
  17070. function TranslateAccelerator; external user32 name 'TranslateAcceleratorA';
  17071. function TranslateCharsetInfo; external user32 name 'TranslateCharsetInfo';
  17072. function TranslateMDISysAccel; external user32 name 'TranslateMDISysAccel';
  17073. function TranslateMessage; external user32 name 'TranslateMessage';
  17074. function UnhookWindowsHook; external user32 name 'UnhookWindowsHook';
  17075. function UnhookWindowsHookEx; external user32 name 'UnhookWindowsHookEx';
  17076. function UnionRect; external user32 name 'UnionRect';
  17077. function UnloadKeyboardLayout; external user32 name 'UnloadKeyboardLayout';
  17078. function UnpackDDElParam; external user32 name 'UnpackDDElParam';
  17079. function UnregisterClassA; external user32 name 'UnregisterClassA';
  17080. function UnregisterClassW; external user32 name 'UnregisterClassW';
  17081. function UnregisterClass; external user32 name 'UnregisterClassA';
  17082. function UnregisterHotKey; external user32 name 'UnregisterHotKey';
  17083. function UpdateICMRegKeyA; external user32 name 'UpdateICMRegKeyA';
  17084. function UpdateICMRegKeyW; external user32 name 'UpdateICMRegKeyW';
  17085. function UpdateICMRegKey; external user32 name 'UpdateICMRegKeyA';
  17086. function UpdateWindow; external user32 name 'UpdateWindow';
  17087. function ValidateRect; external user32 name 'ValidateRect';
  17088. function ValidateRgn; external user32 name 'ValidateRgn';
  17089. function VkKeyScanA; external user32 name 'VkKeyScanA';
  17090. function VkKeyScanW; external user32 name 'VkKeyScanW';
  17091. function VkKeyScan; external user32 name 'VkKeyScanA';
  17092. function VkKeyScanExA; external user32 name 'VkKeyScanExA';
  17093. function VkKeyScanExW; external user32 name 'VkKeyScanExW';
  17094. function VkKeyScanEx; external user32 name 'VkKeyScanExA';
  17095. function WaitForInputIdle; external user32 name 'WaitForInputIdle';
  17096. function WaitMessage; external user32 name 'WaitMessage';
  17097. function WinHelpA; external user32 name 'WinHelpA';
  17098. function WinHelpW; external user32 name 'WinHelpW';
  17099. function WinHelp; external user32 name 'WinHelpA';
  17100. function WindowFromDC; external user32 name 'WindowFromDC';
  17101. function WindowFromPoint; external user32 name 'WindowFromPoint';
  17102. procedure keybd_event; external user32 name 'keybd_event';
  17103. procedure mouse_event; external user32 name 'mouse_event';
  17104. function wsprintfA; external user32 name 'wsprintfA';
  17105. function wsprintfW; external user32 name 'wsprintfW';
  17106. function wsprintf; external user32 name 'wsprintfA';
  17107. function wvsprintfA; external user32 name 'wvsprintfA';
  17108. function wvsprintfW; external user32 name 'wvsprintfW';
  17109. function wvsprintf; external user32 name 'wvsprintfA';
  17110.  
  17111.  
  17112. { Translated from WINDEF.H }
  17113.  
  17114. function MakeWord(A, B: Byte): Word;
  17115. begin
  17116.   Result := A or B shl 8;
  17117. end;
  17118.  
  17119. function MakeLong(A, B: Word): Longint;
  17120. begin
  17121.   Result := A or B shl 16;
  17122. end;
  17123.  
  17124. function HiWord(L: DWORD): Word;
  17125. begin
  17126.   Result := L shr 16;
  17127. end;
  17128.  
  17129. function HiByte(W: Word): Byte;
  17130. begin
  17131.   Result := W shr 8;
  17132. end;
  17133.  
  17134. { Translated from WINBASE.H }
  17135.  
  17136. function DefineHandleTable(Offset: Word): Bool;
  17137. begin
  17138.   Result := True;
  17139. end;
  17140.  
  17141. procedure LimitEmsPages(Kbytes: Longint);
  17142. begin
  17143. end;
  17144.  
  17145. function SetSwapAreaSize(Size: Word): Longint;
  17146. begin
  17147.   Result := Size;
  17148. end;
  17149.  
  17150. procedure LockSegment(Segment: THandle);
  17151. begin
  17152.   GlobalFix(Segment);
  17153. end;
  17154.  
  17155. procedure UnlockSegment(Segment: THandle);
  17156. begin
  17157.   GlobalUnfix(Segment);
  17158. end;
  17159.  
  17160. function GetCurrentTime: Longint;
  17161. begin
  17162.   Result := GetTickCount;
  17163. end;
  17164.  
  17165. function Yield: Bool;
  17166. begin
  17167.   Result := True;
  17168. end;
  17169.  
  17170. procedure MoveMemory(Destination: Pointer; Source: Pointer; Length: DWORD);
  17171. begin
  17172.   Move(Source^, Destination^, Length);
  17173. end;
  17174.  
  17175. procedure CopyMemory(Destination: Pointer; Source: Pointer; Length: DWORD);
  17176. begin
  17177.   Move(Source^, Destination^, Length);
  17178. end;
  17179.  
  17180. procedure FillMemory(Destination: Pointer; Length: DWORD; Fill: Byte);
  17181. begin
  17182.   FillChar(Destination^, Length, Fill);
  17183. end;
  17184.  
  17185. procedure ZeroMemory(Destination: Pointer; Length: DWORD);
  17186. begin
  17187.   FillChar(Destination^, Length, 0);
  17188. end;
  17189.  
  17190. function FreeModule(var hLibModule: HINST): BOOL;
  17191. begin
  17192.   Result := FreeLibrary(hLibModule);
  17193. end;
  17194.  
  17195. procedure FreeProcInstance(Proc: FARPROC);
  17196. begin
  17197. end;
  17198.  
  17199. function MakeProcInstance(Proc: FARPROC; Instance: THandle): FARPROC;
  17200. begin
  17201.   Result := Proc;
  17202. end;
  17203.  
  17204. function GlobalLRUNewest(h: THandle): THandle;
  17205. begin
  17206.   Result := h;
  17207. end;
  17208.  
  17209. function GlobalLRUOldest(h: THandle): THandle;
  17210. begin
  17211.   Result := h;
  17212. end;
  17213.  
  17214. function GlobalDiscard(h: THandle): THandle;
  17215. begin
  17216.  Result := GlobalReAlloc(h, 0, GMEM_MOVEABLE);
  17217. end;
  17218.  
  17219. function LocalDiscard(h: THandle): THandle;
  17220. begin
  17221.  Result := LocalReAlloc(h, 0, LMEM_MOVEABLE);
  17222. end;
  17223.  
  17224. function GetFreeSpace(w: Word): DWORD;
  17225. begin
  17226.   Result := $100000;
  17227. end;
  17228.  
  17229. function UnlockResource(hResData: THandle): BOOL;
  17230. begin
  17231.   Result := False;
  17232. end;
  17233.  
  17234. function GlobalAllocPtr(Flags: Integer; Bytes: Longint): Pointer; assembler;
  17235. asm
  17236.         PUSH    EDX
  17237.         PUSH    EAX
  17238.         CALL    GlobalAlloc
  17239.         PUSH    EAX
  17240.         CALL    GlobalLock
  17241. end;
  17242.  
  17243. function GlobalReAllocPtr(P: Pointer; Bytes: Longint;
  17244.   Flags: Integer): Pointer; assembler;
  17245. asm
  17246.         PUSH    ECX
  17247.         PUSH    EDX
  17248.         PUSH    EAX
  17249.         CALL    GlobalHandle
  17250.         PUSH    EAX
  17251.         PUSH    EAX
  17252.         CALL    GlobalUnlock
  17253.         CALL    GlobalReAlloc
  17254.         PUSH    EAX
  17255.         CALL    GlobalLock
  17256. end;
  17257.  
  17258. function GlobalFreePtr(P: Pointer): THandle; assembler;
  17259. asm
  17260.         PUSH    EAX
  17261.         CALL    GlobalHandle
  17262.         PUSH    EAX
  17263.         PUSH    EAX
  17264.         CALL    GlobalUnlock
  17265.         CALL    GlobalFree
  17266. end;
  17267.  
  17268.  
  17269. { Translated from WINERROR.H }
  17270.  
  17271. function Succeeded(Status: HRESULT): BOOL;
  17272. begin
  17273.   Result := Status >= 0;
  17274. end;
  17275.  
  17276. function Failed(Status: HRESULT): BOOL;
  17277. begin
  17278.   Result := Status < 0;
  17279. end;
  17280.  
  17281. function IsError(Status: HRESULT): BOOL;
  17282. begin
  17283.   Result := (Status shr 31) = SEVERITY_ERROR;
  17284. end;
  17285.  
  17286. function HResultCode(hr: HRESULT): Integer;
  17287. begin
  17288.   Result := hr and $0000FFFF;
  17289. end;
  17290.  
  17291. function HResultFacility(hr: HRESULT): Integer;
  17292. begin
  17293.   Result := (hr shr 16) and $00001FFF;
  17294. end;
  17295.  
  17296. function HResultSeverity(hr: HRESULT): Integer;
  17297. begin
  17298.   Result := (hr shr 31) and $00000001;
  17299. end;
  17300.  
  17301. function MakeResult(sev, fac, code: Integer): HResult;
  17302. begin
  17303.   Result := (sev shl 31) or (fac shl 16) or code;
  17304. end;
  17305.  
  17306. function HResultFromWin32(x: Integer): HRESULT;
  17307. begin
  17308.   Result := x;
  17309.   if Result <> 0 then
  17310.     Result := ((Result and $0000FFFF) or (FACILITY_WIN32 shl 16) or $80000000);
  17311. end;
  17312.  
  17313. function HResultFromNT(x: Integer): HRESULT;
  17314. begin
  17315.   Result := x or FACILITY_NT_BIT;
  17316. end;
  17317.  
  17318.  
  17319. { Translated from WINGDI.H }
  17320.  
  17321. function MakeROP4(fore, back: DWORD): DWORD;
  17322. begin
  17323.   Result := ((back shl 8) and $FF000000) or fore;
  17324. end;
  17325.  
  17326. function GetCValue(cmyk: COLORREF): Byte;
  17327. begin
  17328.   Result := Byte(cmyk);
  17329. end;
  17330.  
  17331. function GetMValue(cmyk: COLORREF): Byte;
  17332. begin
  17333.   Result := Byte(cmyk shr 8);
  17334. end;
  17335.  
  17336. function GetYValue(cmyk: COLORREF): Byte;
  17337. begin
  17338.   Result := Byte(cmyk shr 16);
  17339. end;
  17340.  
  17341. function GetKValue(cmyk: COLORREF): Byte;
  17342. begin
  17343.   Result := Byte(cmyk shr 24);
  17344. end;
  17345.  
  17346. function CMYK(c, m, y, k: Byte): COLORREF;
  17347. begin
  17348.   Result := (c or (m shl 8) or (y shl 16) or (k shl 24));
  17349. end;
  17350.  
  17351. function RGB(r, g, b: Byte): COLORREF;
  17352. begin
  17353.   Result := (r or (g shl 8) or (b shl 16));
  17354. end;
  17355.  
  17356. function PaletteRGB(r, g, b: Byte): COLORREF;
  17357. begin
  17358.   Result := $02000000 or RGB(r,g,b);
  17359. end;
  17360.  
  17361. function PaletteIndex(i: Word): COLORREF;
  17362. begin
  17363.   Result := $01000000 or i;
  17364. end;
  17365.  
  17366. function GetRValue(rgb: DWORD): Byte;
  17367. begin
  17368.   Result := Byte(rgb);
  17369. end;
  17370.  
  17371. function GetGValue(rgb: DWORD): Byte;
  17372. begin
  17373.   Result := Byte(rgb shr 8);
  17374. end;
  17375.  
  17376. function GetBValue(rgb: DWORD): Byte;
  17377. begin
  17378.   Result := Byte(rgb shr 16);
  17379. end;
  17380.  
  17381.  
  17382. { Translated from WINUSER.H }
  17383.  
  17384. function SmallPointToPoint(const P: TSmallPoint): TPoint;
  17385. begin
  17386.   Result.X := P.X;
  17387.   Result.Y := P.Y;
  17388. end;
  17389.  
  17390. function PointToSmallPoint(const P: TPoint): TSmallPoint;
  17391. begin
  17392.   Result.X := P.X;
  17393.   Result.Y := P.Y;
  17394. end;
  17395.  
  17396. function MakeWParam(l, h: Word): WPARAM;
  17397. begin
  17398.   Result := MakeLong(l, h);
  17399. end;
  17400.  
  17401. function MakeLParam(l, h: Word): LPARAM;
  17402. begin
  17403.   Result := MakeLong(l, h);
  17404. end;
  17405.  
  17406. function MakeLResult(l, h: Word): LRESULT;
  17407. begin
  17408.   Result := MakeLong(l, h);
  17409. end;
  17410.  
  17411. function ExitWindows(dwReserved: DWORD; Code: Word): BOOL;
  17412. begin
  17413.   Result := ExitWindowsEx(EWX_LOGOFF, -1);
  17414. end;
  17415.  
  17416. function PostAppMessageA(idThread: DWORD; Msg: UINT; wParam: WPARAM; lParam: LPARAM): BOOL;
  17417. begin
  17418.   Result := PostThreadMessageA(idThread, Msg, wParam, lParam)
  17419. end;
  17420. function PostAppMessageW(idThread: DWORD; Msg: UINT; wParam: WPARAM; lParam: LPARAM): BOOL;
  17421. begin
  17422.   Result := PostThreadMessageW(idThread, Msg, wParam, lParam)
  17423. end;
  17424. function PostAppMessage(idThread: DWORD; Msg: UINT; wParam: WPARAM; lParam: LPARAM): BOOL;
  17425. begin
  17426.   Result := PostThreadMessage(idThread, Msg, wParam, lParam)
  17427. end;
  17428.  
  17429. function CreateWindowA(lpClassName: PAnsiChar; lpWindowName: PAnsiChar;
  17430.   dwStyle: DWORD; X, Y, nWidth, nHeight: Integer; hWndParent: HWND;
  17431.   hMenu: HMENU; hInstance: HINST; lpParam: Pointer): HWND;
  17432. begin
  17433.   Result := CreateWindowExA(0, lpClassName, lpWindowName, dwStyle, X, Y,
  17434.     nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
  17435. end;
  17436. function CreateWindowW(lpClassName: PWideChar; lpWindowName: PWideChar;
  17437.   dwStyle: DWORD; X, Y, nWidth, nHeight: Integer; hWndParent: HWND;
  17438.   hMenu: HMENU; hInstance: HINST; lpParam: Pointer): HWND;
  17439. begin
  17440.   Result := CreateWindowExW(0, lpClassName, lpWindowName, dwStyle, X, Y,
  17441.     nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
  17442. end;
  17443. function CreateWindow(lpClassName: PChar; lpWindowName: PChar;
  17444.   dwStyle: DWORD; X, Y, nWidth, nHeight: Integer; hWndParent: HWND;
  17445.   hMenu: HMENU; hInstance: HINST; lpParam: Pointer): HWND;
  17446. begin
  17447.   Result := CreateWindowEx(0, lpClassName, lpWindowName, dwStyle, X, Y,
  17448.     nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
  17449. end;
  17450.  
  17451. function CreateDialogA(hInstance: HINST; lpTemplateName: PAnsiChar;
  17452.   hWndParent: HWND; lpDialogFunc: TFNDlgProc): HWND;
  17453. begin
  17454.   Result := CreateDialogParamA(hInstance, lpTemplateName, hWndParent,
  17455.     lpDialogFunc, 0);
  17456. end;
  17457. function CreateDialogW(hInstance: HINST; lpTemplateName: PWideChar;
  17458.   hWndParent: HWND; lpDialogFunc: TFNDlgProc): HWND;
  17459. begin
  17460.   Result := CreateDialogParamW(hInstance, lpTemplateName, hWndParent,
  17461.     lpDialogFunc, 0);
  17462. end;
  17463. function CreateDialog(hInstance: HINST; lpTemplateName: PChar;
  17464.   hWndParent: HWND; lpDialogFunc: TFNDlgProc): HWND;
  17465. begin
  17466.   Result := CreateDialogParam(hInstance, lpTemplateName, hWndParent,
  17467.     lpDialogFunc, 0);
  17468. end;
  17469.  
  17470. function CreateDialogIndirectA(hInstance: HINST; const lpTemplate: TDlgTemplate;
  17471.   hWndParent: HWND; lpDialogFunc: TFNDlgProc): HWND;
  17472. begin
  17473.   Result := CreateDialogIndirectParamA(hInstance, lpTemplate, hWndParent,
  17474.     lpDialogFunc, 0);
  17475. end;
  17476. function CreateDialogIndirectW(hInstance: HINST; const lpTemplate: TDlgTemplate;
  17477.   hWndParent: HWND; lpDialogFunc: TFNDlgProc): HWND;
  17478. begin
  17479.   Result := CreateDialogIndirectParamW(hInstance, lpTemplate, hWndParent,
  17480.     lpDialogFunc, 0);
  17481. end;
  17482. function CreateDialogIndirect(hInstance: HINST; const lpTemplate: TDlgTemplate;
  17483.   hWndParent: HWND; lpDialogFunc: TFNDlgProc): HWND;
  17484. begin
  17485.   Result := CreateDialogIndirectParam(hInstance, lpTemplate, hWndParent,
  17486.     lpDialogFunc, 0);
  17487. end;
  17488.  
  17489. function DialogBoxA(hInstance: HINST; lpTemplate: PAnsiChar;
  17490.   hWndParent: HWND; lpDialogFunc: TFNDlgProc): Integer;
  17491. begin
  17492.   Result := DialogBoxParamA(hInstance, lpTemplate, hWndParent,
  17493.     lpDialogFunc, 0);
  17494. end;
  17495. function DialogBoxW(hInstance: HINST; lpTemplate: PWideChar;
  17496.   hWndParent: HWND; lpDialogFunc: TFNDlgProc): Integer;
  17497. begin
  17498.   Result := DialogBoxParamW(hInstance, lpTemplate, hWndParent,
  17499.     lpDialogFunc, 0);
  17500. end;
  17501. function DialogBox(hInstance: HINST; lpTemplate: PChar;
  17502.   hWndParent: HWND; lpDialogFunc: TFNDlgProc): Integer;
  17503. begin
  17504.   Result := DialogBoxParam(hInstance, lpTemplate, hWndParent,
  17505.     lpDialogFunc, 0);
  17506. end;
  17507.  
  17508. function DialogBoxIndirectA(hInstance: HINST; const lpDialogTemplate: TDlgTemplate;
  17509.   hWndParent: HWND; lpDialogFunc: TFNDlgProc): Integer;
  17510. begin
  17511.   Result := DialogBoxIndirectParamA(hInstance, lpDialogTemplate, hWndParent,
  17512.     lpDialogFunc, 0);
  17513. end;
  17514. function DialogBoxIndirectW(hInstance: HINST; const lpDialogTemplate: TDlgTemplate;
  17515.   hWndParent: HWND; lpDialogFunc: TFNDlgProc): Integer;
  17516. begin
  17517.   Result := DialogBoxIndirectParamW(hInstance, lpDialogTemplate, hWndParent,
  17518.     lpDialogFunc, 0);
  17519. end;
  17520. function DialogBoxIndirect(hInstance: HINST; const lpDialogTemplate: TDlgTemplate;
  17521.   hWndParent: HWND; lpDialogFunc: TFNDlgProc): Integer;
  17522. begin
  17523.   Result := DialogBoxIndirectParam(hInstance, lpDialogTemplate, hWndParent,
  17524.     lpDialogFunc, 0);
  17525. end;
  17526.  
  17527. function EnumTaskWindows(hTask: THandle; lpfn: FARPROC; lParam: LPARAM): BOOL;
  17528. begin
  17529.   Result := EnumThreadWindows(DWORD(hTask), lpfn, lParam);
  17530. end;
  17531.  
  17532. function GetWindowTask(hWnd: HWND): THandle;
  17533. begin
  17534.   Result := THandle(GetWindowThreadProcessId(hWnd, nil));
  17535. end;
  17536.  
  17537. function DefHookProc(nCode: Integer; wParam: WPARAM; lParam: LPARAM; phhk: FARPROC): LRESULT;
  17538. begin
  17539.   Result := CallNextHookEx(HHOOK(phhk), nCode, wParam, lParam);
  17540. end;
  17541.  
  17542. end.
  17543.  
  17544.  
  17545.