home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft_Programmers_Library.7z / MPL / os2 / prgmr2.txt < prev    next >
Encoding:
Text File  |  2013-11-08  |  1.4 MB  |  38,260 lines

Text Truncated. Only the first 1MB is shown below. Download the file for the complete contents.
  1.  Microsoft Operating System/2: Programmer's Reference Volume 2
  2.  
  3.  
  4.  ══════════════════════════════════════════════════════════════════════════
  5.  
  6.  
  7.  Microsoft(R) Operating System/2: Programmer's Reference Volume 2
  8.  
  9.  Version 1.1
  10.  
  11.  
  12.  ══════════════════════════════════════════════════════════════════════════
  13.  
  14.  
  15.    Information in this document is subject to change without notice and does
  16.    not represent a commitment on the part of Microsoft Corporation. The
  17.    software and/or databases described in this document are furnished under a
  18.    license agreement or nondisclosure agreement. The software and/or
  19.    databases may be used or copied only in accordance with the terms of the
  20.    agreement. The purchaser may make one copy of the software for backup
  21.    purposes. No part of this manual and/or database may be reproduced or
  22.    transmitted in any form or by any means, electronic or mechanical,
  23.    including photocopying, recording, or information storage and retrieval
  24.    systems, for any purpose other than the purchaser's personal use, without
  25.    the written permission of Microsoft Corporation.
  26.  
  27.    PUBLISHED BY
  28.  
  29.    (C) Copyright Microsoft Corporation, 1989. All rights reserved.
  30.  
  31.    Printed in the United States of America.
  32.  
  33.    The character-set tables in this manual are reprinted by permission from
  34.    the IBM Operating System/2 User's Reference, (C) 1987 by International
  35.    Business Machines Corporation.
  36.  
  37.    Microsoft(R), MS(R), MS-DOS(R), and the Microsoft logo are registered
  38.    trademarks of Microsoft Corporation.
  39.  
  40.    IBM(R), PC/AT(R), and Personal System/2(R) are registered trademarks
  41.    of International Business Machines Corporation.
  42.  
  43.    Document No. LN0702B-110-I00-0289
  44.  
  45.  
  46.  
  47.  ────────────────────────────────────────────────────────────────────────────
  48.  Contents
  49.  
  50.  
  51.  Chapter 1  Introduction
  52.         1.1     Overview
  53.         1.2     How to Use This Manual
  54.         1.3     Naming Conventions
  55.         1.4     Notational Conventions
  56.  
  57.  Chapter 2  Functions Directory
  58.         2.1     Introduction
  59.         2.2     Functions
  60.  
  61.  Chapter 3  Messages Directory
  62.         3.1     Introduction
  63.         3.2     Messages
  64.  
  65.  Chapter 4  Types, Macros, Structures
  66.         4.1     Introduction
  67.         4.2     Types
  68.         4.3     Macros
  69.         4.4     Structures
  70.  
  71.  Chapter 5  File Formats
  72.         5.1     Introduction
  73.         5.2     Font-File Format
  74.         5.3     Font Signature
  75.         5.4     Font Metrics
  76.         5.5     Font Character Definition
  77.         5.6     Code-Page Font Support
  78.  
  79.  Appendix A  Error Values
  80.         A.1     Introduction
  81.         A.2     Errors
  82.  
  83.  Appendix B  Device Capabilities
  84.         B.1     Introduction
  85.         B.2     About Device Capabilities
  86.  
  87.  Figures
  88.         Figure 1.1     Sample Reference Page
  89.  
  90.  Tables
  91.         Table 5.1      Additional Glyphs
  92.  
  93.  
  94.  
  95.  ────────────────────────────────────────────────────────────────────────────
  96.  Chapter 1  Introduction
  97.  
  98.         1.1     Overview
  99.         1.2     How to Use This Manual
  100.             1.2.1     C Format
  101.             1.2.2     MS OS/2 Include Files
  102.             1.2.3     MS OS/2 Calling Conventions
  103.             1.2.4     Bit Masks in Function Parameters
  104.             1.2.5     Structures
  105.         1.3     Naming Conventions
  106.             1.3.1     Parameter and Field Names
  107.                 1.3.1.1    Prefixes
  108.                 1.3.1.2    Base Types
  109.             1.3.2     Constant Names
  110.         1.4     Notational Conventions
  111.  
  112.  1.1  Overview
  113.  
  114.    This manual describes the Dev, Gpi, and Win system functions of
  115.    Microsoft(R) Operating System/2 (MS(R) OS/2). These functions, also called
  116.    the Presentation Manager functions, let programs use the window-management
  117.    and graphics features of MS OS/2.
  118.  
  119.    MS OS/2 system functions are designed to be used in C, Pascal, and other
  120.    high-level-language programs, as well as in assembly-language programs. In
  121.    MS OS/2, all programs request operating-system services by calling system
  122.    functions.
  123.  
  124.    This chapter, "Introduction," shows how to use this manual, provides a
  125.    brief description of MS OS/2 calling conventions, illustrates function
  126.    calls in various languages, and outlines MS OS/2 naming conventions.
  127.  
  128.    Chapter 2, "Functions Directory," is an alphabetical listing of MS OS/2
  129.    Presentation Manager functions. This chapter defines each function's
  130.    purpose, gives its syntax, describes the function parameters, and gives
  131.    possible return values. Many functions also show simple program examples
  132.    that illustrate how the function is used to carry out simple tasks.
  133.  
  134.    Chapter 3, "Messages Directory," lists the messages sent and received by
  135.    MS OS/2 Presentation Manager functions.
  136.  
  137.    Chapter 4, "Types, Macros, Structures," describes the types, macros, and
  138.    structures used by MS OS/2 Presentation Manager functions.
  139.  
  140.    Chapter 5, "File Formats," describes the format of font files. Font files
  141.    contain bitmap or vector information that MS OS/2 needs for drawing
  142.    characters using Gpi functions.
  143.  
  144.    Appendix A, "Error Values," lists error codes and their corresponding
  145.    values.
  146.  
  147.    Appendix B, "Device Capabilities," lists the device capabilities that can
  148.    be determined by using the DevQueryCaps function.
  149.  
  150.    This manual is intended to fully describe MS OS/2 Presentation Manager
  151.    functions and the structures and file formats used with these functions.
  152.    It does not show how to use these functions to carry out specific tasks.
  153.    For more information on this topic, see the Microsoft Operating System/2
  154.    Programmer's Reference, Volume 1. Also, this manual does not describe MS
  155.    OS/2 base system functions. MS OS/2 base system functions let programs use
  156.    the operating system to carry out tasks such as reading from and writing
  157.    to disk files; allocating memory; starting other programs; and using the
  158.    keyboard, mouse, and video screen. For more information on MS OS/2 base
  159.    system functions, see the Microsoft Operating System/2 Programmer's
  160.    Reference, Volume 3.
  161.  
  162.  
  163.  1.2  How to Use This Manual
  164.  
  165.    This manual provides detailed information about each MS OS/2 Presentation
  166.    Manager function, message, macro, and structure. Each description has the
  167.    following format:
  168.  
  169.    ┌────────────────────────────────────────────────────────────────────────┐
  170.    │ Figure 1.1 can be found in Section 1.2 of the printed manual.          │
  171.    └────────────────────────────────────────────────────────────────────────┘
  172.  
  173.    Figure 1.1  Sample Reference Page
  174.  
  175.    These are the elements shown:
  176.  
  177.    1.  The function, message, macro, or structure name.
  178.  
  179.    2.  The function, message, macro, or structure syntax. The syntax
  180.        specifies the number of parameters (or fields) and gives the type of
  181.        each. It also gives the order (from left to right) that parameters
  182.        must be pushed on the stack. Comments to the right briefly describe
  183.        the purpose of the parameter (or field).
  184.  
  185.    3.  A description of the function, message, macro, or structure, including
  186.        its purpose and details of operation.
  187.  
  188.    4.  A full description of each parameter (or field), including permitted
  189.        values and related structures.
  190.  
  191.    5.  A description of the function return value, including possible error
  192.        values.
  193.  
  194.    6.  An example showing how the function can be used to accomplish a simple
  195.        task.
  196.  
  197.    7.  A list of related functions, structures, macros, and messages.
  198.  
  199.  1.2.1  C Format
  200.  
  201.    In this manual, the syntax for MS OS/2 functions is given in C-language
  202.    format. In your C-language sources, the function name must be spelled
  203.    exactly as given in the syntax and the parameters must be used in the
  204.    order given in the syntax. This syntax also applies to Pascal program
  205.    sources.
  206.  
  207.    The following example shows how to call the WinAlarm function in a
  208.    C-language program:
  209.  
  210.    /* sound an alarm when an error occurs */
  211.  
  212.    WinAlarm(HWND_DESKTOP,       /* alarm for the desktop window */
  213.             WA_ERROR);          /* tone for errors              */
  214.  
  215.  1.2.2  MS OS/2 Include Files
  216.  
  217.    This manual uses many types, structures, and constants that are not part
  218.    of standard C language. These items, designed for MS OS/2, are defined in
  219.    the MS OS/2 C-language include files provided with the Microsoft OS/2
  220.    Presentation Manager Softset and the Microsoft OS/2 Presentation Manager
  221.    Toolkit.
  222.  
  223.    In C-language programs, the #include directive specifying os2.h, the MS
  224.    OS/2 C-language include file, can be placed at the beginning of the source
  225.    file to include the definitions for the special types, structures, and
  226.    constants. Although there are many MS OS/2 include files, the os2.h file
  227.    contains the additional #include directives needed to process the basic MS
  228.    OS/2 definitions.
  229.  
  230.    To speed up processing of the MS OS/2 C-language include files, many
  231.    definitions are processed only if the C-language program explicitly
  232.    defines a corresponding include constant. An include constant is simply a
  233.    constant name, with the prefix INCL_, that controls a portion of the
  234.    include files. If a constant is defined using the #define directive, the
  235.    corresponding MS OS/2 definitions are processed. For a list of the include
  236.    constants and a description of the MS OS/2 system functions they enable,
  237.    see the Microsoft Operating System/2 Programmer's Reference, Volume 1.
  238.  
  239.  1.2.3  MS OS/2 Calling Conventions
  240.  
  241.    You must know MS OS/2 calling conventions to use MS OS/2 functions in
  242.    other high-level languages or in assembly language. MS OS/2 functions use
  243.    the Pascal (sometimes called the PLM) calling convention for passing
  244.    parameters, and they apply some additional rules to support dynamic-link
  245.    libraries. The following rules apply:
  246.  
  247.    ■  You must push the parameters on the stack. In this manual, each
  248.       function description lists the parameters in the order they must be
  249.       pushed. The left parameter must be pushed first, the right parameter
  250.       last. If a parameter specifies an address, the address must be a far
  251.       address; that is, it must have the form selector:offset. The selector
  252.       must be pushed first, then the offset.
  253.  
  254.    ■  The function automatically removes the parameters from the stack as it
  255.       returns. This means the function must have a fixed number of
  256.       parameters.
  257.  
  258.    ■  You must use an intersegment call instruction to call the function.
  259.       This is required for all dynamic-link-library functions.
  260.  
  261.    ■  The function returns a value, possibly an error value, in either the ax
  262.       register or the dx:ax register pair. Only the di and si register values
  263.       are guaranteed to be preserved by the function. MS OS/2 Presentation
  264.       Manager functions may preserve other registers as well, but they do not
  265.       preserve the flags register. The contents of the flags register are
  266.       undefined; specifically, the direction flag in the register may be
  267.       changed. However, if the direction flag was zero before the function
  268.       was called, it will be zero after the function returns.
  269.  
  270.    The following example shows how MS OS/2 calling conventions apply to the
  271.    WinCreateStdWindow function in an assembly-language program:
  272.  
  273.    EXTRN WINCREATESTDWINDOW:FAR
  274.  
  275.    hwndParent            dd      01H
  276.    flCreateFlags         dd      0FH
  277.    szClientClass         db     "MyClass", 0
  278.    szTitle               db     "My Window", 0
  279.    hwndClient            dd      01H
  280.  
  281.    push word ptr [hwndParent+2]     ; handle of the parent window
  282.    push word ptr [hwnParent]
  283.    push 0                           ; frame-window style
  284.    push 0
  285.    push ds                          ; creation flags
  286.    push offset flCreateFlags
  287.    push ds
  288.    push offset szClientClass        ; client-window class name
  289.    push ds                          ; address of title-bar text
  290.    push offset szTitle
  291.    push 0                           ; client-window style
  292.    push 0                           ;
  293.    push 0                           ; handle of the resource file
  294.    push 1                           ; resource identifier
  295.    push ds                          ; address of client-window handle
  296.    push offset hwndClient
  297.    call WINCREATESTDWINDOW
  298.  
  299.    The following example shows how to call the same WinCreateStdWindow
  300.    function in a C-language program. In C, the WinCreateStdWindow function
  301.    name, parameter types, and constant names are defined in os2.h, the MS
  302.    OS/2 C-language include file.
  303.  
  304.    # include <os2.h>
  305.  
  306.    HWND hwndParent = HWND_DESKTOP;
  307.    ULONG flCreateFlags =
  308.        FCF_TITLEBAR | FCF_SYSMENU | FCF_MENU | FCF_SIZEBORDER;
  309.    HWND hwndClient;
  310.  
  311.    WinCreateStdWindow(
  312.        hwndParent,          /* handle of the parent window     */
  313.        0L,                  /* frame-window style              */
  314.        &flCreateFlags,      /* creation flags                  */
  315.        "MyClass",           /* client-window class name        */
  316.        "My Window",         /* address of title-bar text       */
  317.        0L,                  /* client-window style             */
  318.        0,                   /* handle of the resource file     */
  319.        1,                   /* resource identifier             */
  320.        &hwndClient);        /* address of client-window handle */
  321.  
  322.  
  323.  1.2.4  Bit Masks in Function Parameters
  324.  
  325.    Many MS OS/2 system functions accept or return bit masks as part of their
  326.    operation. A bit mask is a collection of two or more bit fields within a
  327.    single byte, or a short or long value. Bit masks provide a way to pack
  328.    many Boolean flags (flags whose values represent on/off or true/false
  329.    values) into a single parameter or structure field. In assembly-language
  330.    programming, it is easy to individually set, clear, or test the bits in a
  331.    bit mask by using instructions that modify or examine bits within a byte
  332.    or a word. In C-language programming, however, the programmer does not
  333.    have direct access to these instructions, so the bitwise AND and OR
  334.    operators typically are used to examine and modify the bit masks.
  335.  
  336.    Since this manual presents the syntax of MS OS/2 system functions in
  337.    C-language syntax, it also defines bit masks in a way that is easiest to
  338.    work with using the C language: as a set of constant values. When a
  339.    function parameter is a bit mask, this manual provides a list of constants
  340.    (named or numeric) that represent the correct values used to set, clear,
  341.    or examine each field in the bit mask. For example, the fsSelection field
  342.    of the FATTRS structure in the GpiCreateLogFont function specifies several
  343.    values, such as FATTR_SEL_ITALIC and FATTR_SEL_UNDERSCORE. These represent
  344.    the "set" values of the fields in the bit mask. Typically, the description
  345.    associated with the value explains the result of the function if the given
  346.    value is used; that is, when the corresponding bit is set. Generally, the
  347.    opposite result is assumed when the value is not used. For example, using
  348.    FATTR_SEL_ITALIC in the fsSelection field enables the italic font; not
  349.    using it disables the italic font.
  350.  
  351.  1.2.5  Structures
  352.  
  353.    Many MS OS/2 system functions use structures as input and output
  354.    parameters. This manual defines all structures and their fields using
  355.    C-language syntax. In most cases, the structure definition presented is
  356.    copied directly from the C-language include files provided with the
  357.    Microsoft C Optimizing Compiler. Occasionally, an MS OS/2 function may
  358.    have a structure that has no corresponding include-file definition. In
  359.    such cases, this manual gives an incomplete form of the C-language
  360.    structure definition to indicate that the structure is not already defined
  361.    in an include file.
  362.  
  363.  
  364.  1.3  Naming Conventions
  365.  
  366.    In this manual, all parameter, variable, structure, field, and constant
  367.    names conform to MS OS/2 naming conventions. MS OS/2 naming conventions
  368.    are rules that define how to create names that indicate both the purpose
  369.    and data type of an item used with MS OS/2 system functions. These naming
  370.    conventions are used in this manual to help you readily identify the
  371.    purpose and type of the function parameters and structure fields. These
  372.    conventions are also used in most MS OS/2 sample program sources to make
  373.    the sources more readable and informative.
  374.  
  375.  1.3.1  Parameter and Field Names
  376.  
  377.    With MS OS/2 naming conventions, all parameter and field names consist of
  378.    up to three elements: a prefix, a base type, and a qualifier. A name
  379.    always consists of at least a base type or a qualifier. In most cases, the
  380.    name also includes a prefix.
  381.  
  382.    The base type, always written in lowercase letters, identifies the data
  383.    type of the item. The prefix, also written in lowercase letters, specifies
  384.    additional information about the item, such as whether it is a pointer, an
  385.    array, or a count of bytes. The qualifier, a short word or phrase written
  386.    with the first letter of each word uppercase, specifies the purpose of the
  387.    item.
  388.  
  389.    There are several standard prefixes and base types. These are used for the
  390.    data types most frequently used with MS OS/2.
  391.  
  392.    1.3.1.1  Prefixes
  393.  
  394.    The following is a list of standard prefixes used in MS OS/2 naming
  395.    conventions:
  396.  
  397. ╓┌─┌───────┌─────────────────────────────────────────────────────────────────╖
  398.    Prefix  Description
  399.    ──────────────────────────────────────────────────────────────────────────
  400.    p       Pointer. This prefix identifies a far, or 32-bit, pointer to a
  401.    Prefix  Description
  402.    ──────────────────────────────────────────────────────────────────────────
  403.    p       Pointer. This prefix identifies a far, or 32-bit, pointer to a
  404.            given item. For example, pch is a far pointer to a character.
  405.  
  406.    np      Near pointer. This prefix identifies a near, or 16-bit, pointer to
  407.            a given item. For example, npch is a near pointer to a character.
  408.  
  409.    a       Array. This prefix identifies an array of two or more items of a
  410.            given type. For example, ach is an array of characters.
  411.  
  412.    i       Index. This prefix identifies an index into an array. For example,
  413.            ich is an index to one character in an array of characters.
  414.  
  415.    c       Count. This prefix identifies a count of items. It is usually
  416.            combined with the base type of the items being counted instead of
  417.            the base type of the actual parameter. For example, cch is a count
  418.            of characters even though it may be declared with the type USHORT.
  419.  
  420.    h       Handle. This prefix is used for values that uniquely identify an
  421.            object but that cannot be used to access the object directly. For
  422.    Prefix  Description
  423.    ──────────────────────────────────────────────────────────────────────────
  424.           object but that cannot be used to access the object directly. For
  425.            example, hfile is a handle of a file.
  426.  
  427.    off     Offset. This prefix is used for values that represent offsets from
  428.            the beginning of a buffer or a structure. For example, off is the
  429.            offset from the beginning of the given segment to the specified
  430.            byte.
  431.  
  432.    id      Identifier. This prefix is used for values that identify an
  433.            object. For example, idSession is a session identifier.
  434.    ──────────────────────────────────────────────────────────────────────────
  435.  
  436.  
  437.    1.3.1.2  Base Types
  438.  
  439.    The following is a list of standard base types used in MS OS/2 naming
  440.    conventions:
  441.  
  442. ╓┌─┌───────┌─────────────────────────────────────────────────────────────────╖
  443.    Base    Type/Description
  444.    type
  445.    ──────────────────────────────────────────────────────────────────────────
  446.    f       BOOL. A 16-bit flag or Boolean value. The qualifier should
  447.            describe the condition associated with the flag when it is TRUE.
  448.            For example, fSuccess is TRUE if successful, FALSE if not; fError
  449.            is TRUE if an error occurs and FALSE if no error occurs. For
  450.            objects of type BOOL, a zero value implies FALSE; a nonzero value
  451.            implies TRUE.
  452.  
  453.    ch      CHAR. An 8-bit signed value.
  454.  
  455.    s       SHORT. A 16-bit signed value.
  456.  
  457.    l       LONG. A 32-bit signed value.
  458.  
  459.    uch     UCHAR. An 8-bit unsigned value.
  460.  
  461.    us      USHORT. A 16-bit unsigned value.
  462.  
  463.    ul      ULONG. A 32-bit unsigned value.
  464.    Base    Type/Description
  465.    type
  466.    ──────────────────────────────────────────────────────────────────────────
  467.   ul      ULONG. A 32-bit unsigned value.
  468.  
  469.    b       BYTE. An 8-bit unsigned value. Same as uch.
  470.  
  471.    sz      CHAR[ ]. Array of characters, terminated with a null character
  472.            (the last byte is set to zero).
  473.  
  474.    fb      UCHAR. Array of flags in a byte. This base type is used when more
  475.            than one flag is packed in an 8-bit value. Values for such an
  476.            array are typically created by using the logical OR operator to
  477.            combine two or more values.
  478.  
  479.    fs      USHORT. Array of flags in a short (16-bit unsigned value). This
  480.            base type is used when more than one flag is packed in a 16-bit
  481.            value. Values for such an array are typically created by using the
  482.            logical OR operator to combine two or more values.
  483.  
  484.    fl      ULONG. Array of flags in a long (32-bit unsigned value). This base
  485.    Base    Type/Description
  486.    type
  487.    ──────────────────────────────────────────────────────────────────────────
  488.   fl      ULONG. Array of flags in a long (32-bit unsigned value). This base
  489.            type is used when more than one flag is packed in a 32-bit value.
  490.            Values for such an array are typically created by using the
  491.            logical OR operator to combine two or more values.
  492.  
  493.    sel     SEL. A 16-bit value that is used to hold a segment selector.
  494.    ──────────────────────────────────────────────────────────────────────────
  495.  
  496.  
  497.    The base type for a structure is usually derived from the structure name.
  498.    An MS OS/2 structure name, always written in uppercase letters, is a word
  499.    or phrase that describes the size, purpose, and/or intended content
  500.    associated with the type. The base type is typically an abbreviation of
  501.    the structure name. The following list gives the base types for the
  502.    structures described in this manual:
  503.  
  504.    acc             fcdata          ptl
  505.    acct            fm              ptri
  506.    arcp            gradl           qmsq
  507.    bmi             hci             rcfx
  508.    bmp             hpga            rcl
  509.    btncd           ibmd            rgb
  510.    cbnd            krnpr           rgnrc
  511.    clsi            lbnd            sbcd
  512.    crst            matlf           sizfx
  513.    csri            mbhdr           sizl
  514.    ctchbf          mbnd            smhs
  515.    dde             mi              swctl
  516.    ddei            mqi             swent
  517.    dop             oi              swp
  518.    dlgt            pbnd            ti
  519.    dlgti           pib             ubtn
  520.    driv            proge           wprm
  521.    erri            progt           wywin
  522.    fat             ptfx
  523.  
  524.  1.3.2  Constant Names
  525.  
  526.    A constant name is a descriptive name for a numeric value used with an MS
  527.    OS/2 function. All constant names are written in uppercase letters and
  528.    have a prefix derived from the name of the function, object, or idea
  529.    associated with the constant. The prefix is followed by an underscore (_)
  530.    and the rest of the constant name, which indicates the meaning of the
  531.    constant and may specify a value, action, color, or condition. A few
  532.    common constants do not have prefixes──for example, NULL is used for null
  533.    pointers of all types, and TRUE and FALSE are used with the BOOL data
  534.    type.
  535.  
  536.  
  537.  1.4  Notational Conventions
  538.  
  539.    The following notational conventions are used throughout this manual:
  540.  
  541.    Convention      Meaning
  542.    ──────────────────────────────────────────────────────────────────────────
  543.    bold            Bold type is used for keywords──for example, the names of
  544.                    functions, data types, structures, and macros. These names
  545.                    are spelled exactly as they should appear in source
  546.                    programs.
  547.  
  548.    italics         Italic type is used to indicate the name of an argument;
  549.                    this name must be replaced by an actual argument. Italics
  550.                    are also used to show emphasis in text.
  551.  
  552.    this type       This type is used for example program-code fragments.
  553.    ──────────────────────────────────────────────────────────────────────────
  554.  
  555.  
  556.  
  557.  ────────────────────────────────────────────────────────────────────────────
  558.  Chapter 2  Functions Directory
  559.  
  560.         2.1     Introduction
  561.         2.2     Functions
  562.  
  563.  2.1  Introduction
  564.  
  565.    This chapter describes MS OS/2 Dev, Gpi, and Win functions. These
  566.    functions, also called MS OS/2 Presentation Manager functions, provide the
  567.    special Presentation Manager features of MS OS/2, such as windows, message
  568.    queues, and device-independent graphics. The Dev, Gpi, and Win functions
  569.    represent three distinct function groups. As described in the following
  570.    list, programs use these function groups to carry out specific tasks:
  571.  
  572. ╓┌─┌───────────┌─────────────────────────────────────────────────────────────╖
  573.    Function    Usage
  574.    group
  575.    ──────────────────────────────────────────────────────────────────────────
  576.    Dev         Use the Presentation Manager device (Dev) functions to open
  577.                and control Presentation Manager device drivers. These
  578.                functions let you create device contexts that you can
  579.                associate with a presentation space and use with the Gpi
  580.                functions to carry out device-independent graphics for
  581.                displays, printers, and plotters.
  582.  
  583.    Gpi         Use the graphics programming interface (Gpi) functions to
  584.                create graphics output for a display, printer, and other
  585.                output devices. The Gpi functions give you a full range of
  586.                graphics primitives, from lines to complex curves to bitmaps.
  587.                You choose the attributes for the primitives, such as color,
  588.                line width, and pattern, and then draw lines, text, and
  589.                shapes. The retained-graphics capability lets you save the
  590.    Function    Usage
  591.    group
  592.    ──────────────────────────────────────────────────────────────────────────
  593.               shapes. The retained-graphics capability lets you save the
  594.                drawing in segments and build complex pictures by drawing a
  595.                chain of segments.
  596.  
  597.    Win         Use the window-manager (Win) functions to create and manage
  598.                windows. Presentation Manager applications use windows as the
  599.                main interface with the user. The Win functions let you create
  600.                menus, scroll bars, and dialog windows that let the user
  601.                choose commands and supply input. Your application receives
  602.                all mouse and keyboard input as messages from the message
  603.                queue. The Win functions let you retrieve messages from the
  604.                queue and dispatch them to the window the input is intended
  605.                for.
  606.    ──────────────────────────────────────────────────────────────────────────
  607.  
  608.  
  609.    This chapter gives complete syntax, purpose, and parameter descriptions
  610.    for each function. Types, macros, and structures used by a function are
  611.    given with the function; these are described more fully in Chapter 4,
  612.    "Types, Macros, Structures." The numeric values for error values returned
  613.    by the functions are listed in Appendix A, "Error Values."
  614.  
  615.    Many of the function descriptions in this chapter include examples. The
  616.    examples show how to use the functions to accomplish simple tasks. In
  617.    nearly all cases, the examples are code fragments, not complete programs.
  618.    A code fragment is intended to show the context in which a function can be
  619.    used, but often assumes that variables, structures, and constants used in
  620.    the example have been defined and/or initialized. Also, a code fragment
  621.    may use comments to represent a task instead of giving the actual
  622.    statements.
  623.  
  624.    Although the examples are not complete, you can still use them in your
  625.    programs if you take the following steps:
  626.  
  627.    ■  Include the os2.h file in your program.
  628.  
  629.    ■  Define the appropriate include constants for the functions, structures,
  630.       and constants used in the example.
  631.  
  632.    ■  Define and initialize all variables.
  633.  
  634.    ■  Replace comments that represent tasks with appropriate statements.
  635.  
  636.    ■  Check return values for errors and take appropriate actions.
  637.  
  638.  
  639.  2.2  Functions
  640.  
  641.    The following is a complete list, in alphabetical order, of the MS OS/2
  642.    Dev, Gpi, and Win functions.
  643.  
  644.  ────────────────────────────────────────────────────────────────────────────
  645.  DevCloseDC
  646.  ────────────────────────────────────────────────────────────────────────────
  647.    HMF DevCloseDC (hdc)
  648.    HDC hdc;                /*device-context handle                         */
  649.  
  650.    The DevCloseDC function closes the specified device context. If the device
  651.    context is associated with a presentation space or was created by using
  652.    the WinOpenWindowDC function, an error occurs and the device context is
  653.    not closed. This function decrements the use count (by one) of processes
  654.    that have accessed the device context. The device context is deleted when
  655.    the use count reaches zero.
  656.  
  657.  Parameters
  658.  
  659.    hdc  Identifies the device context. An error results if this parameter
  660.    identifies a screen device context or is associated with a micro
  661.    presentation space.
  662.  
  663.  Return Value
  664.  
  665.    The return value is DEV_OK if the function is successful and the device
  666.    context is not a metafile device context. The return value is DEV_ERROR if
  667.    an error occurs. Any other return value indicates that the function closed
  668.    a metafile device context and returned its handle.
  669.  
  670.  See Also
  671.  
  672.    DevOpenDC, WinOpenWindowDC
  673.  
  674.  
  675.  ────────────────────────────────────────────────────────────────────────────
  676.  DevEscape
  677.  ────────────────────────────────────────────────────────────────────────────
  678.    LONG DevEscape (hdc, cmdCode, cbInData, pbInData, pcbOutData, pbOutData)
  679.    HDC hdc;                /*device-context handle                         */
  680.    LONG cmdCode;           /*escape function to perform                    */
  681.    LONG cbInData;          /*size of input buffer                          */
  682.    PBYTE pbInData;         /*pointer to input buffer                       */
  683.    PLONG pcbOutData;       /*pointer to buffer for number of bytes         */
  684.                            /*received                                      */
  685.    PBYTE pbOutData;        /*pointer to output buffer                      */
  686.  
  687.    The DevEscape function allows applications to access facilities of a
  688.    device not otherwise available through the applications programming
  689.    interface (API). Calls to escape functions are, in general, sent to the
  690.    device driver and must be understood by it.
  691.  
  692.  Parameters
  693.  
  694.    hdc  Identifies the device context.
  695.  
  696.    cmdCode  Specifies the escape function to perform. The following escape
  697.    functions are currently defined:
  698.  
  699.          DEVESC_QUERYESCSUPPORT
  700.          DEVESC_GETSCALINGFACTOR
  701.          DEVESC_STARTDOC
  702.          DEVESC_ENDDOC
  703.          DEVESC_NEXTBAND
  704.          DEVESC_ABORTDOC
  705.          DEVESC_NEWFRAME
  706.          DEVESC_DRAFTMODE
  707.          DEVESC_FLUSHOUTPUT
  708.          DEVESC_RAWDATA
  709.  
  710.    Devices can define additional escape functions by using other cmdCode
  711.    values in the following ranges:
  712.  
  713.    Range       Meaning
  714.    ──────────────────────────────────────────────────────────────────────────
  715.    32768-40959 Not stored in a metafile and not recorded (passed to the
  716.                device driver for PM_Q_STD).
  717.  
  718.    40960-49151 Stored in a metafile only (passed to the device driver for
  719.                PM_Q_STD).
  720.  
  721.    49152-57343 Stored in a metafile and recorded (not passed to the device
  722.                driver for PM_Q_STD).
  723.  
  724.    57344-65535 Recorded only (not passed to the device driver for PM_Q_STD).
  725.    ──────────────────────────────────────────────────────────────────────────
  726.  
  727.    cbInData  Specifies the number of bytes of data in the buffer pointed to
  728.    by the pbInData parameter.
  729.  
  730.    pbInData  Points to the buffer that contains the input data required for
  731.    the escape function.
  732.  
  733.    pcbOutData  Points to the buffer that receives the number of bytes of data
  734.    in the buffer pointed by the pbOutData parameter. If data is returned in
  735.    the pbOutData parameter, pcbOutData is updated to the number of bytes of
  736.    data returned.
  737.  
  738.    pbOutData  Points to the buffer that receives the output from this escape.
  739.    If this parameter is NULL, no data is returned.
  740.  
  741.  Return Value
  742.  
  743.    The return value is DEV_OK if the function is successful, DEVESC_ERROR if
  744.    an error occurs, or DEVESC_NOTIMPLEMENTED if the escape function is not
  745.    implemented for the specified code.
  746.  
  747.  Comments
  748.  
  749.    The standard escape functions, or escapes, are listed as follows, with the
  750.    contents of each DevEscape parameter:
  751.  
  752.    The DEVESC_QUERYESCSUPPORT escape determines whether the device driver has
  753.    implemented a particular escape. The return value gives the result. This
  754.    escape is not stored in a metafile or recorded.
  755.  
  756.    For DEVESC_QUERYESCSUPPORT, the DevEscape parameters contain the following
  757.    information:
  758.  
  759.    Parameter       Description
  760.    ──────────────────────────────────────────────────────────────────────────
  761.    cbInData        Specifies the number of bytes pointed to by the pbInData
  762.                    parameter.
  763.  
  764.    pbInData        Specifies the escape-code value of the escape function to
  765.                    be checked.
  766.  
  767.    pcbOutData      Not used; can be set to NULL.
  768.  
  769.    pbOutData       Not used; can be set to NULL.
  770.    ──────────────────────────────────────────────────────────────────────────
  771.  
  772.    The DEVESC_GETSCALINGFACTOR escape returns the scaling factors for the x
  773.    and y axes of a printing device. For each scaling factor, an exponent of
  774.    two is put in the pbOutData parameter. For example, the value 3 is used if
  775.    the scaling factor is 8. Scaling factors are used by devices that cannot
  776.    support graphics at the same resolution as the device resolution.
  777.  
  778.    For DEVESC_GETSCALINGFACTOR, the DevEscape parameters contain the
  779.    following information:
  780.  
  781.    Parameter       Description
  782.    ──────────────────────────────────────────────────────────────────────────
  783.    cbInData        Not used; can be set to zero.
  784.  
  785.    pbInData        Not used; can be set to NULL.
  786.  
  787.    pcbOutData      Points to the number of bytes of data pointed to by the
  788.                    pbOutData parameter. Upon return, this parameter is
  789.                    updated to the number of bytes returned.
  790.  
  791.    pbOutData       Points to the buffer that receives the output from this
  792.                    escape. A structure is returned that specifies the scaling
  793.                    factors for the x and y axes.
  794.    ──────────────────────────────────────────────────────────────────────────
  795.  
  796.    The DEVESC_STARTDOC escape allows an application to indicate that a new
  797.    print job is starting and that all subsequent calls to DEVESC_NEWFRAME
  798.    should be spooled under the same job, until DEVESC_ENDDOC is called. This
  799.    ensures that documents longer than one page are not interspersed with
  800.    other jobs.
  801.  
  802.    For DEVESC_STARTDOC, the DevEscape parameters contain the following
  803.    information:
  804.  
  805.    Parameter       Description
  806.    ──────────────────────────────────────────────────────────────────────────
  807.    cbInData        Specifies the number of bytes pointed to by the pbInData
  808.                    parameter.
  809.  
  810.    pbInData        Points to the null-terminated ASCII string that specifies
  811.                    the name of the document.
  812.  
  813.    pcbOutData      Not used; can be set to NULL.
  814.  
  815.    pbOutData       Not used; can be set to NULL.
  816.    ──────────────────────────────────────────────────────────────────────────
  817.  
  818.    The DEVESC_ENDDOC escape ends a print job started by the DEVESC_STARTDOC
  819.    escape.
  820.  
  821.    For DEVESC_ENDDOC, the DevEscape parameters contain the following
  822.    information:
  823.  
  824.    Parameter       Description
  825.    ──────────────────────────────────────────────────────────────────────────
  826.    cbInData        Not used; can be set to zero.
  827.  
  828.    pbInData        Not used; can be set to NULL.
  829.  
  830.    pcbOutData      Points to the buffer that specifies the number of
  831.                    characters in the string pointed to by the pbOutData
  832.                    parameter. This parameter should be NULL if the number of
  833.                    characters is zero.
  834.  
  835.    pbOutData       Points to the USHORT value that specifies the job
  836.                    identifier if a spooler print job was created.
  837.    ──────────────────────────────────────────────────────────────────────────
  838.  
  839.    The DEVESC_NEXTBAND escape allows an application to signal that it has
  840.    finished writing to a "band," or rectangle. The coordinates of the next
  841.    band are returned. This escape is used by applications that perform handle
  842.    banding ("for-printing") themselves.
  843.  
  844.    For DEVESC_NEXTBAND, the DevEscape parameters contain the following
  845.    information:
  846.  
  847.    Parameter       Description
  848.    ──────────────────────────────────────────────────────────────────────────
  849.    cbInData        Not used; can be set to zero.
  850.  
  851.    pbInData        Not used; can be set to NULL.
  852.  
  853.    pcbOutData      Points to the number of bytes of data pointed to by the
  854.                    pbOutData parameter. Upon return, the escape updates this
  855.                    parameter to the number of bytes returned.
  856.  
  857.    pbOutData       Points to the address of the buffer that receives the
  858.                    output from this escape. A structure is returned that
  859.                    specifies the device coordinates of the next band, which
  860.                    is a rectangle.
  861.    ──────────────────────────────────────────────────────────────────────────
  862.  
  863.    The DEVESC_ABORTDOC escape stops the current job, erasing everything
  864.    written by the application to the device since the DEVESC_ENDDOC escape
  865.    was called.
  866.  
  867.    For DEVESC_ABORTDOC, the DevEscape parameters contain the following
  868.    information:
  869.  
  870.    Parameter       Description
  871.    ──────────────────────────────────────────────────────────────────────────
  872.    cbInData        Not used; can be set to zero.
  873.  
  874.    pbInData        Not used; can be set to NULL.
  875.  
  876.    pcbOutData      Not used; can be set to NULL.
  877.  
  878.    pbOutData       Not used; can be set to NULL.
  879.    ──────────────────────────────────────────────────────────────────────────
  880.  
  881.    The DEVESC_NEWFRAME escape allows an application to signal when it has
  882.    finished writing to a page. You usually use this escape with a printer
  883.    device to advance to a new page. Calling this escape, which is similar to
  884.    processing the GpiErase function for a screen device context, resets the
  885.    screen attributes.
  886.  
  887.    For DEVESC_NEWFRAME, the DevEscape parameters contain the following
  888.    information:
  889.  
  890.    Parameter       Description
  891.    ──────────────────────────────────────────────────────────────────────────
  892.    cbInData        Not used; can be set to zero.
  893.  
  894.    pbInData        Not used; can be set to NULL.
  895.  
  896.    pcbOutData      Not used; can be set to NULL.
  897.  
  898.    pbOutData       Not used; can be set to NULL.
  899.    ──────────────────────────────────────────────────────────────────────────
  900.  
  901.    The DEVESC_DRAFTMODE escape turns draft mode on or off. Turning draft mode
  902.    on instructs the device driver to print faster and with lower quality. You
  903.    can change the draft mode only at page boundaries──for example, after a
  904.    call to the DEVESC_NEWFRAME escape.
  905.  
  906.    For DEVESC_DRAFTMODE, the DevEscape parameters contain the following
  907.    information:
  908.  
  909.    Parameter       Description
  910.    ──────────────────────────────────────────────────────────────────────────
  911.    cbInData        Specifies the number of bytes pointed to by the pbInData
  912.                    parameter.
  913.  
  914.    pbInData        Points to the SHORT value that specifies the draft mode; 1
  915.                    for on, 0 for off.
  916.  
  917.    pcbOutData      Not used; can be set to NULL.
  918.  
  919.    pbOutData       Not used; can be set to NULL.
  920.    ──────────────────────────────────────────────────────────────────────────
  921.  
  922.    The DEVESC_FLUSHOUTPUT escape removes any output from the device buffer.
  923.  
  924.    For DEVESC_FLUSHOUTPUT, the DevEscape parameters contain the following
  925.    information:
  926.  
  927.    Parameter       Description
  928.    ──────────────────────────────────────────────────────────────────────────
  929.    cbInData        Not used; can be set to zero.
  930.  
  931.    pbInData        Not used; can be set to NULL.
  932.  
  933.    pcbOutData      Not used; can be set to NULL.
  934.  
  935.    pbOutData       Not used; can be set to NULL.
  936.    ──────────────────────────────────────────────────────────────────────────
  937.  
  938.    The DEVESC_RAWDATA escape allows an application to send "raw," or binary,
  939.    data directly to a device driver. For example, in the case of a printer
  940.    device driver, the data could be a stream of printer data.
  941.  
  942.    If binary data is mixed with other data──for example, Gpi data──being sent
  943.    to the same page of a device context, the results are unpredictable and
  944.    depend upon the action taken by the Presentation Manager device driver,
  945.    which, might even ignore the Gpi data completely. In general, you should
  946.    send binary data either to a separate page, using the DEVESC_NEWFRAME
  947.    escape to obtain a new page, or to a separate document, using the
  948.    DEVESC_STARTDOC and DEVESC_ENDDOC escapes to create a new document.
  949.  
  950.    For DEVESC_RAWDATA, the DevEscape parameters contain the following
  951.    information:
  952.  
  953.    Parameter       Description
  954.    ──────────────────────────────────────────────────────────────────────────
  955.    cbInData        Specifies the number of bytes pointed to by the pbInData
  956.                    parameter.
  957.  
  958.    pbInData        Points to the binary data.
  959.  
  960.    pcbOutData      Not used; can be set to NULL.
  961.  
  962.    pbOutData       Not used; can be set to NULL.
  963.    ──────────────────────────────────────────────────────────────────────────
  964.  
  965.  See Also
  966.  
  967.    GpiErase
  968.  
  969.  
  970.  ────────────────────────────────────────────────────────────────────────────
  971.  DevOpenDC
  972.  ────────────────────────────────────────────────────────────────────────────
  973.    HDC DevOpenDC (hab, type, pszToken, count, pbData, hdcComp)
  974.    HAB hab;                /*anchor-block handle                           */
  975.    LONG type;              /*type of device context                        */
  976.    PSZ pszToken;           /*pointer to device-information token           */
  977.    LONG count;             /*number of elements in structure               */
  978.    PDEVOPENDATA pbData;    /*pointer to structure for device context       */
  979.    HDC hdcComp;            /*handle of compatible device context           */
  980.  
  981.    The DevOpenDC function creates a device context. This function initializes
  982.    the use count (to one) of the number of processes that have access to the
  983.    device context.
  984.  
  985.  Parameters
  986.  
  987.    hab  Identifies the anchor block.
  988.  
  989.    type  Specifies the type of device context; it can be one of the
  990.    following:
  991.  
  992.    Value           Meaning
  993.    ──────────────────────────────────────────────────────────────────────────
  994.    OD_QUEUED       A device, such as a printer or plotter, for which to queue
  995.                    output.
  996.  
  997.    OD_DIRECT       A device, such as a printer or plotter, for which to not
  998.                    queue output.
  999.  
  1000.    OD_INFO         Same as for OD_DIRECT, but used only to retrieve
  1001.                    information (for example, font metrics). You can draw to a
  1002.                    presentation space associated with such a device context,
  1003.                    but you cannot update any output.
  1004.  
  1005.    OD_METAFILE     A device context that is used to draw a metafile. The
  1006.                    graphics field defines the area of interest within the
  1007.                    metafile picture.
  1008.  
  1009.    OD_MEMORY       A device context that is used to contain a bitmap.
  1010.    ──────────────────────────────────────────────────────────────────────────
  1011.  
  1012.    pszToken  Points to the null-terminated string that contains the
  1013.    device-information token. This device information, which is held in the
  1014.    os2.ini file, is the same as that which may be pointed to by the pbData
  1015.    parameter; any information obtained from pbData overrides the information
  1016.    obtained by using this parameter. If you specify an asterisk (*) for
  1017.    pszToken, no device information is taken from the os2.ini file. MS OS/2
  1018.    version 1.1 acts as if "*" is specified but allows you to specify any
  1019.    string.
  1020.  
  1021.    count  Specifies the number of elements in the structure pointed to by the
  1022.    pbData parameter. This number may be less than the number of items in the
  1023.    full list if omitted items are irrelevant or are supplied from the
  1024.    pszToken parameter or elsewhere.
  1025.  
  1026.    pbData  Points to a data area that describes the output device. This area
  1027.    can be either an array of pointers or a DEVOPENSTRUC structure, which has
  1028.    the following form:
  1029.  
  1030.    typedef struct _DEVOPENSTRUC {
  1031.        PSZ        pszLogAddress;
  1032.        PSZ        pszDriverName;
  1033.        PDRIVDATA  pdriv;
  1034.        PSZ        pszDataType;
  1035.        PSZ        pszComment;
  1036.        PSZ        pszQueueProcName;
  1037.        PSZ        pszQueueProcParams;
  1038.        PSZ        pszSpoolerParams;
  1039.        PSZ        pszNetworkParams;
  1040.    } DEVOPENSTRUC;
  1041.  
  1042.    For a full description, see Chapter 4, "Types, Macros, Structures."
  1043.  
  1044.    hdcComp  Identifies the compatible device context. When the type parameter
  1045.    is OD_MEMORY, this parameter identifies a device context that is
  1046.    compatible with the bitmaps to be used with it. If you do not supply this
  1047.    parameter or if it is NULL, the device context that MS OS/2 opens is
  1048.    compatible with the screen.
  1049.  
  1050.  Return Value
  1051.  
  1052.    The return value identifies the device context if the function is
  1053.    successful. The return value is DEV_ERROR if an error occurs.
  1054.  
  1055.  
  1056.  ────────────────────────────────────────────────────────────────────────────
  1057.  DevPostDeviceModes
  1058.  ────────────────────────────────────────────────────────────────────────────
  1059.    LONG DevPostDeviceModes (hab, pbDriverData, pszDriverName, achDeviceName,
  1060.    pszLogAddr)
  1061.    HAB hab;                /*anchor-block handle                           */
  1062.    PDRIVDATA pbDriverData; /*pointer to buffer for data                    */
  1063.    PSZ pszDriverName;      /*pointer to string for driver name             */
  1064.    PSZ achDeviceName;      /*pointer to device name                        */
  1065.    PSZ pszLogAddr;         /*pointer to string for name of output device   */
  1066.  
  1067.    The DevPostDeviceModes function causes a device driver to post a dialog
  1068.    box that allows the user to set options for the device──for example,
  1069.    resolution, font cartridges, and so forth.
  1070.  
  1071.    The application can call this function first with a NULL data pointer to
  1072.    find out how much storage is needed for the data buffer. Having allocated
  1073.    the storage, the application can then call the function a second time in
  1074.    order to have the buffer filled with data.
  1075.  
  1076.    Once the data has been returned, you can pass it to the DevOpenDC function
  1077.    as the buffer data pointed to by the pbDriverData parameter.
  1078.  
  1079.  Parameters
  1080.  
  1081.    hab  Identifies the anchor block.
  1082.  
  1083.    pbDriverData  Points to the data buffer that receives device data defined
  1084.    by the driver. If this parameter is NULL, the function returns the
  1085.    required size of the buffer. The format of the data is the same as for the
  1086.    pbData parameter of the DevOpenDC function.
  1087.  
  1088.    pszDriverName  Points to the null-terminated string that contains the name
  1089.    of the device driver.
  1090.  
  1091.    achDeviceName  Points to a null-terminated string that identifies the
  1092.    particular device (model number, etc.). This string must not exceed 32
  1093.    bytes. Valid names are defined by device drivers.
  1094.  
  1095.    pszLogAddr  Points to the null-terminated string that contains the logical
  1096.    address of the output device──for example, LPT1.
  1097.  
  1098.  Return Value
  1099.  
  1100.    The return value if the pbDriverData parameter is NULL is the size (in
  1101.    bytes) required for the data buffer, DPDM_NONE if there are no options
  1102.    that can be set, or DPDM_ERROR if an error occurs.
  1103.  
  1104.    The return value if pbDriverData is not NULL is DEV_OK if the function is
  1105.    successful, DPDM_NONE if there is no device mode, or DPDM_ERROR if an
  1106.    error occurs.
  1107.  
  1108.  See Also
  1109.  
  1110.    DevOpenDC
  1111.  
  1112.  
  1113.  ────────────────────────────────────────────────────────────────────────────
  1114.  DevQueryCaps
  1115.  ────────────────────────────────────────────────────────────────────────────
  1116.    BOOL DevQueryCaps (hdc, lStartitem, cItems, alItems)
  1117.    HDC hdc;                /*device-context handle                         */
  1118.    LONG lStartitem;        /*first item to retrieve                        */
  1119.    LONG cItems;            /*number of items to retrieve                   */
  1120.    PLONG alItems;          /*array for device characteristics              */
  1121.  
  1122.    The DevQueryCaps function queries the characteristics of the specified
  1123.    device.
  1124.  
  1125.  Parameters
  1126.  
  1127.    hdc  Identifies the device context.
  1128.  
  1129.    lStartitem  Specifies the first item of information to retrieve.
  1130.  
  1131.    cItems  Specifies the number of items of information to retrieve.
  1132.  
  1133.    alItems  Points to an array of device characteristics, starting with the
  1134.    item specified by the lStartitem parameter. For more information about
  1135.    device characteristics, see Appendix B, "Device Capabilities."
  1136.  
  1137.  Return Value
  1138.  
  1139.    The return value is TRUE if the function is successful or FALSE if an
  1140.    error occurs.
  1141.  
  1142.  See Also
  1143.  
  1144.    DevOpenDC
  1145.  
  1146.  
  1147.  ────────────────────────────────────────────────────────────────────────────
  1148.  DevQueryDeviceNames
  1149.  ────────────────────────────────────────────────────────────────────────────
  1150.    BOOL DevQueryDeviceNames (hab, pszDriverName, pcMaxNames, achDeviceName,
  1151.    achDeviceDesc, pcMaxDataTypes, achDataType)
  1152.    HAB hab;                /*anchor-block handle                           */
  1153.    PSZ pszDriverName;      /*pointer to string for device name             */
  1154.    PLONG pcMaxNames;       /*maximum number of device drivers              */
  1155.    PSTR32 achDeviceName;   /*pointer to array of device names              */
  1156.    PSTR64 achDeviceDesc;   /*pointer to array of device descriptions       */
  1157.    PLONG pcMaxDataTypes;   /*maximum number of data types                  */
  1158.    PSTR16 achDataType;     /*pointer to array of data types                */
  1159.  
  1160.    The DevQueryDeviceNames function returns the device names, descriptions,
  1161.    and data types supported by the specified device driver.
  1162.  
  1163.    The application can call the function first with the pcMaxNames and
  1164.    pcMaxDataTypes parameters set to zero in order to find how much storage is
  1165.    needed for the data buffers. Having allocated the storage, the application
  1166.    then calls the function a second time in order to have the buffers filled
  1167.    with data for the data to be filled in.
  1168.  
  1169.  Parameters
  1170.  
  1171.    hab  Identifies the anchor block.
  1172.  
  1173.    pszDriverName  Points to the null-terminated string that contains the name
  1174.    of the device driver.
  1175.  
  1176.    pcMaxNames  Points to the maximum number of device names and descriptions
  1177.    that can be returned. If this parameter is zero, the number of device
  1178.    names and descriptions supported is returned and the arrays pointed to by
  1179.    the achDeviceName and achDeviceDesc parameters are not updated. If this
  1180.    parameter is nonzero, then its value is updated to the number returned in
  1181.    the arrays pointed to by achDeviceName and achDeviceDesc and the arrays
  1182.    are updated.
  1183.  
  1184.    achDeviceName  Points to an array of null-terminated strings, each element
  1185.    of which identifies a particular device (for example, model number). Valid
  1186.    names are defined by device drivers. IBM4201 is an example of a device
  1187.    name.
  1188.  
  1189.    achDeviceDesc  Points to an array of null-terminated strings, each element
  1190.    of which is a description of a particular device (for example, model
  1191.    name). Valid names are defined by device drivers. IBM 4201 Proprinter is
  1192.    an example of a device description.
  1193.  
  1194.    pcMaxDataTypes  Points to the maximum number of data types that can be
  1195.    returned. If this parameter is zero, the number of data types supported is
  1196.    returned and the array pointed to by the achDataType parameter is not
  1197.    updated. If this parameter is nonzero, then its value is updated to the
  1198.    number returned and the array is updated.
  1199.  
  1200.    achDataType  Points to an array of null-terminated strings, each element
  1201.    of which identifies a data type. Valid data types are defined by device
  1202.    drivers. PM_Q_STD is an example of a data type.
  1203.  
  1204.  Return Value
  1205.  
  1206.    The return value is TRUE if the function is successful or FALSE if an
  1207.    error occurs.
  1208.  
  1209.  
  1210.  ────────────────────────────────────────────────────────────────────────────
  1211.  DevQueryHardcopyCaps
  1212.  ────────────────────────────────────────────────────────────────────────────
  1213.    LONG DevQueryHardcopyCaps (hdc, iStartForm, cForms, phci)
  1214.    HDC hdc;                /*device-context handle                         */
  1215.    LONG iStartForm;        /*index of form code to start from              */
  1216.    LONG cForms;            /*number of forms to query                      */
  1217.    PHCINFO phci;           /*pointer to structure for results              */
  1218.  
  1219.    The DevQueryHardcopyCaps function returns information about the hardcopy
  1220.    capabilities of a device.
  1221.  
  1222.    You can use the iStartForm and cForms parameters together to enumerate all
  1223.    available form codes without having to allocate a buffer large enough to
  1224.    hold information on them all.
  1225.  
  1226.  Parameters
  1227.  
  1228.    hdc  Identifies the device context.
  1229.  
  1230.    iStartForm  Specifies the index of the form code from which to start the
  1231.    query. The first form code is specified by the value 0.
  1232.  
  1233.    cForms  Specifies the number of forms to query.
  1234.  
  1235.    phci  Points to the buffer that contains the results of the query. The
  1236.    result consists of cForms copies of the HCINFO structure. The HCINFO
  1237.    structure has the following form:
  1238.  
  1239.    typedef struct _HCINFO {
  1240.        CHAR szFormname[32];
  1241.        LONG cx;
  1242.        LONG cy;
  1243.        LONG xLeftClip;
  1244.        LONG yBottomClip;
  1245.        LONG xRightClip;
  1246.        LONG yTopClip;
  1247.        LONG xPels;
  1248.        LONG yPels;
  1249.        LONG flAttributes;
  1250.    } HCINFO;
  1251.  
  1252.    For a full description, see Chapter 4, "Types, Macros, Structures."
  1253.  
  1254.  Return Value
  1255.  
  1256.    If there are five form codes defined and the iStartForm parameter is 2 and
  1257.    the cForms parameter is 3, a query is performed for form codes 2, 3, and 4
  1258.    and the result is returned in the buffer pointed to by the phci parameter.
  1259.  
  1260.    The return value if cForms is zero is the number of available forms, or if
  1261.    cForms is nonzero, the number of forms returned. The return value is
  1262.    DQHC_ERROR if an error occurs.
  1263.  
  1264.  ────────────────────────────────────────────────────────────────────────────
  1265.  GpiAssociate
  1266.  ────────────────────────────────────────────────────────────────────────────
  1267.    BOOL GpiAssociate (hps, hdc)
  1268.    HPS hps;                /*presentation-space handle                     */
  1269.    HDC hdc;                /*device-context handle                         */
  1270.  
  1271.    The GpiAssociate function associates a presentation space with a device
  1272.    context and resets the presentation space. Once a device context is
  1273.    associated with a presentation space, all subsequent drawing in the
  1274.    presentation space is copied to the device.
  1275.  
  1276.    Only one device context can be associated with a presentation space at a
  1277.    time. GpiAssociate cannot associate a new device context with a
  1278.    presentation space until the current device context is released. The
  1279.    function releases the current device context from the presentation space
  1280.    if hdc is NULL.
  1281.  
  1282.  Parameters
  1283.  
  1284.    hps  Identifies a normal presentation space. Micro and cached presentation
  1285.    spaces cannot be used.
  1286.  
  1287.    hdc  Identifies the device context. Although any type of device context
  1288.    may be used, the device context must not be already associated with a
  1289.    presentation space.
  1290.  
  1291.  Return Value
  1292.  
  1293.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  1294.    an error occurred.
  1295.  
  1296.  Errors
  1297.  
  1298.    Use the WinGetLastError function to retrieve the error value, which may be
  1299.    one of the following:
  1300.  
  1301.          PMERR_DC_IS_ASSOCIATED
  1302.          PMERR_INV_MICROPS_FUNCTION
  1303.          PMERR_PS_IS_ASSOCIATED
  1304.  
  1305.  Comments
  1306.  
  1307.    When GpiAssociate resets the presentation space, it sets all attributes to
  1308.    their default values, sets the model transform to unity, sets the current
  1309.    position to (0,0), closes any open path, area, or element brackets, closes
  1310.    any open segment, removes any clip path, viewing limits and clip region,
  1311.    and enables kerning if the device supports kerning.
  1312.  
  1313.    The GpiCreatePS function can also be used to associate a device context
  1314.    with a new presentation space.
  1315.  
  1316.  Example
  1317.  
  1318.    This example releases the current device context and associates a new
  1319.    device context with the presentation space.
  1320.  
  1321.    HPS hps;
  1322.    HDC hdcPrinter;
  1323.    GpiAssociate(hps, NULL);       /* release the current device context */
  1324.    GpiAssociate(hps, hdcPrinter); /* associate a printer device context */
  1325.  
  1326.  See Also
  1327.  
  1328.    GpiCreatePS, GpiResetPS
  1329.  
  1330.  
  1331.  ────────────────────────────────────────────────────────────────────────────
  1332.  GpiBeginArea
  1333.  ────────────────────────────────────────────────────────────────────────────
  1334.    BOOL GpiBeginArea (hps, flOptions)
  1335.    HPS hps;                /*presentation-space handle                     */
  1336.    ULONG flOptions;        /*area-option flag                              */
  1337.  
  1338.    The GpiBeginArea function starts an area bracket, that is, it starts a
  1339.    sequence of functions that define the shape of an area. All subsequent
  1340.    drawing functions, up to the next GpiEndArea function, apply to the new
  1341.    area. The flOptions parameter specifies whether the figures in the area
  1342.    have boundary lines and which filling mode to use for constructing the
  1343.    interior of the area.
  1344.  
  1345.  Parameters
  1346.  
  1347.    hps  Identifies the presentation space.
  1348.  
  1349.    flOptions  Specifies the area options. It can be any combination of the
  1350.    following values:
  1351.  
  1352.    Value               Meaning
  1353.    ──────────────────────────────────────────────────────────────────────────
  1354.    BA_ALTERNATE        Constructs the interior in alternate mode (default).
  1355.  
  1356.    BA_BOUNDARY         Boundary lines are drawn.
  1357.  
  1358.    BA_NOBOUNDARY       Boundary lines are not drawn (default).
  1359.  
  1360.    BA_WINDING          Constructs the interior in winding mode.
  1361.    ──────────────────────────────────────────────────────────────────────────
  1362.  
  1363.  Return Value
  1364.  
  1365.    The return value is GPI_OK or GPI_HITS if the function is successful (it
  1366.    is GPI_HITS if the detectable attribute is set for the presentation space
  1367.    and a correlation hit occurs). The return value is GPI_ERROR if an error
  1368.    occurred.
  1369.  
  1370.  Errors
  1371.  
  1372.    Use the WinGetLastError function to retrieve the error value, which may be
  1373.    one of the following:
  1374.  
  1375.          PMERR_ALREADY_IN_AREA
  1376.          PMERR_INV_AREA_CONTROL
  1377.          PMERR_INV_IN_PATH
  1378.  
  1379.  Example
  1380.  
  1381.    This example uses the GpiBeginArea function to draw an area. The area, an
  1382.    isosceles triangle, is drawn with boundary lines and filled using the
  1383.    alternate filling mode.
  1384.  
  1385.    HPS hps;
  1386.    POINTL ptlStart = { 0, 0 };
  1387.    POINTL ptlTriangle[] = { 100, 100, 200, 0, 0, 0 };
  1388.    GpiMove(hps, &ptlStart);    /* move to starting point (0, 0)     */
  1389.    GpiBeginArea(hps,           /* start the area bracket            */
  1390.        BA_BOUNDARY |           /* draw boundary lines               */
  1391.        BA_ALTERNATE);          /* fill interior with alternate mode */
  1392.    GpiPolyLine(hps, 3L, ptlTriangle);       /* draw the triangle    */
  1393.    GpiEndArea(hps);                         /* end the area bracket */
  1394.                                             /* and fill the area    */
  1395.  
  1396.  See Also
  1397.  
  1398.    GpiEndArea
  1399.  
  1400.  
  1401.  ────────────────────────────────────────────────────────────────────────────
  1402.  GpiBeginElement
  1403.  ────────────────────────────────────────────────────────────────────────────
  1404.    BOOL GpiBeginElement (hps, lType, pszDesc)
  1405.    HPS hps;                /*presentation-space handle                     */
  1406.    LONG lType;             /*element type                                  */
  1407.    PSZ pszDesc;            /*pointer to element description                */
  1408.  
  1409.    The GpiBeginElement function starts an element bracket, that is, a
  1410.    sequence of functions that define the contents of an element. All
  1411.    subsequent graphics functions, up to the next GpiEndElement or
  1412.    GpiCloseSegment function, apply to the new element.
  1413.  
  1414.    The GpiBeginElement may only be used while creating a segment. The element
  1415.    type and element description, specified by the lType and pszDesc
  1416.    parameters, are values that the application supplies to distinguish one
  1417.    element from another within a segment.
  1418.  
  1419.  Parameters
  1420.  
  1421.    hps  Identifies the presentation space.
  1422.  
  1423.    lType  Specifies the element type. It can be any integer value.
  1424.  
  1425.    pszDesc  Points to a null-terminated string. If no description is needed,
  1426.    it may point to an empty string.
  1427.  
  1428.  Return Value
  1429.  
  1430.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  1431.    an error occurred.
  1432.  
  1433.  Errors
  1434.  
  1435.    Use the WinGetLastError function to retrieve the error value, which may be
  1436.    one of the following:
  1437.  
  1438.          PMERR_ALREADY_IN_ELEMENT
  1439.          PMERR_INV_MICROPS_FUNCTION
  1440.  
  1441.  Comments
  1442.  
  1443.    The GpiBeginElement function cannot be used within an element bracket.
  1444.  
  1445.  Example
  1446.  
  1447.    This example uses the GpiBeginElement function to create an element in a
  1448.    segment. The element type is 1 and the element description is "Triangle".
  1449.    The application can use these later to identify the element.
  1450.  
  1451.    POINTL ptlStart = { 0, 0 };
  1452.    POINTL ptlTriangle[] = { 100, 100, 200, 0, 0, 0 };
  1453.    GpiBeginElement(hps,                   /* start element bracket      */
  1454.        1L,                                /* element type is 1          */
  1455.        "Triangle");                       /* element description        */
  1456.    GpiMove(hps, &ptlStart);               /* move to start point (0, 0) */
  1457.    GpiPolyLine(hps, 3L, ptlTriangle);     /* draw triangle              */
  1458.    GpiEndElement(hps);                    /* end element bracket        */
  1459.  
  1460.  See Also
  1461.  
  1462.    GpiCloseSegment, GpiDeleteElement, GpiEndElement, GpiQueryElement,
  1463.    GpiQueryElementPointer, GpiSetElementPointer
  1464.  
  1465.  
  1466.  ────────────────────────────────────────────────────────────────────────────
  1467.  GpiBeginPath
  1468.  ────────────────────────────────────────────────────────────────────────────
  1469.    BOOL GpiBeginPath (hps, idPath)
  1470.    HPS hps;                /*presentation-space handle                     */
  1471.    LONG idPath;            /*path identifier                               */
  1472.  
  1473.    The GpiBeginPath function starts a path bracket, that is, starts a
  1474.    sequence of functions that define the shape and size of a path.
  1475.    GpiBeginPath sets the path identifier and initializes the path, clearing
  1476.    any path created previously with this identifier. All subsequent drawing
  1477.    functions, up to the next GpiEndPath function, apply to the new path.
  1478.  
  1479.  Parameters
  1480.  
  1481.    hps  Identifies the presentation space.
  1482.  
  1483.    idPath  Specifies the path identifier; for MS OS/2 version 1.1, it must be
  1484.    1.
  1485.  
  1486.  Return Value
  1487.  
  1488.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  1489.    an error occurred.
  1490.  
  1491.  Errors
  1492.  
  1493.    Use the WinGetLastError function to retrieve the error value, which may be
  1494.    one of the following:
  1495.  
  1496.          PMERR_ALREADY_IN_PATH
  1497.          PMERR_INV_PATH_ID
  1498.  
  1499.  Comments
  1500.  
  1501.    Since there is a limit to the size of a path, any line or curve drawing
  1502.    function within a path bracket that would exceed the limit returns the
  1503.    PMERR_PATH_TOO_BIG error value.
  1504.  
  1505.  Example
  1506.  
  1507.    This example uses the GpiBeginPath function to create a path. The path, an
  1508.    isosceles triangle, is given path identifier 1. After the path bracket is
  1509.    ended using GpiEndPath, a subsequent call to the GpiFillPath function
  1510.    draws and fills the path.
  1511.  
  1512.    HPS hps;
  1513.    POINTL ptlStart = { 0, 0 };
  1514.    POINTL ptlTriangle[] = { 100, 100, 200, 0 };
  1515.    GpiBeginPath(hps, 1L);                  /* start the path bracket */
  1516.    GpiMove(hps, &ptlStart);                /* move to starting point */
  1517.    GpiPolyLine(hps, 2L, ptlTriangle);      /* draw the three sides   */
  1518.    GpiCloseFigure(hps);                    /* close the triangle     */
  1519.    GpiEndPath(hps);                        /* end the path bracket   */
  1520.    GpiFillPath(hps, 1L, FPATH_ALTERNATE);  /* draw and fill the path */
  1521.  
  1522.  See Also
  1523.  
  1524.    GpiCloseFigure, GpiEndPath, GpiFillPath, GpiModifyPath,
  1525.    GpiSetClipPath, GpiSetLineWidthGeom, GpiStrokePath
  1526.  
  1527.  
  1528.  ────────────────────────────────────────────────────────────────────────────
  1529.  GpiBitBlt
  1530.  ────────────────────────────────────────────────────────────────────────────
  1531.    LONG GpiBitBlt (hpsTarg, hpsSrc, cPoints, aptl, lRop, flOptions)
  1532.    HPS hpsTarg;            /*target presentation-space handle              */
  1533.    HPS hpsSrc;             /*source presentation-space handle              */
  1534.    LONG cPoints;           /*number of points in array                     */
  1535.    PPOINTL aptl;           /*pointer to array                              */
  1536.    LONG lRop;              /*mixing method                                 */
  1537.    ULONG flOptions;        /*line/column-compression flag                  */
  1538.  
  1539.    The GpiBitBlt function copies a bitmap from one presentation space to
  1540.    another. It can also modify the bitmap within a rectangle in a
  1541.    presentation space. The exact operation carried out by GpiBitBlt depends
  1542.    on the raster operation specified by the lRop parameter.
  1543.  
  1544.    If lRop directs GpiBitBlt to copy a bitmap, the function copies the bitmap
  1545.    from a source presentation space specified by hpsSrc to a target
  1546.    presentation space specified by hpsTarg. Each presentation space must be
  1547.    associated with a device context for the display, for memory, or for some
  1548.    other suitable raster device. The target and source presentation spaces
  1549.    can be the same if desired. The aptl parameter points to an array of
  1550.    points that specify the corners of a rectangle containing the bitmap in
  1551.    the source presentation space as well as the corners of the rectangle in
  1552.    the target presentation space to receive the bitmap. If the source and
  1553.    target rectangles are not the same, GpiBitBlt stretches or compresses the
  1554.    bitmap to fit the target rectangle.
  1555.  
  1556.    If lRop directs GpiBitBlt to modify a bitmap, the function uses the raster
  1557.    operation to determine how to alter the bits in a rectangle in the target
  1558.    presentation space. Raster operations include changes such as inverting
  1559.    target bits, replacing target bits with pattern bits, and mixing target
  1560.    and pattern bits to create new colors. For some raster operations, the
  1561.    function mixes the bits of a bitmap from a source presentation space with
  1562.    the target and/or pattern bits.
  1563.  
  1564.  Parameters
  1565.  
  1566.    hpsTarg  Identifies the target presentation space.
  1567.  
  1568.    hpsSrc  Identifies the source presentation space.
  1569.  
  1570.    cPoints  Specifies the number of points pointed to by the aptl parameter.
  1571.    It may be one of the following values:
  1572.  
  1573.    Value   Meaning
  1574.    ──────────────────────────────────────────────────────────────────────────
  1575.    2       The points specify the lower-left and upper-right corners of the
  1576.            target rectangle. If 2 is given, the raster operation specified by
  1577.            the lRop parameter must not include a source.
  1578.  
  1579.    3       The points specify the lower-left and upper-right corners of the
  1580.            target rectangle, and the lower-left corner of the source
  1581.            rectangle. The upper-right corner of the source rectangle is
  1582.            computed such that the target and source rectangles have equal
  1583.            width and height. Any raster operation may be used. If the
  1584.            operation does not include a source, the third point is ignored.
  1585.  
  1586.    4       The points specify the lower-left and upper-right corners of the
  1587.            target and the source rectangles. If the rectangles do not have
  1588.            equal width and height, the source bitmap is stretched or
  1589.            compressed to fit the target rectangle. GpiBitBlt uses the
  1590.            flOptions parameter to determine how the bitmap should be
  1591.            compressed. If the raster operation does not include a source, the
  1592.            source coordinates are ignored.
  1593.    ──────────────────────────────────────────────────────────────────────────
  1594.  
  1595.    aptl  Points to an array of POINTL structures containing the number of
  1596.    points specified in the cPoints parameter. The points must be given in the
  1597.    following order:
  1598.  
  1599.    Element index       Coordinate
  1600.    ──────────────────────────────────────────────────────────────────────────
  1601.    0                   Specifies the lower-left corner of the target
  1602.                        rectangle.
  1603.  
  1604.    1                   Specifies the upper-right corner of the target
  1605.                        rectangle.
  1606.  
  1607.    2                   Specifies the lower-left corner of the source
  1608.                        rectangle.
  1609.  
  1610.    3                   Specifies the upper-right corner of the source
  1611.                        rectangle.
  1612.    ──────────────────────────────────────────────────────────────────────────
  1613.  
  1614.    All points must be in device coordinates. The POINTL structure has the
  1615.    following form:
  1616.  
  1617.    typedef struct _POINTL  {
  1618.        LONG  x;
  1619.        LONG  y;
  1620.    } POINTL;
  1621.  
  1622.    For a full description, see Chapter 4, "Types, Macros, Structures."
  1623.  
  1624.    lRop  Specifies the raster operation for the function. It can be any value
  1625.    in the range 0 through 255 or one of the following values, which represent
  1626.    common raster operations:
  1627.  
  1628. ╓┌─┌───────────────────┌─────────────────────────────────────────────────────╖
  1629.    Value               Meaning
  1630.    ──────────────────────────────────────────────────────────────────────────
  1631.    ROP_DSTINVERT       Inverts the target.
  1632.  
  1633.    ROP_MERGECOPY       Combines the source and the pattern using the bitwise
  1634.                        AND operator.
  1635.  
  1636.    ROP_MERGEPAINT      Combines the inverse of the source and the target
  1637.                        using the bitwise OR operator.
  1638.  
  1639.    ROP_NOTSRCCOPY      Copies the inverse of the source to the target.
  1640.    Value               Meaning
  1641.    ──────────────────────────────────────────────────────────────────────────
  1642.   ROP_NOTSRCCOPY      Copies the inverse of the source to the target.
  1643.  
  1644.    ROP_NOTSRCERASE     Combines the inverse of the source and the inverse of
  1645.                        the target bitmaps using the bitwise AND operator.
  1646.  
  1647.    ROP_ONE             Sets all target pels to 1.
  1648.  
  1649.    ROP_PATCOPY         Copies the pattern to the target.
  1650.  
  1651.    ROP_PATINVERT       Combines the target and the pattern using the bitwise
  1652.                        exclusive XOR operator.
  1653.  
  1654.    ROP_PATPAINT        Combines the inverse of the source, the pattern, and
  1655.                        target using the bitwise OR operator.
  1656.  
  1657.    ROP_SRCAND          Combines the source and target bitmaps using the
  1658.                        bitwise AND operator.
  1659.  
  1660.    ROP_SRCCOPY         Copies the source bitmap to the target.
  1661.    Value               Meaning
  1662.    ──────────────────────────────────────────────────────────────────────────
  1663.   ROP_SRCCOPY         Copies the source bitmap to the target.
  1664.  
  1665.    ROP_SRCERASE        Combines the source and the inverse of the target
  1666.                        bitmaps using the bitwise AND operator.
  1667.  
  1668.    ROP_SRCINVERT       Combines the source and target bitmaps using the
  1669.                        bitwise exclusive OR operator.
  1670.  
  1671.    ROP_SRCPAINT        Combines the source and target bitmaps using the
  1672.                        bitwise OR operator.
  1673.  
  1674.    ROP_ZERO            Sets all target pels to 0.
  1675.    ──────────────────────────────────────────────────────────────────────────
  1676.  
  1677.  
  1678.    flOptions  Specifies how to compress a bitmap if the target rectangle is
  1679.    smaller than the source. It can be one of the following values:
  1680.  
  1681.    Value             Meaning
  1682.    ──────────────────────────────────────────────────────────────────────────
  1683.    BBO_AND           Compresses two rows or columns into one by combining
  1684.                      them with the bitwise AND operator. This value is useful
  1685.                      for compressing bitmaps
  1686.  
  1687.    BBO_IGNORE        Compresses two rows or columns by throwing one out. This
  1688.                      value is useful for compressing color bitmaps. that have
  1689.                      black images on a white background.
  1690.  
  1691.    BBO_OR            Compresses two rows or columns into one by combining
  1692.                      them with the bitwise OR operator. This value is the
  1693.                      default and is useful for compressing bitmaps that have
  1694.                      white images on a black background.
  1695.    ──────────────────────────────────────────────────────────────────────────
  1696.  
  1697.    All values in the range 0x0100 through 0xFF00 are reserved for privately
  1698.    supported modes for particular devices.
  1699.  
  1700.  Return Value
  1701.  
  1702.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  1703.    an error occurred.
  1704.  
  1705.  Errors
  1706.  
  1707.    Use the WinGetLastError function to retrieve the error value, which may be
  1708.    one of the following:
  1709.  
  1710.          PMERR_BASE_ERROR
  1711.          PMERR_BITMAP_NOT_SELECTED
  1712.          PMERR_INCOMPATIBLE_BITMAP
  1713.          PMERR_INV_BITBLT_MIX
  1714.          PMERR_INV_BITBLT_STYLE
  1715.          PMERR_INV_COORDINATE
  1716.          PMERR_INV_DC_TYPE
  1717.          PMERR_INV_HBITMAP
  1718.          PMERR_INV_HDC
  1719.          PMERR_INV_IN_AREA
  1720.          PMERR_INV_IN_PATH
  1721.          PMERR_INV_LENGTH_OR_COUNT
  1722.  
  1723.  Comments
  1724.  
  1725.    The source and target presentation spaces may be associated with any
  1726.    device context having raster capabilities. Some raster devices, such as
  1727.    banded printers, can receive bitmaps but cannot supply them. These devices
  1728.    cannot be used as a source.
  1729.  
  1730.    GpiBitBlt does not affect the pels in the upper and right boundaries of
  1731.    the target rectangle. This means the function draws up to but does not
  1732.    include those pels.
  1733.  
  1734.    If lRop includes a pattern, GpiBitBlt uses the current area color, area
  1735.    background color, pattern set, and pattern symbol of the target
  1736.    presentation space. Although the function may stretch or compress the
  1737.    bitmap, it never stretches or compresses the pattern.
  1738.  
  1739.    If the target and source presentation spaces are associated with device
  1740.    contexts that have different color formats, GpiBitBlt converts the bitmap
  1741.    color format as it copies the bitmap. This applies to bitmaps copied to or
  1742.    from a device context having a monochrome format. To convert a monochrome
  1743.    bitmap to a color bitmap, GpiBitBlt converts 1 pels to the target's
  1744.    foreground color, and 0 pels to the current area background color. To
  1745.    convert a color bitmap to a monochrome bitmap, GpiBitBlt converts pels
  1746.    with the source's background color to the target's background color, and
  1747.    all other pels to the target's foreground color.
  1748.  
  1749.    The bitmap associated with a source presentation space is always a finite
  1750.    size. Although GpiBitBlt will copy a bitmap when given a source rectangle
  1751.    that is larger than the source bitmap or extends past the boundaries of
  1752.    the source bitmap, any pels not associated with the source bitmap are
  1753.    undefined.
  1754.  
  1755.  Example
  1756.  
  1757.    This example uses GpiBitBlt to copy and compress a bitmap in a
  1758.    presentation space. The function copies the bitmap that is 100 pels wide
  1759.    and 100 pels high into a 50-by-50-pel rectangle at the location (300,400).
  1760.    Since the raster operation is ROP_SRCCOPY, GpiBitBlt replaces the image
  1761.    previously in the target rectangle. The function compresses the bitmap to
  1762.    fit the new rectangle by discarding extra rows and columns as specified by
  1763.    the BBO_IGNORE option.
  1764.  
  1765.    HPS hps;
  1766.    POINTL aptl[4] = {
  1767.        300, 400,         /* lower-left corner of target    */
  1768.        350, 450,         /* upper-right corner of target   */
  1769.        0, 0,             /* lower-left corner of source    */
  1770.        100, 100 };       /* upper-right corner of source   */
  1771.  
  1772.    GpiBitBlt(hps,        /* target presentation space      */
  1773.        hps,              /* source presentation space      */
  1774.        4L,               /* four points needed to compress */
  1775.        aptl,             /* points to source and target    */
  1776.        ROP_SRCCOPY,      /* copy source replacing target   */
  1777.        BBO_IGNORE);      /* discard extra rows and columns */
  1778.  
  1779.  See Also
  1780.  
  1781.    DevOpenDC, GpiCreateBitmap, GpiLoadBitmap, GpiSetBitmap,
  1782.    GpiSetBitmapDimension, GpiSetBitmapId, GpiWCBitBlt
  1783.  
  1784.  
  1785.  ────────────────────────────────────────────────────────────────────────────
  1786.  GpiBox
  1787.  ────────────────────────────────────────────────────────────────────────────
  1788.    LONG GpiBox (hps, cmdControl, pptl, lHRound, lVRound)
  1789.    HPS hps;                /*presentation-space handle                     */
  1790.    LONG cmdControl;        /*fill and outline indicator                    */
  1791.    PPOINTL pptl;           /*pointer to structure for box corners          */
  1792.    LONG lHRound;           /*horizontal length of rounding-ellipse axis    */
  1793.    LONG lVRound;           /*vertical length of rounding-ellipse axis      */
  1794.  
  1795.    The GpiBox function draws a rectangular box or a box with rounded corners.
  1796.    The function draws the box by drawing the outline of a rectangle. The
  1797.    current position specifies one corner and the point given by pptl
  1798.    specifies the other. The sides of the box are always parallel to the x and
  1799.    y axes. The function may fill the interior with the current fill pattern.
  1800.    If a rounded box is requested, the function rounds the corners of the
  1801.    rectangle using quarter ellipses. The lHRound and lVRound parameters
  1802.    specify the lengths of the major and minor axes for the ellipse. If either
  1803.    the lHRound or the lVRound parameter is zero, no rounding occurs.
  1804.  
  1805.    The current position is unchanged by this function.
  1806.  
  1807.  Parameters
  1808.  
  1809.    hps  Identifies the presentation space.
  1810.  
  1811.    cmdControl  Specifies whether to draw the box's interior and/or outline.
  1812.    It can be one of the following values:
  1813.  
  1814.    Value               Meaning
  1815.    ──────────────────────────────────────────────────────────────────────────
  1816.    DRO_FILL            Fills the interior.
  1817.  
  1818.    DRO_OUTLINE         Draws the outline.
  1819.  
  1820.    DRO_OUTLINEFILL     Draws the outline and fills the interior.
  1821.    ──────────────────────────────────────────────────────────────────────────
  1822.  
  1823.    pptl  Points to the POINTL structure that contains the coordinates of a
  1824.    corner of the box. The POINTL structure has the following form:
  1825.  
  1826.    typedef struct _POINTL  {
  1827.        LONG  x;
  1828.        LONG  y;
  1829.    } POINTL;
  1830.  
  1831.    For a full description, see Chapter 4, "Types, Macros, Structures."
  1832.  
  1833.    lHRound  Specifies the horizontal length (in world coordinates) of the
  1834.    full axis of the ellipse used for rounding at each corner.
  1835.  
  1836.    lVRound  Specifies the vertical length (in world coordinates) of the full
  1837.    axis of the ellipse used for rounding at each corner.
  1838.  
  1839.  Return Value
  1840.  
  1841.    The return value is GPI_OK or GPI_HITS if the function is successful (it
  1842.    is GPI_HITS if the detectable attribute is set for the presentation space
  1843.    and a correlation hit occurs). The return value is GPI_ERROR if an error
  1844.    occurs.
  1845.  
  1846.  Errors
  1847.  
  1848.    Use the WinGetLastError function to retrieve the error value, which may be
  1849.    the following value:
  1850.  
  1851.          PMERR_INV_BOX_CONTROL
  1852.  
  1853.  Comments
  1854.  
  1855.    GpiBox can be used in an area bracket but only if DRO_OUTLINE is used. If
  1856.    the current position is (x0,y0), and pptl is set to (x1,y1), the box is
  1857.    drawn from (x0,y0) to (x1,y0) to (x1,y1) to (x0,y1) to (x0,y0). This can
  1858.    affect the way the box is filled when drawn in an area.
  1859.  
  1860.    When correlating a segment, a box drawn using GpiBox will be "hit" if the
  1861.    box boundary intersects in the pick aperture. If the pick aperture lies
  1862.    within the box, a hit occurs only if the interior is drawn, that is, only
  1863.    if the DRO_FILL or DRO_OUTLINEFILL option is used.
  1864.  
  1865.  Example
  1866.  
  1867.    This example calls GpiBox to draw a series of rounded boxes, one inside
  1868.    another.
  1869.  
  1870.    POINTL ptl = { 100, 100 };
  1871.    SHORT i;
  1872.  
  1873.    for (i = 0; i < 5; i++)
  1874.        GpiBox(hps,            /* handle to a ps        */
  1875.            DRO_OUTLINE,       /* fill the interior     */
  1876.            (PPOINTL) &ptl,    /* address of the corner */
  1877.            i * 10L,           /* horizontal length     */
  1878.            i * 10L);          /* vertical length       */
  1879.  
  1880.  See Also
  1881.  
  1882.    GpiBeginArea, GpiEndArea
  1883.  
  1884.  
  1885.  ────────────────────────────────────────────────────────────────────────────
  1886.  GpiCallSegmentMatrix
  1887.  ────────────────────────────────────────────────────────────────────────────
  1888.    LONG GpiCallSegmentMatrix (hps, idSegment, cElements, pmatlf, lType)
  1889.    HPS hps;                /*presentation-space handle                     */
  1890.    LONG idSegment;         /*segment identifier                            */
  1891.    LONG cElements;         /*number of matrix elements to examine          */
  1892.    PMATRIXLF pmatlf;       /*pointer to structure for matrix               */
  1893.    LONG lType;             /*transformation modifier                       */
  1894.  
  1895.    The GpiCallSegmentMatrix function draws the specified segment using an
  1896.    instance transformation. The function combines the instance transformation
  1897.    pointed to by pmatlf with the current model transformation, then draws the
  1898.    segment as if calling the GpiDrawSegment function. The combined
  1899.    transformation applies only while the function draws the segment.
  1900.    GpiCallSegmentMatrix does not modify the current model transformation.
  1901.  
  1902.  Parameters
  1903.  
  1904.    hps  Identifies the presentation space.
  1905.  
  1906.    idSegment  Specifies the segment to draw. This value must be greater than
  1907.    zero.
  1908.  
  1909.    cElements  Specifies the number of matrix elements pointed to by pmatlf.
  1910.    It can be any value from 0 through 9.
  1911.  
  1912.    pmatlf  Points to a MATRIXLF structure that contains the matrix for the
  1913.    instance transformation. Although a transformation requires nine matrix
  1914.    elements, the function copies from the structure only the number of matrix
  1915.    elements specified by cElements. If cElements is less than nine, the
  1916.    function supplies the remaining elements by substituting corresponding
  1917.    elements from the identity matrix. The MATRIXLF structure has the
  1918.    following form:
  1919.  
  1920.    typedef struct _MATRIXLF {
  1921.        FIXED fxM11;
  1922.        FIXED fxM12;
  1923.        LONG  lM13;
  1924.        FIXED fxM21;
  1925.        FIXED fxM22;
  1926.        LONG  lM23;
  1927.        LONG  lM31;
  1928.        LONG  lM32;
  1929.        LONG  lM33;
  1930.    } MATRIXLF;
  1931.  
  1932.    For a full description, see Chapter 4, "Types, Macros, Structures."
  1933.  
  1934.    lType  Specifies how to combine the instance transformation with the model
  1935.    transformation. It can be one of the following values:
  1936.  
  1937.    Value                 Meaning
  1938.    ──────────────────────────────────────────────────────────────────────────
  1939.    TRANSFORM_ADD         Adds the model transformation to the instance
  1940.                          transformation (MODEL * INSTANCE).
  1941.  
  1942.    TRANSFORM_PREEMPT     Adds the instance transformation to the model
  1943.                          transformation (INSTANCE * MODEL).
  1944.  
  1945.    TRANSFORM_REPLACE     Replaces the model transform with the instance
  1946.                          transformation.
  1947.    ──────────────────────────────────────────────────────────────────────────
  1948.  
  1949.  Return Value
  1950.  
  1951.    The return value is GPI_OK or GPI_HITS if the function is successful (it
  1952.    is GPI_HITS if the detectable attribute is set for the presentation space
  1953.    and a correlation hit occurs). The return value is GPI_ERROR if an error
  1954.    occurs.
  1955.  
  1956.  Errors
  1957.  
  1958.    Use the WinGetLastError function to retrieve the error value, which may be
  1959.    one of the following:
  1960.  
  1961.          PMERR_CALLED_SEG_IS_CURRENT
  1962.          PMERR_CALLED_SEG_NOT_FOUND
  1963.          PMERR_INV_MICROPS_FUNCTION
  1964.          PMERR_INV_SEG_NAME
  1965.          PMERR_INV_TRANSFORM_TYPE
  1966.          PMERR_SEG_CALL_RECURSIVE
  1967.  
  1968.  Example
  1969.  
  1970.    This example calls the GpiCallSegmentMatrix function to draw a segment
  1971.    three times. Each time the segment is drawn, the instance transformation
  1972.    doubles in size. The result is three triangles with the last triangle
  1973.    twice the size of the second, and the second twice the size of the first.
  1974.  
  1975.    POINTL ptlStart = { 0, 0 };
  1976.    POINTL ptlTriangle[] = { 100, 100, 200, 0, 0, 0 };
  1977.    MATRIXLF matlfInstance = { 1, 0, 0, 0, 1, 0, 0, 0, 1 };
  1978.  
  1979.    GpiOpenSegment(hps, 1L);             /* open the segment           */
  1980.    GpiMove(hps, &ptlStart);             /* move to start point (0, 0) */
  1981.    GpiPolyLine(hps, 3L, ptlTriangle);   /* draw the triangle          */
  1982.    GpiCloseSegment(hps);                /* close the segment          */
  1983.  
  1984.    for (i = 0; i < 3; i++) {
  1985.  
  1986.        /*
  1987.         * Draw the segment after adding the matrix to the model
  1988.         * transformation.
  1989.         */
  1990.  
  1991.        GpiCallSegmentMatrix(hps, 1L, 9, &matlfInstance, TRANSFORM_ADD);
  1992.        matlfInstance.fxM11 *= 2;
  1993.        matlfInstance.fxM22 *= 2;
  1994.    }
  1995.  
  1996.  
  1997.  See Also
  1998.  
  1999.    GpiDrawSegment
  2000.  
  2001.  
  2002.  ────────────────────────────────────────────────────────────────────────────
  2003.  GpiCharString
  2004.  ────────────────────────────────────────────────────────────────────────────
  2005.    LONG GpiCharString (hps, cchString, pchString)
  2006.    HPS hps;                /*presentation-space handle                     */
  2007.    LONG cchString;         /*number of characters in string                */
  2008.    PCH pchString;          /*pointer to string to draw                     */
  2009.  
  2010.    The GpiCharString function draws a character string positioned at the
  2011.    current position. After the function draws the string, it sets the current
  2012.    position to the end of the character string.
  2013.  
  2014.  Parameters
  2015.  
  2016.    hps  Identifies the presentation space.
  2017.  
  2018.    cchString  Specifies the number of characters in the string pointed to by
  2019.    pchString.
  2020.  
  2021.    pchString  Points to the character string to be drawn.
  2022.  
  2023.  Return Value
  2024.  
  2025.    The return value is GPI_OK or GPI_HITS if the function is successful (it
  2026.    is GPI_HITS if the detectable attribute is set for the presentation space
  2027.    and a correlation hit occurs). The return value is GPI_ERROR if an error
  2028.    occurs.
  2029.  
  2030.  Example
  2031.  
  2032.    This example uses the GpiCharString function to draw the string "Hello".
  2033.    The GpiMove function moves the current position to (100,100) so that the
  2034.    string starts there.
  2035.  
  2036.    HPS hps;
  2037.    POINTL ptlStart;
  2038.  
  2039.    ptlStart.x = 100L;
  2040.    ptlStart.y = 100L;
  2041.  
  2042.    /* Start string at (100, 100). */
  2043.  
  2044.    GpiMove(hps, &ptlStart);
  2045.  
  2046.    /* Draw the 5-character string. */
  2047.  
  2048.    GpiCharString(hps, 5L, "Hello");
  2049.  
  2050.  See Also
  2051.  
  2052.    GpiCharStringAt, GpiCharStringPos
  2053.  
  2054.  
  2055.  ────────────────────────────────────────────────────────────────────────────
  2056.  GpiCharStringAt
  2057.  ────────────────────────────────────────────────────────────────────────────
  2058.    LONG GpiCharStringAt (hps, pptlStart, cchString, pchString)
  2059.    HPS hps;                /*presentation-space handle                     */
  2060.    PPOINTL pptlStart;      /*pointer to structure for starting position    */
  2061.    LONG cchString;         /*number of characters in string                */
  2062.    PCH pchString;          /*pointer to string to draw                     */
  2063.  
  2064.    The GpiCharStringAt function draws a character string starting at the
  2065.    specified position. After the function draws the string, it sets the
  2066.    current position to the end of the character string.
  2067.  
  2068.  Parameters
  2069.  
  2070.    hps  Identifies the presentation space.
  2071.  
  2072.    pptlStart  Points to the POINTL structure that contains the starting
  2073.    position in world coordinates. The POINTL structure has the following
  2074.    form:
  2075.  
  2076.    typedef struct _POINTL  {
  2077.        LONG  x;
  2078.        LONG  y;
  2079.    } POINTL;
  2080.  
  2081.    For a full description, see Chapter 4, "Types, Macros, Structures."
  2082.  
  2083.    cchString  Specifies the number of characters pointed to by pchString.
  2084.  
  2085.    pchString  Points to the character string to be drawn.
  2086.  
  2087.  Return Value
  2088.  
  2089.    The return value is GPI_OK or GPI_HITS if the function is successful (it
  2090.    is GPI_HITS if the detectable attribute is set for the presentation space
  2091.    and a correlation hit occurs). The return value is GPI_ERROR if an error
  2092.    occurs.
  2093.  
  2094.  Example
  2095.  
  2096.    The example uses the GpiCharStringAt function to draw the string "Hello"
  2097.    starting at the position (100,100). It then uses the GpiMove and
  2098.    GpiCharString functions to draw the same string at exactly the same
  2099.    position.
  2100.  
  2101.    HPS hps;
  2102.    POINTL ptlStart;
  2103.  
  2104.    ptlStart.x = 100L;
  2105.    ptlStart.y = 100L;
  2106.  
  2107.    /* Draw the string "Hello" at (100, 100). */
  2108.  
  2109.    GpiCharStringAt(hps, &ptlStart, 5, "Hello");
  2110.  
  2111.    /* These two calls are identical to the one above. */
  2112.  
  2113.    GpiMove(hps, &ptlStart);
  2114.    GpiCharString(hps, 5L, "Hello");
  2115.  
  2116.  See Also
  2117.  
  2118.    GpiCharString, GpiMove
  2119.  
  2120.  
  2121.  ────────────────────────────────────────────────────────────────────────────
  2122.  GpiCharStringPos
  2123.  ────────────────────────────────────────────────────────────────────────────
  2124.    LONG GpiCharStringPos (hps, prcl, flOptions, cchString, pchString, adx)
  2125.    HPS hps;                /*presentation-space handle                     */
  2126.    PRECTL prcl;            /*pointer to structure for rectangle            */
  2127.                            /*coordinates                                   */
  2128.    ULONG flOptions;        /*formatting flags                              */
  2129.    LONG cchString;         /*number of characters in string                */
  2130.    PCH pchString;          /*pointer to string to draw                     */
  2131.    PLONG adx;              /*pointer to array of increment values          */
  2132.  
  2133.    The GpiCharStringPos function draws a character string starting at the
  2134.    current position and using one or more formatting options. The options
  2135.    direct the function to draw a background for the string, clip the string
  2136.    to the given rectangle, or position the characters in the string using
  2137.    distances given in an array. After drawing the string, the function either
  2138.    leaves the current position at the end of the string or resets it to the
  2139.    beginning of the string.
  2140.  
  2141.  Parameters
  2142.  
  2143.    hps  Identifies the presentation space.
  2144.  
  2145.    prcl  Points to a RECTL structure that contains the lower-left and
  2146.    upper-right corners of a rectangle. The function draws the rectangle if
  2147.    the CHS_OPAQUE option is given. It uses the rectangle to clip the string
  2148.    if the CHS_CLIP option is given. Otherwise the rectangle is ignored. The
  2149.    RECTL structure has the following form:
  2150.  
  2151.    typedef struct _RECTL {
  2152.        LONG  xLeft;
  2153.        LONG  yBottom;
  2154.        LONG  xRight;
  2155.        LONG  yTop;
  2156.    } RECTL;
  2157.  
  2158.    For a full description, see Chapter 4, "Types, Macros, Structures."
  2159.  
  2160.    flOptions  Specifies the formatting options. It can be one or more of the
  2161.    following values:
  2162.  
  2163.    Value             Meaning
  2164.    ──────────────────────────────────────────────────────────────────────────
  2165.    CHS_CLIP          Clips the string to the rectangle, omitting any portion
  2166.                      of any character outside the rectangle. The function
  2167.                      clips the string regardless of whether CHS_OPAQUE is
  2168.                      specified.
  2169.  
  2170.    CHS_LEAVEPOS      Resets the current position back to the start of the
  2171.                      string. If not given, GpiCharStringPos moves the current
  2172.                      position to the end of string.
  2173.  
  2174.    CHS_OPAQUE        Draws the rectangle whose lower-left and upper-right
  2175.                      corners are specified by prcl, then fills the rectangle
  2176.                      with the current background color. The string is drawn
  2177.                      after filling the rectangle.
  2178.  
  2179.    CHS_VECTOR        Advances the current position after each character is
  2180.                      drawn by using the next value in the array adx. The
  2181.                      current character direction defines which direction the
  2182.                      current position is advanced.
  2183.    ──────────────────────────────────────────────────────────────────────────
  2184.  
  2185.    All other values are reserved.
  2186.  
  2187.    cchString  Specifies the number of characters in the string pointed to by
  2188.    pchString.
  2189.  
  2190.    pchString  Points to the character string to be drawn.
  2191.  
  2192.    adx  Points to an array of increment values. Each value is a 4-byte,
  2193.    signed integer specifying the distance in world coordinates to advance the
  2194.    current position after drawing a character. There must be one value for
  2195.    each character in the string. The first element specifies the distance to
  2196.    advance after drawing the first character, the second element specifies
  2197.    the distance after the second character, and so on.
  2198.  
  2199.  Return Value
  2200.  
  2201.    The return value is GPI_OK or GPI_HITS if the function is successful (it
  2202.    is GPI_HITS if the detectable attribute is set for the presentation space
  2203.    and a correlation hit occurs). The return value is GPI_ERROR if an error
  2204.    occurs.
  2205.  
  2206.  Comments
  2207.  
  2208.    If CHS_OPAQUE is specified and the drawing mode is DM_RETAIN,
  2209.    GpiCharStringPos uses the color mix mode BM_OVERPAINT to fill the
  2210.    rectangle. In other drawing modes, the function uses the BM_LEAVEALONE.
  2211.    GpiCharStringPos draws the rectangle using the coordinates specified in
  2212.    prcl. It does not use the start of the string to compute the rectangle's
  2213.    location.
  2214.  
  2215.  See Also
  2216.  
  2217.    GpiCharString, GpiCharStringAt, GpiCharStringPosAt
  2218.  
  2219.  
  2220.  ────────────────────────────────────────────────────────────────────────────
  2221.  GpiCharStringPosAt
  2222.  ────────────────────────────────────────────────────────────────────────────
  2223.    LONG GpiCharStringPosAt (hps, pptlStart, prcl, flOptions, cchString,
  2224.    pchString, adx)
  2225.    HPS hps;                /*presentation-space handle                     */
  2226.    PPOINTL pptlStart;      /*pointer to structure for starting position    */
  2227.    PRECTL prcl;            /*pointer to structure for rectangle            */
  2228.                            /*coordinates                                   */
  2229.    ULONG flOptions;        /*formatting flags                              */
  2230.    LONG cchString;         /*number of characters in string                */
  2231.    PCH pchString;          /*pointer to string to draw                     */
  2232.    PLONG adx;              /*increment vector                              */
  2233.  
  2234.    The GpiCharStringPosAt function draws a character string starting at the
  2235.    specified position and using one or more formatting options. The options
  2236.    direct the function to draw a background for the string, clip the string
  2237.    to the given rectangle, or position the characters in the string using
  2238.    distances given in an array. After drawing the string, the function either
  2239.    leaves the current position at the end of the string or resets it to the
  2240.    beginning of the string.
  2241.  
  2242.  Parameters
  2243.  
  2244.    hps  Identifies the presentation space.
  2245.  
  2246.    pptlStart  Points to a POINTL structure that contains the starting
  2247.    position in world coordinates. The POINTL structure has the following
  2248.    form:
  2249.  
  2250.    typedef struct _POINTL  {
  2251.        LONG  x;
  2252.        LONG  y;
  2253.    } POINTL;
  2254.  
  2255.    For a full description, see Chapter 4, "Types, Macros, Structures."
  2256.  
  2257.    prcl  Points to a RECTL structure that contains the lower-left and
  2258.    upper-right corners of a rectangle. The function draws the rectangle if
  2259.    the CHS_OPAQUE option is given. It uses the rectangle to clip the string
  2260.    if the CHS_CLIP option is given. Otherwise the rectangle is ignored. The
  2261.    RECTL structure has the following form:
  2262.  
  2263.    typedef struct _RECTL {
  2264.        LONG xLeft;
  2265.        LONG yBottom;
  2266.        LONG xRight;
  2267.        LONG yTop;
  2268.    } RECTL;
  2269.  
  2270.    For a full description, see Chapter 4, "Types, Macros, Structures."
  2271.  
  2272.    flOptions  Specifies the formatting options. It can be one or more of the
  2273.    following values:
  2274.  
  2275.    Value             Meaning
  2276.    ──────────────────────────────────────────────────────────────────────────
  2277.    CHS_CLIP          Clips the string to the rectangle, omitting any portion
  2278.                      of any character outside the rectangle. The function
  2279.                      clips the string regardless of whether CHS_OPAQUE is
  2280.                      specified.
  2281.  
  2282.    CHS_LEAVEPOS      Resets the current position back to the start of the
  2283.                      string. If not given, GpiCharStringPos moves the current
  2284.                      position to the end of string.
  2285.  
  2286.    CHS_OPAQUE        Draws the rectangle whose the lower-left and upper-right
  2287.                      corners are specified by prcl, then fills the rectangle
  2288.                      with the current background color. The string is drawn
  2289.                      after filling the rectangle.
  2290.  
  2291.    CHS_VECTOR        Advances the current position after each character is
  2292.                      drawn by using the next value in the array adx. The
  2293.                      current character direction defines which direction the
  2294.                      current position is advanced.
  2295.    ──────────────────────────────────────────────────────────────────────────
  2296.  
  2297.    All other values are reserved.
  2298.  
  2299.    cchString  Specifies the number of characters in the string pointed to by
  2300.    pchString.
  2301.  
  2302.    pchString  Points to the character string to be drawn.
  2303.  
  2304.    adx  Points to an array of increment values. Each value is a 4-byte,
  2305.    signed integer specifying the distance in world coordinates to advance the
  2306.    current position after drawing a character. There must be one value for
  2307.    each character in the string. The first element specifies the distance to
  2308.    advance after drawing the first character, the second element specifies
  2309.    the distance after the second character, and so on.
  2310.  
  2311.  Return Value
  2312.  
  2313.    The return value is GPI_OK or GPI_HITS if the function is successful (it
  2314.    is GPI_HITS if the detectable attribute is set for the presentation space
  2315.    and a correlation hit occurs). The return value is GPI_ERROR if an error
  2316.    occurs.
  2317.  
  2318.  Comments
  2319.  
  2320.    If CHS_OPAQUE is specified and the drawing mode is DM_RETAIN,
  2321.    GpiCharStringPosAt uses the color mix mode BM_OVERPAINT to fill the
  2322.    rectangle. In other drawing modes, the function uses the BM_LEAVEALONE.
  2323.    GpiCharStringPos draws the rectangle using the coordinates specified in
  2324.    prcl. It does not use the start of the string to compute the rectangle's
  2325.    location.
  2326.  
  2327.  See Also
  2328.  
  2329.    GpiCharStringPos
  2330.  
  2331.  
  2332.  ────────────────────────────────────────────────────────────────────────────
  2333.  GpiCloseFigure
  2334.  ────────────────────────────────────────────────────────────────────────────
  2335.    BOOL GpiCloseFigure (hps)
  2336.    HPS hps;                /*presentation-space handle                     */
  2337.  
  2338.    The GpiCloseFigure function closes an open figure in a path bracket. A
  2339.    figure is open unless it is explicitly closed by using the GpiCloseFigure
  2340.    function. A figure can be open even if the current point and the starting
  2341.    point of the figure are equal.
  2342.  
  2343.  Parameters
  2344.  
  2345.    hps  Identifies the presentation space.
  2346.  
  2347.  Return Value
  2348.  
  2349.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  2350.    an error occurred.
  2351.  
  2352.  Example
  2353.  
  2354.    This example uses the GpiCloseFigure function to close a triangle drawn in
  2355.    a path bracket. The triangle starts at (0,0). Since the current position
  2356.    just before the GpiCloseFigure is (200,0), the function closes the
  2357.    triangle by drawing a line from (200,0) to (0,0).
  2358.  
  2359.    HPS hps;
  2360.    POINTL ptlStart = { 0, 0 };
  2361.    POINTL ptlPoints[] = { 100, 100, 200, 0 };
  2362.  
  2363.    GpiBeginPath(hps, 1L);                  /* start the path bracket */
  2364.    GpiMove(hps, &ptlStart);                /* move to starting point */
  2365.    GpiPolyLine(hps, 2L, ptlPoints);        /* draw the three sides   */
  2366.    GpiCloseFigure(hps);                    /* close the triangle     */
  2367.    GpiEndPath(hps);                        /* end the path bracket   */
  2368.  
  2369.  See Also
  2370.  
  2371.    GpiBeginPath, GpiEndPath
  2372.  
  2373.  
  2374.  ────────────────────────────────────────────────────────────────────────────
  2375.  GpiCloseSegment
  2376.  ────────────────────────────────────────────────────────────────────────────
  2377.    BOOL GpiCloseSegment (hps)
  2378.    HPS hps;                /*presentation-space handle                     */
  2379.  
  2380.    The GpiCloseSegment function closes the current segment. Closing a segment
  2381.    does not delete the segment or affect output on the current device. If any
  2382.    element bracket is open, GpiCloseSegment automatically closes it.
  2383.  
  2384.  Parameters
  2385.  
  2386.    hps  Identifies the presentation space.
  2387.  
  2388.  Return Value
  2389.  
  2390.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  2391.    an error occurred.
  2392.  
  2393.  Errors
  2394.  
  2395.    Use the WinGetLastError function to retrieve the error value, which may be
  2396.    one of the following:
  2397.  
  2398.          PMERR_AREA_INCOMPLETE
  2399.          PMERR_IMAGE_INCOMPLETE
  2400.          PMERR_INV_MICROPS_FUNCTION
  2401.          PMERR_INV_MODE_FOR_REOPEN_SEG
  2402.          PMERR_PATH_INCOMPLETE
  2403.  
  2404.  Comments
  2405.  
  2406.    You must explicitly end any area or path bracket before closing the
  2407.    segment. Failing to end an area or path may invalidate the segment.
  2408.  
  2409.    GpiCloseSegment resets the current viewing transformation to identity.
  2410.  
  2411.  Example
  2412.  
  2413.    This example uses the GpiCloseSegment function to close a segment. The
  2414.    GpiOpenSegment opens the segment; GpiMove and GpiPolyLine draw a triangle.
  2415.  
  2416.    POINTL ptlStart = { 0, 0 };
  2417.    POINTL ptlTriangle[] = { 100,100, 200,0, 0,0 };
  2418.  
  2419.    GpiOpenSegment(hps, 1L);             /* open the segment          */
  2420.    GpiMove(hps, &ptlStart);             /* move to start point (0,0) */
  2421.    GpiPolyLine(hps, 3L, ptlTriangle);   /* draw triangle             */
  2422.    GpiCloseSegment(hps);                /* close the segment         */
  2423.  
  2424.  See Also
  2425.  
  2426.    GpiOpenSegment
  2427.  
  2428.  
  2429.  ────────────────────────────────────────────────────────────────────────────
  2430.  GpiCombineRegion
  2431.  ────────────────────────────────────────────────────────────────────────────
  2432.    LONG GpiCombineRegion (hps, hrgnDest, hrgnSrc1, hrgnSrc2, cmdMode)
  2433.    HPS hps;                /*presentation-space handle                     */
  2434.    HRGN hrgnDest;          /*handle of destination region                  */
  2435.    HRGN hrgnSrc1;          /*handle of first source region                 */
  2436.    HRGN hrgnSrc2;          /*handle of second source region                */
  2437.    LONG cmdMode;           /*combination method                            */
  2438.  
  2439.    The GpiCombineRegion function combines two source regions identified by
  2440.    hrgnSrc1 and hrgnSrc2. The new region replaces the destination region
  2441.    identified by hrgnDest. If one of the source regions is also given as the
  2442.    destination region, the function replaces that source region with the new
  2443.    region, but does not affect the other source region.
  2444.  
  2445.  Parameters
  2446.  
  2447.    hps  Identifies the presentation space. The presentation space must be
  2448.    associated with a device context.
  2449.  
  2450.    hrgnDest  Identifies the destination region.
  2451.  
  2452.    hrgnSrc1  Identifies the first source region.
  2453.  
  2454.    hrgnSrc2  Identifies the second source region.
  2455.  
  2456.    cmdMode  Specifies how to combine the source regions. It can be one of the
  2457.    following values:
  2458.  
  2459.    Value     Meaning
  2460.    ──────────────────────────────────────────────────────────────────────────
  2461.    CRGN_AND  Creates the intersection of the source regions (hrgnSrc1
  2462.              INTERSECT hrgnSrc2). The new region contains only the parts of
  2463.              the source regions that are common.
  2464.  
  2465.    CRGN_COPY Copies the first source region to the destination. The function
  2466.              does not use the hrgnSrc2 parameter.
  2467.  
  2468.    CRGN_DIFF Creates the difference of the source region (hrgnSrc1 INTERSECT
  2469.              NOT hrgnSrc2). The new region contains the parts of the first
  2470.              source region that are not also in the second region.
  2471.  
  2472.    CRGN_OR   Creates the union of the two source regions (hrgnSrc1 UNION
  2473.              hrgnSrc2). The new region contains all parts of both source
  2474.              regions.
  2475.  
  2476.    CRGN_XOR  Creates the "symmetric" difference of the source regions
  2477.              (hrgnSrc1 - hrgnSrc2). The new region contains only the parts of
  2478.              the source regions that are not common.
  2479.    ──────────────────────────────────────────────────────────────────────────
  2480.  
  2481.  Return Value
  2482.  
  2483.    The return value is RGN_NULL, RGN_RECT, or REGN_COMPLEX if the function is
  2484.    successful. The return value is RGN_ERROR if an error occurred.
  2485.  
  2486.  Errors
  2487.  
  2488.    Use the WinGetLastError function to retrieve the error value, which may be
  2489.    the following:
  2490.  
  2491.          PMERR_INV_REGION_MIX
  2492.  
  2493.  Comments
  2494.  
  2495.    The source and destination regions must belong to the same presentation
  2496.    space or to presentation spaces associated with a similar device context.
  2497.  
  2498.  Example
  2499.  
  2500.    This example uses the GpiCombineRegion function to create a complex region
  2501.    consisting of everything in two rectangles except where they overlap.
  2502.  
  2503.    HRGN hrgn1, hrgn2, hrgn3;
  2504.    RECTL rclRect1 = { 0, 0, 100, 100 };
  2505.    RECTL rclRect2 = { 50, 50, 200, 200 };
  2506.  
  2507.    hrgn1 = GpiCreateRegion(hps, 1L, &rclRect1); /* create first region  */
  2508.    hrgn2 = GpiCreateRegion(hps, 1L, &rclRect2); /* create second region */
  2509.    hrgn3 = GpiCreateRegion(hps, 0L, NULL);      /* create empty region  */
  2510.  
  2511.    /* Combine first and second regions, replacing the empty region. */
  2512.  
  2513.    GpiCombineRegion(hrgn3, hrgn1, hrgn2, CRGN_XOR);
  2514.  
  2515.  See Also
  2516.  
  2517.    GpiCreateRegion
  2518.  
  2519.  
  2520.  ────────────────────────────────────────────────────────────────────────────
  2521.  GpiComment
  2522.  ────────────────────────────────────────────────────────────────────────────
  2523.    BOOL GpiComment (hps, cbData, pbData)
  2524.    HPS hps;                /*presentation-space handle                     */
  2525.    LONG cbData;            /*length of comment string                      */
  2526.    PBYTE pbData;           /*pointer to the comment string                 */
  2527.  
  2528.    The GpiComment function adds a comment string to a segment.
  2529.  
  2530.  Parameters
  2531.  
  2532.    hps  Identifies the presentation space.
  2533.  
  2534.    cbData  Specifies the length in bytes of the comment string pointed to by
  2535.    pbData.
  2536.  
  2537.    pbData  Points to the comment string. The string must not be longer than
  2538.    255 bytes.
  2539.  
  2540.  Return Value
  2541.  
  2542.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  2543.    an error occurred.
  2544.  
  2545.  Example
  2546.  
  2547.    This example uses the GpiComment function to comment the contents of a
  2548.    segment.
  2549.  
  2550.    POINTL ptlStart = { 0, 0 };
  2551.    POINTL ptlTriangle[] = { 100, 100, 200, 0, 0, 0 };
  2552.  
  2553.    GpiOpenSegment(hps, 0L);                        /* open the segment  */
  2554.    GpiComment(hps, 18L, "Start point (0, 0)");
  2555.    GpiMove(hps, &ptlStart);
  2556.    GpiComment(hps, 13L, "Draw triangle");
  2557.    GpiPolyLine(hps, 3L, ptlTriangle);
  2558.    GpiCloseSegment(hps);                           /* close the segment */
  2559.  
  2560.  See Also
  2561.  
  2562.    GpiCloseSegment, GpiMove, GpiOpenSegment, GpiPolyLine
  2563.  
  2564.  
  2565.  ────────────────────────────────────────────────────────────────────────────
  2566.  GpiConvert
  2567.  ────────────────────────────────────────────────────────────────────────────
  2568.    BOOL GpiConvert (hps, lSrc, lTarg, cPoints, aptl)
  2569.    HPS hps;                /*presentation-space handle                     */
  2570.    LONG lSrc;              /*source coordinate space                       */
  2571.    LONG lTarg;             /*target coordinate space                       */
  2572.    LONG cPoints;           /*number of coordinate pairs in structure       */
  2573.    PPOINTL aptl;           /*pointer to structure for coordinate pairs     */
  2574.  
  2575.    The GpiConvert function converts one or more points from one coordinate
  2576.    space to another. For each POINTL structure in the array pointed to by
  2577.    aptl, the function replaces the original x- and y-coordinate values with
  2578.    the converted values.
  2579.  
  2580.  Parameters
  2581.  
  2582.    hps  Identifies the presentation space.
  2583.  
  2584.    lSrc  Specifies the source coordinate space. It can be one of the
  2585.    following values:
  2586.  
  2587.    Value             Meaning
  2588.    ──────────────────────────────────────────────────────────────────────────
  2589.    CVTC_DEFAULTPAGE  Page space prior to default viewing transform
  2590.  
  2591.    CVTC_DEVICE       Device space
  2592.  
  2593.    CVTC_MODEL        Model space
  2594.  
  2595.    CVTC_PAGE         Page space after default viewing transform
  2596.  
  2597.    CVTC_WORLD        World coordinates
  2598.    ──────────────────────────────────────────────────────────────────────────
  2599.  
  2600.    lTarg  Specifies the target coordinate space. It can be one of the
  2601.    following values:
  2602.  
  2603.    Value             Meaning
  2604.    ──────────────────────────────────────────────────────────────────────────
  2605.    CVTC_DEFAULTPAGE  Page space prior to default viewing transform
  2606.  
  2607.    CVTC_DEVICE       Device space
  2608.  
  2609.    CVTC_MODEL        Model space
  2610.  
  2611.    CVTC_PAGE         Page space after default viewing transform
  2612.  
  2613.    CVTC_WORLD        World coordinates
  2614.    ──────────────────────────────────────────────────────────────────────────
  2615.  
  2616.    cPoints  Specifies the number of coordinate pairs pointed to by aptl.
  2617.  
  2618.    aptl  Points to an array of POINTL structures containing the coordinate
  2619.    pairs. The POINTL structure has the following form:
  2620.  
  2621.    typedef struct _POINTL  {
  2622.        LONG  x;
  2623.        LONG  y;
  2624.    } POINTL;
  2625.  
  2626.    For a full description, see Chapter 4, "Types, Macros, Structures."
  2627.  
  2628.  Return Value
  2629.  
  2630.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  2631.    an error occurred.
  2632.  
  2633.  See Also
  2634.  
  2635.    GpiSetModelTransformMatrix, GpiSetPageViewport,
  2636.    GpiSetSegmentTransformMatrix, GpiSetViewingTransformMatrix
  2637.  
  2638.  
  2639.  ────────────────────────────────────────────────────────────────────────────
  2640.  GpiCopyMetaFile
  2641.  ────────────────────────────────────────────────────────────────────────────
  2642.    HMF GpiCopyMetaFile (hmfSrc)
  2643.    HMF hmfSrc;             /*handle of source metafile                     */
  2644.  
  2645.    The GpiCopyMetaFile function creates a copy of the metafile identified by
  2646.    hmfSrc and returns a handle for the new metafile. The new metafile can be
  2647.    edited or deleted without affecting the original metafile.
  2648.  
  2649.  Parameters
  2650.  
  2651.    hmfSrc  Identifies the source metafile. The source metafile must have been
  2652.    loaded previously using the GpiLoadMetaFile function or created previously
  2653.    using the DevOpenDC and DevCloseDC functions.
  2654.  
  2655.  Return Value
  2656.  
  2657.    The return value is the handle of the new metafile if the function is
  2658.    successful, or it is GPI_ERROR if an error occurred.
  2659.  
  2660.  Example
  2661.  
  2662.    This example uses the GpiCopyMetaFile function to copy make a copy of the
  2663.    metafile loaded using the GpiLoadMetaFile function.
  2664.  
  2665.    HMF hmf1, hmf2;
  2666.  
  2667.    GpiLoadMetaFile(hmf1, "sample.met");  /* load the metafile from disk */
  2668.    hmf2 = GpiCopyMetaFile(hmf1);         /* copy the metafile           */
  2669.  
  2670.  See Also
  2671.  
  2672.    DevCloseDC, DevOpenDC, GpiLoadMetaFile
  2673.  
  2674.  
  2675.  ────────────────────────────────────────────────────────────────────────────
  2676.  GpiCorrelateChain
  2677.  ────────────────────────────────────────────────────────────────────────────
  2678.    LONG GpiCorrelateChain (hps, lType, pptl, lMaxHits, lMaxDepth, alSegTag)
  2679.    HPS hps;                /*presentation-space handle                     */
  2680.    LONG lType;             /*segment type                                  */
  2681.    PPOINTL pptl;           /*pointer to structure for aperture center      */
  2682.    LONG lMaxHits;          /*maximum number of hits                        */
  2683.    LONG lMaxDepth;         /*maximum number of segment/tag pairs to return */
  2684.    PLONG alSegTag;         /*pointer to array of segment and tag           */
  2685.                            /*identifiers                                   */
  2686.  
  2687.    The GpiCorrelateChain function correlates the segment chain, identifying
  2688.    each tagged primitive that intersects the current aperture, as set by the
  2689.    GpiSetPickApertureSize function.
  2690.  
  2691.    The GpiCorrelateChain function correlates a segment chain by searching for
  2692.    each tagged primitive in each segment that lies completely or partially
  2693.    within the aperture. Each instance of a tagged primitive in the aperture
  2694.    is called a "hit." The function records a hit by copying the identifier of
  2695.    the segment containing the primitive (along with the identifier for its
  2696.    tag) to the array pointed to by alSegTag. After searching all segments in
  2697.    the chain, GpiCorrelateChain returns the number of hits it located.
  2698.  
  2699.  Parameters
  2700.  
  2701.    hps  Identifies the presentation space.
  2702.  
  2703.    lType  Specifies the type of segment to correlate. It can be one of the
  2704.    following values:
  2705.  
  2706.    Value             Meaning
  2707.    ──────────────────────────────────────────────────────────────────────────
  2708.    PICKSEL_ALL       Correlate all segments with nonzero identifiers
  2709.                      regardless of the detectability and visibility
  2710.                      attributes of the segments.
  2711.  
  2712.    PICKSEL_VISIBLE   Correlate visible and detectable segments with nonzero
  2713.                      identifiers.
  2714.    ──────────────────────────────────────────────────────────────────────────
  2715.  
  2716.    pptl  Points to the POINTL structure that contains the position (in
  2717.    presentation page units) of the center of the aperture. The POINTL
  2718.    structure has the following form:
  2719.  
  2720.    typedef struct _POINTL  {
  2721.        LONG  x;
  2722.        LONG  y;
  2723.    } POINTL;
  2724.  
  2725.    For a full description, see Chapter 4, "Types, Macros, Structures."
  2726.  
  2727.    lMaxHits  Specifies the maximum number of hits to record.
  2728.  
  2729.    lMaxDepth  Specifies the maximum number of segment/tag pairs to record for
  2730.    each hit.
  2731.  
  2732.    alSegTag  Points to the array to receive the segment/tag pairs. The array
  2733.    must be large enough to receive 8 x lMaxHits x lMaxDepth bytes.
  2734.  
  2735.  Return Value
  2736.  
  2737.    The return value is the number of hits that occurred if the function is
  2738.    successful or GPI_ERROR if an error occurred.
  2739.  
  2740.  Errors
  2741.  
  2742.    Use the WinGetLastError function to retrieve the error value, which may be
  2743.    one of the following:
  2744.  
  2745.          PMERR_AREA_INCOMPLETE
  2746.          PMERR_IMAGE_INCOMPLETE
  2747.          PMERR_INV_CORRELATE_DEPTH
  2748.          PMERR_INV_CORRELATE_TYPE
  2749.          PMERR_INV_MAX_HITS
  2750.          PMERR_INV_MICROPS_FUNCTION
  2751.          PMERR_PATH_INCOMPLETE
  2752.  
  2753.  Comments
  2754.  
  2755.    GpiCorrelateChain may record more than one segment for each hit. It first
  2756.    records the segment containing the hit, then the segment that called the
  2757.    first segment, and so on until the function either records the original
  2758.    segment in this chain or has recorded lMaxDepth segments. If the function
  2759.    finds less than lMaxDepth segments for the hit, the function records zeros
  2760.    so that exactly lMaxDepth records are copied for each hit. The function
  2761.    records all hits up to lMaxHits, then continues to count the hits even
  2762.    though it no longer records them. The return value specifies the complete
  2763.    number of hits, not just those recorded.
  2764.  
  2765.    The function searches only segments that have nonzero identifiers. If the
  2766.    function encounters a segment with a zero identifier, it stops the search
  2767.    even if subsequent segments in the chain have nonzero identifiers. During
  2768.    the search, the function ignores primitives that do not have nonzero
  2769.    identifiers. The function never records more than one hit for a tag in a
  2770.    segment even if that tag is used with many primitives.
  2771.  
  2772.  See Also
  2773.  
  2774.    GpiCorrelateFrom, GpiCorrelateSegment, GpiSetPickApertureSize
  2775.  
  2776.  
  2777.  ────────────────────────────────────────────────────────────────────────────
  2778.  GpiCorrelateFrom
  2779.  ────────────────────────────────────────────────────────────────────────────
  2780.    LONG GpiCorrelateFrom (hps, idFirstSegment, idLastSegment, lType, pptl,
  2781.    lMaxHits, lMaxDepth, alSegTag)
  2782.    HPS hps;                /*presentation-space handle                     */
  2783.    LONG idFirstSegment;    /*first segment to correlate                    */
  2784.    LONG idLastSegment;     /*last segment to correlate                     */
  2785.    LONG lType;             /*segment type                                  */
  2786.    PPOINTL pptl;           /*pointer to structure for aperture center      */
  2787.    LONG lMaxHits;          /*maximum number of hits                        */
  2788.    LONG lMaxDepth;         /*maximum number of segment/tag pairs to return */
  2789.    PLONG alSegTag;         /*pointer to array of segment and tag           */
  2790.                            /*identifiers                                   */
  2791.  
  2792.    The GpiCorrelateFrom function correlates a portion of the segment chain,
  2793.    identifying each tagged primitive that intersects the current aperture, as
  2794.    set by the GpiSetPickApertureSize function.
  2795.  
  2796.    The GpiCorrelateFrom function correlates a portion of the segment chain by
  2797.    searching for each tagged primitive that lies completely or partially
  2798.    within the aperture. Each instance of a tagged primitive in the aperture
  2799.    is called a "hit." The function records a hit by copying the identifier of
  2800.    the segment containing the primitive (along with the identifier for its
  2801.    tag) to the array pointed to by alSegTag. The function starts the search
  2802.    with the segment identified by idFirstSegment and includes chained and
  2803.    called segments up to, and including, the segment identified by
  2804.    idLastSegment. After searching these segments, GpiCorrelateFrom returns
  2805.    the number of hits it located.
  2806.  
  2807.  Parameters
  2808.  
  2809.    hps  Identifies the presentation space.
  2810.  
  2811.    idFirstSegment  Specifies the first segment to correlate. This value must
  2812.    be greater than zero.
  2813.  
  2814.    idLastSegment  Specifies the last segment to correlate. This value must be
  2815.    greater than zero.
  2816.  
  2817.    lType  Specifies the type of segment to correlate. It can be one of the
  2818.    following values:
  2819.  
  2820.    Value             Meaning
  2821.    ──────────────────────────────────────────────────────────────────────────
  2822.    PICKSEL_ALL       Correlate all segments with nonzero identifiers
  2823.                      regardless of the detectability and visibility
  2824.                      attributes of the segments.
  2825.  
  2826.    PICKSEL_VISIBLE   Correlate visible and detectable segments with nonzero
  2827.                      identifiers.
  2828.    ──────────────────────────────────────────────────────────────────────────
  2829.  
  2830.    pptl  Points to the POINTL structure that contains the position (in
  2831.    presentation page units) of the center of the aperture. The POINTL
  2832.    structure has the following form:
  2833.  
  2834.    typedef struct _POINTL  {
  2835.        LONG  x;
  2836.        LONG  y;
  2837.    } POINTL;
  2838.  
  2839.    For a full description, see Chapter 4, "Types, Macros, Structures."
  2840.  
  2841.    lMaxHits  Specifies the maximum number of hits to record.
  2842.  
  2843.    lMaxDepth  Specifies the maximum number of segment/tag pairs to record.
  2844.  
  2845.    alSegTag  Points to the array to receive the segment/tag pairs. The array
  2846.    must be large enough to receive 8 x lMaxHits x lMaxDepth bytes.
  2847.  
  2848.  Return Value
  2849.  
  2850.    The return value is the number of hits that occurred if the function is
  2851.    successful or GPI_ERROR if an error occurred.
  2852.  
  2853.  Errors
  2854.  
  2855.    Use the WinGetLastError function to retrieve the error value, which may be
  2856.    one of the following:
  2857.  
  2858.          PMERR_AREA_INCOMPLETE
  2859.          PMERR_IMAGE_INCOMPLETE
  2860.          PMERR_INV_CORRELATE_DEPTH
  2861.          PMERR_INV_CORRELATE_TYPE
  2862.          PMERR_INV_MAX_HITS
  2863.          PMERR_INV_MICROPS_FUNCTION
  2864.          PMERR_INV_SEG_NAME
  2865.          PMERR_PATH_INCOMPLETE
  2866.  
  2867.  Comments
  2868.  
  2869.    GpiCorrelateFrom may record more than one segment for each hit. It first
  2870.    records the segment containing the hit, then the segment that called the
  2871.    first segment, and so on until the function either records the original
  2872.    segment in this chain or has recorded lMaxDepth segments. If the function
  2873.    finds less than lMaxDepth segments for the hit, the function records zeros
  2874.    so that exactly lMaxDepth records are copied for each hit. The function
  2875.    records all hits up to lMaxHits, then continues to count the hits even
  2876.    though it no longer records them. The return value specifies the complete
  2877.    number of hits, not just those recorded.
  2878.  
  2879.    The function searches only segments that have nonzero identifiers. If the
  2880.    function encounters a segment with a zero identifier, it stops the search
  2881.    even if subsequently called segments have nonzero identifiers. During the
  2882.    search, the function ignores primitives that do not have nonzero
  2883.    identifiers. The function never records more than one hit for a tag in a
  2884.    segment even if that tag is used with many primitives.
  2885.  
  2886.    If the idFirstSegment parameter does not exist, or is not in the segment
  2887.    chain, the function returns an error. If the segment specified by
  2888.    idLastSegment does not exist, is not in the chain, or is chained before
  2889.    idFirstSegment, no error results and the function continues to the end of
  2890.    the chain.
  2891.  
  2892.  See Also
  2893.  
  2894.    GpiCorrelateChain, GpiCorrelateSegment
  2895.  
  2896.  
  2897.  ────────────────────────────────────────────────────────────────────────────
  2898.  GpiCorrelateSegment
  2899.  ────────────────────────────────────────────────────────────────────────────
  2900.    LONG GpiCorrelateSegment (hps, idSegment, lType, pptl, lMaxHits,
  2901.    lMaxDepth, alSegTag)
  2902.    HPS hps;                /*presentation-space handle                     */
  2903.    LONG idSegment;         /*segment to correlate                          */
  2904.    LONG lType;             /*segment type                                  */
  2905.    PPOINTL pptl;           /*pointer to structure for aperture center      */
  2906.    LONG lMaxHits;          /*maximum number of hits                        */
  2907.    LONG lMaxDepth;         /*maximum number of segment/tag pairs to return */
  2908.    PLONG alSegTag;         /*pointer to array of segment and tag           */
  2909.                            /*identifiers                                   */
  2910.  
  2911.    The GpiCorrelateSegment function correlates the specified segment,
  2912.    identifying each tagged primitive that intersects the current aperture, as
  2913.    set by the GpiSetPickApertureSize function.
  2914.  
  2915.    The GpiCorrelateSegment function correlates a segment by searching for
  2916.    each tagged primitive in the segment that lies completely or partially
  2917.    within the aperture. Each instance of a tagged primitive in the aperture
  2918.    is called a "hit." The function records a hit by copying the identifier of
  2919.    the segment containing the primitive (along with the identifier for its
  2920.    tag) to the array pointed to by alSegTag. The function also searches
  2921.    segments that are called by the specified segment. After searching all
  2922.    segments, GpiCorrelateSegment returns the number of hits it located.
  2923.  
  2924.  Parameters
  2925.  
  2926.    hps  Identifies the presentation space.
  2927.  
  2928.    idSegment  Specifies the segment to correlate. This value must be greater
  2929.    than zero.
  2930.  
  2931.    lType  Specifies the type of segment to correlate. It can be one of the
  2932.    following values:
  2933.  
  2934.    Value             Meaning
  2935.    ──────────────────────────────────────────────────────────────────────────
  2936.    PICKSEL_ALL       Correlate all segments with nonzero identifiers
  2937.                      regardless of the detectability and visibility
  2938.                      attributes of the segments.
  2939.  
  2940.    PICKSEL_VISIBLE   Correlate visible and detectable segments with nonzero
  2941.                      identifiers.
  2942.    ──────────────────────────────────────────────────────────────────────────
  2943.  
  2944.    pptl  Points to the POINTL structure that contains the position (in
  2945.    presentation page units) of the center of the aperture. The POINTL
  2946.    structure has the following form:
  2947.  
  2948.    typedef struct _POINTL  {
  2949.        LONG  x;
  2950.        LONG  y;
  2951.    } POINTL;
  2952.  
  2953.    For a full description, see Chapter 4, "Types, Macros, Structures."
  2954.  
  2955.    lMaxHits  Specifies the maximum number of hits to record.
  2956.  
  2957.    lMaxDepth  Specifies the maximum number of segment/tag pairs to record.
  2958.  
  2959.    alSegTag  Points to the array to receive the segment/tag pairs. The array
  2960.    must be large enough to receive 8 x lMaxHits x lMaxDepth bytes.
  2961.  
  2962.  Return Value
  2963.  
  2964.    The return value is the number of hits that occurred if the function is
  2965.    successful or GPI_ERROR if an error occurred.
  2966.  
  2967.  Errors
  2968.  
  2969.    Use the WinGetLastError function to retrieve the error value, which may be
  2970.    one of the following:
  2971.  
  2972.          PMERR_AREA_INCOMPLETE
  2973.          PMERR_IMAGE_INCOMPLETE
  2974.          PMERR_INV_CORRELATE_DEPTH
  2975.          PMERR_INV_CORRELATE_TYPE
  2976.          PMERR_INV_MAX_HITS
  2977.          PMERR_INV_MICROPS_FUNCTION
  2978.          PMERR_INV_SEG_NAME
  2979.          PMERR_PATH_INCOMPLETE
  2980.  
  2981.  Comments
  2982.  
  2983.    GpiCorrelateSegment may record more than one segment for each hit. It
  2984.    first records the segment containing the hit, then the segment that called
  2985.    the first segment, and so on until the function either records the
  2986.    original segment in this chain or records lMaxDepth segments. If the
  2987.    function finds less than lMaxDepth segments for the hit, the function
  2988.    records zeros so that exactly lMaxDepth records are copied for each hit.
  2989.    The function records all hits up to lMaxHits, then continues to count the
  2990.    hits even though it no longer records them. The return value specifies the
  2991.    complete number of hits, not just those recorded.
  2992.  
  2993.    The function searches only segments that have nonzero identifiers. If the
  2994.    function encounters a segment with a zero identifier, it stops the search
  2995.    even if subsequently called segments have nonzero identifiers. During the
  2996.    search, the function ignores primitives that do not have nonzero
  2997.    identifiers. The function never records more than one hit for a tag in a
  2998.    segment even if that tag is used with many primitives.
  2999.  
  3000.  See Also
  3001.  
  3002.    GpiCorrelateChain, GpiCorrelateFrom
  3003.  
  3004.  
  3005.  ────────────────────────────────────────────────────────────────────────────
  3006.  GpiCreateBitmap
  3007.  ────────────────────────────────────────────────────────────────────────────
  3008.    HBITMAP GpiCreateBitmap (hps, pbmpFormat, flOptions, pbData, pbmiData)
  3009.    HPS hps;                /*presentation-space handle                     */
  3010.    PBITMAPINFOHEADER pbmpFormat;
  3011.                            /*pointer to structure for format data          */
  3012.    ULONG flOptions;        /*options                                       */
  3013.    PBYTE pbData;           /*pointer to buffer of image data               */
  3014.    PBITMAPINFO pbmiData;   /*pointer to structure for color and format     */
  3015.  
  3016.    The GpiCreateBitmap function creates a bitmap and returns a bitmap handle
  3017.    identifying the bitmap. The new bitmap has the width, height, and format
  3018.    specified by fields of the structure pointed to by pbmpFormat. The
  3019.    flOptions parameter specifies whether to initialize the bitmap color and
  3020.    image. If the parameter is CBM_INIT, the function uses the bitmap image
  3021.    data pointed to by pbData and the bitmap color data pointed to by pbmiData
  3022.    to initialize the bitmap. If CBM_INIT is not given, the bitmap's initial
  3023.    image and color are undefined.
  3024.  
  3025.    The bitmap handle can be used in subsequent functions that accept bitmap
  3026.    handles. In most cases, the bitmap is set to a memory presentation space
  3027.    using the GpiSetBitmap function, then copied to the screen or a printer
  3028.    using the GpiBitBlt function.
  3029.  
  3030.  Parameters
  3031.  
  3032.    hps  Identifies the presentation space.
  3033.  
  3034.    pbmpFormat  Points to the BITMAPINFOHEADER structure that contains the
  3035.    bitmap format data. The BITMAPINFOHEADER structure has the following form:
  3036.  
  3037.    typedef struct _BITMAPINFOHEADER {
  3038.        ULONG  cbFix;
  3039.        USHORT cx;
  3040.        USHORT cy;
  3041.        USHORT cPlanes;
  3042.        USHORT cBitCount;
  3043.    } BITMAPINFOHEADER;
  3044.  
  3045.    For a full description, see Chapter 4, "Types, Macros, Structures."
  3046.  
  3047.    flOptions  Specifies whether to initialize the bitmap. It can one of the
  3048.    following values:
  3049.  
  3050.    Value             Meaning
  3051.    ──────────────────────────────────────────────────────────────────────────
  3052.    CBM_INIT          Initializes the bitmap, using the bitmap image and color
  3053.                      data specified by the pbData and pbmiData parameters.
  3054.  
  3055.    0x0000            Does not initialize the bitmap.
  3056.    ──────────────────────────────────────────────────────────────────────────
  3057.  
  3058.    pbData  Points to the buffer that contains bitmap image data. The image
  3059.    data defines the color of each pel in the bitmap. This parameter is
  3060.    ignored if CBM_INIT is not given.
  3061.  
  3062.    pbmiData  Points to a BITMAPINFO structure that contains the bitmap format
  3063.    and color data. The format data is identical to the data pointed to by the
  3064.    pbmpFormat parameter. The color data follows immediately after the format
  3065.    data, and consists of two or more RGB color values. The exact number
  3066.    depends on the bitmap format. This parameter is ignored if CBM_INIT is not
  3067.    given. The BITMAPINFO structure has the following form:
  3068.  
  3069.    typedef struct _BITMAPINFO {
  3070.        ULONG  cbFix;
  3071.        USHORT cx;
  3072.        USHORT cy;
  3073.        USHORT cPlanes;
  3074.        USHORT cBitCount;
  3075.        RGB    argbColor[1];
  3076.    } BITMAPINFO;
  3077.  
  3078.    For a full description, see Chapter 4, "Types, Macros, Structures."
  3079.  
  3080.  Return Value
  3081.  
  3082.    The return value identifies the new bitmap if the function is successful,
  3083.    or is GPI_ERROR if an error occurred.
  3084.  
  3085.  Errors
  3086.  
  3087.    Use the WinGetLastError function to retrieve the error value, which may be
  3088.    the following:
  3089.  
  3090.          PMERR_INV_USAGE
  3091.  
  3092.  Comments
  3093.  
  3094.    The full number of bitmap formats depends on what the associated device
  3095.    supports. However, most devices support the following standard bitmap
  3096.    formats:
  3097.  
  3098.    Format            Description
  3099.    ──────────────────────────────────────────────────────────────────────────
  3100.    Monochrome        1 bit per pel and 1 color plane
  3101.  
  3102.    16-color          4 bits per pel and 1 color plane
  3103.  
  3104.    256-color         8 bits per pel and 1 color plane
  3105.  
  3106.    Full-color        24 bits per pel and 1 color plane
  3107.    ──────────────────────────────────────────────────────────────────────────
  3108.  
  3109.    When initializing the bitmap, the bitmap color data must consist of an
  3110.    appropriate number of RGB color values. For monochrome format, it must
  3111.    have 2 values; for 16-color format, 16 values; and for 256-color format,
  3112.    256 values. No color values are required for the full-color format, since
  3113.    the image data for each pel fully specifies the pel color.
  3114.  
  3115.    When CBM_INIT is given, the function continues to copy data from the
  3116.    buffer until the entire bitmap is initialized. The function expects each
  3117.    row of image data to contain a multiple of 32 bits (4 bytes). Although the
  3118.    bitmap width does not have to be a multiple of 32, the image data must be.
  3119.    Any extra bits at the end of a row are ignored.
  3120.  
  3121.    The new bitmap belongs to the device context associated with the given
  3122.    presentation space. It can be set to any presentation space having the
  3123.    same device context or having a compatible device context.
  3124.  
  3125.  Example
  3126.  
  3127.    The following example loads a bitmap resource from memory and uses the
  3128.    GpiCreateBitmap function to create the bitmap. This is similar to using
  3129.    the GpiLoadBitmap function, except it gives the application the chance to
  3130.    modify the bitmap image data before creating the bitmap.
  3131.  
  3132.    SEL sel;          /* selector for segment containing bitmap resource */
  3133.    PBITMAPFILEHEADER pbfh;  /* bitmap resource header information       */
  3134.    PBYTE pb;                /* pointer to bitmap image data in resource */
  3135.    HBITMAP hbm;             /* bitmap handle                            */
  3136.  
  3137.    DosGetResource(NULL, RT_BITMAP, 1, &sel); /* load bitmap resource #1 */
  3138.    pbfh = MAKEP(sel, 0);              /* bitmap file header in resource */
  3139.    pb = MAKEP(sel, pbfh->offBits);    /* image data starts at offBits   */
  3140.  
  3141.    /* make any changes to bitmap image data here */
  3142.  
  3143.    hbm = GpiCreateBitmap(hps,             /* presentation space         */
  3144.        &(pbfh->bmp),                      /* bitmap information in file */
  3145.        CBM_INIT,                          /* initialize the bitmap      */
  3146.        pb,                                /* bitmap data                */
  3147.        &(pbfh->bmp));                     /* bitmap information in file */
  3148.  
  3149.    DosFreeSeg(sel);                       /* free bitmap resource       */
  3150.  
  3151.  See Also
  3152.  
  3153.    DosFreeSeg, DosGetResource, GpiDeleteBitmap, GpiLoadBitmap,
  3154.    GpiQueryDeviceBitmapFormats
  3155.  
  3156.  
  3157.  ────────────────────────────────────────────────────────────────────────────
  3158.  GpiCreateLogColorTable
  3159.  ────────────────────────────────────────────────────────────────────────────
  3160.    BOOL GpiCreateLogColorTable (hps, flOptions, lFormat, iStart, clTable,
  3161.    alTable)
  3162.    HPS hps;                /*presentation-space handle                     */
  3163.    ULONG flOptions;        /*options                                       */
  3164.    LONG lFormat;           /*format of entries                             */
  3165.    LONG iStart;            /*starting index                                */
  3166.    LONG clTable;           /*number of entries in table                    */
  3167.    PLONG alTable;          /*pointer to array for table                    */
  3168.  
  3169.    The GpiCreateLogColorTable function creates a logical color table. The
  3170.    logical color table has the format specified by lFormat, with the initial
  3171.    value of each entry specified by the array alTable.
  3172.  
  3173.  Parameters
  3174.  
  3175.    hps  Identifies the presentation space.
  3176.  
  3177.    flOptions  Specifies whether the logical color table uses pure,
  3178.    realizable, or default color values. It can be one of the following
  3179.    values:
  3180.  
  3181. ╓┌─┌─────────────────┌───────────────────────────────────────────────────────╖
  3182.    Value             Meaning
  3183.    ──────────────────────────────────────────────────────────────────────────
  3184.    0x0000            Creates a logical color table having the entries
  3185.                      specified by alTable. The logical color table entries
  3186.                      map to existing device colors in the physical palette or
  3187.                      to dithered colors if no matching device color is in the
  3188.                      palette. This means the table is not realized and does
  3189.                      not require pure colors.
  3190.  
  3191.    LCOL_PURECOLOR    Creates a logical color table whose entries map to pure
  3192.                      (nondithered) colors only. If not given, the function
  3193.                      creates a color table whose entries map to dithered
  3194.    Value             Meaning
  3195.    ──────────────────────────────────────────────────────────────────────────
  3196.                     creates a color table whose entries map to dithered
  3197.                      colors if the physical palette does not contain matching
  3198.                      device colors.
  3199.  
  3200.    LCOL_REALIZABLE   Creates a logical color table that can be realized by
  3201.                      using the GpiRealizeColorTable function. Until the
  3202.                      logical color table is realized, colors in the table map
  3203.                      to the existing device colors in the physical palette.
  3204.                      This option is useful only for devices that permit
  3205.                      realization of logical color tables.
  3206.  
  3207.    LCOL_RESET        Resets all entries in the logical color table to default
  3208.                      values before initializing the entries specified by the
  3209.                      alTable parameter. This option is useful for quickly
  3210.                      initializing all entries without supplying initial
  3211.                      values for every element in alTable.
  3212.    ──────────────────────────────────────────────────────────────────────────
  3213.  
  3214.  
  3215.    lFormat  Specifies the logical color table format. It can be one of the
  3216.    following values:
  3217.  
  3218.    Value             Meaning
  3219.    ──────────────────────────────────────────────────────────────────────────
  3220.    LCOLF_CONSECRGB   Creates a color table having consecutive entries. The
  3221.                      first entry has the index specified by iStart.
  3222.  
  3223.    LCOLF_INDRGB      Creates a color table. The entries are not required to
  3224.                      be consecutive. The alTable array specifies both the
  3225.                      index and RGB color value for each entry.
  3226.  
  3227.    LCOLF_RGB         Enables direct RGB color mapping. Applications use RGB
  3228.                      values instead of color indexes to specify the colors in
  3229.                      subsequent drawing functions.
  3230.    ──────────────────────────────────────────────────────────────────────────
  3231.  
  3232.    iStart  Specifies the color index of the first entry for a color table
  3233.    having LCOLF_CONSECRGB format. If LCOLF_CONSECRGB is not given, this
  3234.    parameter is ignored.
  3235.  
  3236.    clTable  Specifies the number of elements in the array alTable. If the
  3237.    format LCOLF_INDRGB is given, this parameter must be an even number (that
  3238.    is, two elements for each entry). If LCOL_RESET or LCOLF_RGB is given,
  3239.    this parameter can be zero.
  3240.  
  3241.    alTable  Specifies the start address of the array that contains the color
  3242.    table entries. The format depends on the value of lFormat, as follows:
  3243.  
  3244.    Value               Format
  3245.    ──────────────────────────────────────────────────────────────────────────
  3246.    LCOLF_CONSECRGB     Each element is a 4-byte RGB color value.
  3247.  
  3248.    LCOLF_INDRGB        Each pair of elements contains a 4-byte color index
  3249.                        and a 4-byte RGB color value, in that order.
  3250.  
  3251.    LCOLF_RGB           No elements required.
  3252.    ──────────────────────────────────────────────────────────────────────────
  3253.  
  3254.  Return Value
  3255.  
  3256.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  3257.    an error occurred.
  3258.  
  3259.  Errors
  3260.  
  3261.    Use the WinGetLastError function to retrieve the error value, which may be
  3262.    one of the following:
  3263.  
  3264.          PMERR_INV_COLOR_DATA
  3265.          PMERR_INV_COLOR_FORMAT
  3266.          PMERR_INV_COLOR_OPTIONS
  3267.  
  3268.  Comments
  3269.  
  3270.    Although GpiCreateLogColorTable can create a realizable color table, it
  3271.    does not realize the colors. Until the color table is realized by using
  3272.    the GpiRealizeColorTable function, the logical color table entries are
  3273.    mapped to the existing colors in the physical palette. Realizing the
  3274.    logical color table causes the physical palette colors to be replaced with
  3275.    the realized colors for the logical color table entries.
  3276.  
  3277.    The default physical palette contains at least the standard 16 PC colors
  3278.    (unless this is not physically possible). If a device supports more than
  3279.    16 colors, the physical palette may have additional colors, but there is
  3280.    no guarantee that these additional colors are the same on every device.
  3281.  
  3282.  Example
  3283.  
  3284.    This example uses the GpiCreateLogColorTable function to create a logical
  3285.    color table, using data from the previous logical color table:
  3286.  
  3287.    ULONG alTable[16];                       /* assume 16 entries        */
  3288.  
  3289.    /* retrieve the current table */
  3290.  
  3291.    GpiQueryLogColorTable(hps, 0L, 0L, 16L, alTable);
  3292.  
  3293.    alTable[1] = 0x000080;      /* change the second entry to light blue */
  3294.  
  3295.    GpiCreateLogColorTable(hps,              /* presentation space       */
  3296.        0L,                                  /* no special options       */
  3297.        LCOLF_CONSECRGB,                     /* consecutive RGB values   */
  3298.        0L,                                  /* start with color index 0 */
  3299.        16,                                  /* 16 entries               */
  3300.        alTable);                            /* RGB color values         */
  3301.  
  3302.  See Also
  3303.  
  3304.    DevQueryCaps, GpiErase, GpiQueryColorData, GpiQueryLogColorTable,
  3305.    GpiRealizeColorTable, GpiSetBitmapBits, WinSetSysColors
  3306.  
  3307.  
  3308.  ────────────────────────────────────────────────────────────────────────────
  3309.  GpiCreateLogFont
  3310.  ────────────────────────────────────────────────────────────────────────────
  3311.    LONG GpiCreateLogFont (hps, pchName, lcid, pfat)
  3312.    HPS hps;                /*presentation-space handle                     */
  3313.    PSTR8 pchName;          /*pointer to logical-font name                  */
  3314.    LONG lcid;              /*local identifier                              */
  3315.    PFATTRS pfat;           /*pointer to structure for font attributes      */
  3316.  
  3317.    The GpiCreateLogFont function creates a logical font. A logical font is a
  3318.    list of font attributes, such as face name, average width, and maximum
  3319.    height, that an application uses to request a physical font. A physical
  3320.    font is the bitmap or vector information the system uses to draw
  3321.    characters on a device. Applications create logical fonts to specify the
  3322.    fonts they need, and the system maps the logical fonts to matching
  3323.    physical fonts.
  3324.  
  3325.    GpiCreateLogFont creates a logical font using the font attributes
  3326.    specified in the structure pointed to by the pfat parameter. Each logical
  3327.    font has a local identifier and logical font name, specified by the lcid
  3328.    and pchName parameters, to uniquely identify it. The local identifier can
  3329.    then be used in subsequent graphics functions to identify the font.
  3330.  
  3331.    Since a physical font that exactly matches the logical font may not be
  3332.    available, the system usually maps the logical font to the closest
  3333.    matching physical font. The system uses rules to map the font──for
  3334.    example, it chooses a font with a greater height if a font of the exact
  3335.    height is not available. An application can force the system to choose a
  3336.    particular font by setting the value of the lMatch field in the FATTRS
  3337.    structure to be that returned for the desired font by the GpiQueryFonts
  3338.    function. After GpiCreateLogFont chooses the physical font, this choice
  3339.    does not change for a particular logical font.
  3340.  
  3341.  Parameters
  3342.  
  3343.    hps  Identifies the presentation space.
  3344.  
  3345.    pchName  Points to an 8-character logical-font name. It can be NULL, if no
  3346.    logical font name is desired.
  3347.  
  3348.    lcid  Specifies the local identifier that the application uses to refer to
  3349.    this font. It must be in the range 1 through 254. It is an error if this
  3350.    parameter is already in use to refer to a font or bitmap.
  3351.  
  3352.    pfat  Points to a FATTRS structure that will contain the attributes of the
  3353.    logical font that is created. The FATTRS structure has the following form:
  3354.  
  3355.    typedef struct _FATTRS {
  3356.        USHORT  usRecordLength;
  3357.        USHORT  fsSelection;
  3358.        LONG    lMatch;
  3359.        CHAR    szFaceName[FACESIZE];
  3360.        USHORT  idRegistry;
  3361.        USHORT  usCodePage;
  3362.        LONG    lMaxBaselineExt;
  3363.        LONG    lAveCharWidth;
  3364.        USHORT  fsType;
  3365.        SHORT   sQuality;
  3366.        USHORT  fsFontUse;
  3367.    } FATTRS;
  3368.  
  3369.    For a full description, see Chapter 4, "Types, Macros, Structures."
  3370.  
  3371.  Return Value
  3372.  
  3373.    The return value is 2 if a matching font is found, 1 if a matching font
  3374.    could not be found, or zero if an error occurred.
  3375.  
  3376.  Errors
  3377.  
  3378.    Use the WinGetLastError function to retrieve the error value, which may be
  3379.    one of the following:
  3380.  
  3381.          PMERR_FONT_NOT_LOADED
  3382.          PMERR_INV_FONT_ATTRS
  3383.  
  3384.  Comments
  3385.  
  3386.    To choose the system default font, set the face name to NULL and all other
  3387.    attributes in the FATTR structure, except the code page, to zero.
  3388.  
  3389.    To use a font, the application sets the font for the presentation space by
  3390.    specifying the local identifier for the corresponding logical font with
  3391.    the GpiSetCharSet function. Once a font is set, the system uses the font
  3392.    for subsequent text output.
  3393.  
  3394.  Example
  3395.  
  3396.    This example uses the GpiCreateLogFont function to create a logical font
  3397.    with the local identifier 1. The logical font has the face name "Courier"
  3398.    and requested width and height of 12 pels. Once the font is created, the
  3399.    example sets the font using the local identifier and displays a string in
  3400.    the font at the point (100,100).
  3401.  
  3402.    USHORT i;
  3403.    POINTL ptl = { 100, 100 };
  3404.    FATTRS fat;
  3405.  
  3406.    fat.usRecordLength = sizeof(FATTRS); /* set size of structure        */
  3407.    fat.fsSelection = 0;            /* use default selection             */
  3408.    fat.lMatch = 0L;                /* do not force match                */
  3409.    fat.idRegistry = 0;             /* use default registry              */
  3410.    fat.usCodePage = 850;           /* code page 850                     */
  3411.    fat.lMaxBaselineExt = 12L;      /* requested font height is 12 pels  */
  3412.    fat.lAveCharWidth = 12L;        /* requested font width is 12 pels   */
  3413.    fat.fsType = FATTR_TYPE_FIXED;  /* fixed-spacing font                */
  3414.    fat.fsFontUse = FATTR_FONTUSE_NOMIX; /* do not mix with graphics     */
  3415.  
  3416.    /* copy Courier to szFacename field */
  3417.  
  3418.    for (i=0; fat.szFacename[i] = "Courier"[i]; i++);
  3419.  
  3420.  
  3421.    GpiCreateLogFont(hps,           /* presentation space                */
  3422.                     NULL,          /* do not use logical font name      */
  3423.                     1L,            /* local identifier                  */
  3424.                     &fat);         /* structure with font attributes    */
  3425.  
  3426.    GpiSetCharSet(hps, 1L);           /* set font for presentation space */
  3427.    GpiCharStringAt(hps, &ptl, 5L, "Hello"); /* display a string         */
  3428.  
  3429.  See Also
  3430.  
  3431.    GpiCharStringAt, GpiCreateLogFont, GpiQueryFonts, GpiSetCharSet
  3432.  
  3433.  
  3434.  ────────────────────────────────────────────────────────────────────────────
  3435.  GpiCreatePS
  3436.  ────────────────────────────────────────────────────────────────────────────
  3437.    HPS GpiCreatePS (hab, hdc, psizl, flOptions)
  3438.    HAB hab;                /*anchor-block handle                           */
  3439.    HDC hdc;                /*device-context handle                         */
  3440.    PSIZEL psizl;           /*pointer to structure for page size            */
  3441.    ULONG flOptions;        /*presentation-space options                    */
  3442.  
  3443.    The GpiCreatePS function creates a presentation space. The presentation
  3444.    space has the presentation type, page size, page unit, and storage format
  3445.    specified by psizl and flOptions. The function also associates the device
  3446.    context specified by hdc with the presentation space if a device context
  3447.    is given. The presentation space, identified by the handle returned by
  3448.    GpiCreatePS, can be used in subsequent Gpi functions to draw to the
  3449.    associated device.
  3450.  
  3451.  Parameters
  3452.  
  3453.    hab  Identifies the anchor block.
  3454.  
  3455.    hdc  Identifies a device context. It is required only if the GPIA_ASSOC
  3456.    option is given in flOptions. It must be a handle to a device context if
  3457.    the GPIT_MICRO option is given. Otherwise, it can be NULL.
  3458.  
  3459.    psizl  Points to a SIZEL structure that contains the width and height of
  3460.    the presentation page. The width and height can be zero if the GPIA_ASSOC
  3461.    option is given. The width and height must be non-zero if the PU_ARBITRARY
  3462.    option is given. The SIZEL structure has the following form:
  3463.  
  3464.    typedef struct _SIZEL {
  3465.        LONG cx;
  3466.        LONG cy;
  3467.    } SIZEL;
  3468.  
  3469.    For a full description, see Chapter 4, "Types, Macros, Structures."
  3470.  
  3471.    flOptions  Specifies the presentation-space options. The options define
  3472.    the page unit, storage format, and presentation type for the presentation
  3473.    space, as well as specifying whether to associate a device context with
  3474.    the new presentation space. The flOptions parameter must include exactly
  3475.    one of the following page unit options combined with no more than one each
  3476.    of the following storage format, presentation type, and association
  3477.    options:
  3478.  
  3479.    Page unit         Meaning
  3480.    ──────────────────────────────────────────────────────────────────────────
  3481.    PU_ARBITRARY      Sets units initially to pels but permits the units to be
  3482.                      modified later using the GpiSetPageViewport function.
  3483.  
  3484.    PU_HIENGLISH      Sets units to 0.001 inch.
  3485.  
  3486.    PU_HIMETRIC       Sets units to 0.01 millimeter.
  3487.  
  3488.    PU_LOENGLISH      Sets units to 0.01 inch.
  3489.  
  3490.    PU_LOMETRIC       Sets units to 0.1 millimeter.
  3491.  
  3492.    PU_PELS           Sets units to pels.
  3493.  
  3494.    PU_TWIPS          Sets units to 1/1440 inch (1/20 point).
  3495.    ──────────────────────────────────────────────────────────────────────────
  3496.  
  3497.    Storage format    Meaning
  3498.    ──────────────────────────────────────────────────────────────────────────
  3499.    GPIF_DEFAULT      Stores coordinates as 2-byte integers. GPIF_DEFAULT is
  3500.                      the default if no storage format is given.
  3501.  
  3502.    GPIF_LONG         Stores coordinates as 4-byte integers.
  3503.  
  3504.    GPIF_SHORT        Stores coordinates as 2-byte integers.
  3505.    ──────────────────────────────────────────────────────────────────────────
  3506.  
  3507.    Presentation type Meaning
  3508.    ──────────────────────────────────────────────────────────────────────────
  3509.    GPIT_MICRO        Creates a micro presentation space. The presentation
  3510.                      space must be associated with a screen device context.
  3511.                      The GPIA_ASSOC option and a device context must also be
  3512.                      given.
  3513.  
  3514.    GPIT_NORMAL       Creates a normal presentation space. The presentation
  3515.                      space can be associated with any device context and used
  3516.                      with retained graphics. If a presentation-space type is
  3517.                      not given, the default is GPIT_NORMAL.
  3518.    ──────────────────────────────────────────────────────────────────────────
  3519.  
  3520.    Association       Meaning
  3521.    ──────────────────────────────────────────────────────────────────────────
  3522.    GPIA_ASSOC        Associates the device context specified by hdc with the
  3523.                      new presentation space. If hdc identifies a memory
  3524.                      device context, GPIT_MICRO must be set or the system
  3525.                      will issue a warning.
  3526.  
  3527.    GPIA_NOASSOC      Creates presentation space without associating a device
  3528.                      context. GPIA_NOASSOC is the default if an association
  3529.                      option is not given.
  3530.    ──────────────────────────────────────────────────────────────────────────
  3531.  
  3532.  Return Value
  3533.  
  3534.    The return value is the handle of the presentation space if the function
  3535.    is successful or GPI_ERROR if an error occurred.
  3536.  
  3537.  Errors
  3538.  
  3539.    Use the WinGetLastError function to retrieve the error value, which may be
  3540.    the following:
  3541.  
  3542.          PMERR_INV_OR_INCOMPAT_OPTIONS
  3543.  
  3544.  Comments
  3545.  
  3546.    The presentation type can be normal or micro. Normal presentation spaces
  3547.    can be associated with any device context and can be used for retained
  3548.    graphics. Micro presentation spaces can be associated with any device, but
  3549.    only when they are created. They can never be reassociated. The GPIA_ASSOC
  3550.    and GPIA_NOASSOC options specify whether the new presentation space is to
  3551.    be associated with the device context identified by hdc. If not
  3552.    associated, the GpiAssociate function must be used to associate a device
  3553.    context. A presentation space can not be used without an associated
  3554.    device.
  3555.  
  3556.    The page unit specifies the unit of measure used to draw to the device.
  3557.    For example, if the page unit is pels, a line 100 units long in world
  3558.    space coordinates is 100 pels long on the device.
  3559.  
  3560.    The presentation page size specifies the width and height of the
  3561.    presentation page. The presentation page and page viewport define how
  3562.    points in the presentation page space are mapped to the pels in the device
  3563.    space. This is important for programs that need to change the page unit
  3564.    without recreating the presentation space.
  3565.  
  3566.    The storage format specifies the internal format for coordinate values
  3567.    stored in the segments. This is important for applications that edit
  3568.    segments.
  3569.  
  3570.  Example
  3571.  
  3572.    This example uses the GpiCreatePS function to create a micro presentation
  3573.    space for a memory device context. The function associates the
  3574.    presentation space with the device context and sets the page units to
  3575.    pels. By default, the presentation space is a normal presentation space
  3576.    that uses local storage format.
  3577.  
  3578.    HDC hdc;
  3579.    HPS hps;
  3580.    SIZEL sizl = { 0, 0 };    /* use same page size as device */
  3581.    DEVOPENSTRUC dop;
  3582.  
  3583.    dop.pszLogAddress = NULL;
  3584.    dop.pszDriverName = (PSZ) "DISPLAY";
  3585.    dop.pdriv = NULL;
  3586.    dop.pszDataType = NULL;
  3587.  
  3588.    /* Create the memory device context. */
  3589.  
  3590.    hdc = DevOpenDC(hab, OD_MEMORY, "*", 4L, &dop, NULL);
  3591.  
  3592.    /* Create the presentation and associate the memory device context. */
  3593.  
  3594.    hps = GpiCreatePS(hab, hdc, &sizl, PU_PELS | GPIT_MICRO | GPIA_ASSOC);
  3595.  
  3596.  See Also
  3597.  
  3598.    GpiDestroyPS, GpiSetPageViewport
  3599.  
  3600.  
  3601.  ────────────────────────────────────────────────────────────────────────────
  3602.  GpiCreateRegion
  3603.  ────────────────────────────────────────────────────────────────────────────
  3604.    HRGN GpiCreateRegion (hps, crcl, prcl)
  3605.    HPS hps;                /*presentation-space handle                     */
  3606.    LONG crcl;              /*number of rectangles                          */
  3607.    PRECTL prcl;            /*pointer to structure for rectangles           */
  3608.  
  3609.    The GpiCreateRegion function creates a region for the device associated
  3610.    with the specified presentation space. The region is the union of the
  3611.    rectangles specified by the prcl parameter.
  3612.  
  3613.  Parameters
  3614.  
  3615.    hps  Identifies the presentation space.
  3616.  
  3617.    crcl  Specifies the number of rectangles specified in the prcl parameter.
  3618.    If the crcl parameter is equal to zero, an empty region is created, and
  3619.    prcl is ignored.
  3620.  
  3621.    prcl  Points to an array of RECTL structures. The RECTL structure has the
  3622.    following form:
  3623.  
  3624.    typedef struct _RECTL {
  3625.        LONG xLeft;
  3626.        LONG yBottom;
  3627.        LONG xRight;
  3628.        LONG yTop;
  3629.    } RECTL;
  3630.  
  3631.    For a full description, see Chapter 4, "Types, Macros, Structures."
  3632.  
  3633.  Return Value
  3634.  
  3635.    The return value is a handle to the region if the function is successful
  3636.    or zero if an error occurred. It is an error if this function is issued
  3637.    when there is no device context associated with the presentation space.
  3638.  
  3639.  Example
  3640.  
  3641.    This example uses the GpiCreateRegion function to create a region
  3642.    consisting of the union of three rectangles:
  3643.  
  3644.    HRGN hrgn;                                      /* handle for region */
  3645.    RECTL arcl[3] = { 100, 100, 200, 200,           /* 1st rectangle     */
  3646.                      150, 150, 250, 250,           /* 2nd rectangle     */
  3647.                      200, 200, 300, 300 };         /* 3rd rectangle     */
  3648.  
  3649.    hrgn = GpiCreateRegion(hps,                    /* presentation space */
  3650.                           3L,                     /* three rectangles   */
  3651.                           arcl);      /* pointer to array of rectangles */
  3652.  
  3653.  See Also
  3654.  
  3655.    GpiCombineRegion, GpiDestroyRegion
  3656.  
  3657.  
  3658.  ────────────────────────────────────────────────────────────────────────────
  3659.  GpiDeleteBitmap
  3660.  ────────────────────────────────────────────────────────────────────────────
  3661.    BOOL GpiDeleteBitmap (hbm)
  3662.    HBITMAP hbm;            /*bitmap handle                                 */
  3663.  
  3664.    The GpiDeleteBitmap function deletes the bitmap specified by hbm.
  3665.  
  3666.  Parameters
  3667.  
  3668.    hbm  Identifies the bitmap to delete.
  3669.  
  3670.  Return Value
  3671.  
  3672.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  3673.    an error occurred.
  3674.  
  3675.  Errors
  3676.  
  3677.    Use the WinGetLastError function to retrieve the error value, which may be
  3678.    the following:
  3679.  
  3680.          PMERR_BITMAP_IS_SELECTED
  3681.  
  3682.  Example
  3683.  
  3684.    This example uses the GpiDeleteBitmap function to delete a bitmap. The
  3685.    GpiSetBitmap function releases the bitmap from the presentation space
  3686.    before deleting it. This is needed only if the bitmap is set in the
  3687.    presentation space.
  3688.  
  3689.    HBITMAP hbm, hbmPrevious;
  3690.  
  3691.    hbm = GpiLoadBitmap(hps, NULL, 1, 0L, 0L); /* load the bitmap        */
  3692.    hbmPrevious = GpiSetBitmap(hps, hbm);      /* set bitmap for PS      */
  3693.  
  3694.    /* use GpiBitBlt to display bitmap */
  3695.  
  3696.    GpiSetBitmap(hps, hbmPrevious);            /* release bitmap from PS */
  3697.    GpiDeleteBitmap(hbm);                      /* delete the bitmap      */
  3698.  
  3699.  See Also
  3700.  
  3701.    GpiCreateBitmap, GpiLoadBitmap, GpiQueryDeviceBitmapFormats,
  3702.    GpiSetBitmap
  3703.  
  3704.  
  3705.  ────────────────────────────────────────────────────────────────────────────
  3706.  GpiDeleteElement
  3707.  ────────────────────────────────────────────────────────────────────────────
  3708.    BOOL GpiDeleteElement (hps)
  3709.    HPS hps;                /*presentation-space handle                     */
  3710.  
  3711.    The GpiDeleteElement function deletes an element from the currently open
  3712.    segment. The function deletes the element pointed to by the element
  3713.    pointer, then moves the element pointer to the preceding element (if any).
  3714.    The segment containing the element must be open and the drawing mode must
  3715.    be DM_RETAIN.
  3716.  
  3717.    GpiDeleteElement cannot be used in an element bracket.
  3718.  
  3719.  Parameters
  3720.  
  3721.    hps  Identifies the presentation space.
  3722.  
  3723.  Return Value
  3724.  
  3725.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  3726.    an error occurred.
  3727.  
  3728.  Errors
  3729.  
  3730.    Use the WinGetLastError function to retrieve the error value, which may be
  3731.    the following:
  3732.  
  3733.          PMERR_INV_MICROPS_FUNCTION
  3734.  
  3735.  Example
  3736.  
  3737.    This example uses the GpiDeleteElement function to delete the third
  3738.    element from the previously created segment 2:
  3739.  
  3740.    GpiOpenSegment(hps, 2L);           /* open segment #2       */
  3741.    GpiSetElementPointer(hps, 3L);     /* move to third element */
  3742.    GpiDeleteElement(hps);             /* delete element        */
  3743.    GpiCloseSegment(hps);              /* close the segment     */
  3744.  
  3745.  See Also
  3746.  
  3747.    GpiBeginElement, GpiEndElement, GpiQueryElement,
  3748.    GpiQueryElementPointer, GpiSetElementPointer
  3749.  
  3750.  
  3751.  ────────────────────────────────────────────────────────────────────────────
  3752.  GpiDeleteElementRange
  3753.  ────────────────────────────────────────────────────────────────────────────
  3754.    BOOL GpiDeleteElementRange (hps, idFirstElement, idLastElement)
  3755.    HPS hps;                /*presentation-space handle                     */
  3756.    LONG idFirstElement;    /*first element                                 */
  3757.    LONG idLastElement;     /*last element                                  */
  3758.  
  3759.    The GpiDeleteElementRange function deletes one or more elements from the
  3760.    currently open segment. The function deletes all elements between and
  3761.    including the elements specified by idFirstElement and idLastElement, then
  3762.    moves the element pointer to the preceding element (if any). The function
  3763.    rounds idFirstElement or idLastElement to a valid element-pointer position
  3764.    if the given position does not point to an element. The segment containing
  3765.    the element must be open and the drawing mode must be DM_RETAIN.
  3766.  
  3767.    GpiDeleteElementRange cannot be used in an element bracket.
  3768.  
  3769.  Parameters
  3770.  
  3771.    hps  Identifies the presentation space.
  3772.  
  3773.    idFirstElement  Specifies the element-pointer position of the first
  3774.    element to delete.
  3775.  
  3776.    idLastElement  Specifies the element-pointer position of the last element
  3777.    to delete.
  3778.  
  3779.  Return Value
  3780.  
  3781.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  3782.    an error occurred.
  3783.  
  3784.  Errors
  3785.  
  3786.    Use the WinGetLastError function to retrieve the error value, which may be
  3787.    the following:
  3788.  
  3789.          PMERR_INV_MICROPS_FUNCTION
  3790.  
  3791.  Example
  3792.  
  3793.    This example uses the GpiDeleteElementRange function to delete the second
  3794.    through fifth elements in the previously created segment 2:
  3795.  
  3796.    GpiOpenSegment(hps, 2L);            /* open segment # 2            */
  3797.    GpiDeleteElementRange(hps, 2L, 5L); /* delete elements 2 through 5 */
  3798.    GpiCloseSegment(hps);               /* close the segment           */
  3799.  
  3800.  See Also
  3801.  
  3802.    GpiOffsetElementPointer, GpiQueryElementPointer, GpiSetElementPointer
  3803.  
  3804.  
  3805.  ────────────────────────────────────────────────────────────────────────────
  3806.  GpiDeleteElementsBetweenLabels
  3807.  ────────────────────────────────────────────────────────────────────────────
  3808.    BOOL GpiDeleteElementsBetweenLabels (hps, idFirstLabel, idLastLabel)
  3809.    HPS hps;                /*presentation-space handle                     */
  3810.    LONG idFirstLabel;      /*label of first element                        */
  3811.    LONG idLastLabel;       /*label of last element                         */
  3812.  
  3813.    The GpiDeleteElementsBetweenLabels function deletes one or more elements
  3814.    from the currently open segment. The function deletes all elements between
  3815.    but not including the elements having the labels specified by the
  3816.    idFirstLabel and idLastLabel parameters, then moves the element pointer to
  3817.    the element preceding the deleted elements (if any). If either label
  3818.    cannot be found between the current element-pointer position and the end
  3819.    of the segment, the function deletes no elements and returns an error
  3820.    value. The segment containing the element must be open and the drawing
  3821.    mode must be DM_RETAIN.
  3822.  
  3823.    GpiDeleteElementBetweenLabels cannot be used in an element bracket.
  3824.  
  3825.  Parameters
  3826.  
  3827.    hps  Identifies the presentation space.
  3828.  
  3829.    idFirstLabel  Specifies the label that marks the start of the elements to
  3830.    delete.
  3831.  
  3832.    idLastLabel  Specifies the label that marks the end of the elements to
  3833.    delete.
  3834.  
  3835.  Return Value
  3836.  
  3837.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  3838.    an error occurred.
  3839.  
  3840.  Errors
  3841.  
  3842.    Use the WinGetLastError function to retrieve the error value, which may be
  3843.    one of the following:
  3844.  
  3845.          PMERR_INV_MICROPS_FUNCTION
  3846.          PMERR_LABEL_NOT_FOUND
  3847.  
  3848.  Example
  3849.  
  3850.    This example uses the GpiDeleteElementsBetweenLabels function to delete
  3851.    the elements between but not including the elements having the labels 1
  3852.    and 2:
  3853.  
  3854.    GpiOpenSegment(hps, 2L);            /* open segment #2   */
  3855.  
  3856.    /* delete elements between 1 and 2 */
  3857.  
  3858.    GpiDeleteElementsBetweenLabels(hps, 1L, 2L);
  3859.    GpiCloseSegment(hps);               /* close the segment */
  3860.  
  3861.  See Also
  3862.  
  3863.    GpiLabel, GpiSetElementPointerAtLabel
  3864.  
  3865.  
  3866.  ────────────────────────────────────────────────────────────────────────────
  3867.  GpiDeleteMetaFile
  3868.  ────────────────────────────────────────────────────────────────────────────
  3869.    BOOL GpiDeleteMetaFile (hmf)
  3870.    HMF hmf;                /*metafile handle                               */
  3871.  
  3872.    The GpiDeleteMetaFile function deletes the metafile specified by hmf.
  3873.  
  3874.  Parameters
  3875.  
  3876.    hmf  Identifies the metafile.
  3877.  
  3878.  Return Value
  3879.  
  3880.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  3881.    an error occurred.
  3882.  
  3883.  See Also
  3884.  
  3885.    DevCloseDC, DevOpenDC, GpiLoadMetaFile
  3886.  
  3887.  
  3888.  ────────────────────────────────────────────────────────────────────────────
  3889.  GpiDeleteSegment
  3890.  ────────────────────────────────────────────────────────────────────────────
  3891.    BOOL GpiDeleteSegment (hps, idSegment)
  3892.    HPS hps;                /*presentation-space handle                     */
  3893.    LONG idSegment;         /*identifier of segment to delete               */
  3894.  
  3895.    The GpiDeleteSegment function deletes the segment specified by idSegment.
  3896.    If the segment is open, the function automatically closes the segment
  3897.    before deleting it. If the segment is in the picture chain, the function
  3898.    removes it from the chain.
  3899.  
  3900.    This function deletes only segments created using the GpiOpenSegment
  3901.    function.
  3902.  
  3903.  Parameters
  3904.  
  3905.    hps  Identifies the presentation space.
  3906.  
  3907.    idSegment  Specifies the segment to delete; it must be greater than zero.
  3908.  
  3909.  Return Value
  3910.  
  3911.    The return value is TRUE if the function is successful or FALSE if an
  3912.    error occurred.
  3913.  
  3914.  Errors
  3915.  
  3916.    Use the WinGetLastError function to retrieve the error value, which may be
  3917.    one of the following:
  3918.  
  3919.          PMERR_INV_MICROPS_FUNCTION
  3920.          PMERR_INV_SEG_NAME
  3921.  
  3922.  Example
  3923.  
  3924.    This example uses the GpiDeleteSegment function to delete segment 4:
  3925.  
  3926.    POINTL ptlStart = { 0, 0 };
  3927.    POINTL ptlTriangle[] = { 100, 100, 200, 0, 0, 0 };
  3928.  
  3929.    GpiOpenSegment(hps, 4L);               /* open the segment           */
  3930.    GpiMove(hps, &ptlStart);               /* move to start point (0, 0) */
  3931.    GpiPolyLine(hps, 3L, ptlTriangle);     /* draw triangle              */
  3932.    GpiCloseSegment(hps);                  /* close the segment          */
  3933.        .
  3934.        .
  3935.        .
  3936.    GpiDeleteSegment(hps, 4L);             /* delete segment #4          */
  3937.  
  3938.  See Also
  3939.  
  3940.    GpiCloseSegment, GpiDeleteSegments, GpiOpenSegment,
  3941.    GpiQuerySegmentNames
  3942.  
  3943.  
  3944.  ────────────────────────────────────────────────────────────────────────────
  3945.  GpiDeleteSegments
  3946.  ────────────────────────────────────────────────────────────────────────────
  3947.    BOOL GpiDeleteSegments (hps, idFirstSegment, idLastSegment)
  3948.    HPS hps;                /*presentation-space handle                     */
  3949.    LONG idFirstSegment;    /*identifier of first segment                   */
  3950.    LONG idLastSegment;     /*identifier of last segment                    */
  3951.  
  3952.    The GpiDeleteSegments function deletes the segments between and including
  3953.    the segments specified by the idFirstSegment and idLastSegment parameters.
  3954.    If idFirstSegment and idLastSegment are equal, the function deletes only
  3955.    that segment. If idFirstSegment is greater than idLastSegment, the
  3956.    function deletes only the segment specified by idFirstSegment. If any of
  3957.    the segments is open, the function closes the segment before deleting it.
  3958.    If any of the segments is in the picture chain, the function removes the
  3959.    segment from the chain.
  3960.  
  3961.    This function deletes only segments created using the GpiOpenSegment
  3962.    function.
  3963.  
  3964.  Parameters
  3965.  
  3966.    hps  Identifies the presentation space.
  3967.  
  3968.    idFirstSegment  Specifies the identifier of the first segment to delete.
  3969.    This parameter must be greater than zero.
  3970.  
  3971.    idLastSegment  Specifies the identifier of the last segment to delete.
  3972.    This parameter must be greater than zero.
  3973.  
  3974.  Return Value
  3975.  
  3976.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  3977.    an error occurred.
  3978.  
  3979.  Errors
  3980.  
  3981.    Use the WinGetLastError function to retrieve the error value, which may be
  3982.    one of the following:
  3983.  
  3984.          PMERR_INV_MICROPS_FUNCTION
  3985.          PMERR_INV_SEG_NAME
  3986.  
  3987.  See Also
  3988.  
  3989.    GpiCloseSegment, GpiDeleteSegment, GpiOpenSegment,
  3990.    GpiQuerySegmentNames
  3991.  
  3992.  Example
  3993.  
  3994.    This example uses the GpiDeleteSegments function to delete segments 4
  3995.    through 6:
  3996.  
  3997.    GpiDeleteSegments(hps, 4L, 6L);       /* delete segments 4 through 6 */
  3998.  
  3999.  
  4000.  ────────────────────────────────────────────────────────────────────────────
  4001.  GpiDeleteSetId
  4002.  ────────────────────────────────────────────────────────────────────────────
  4003.    BOOL GpiDeleteSetId (hps, lcid)
  4004.    HPS hps;                /*presentation-space handle                     */
  4005.    LONG lcid;              /*local identifier for font or bitmap           */
  4006.  
  4007.    The GpiDeleteSetId function deletes a logical font or removes the tag from
  4008.    a tagged bitmap, depending on the object identified by local identifier
  4009.    lcid. If the object is a logical font, the function deletes it, making it
  4010.    no longer available for use. If the object is a bitmap, the function
  4011.    removes the tag, but the bitmap handle remains valid. In either case, the
  4012.    function frees the local identifier for use with another object.
  4013.  
  4014.  Parameters
  4015.  
  4016.    hps  Identifies the presentation space.
  4017.  
  4018.    lcid  Specifies the local identifier for the object. If this parameter is
  4019.    set to LCID_ALL, the function deletes all logical fonts and removes the
  4020.    tags from all tagged bitmaps.
  4021.  
  4022.  Return Value
  4023.  
  4024.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  4025.    an error occurred.
  4026.  
  4027.  Example
  4028.  
  4029.    This example uses the GpiDeleteSetId function to delete a logical font.
  4030.    The GpiSetCharSet function is required only if the logical font is the
  4031.    current font for the presentation space.
  4032.  
  4033.    FATTRS fat;
  4034.  
  4035.    /* create and set the font */
  4036.  
  4037.    GpiCreateLogFont(hps, NULL, 1L, &fat);
  4038.    GpiSetCharSet(hps, 1L);
  4039.        .
  4040.        .
  4041.        .
  4042.    GpiSetCharSet(hps, 0L);          /* release the font before deleting */
  4043.    GpiDeleteSetId(hps, 1L);         /* delete the logical font          */
  4044.  
  4045.  See Also
  4046.  
  4047.    GpiSetBitmapId, GpiSetCharSet
  4048.  
  4049.  
  4050.  ────────────────────────────────────────────────────────────────────────────
  4051.  GpiDestroyPS
  4052.  ────────────────────────────────────────────────────────────────────────────
  4053.    BOOL GpiDestroyPS (hps)
  4054.    HPS hps;                /*presentation-space handle                     */
  4055.  
  4056.    The GpiDestroyPS function destroys the presentation space and releases all
  4057.    resources owned by the presentation space. This function should only be
  4058.    used to destroy presentation spaces created by the GpiCreatePS function.
  4059.  
  4060.  Parameters
  4061.  
  4062.    hps  Identifies the presentation space.
  4063.  
  4064.  Return Value
  4065.  
  4066.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  4067.    an error occurred.
  4068.  
  4069.  Example
  4070.  
  4071.    This example uses the GpiDestroyPS function to destroy the presentation
  4072.    space associated with a memory device context:
  4073.  
  4074.    HDC hdc;
  4075.    HPS hps;
  4076.    SIZEL page = { 0, 0 };
  4077.  
  4078.    /* create the memory device context and presentation space */
  4079.  
  4080.    hdc = DevOpenDC(hab, OD_MEMORY, "*", 0L, NULL, NULL);
  4081.    hps = GpiCreatePS(hab, hdc, &page, PU_PELS | GPIT_MICRO | GPIA_ASSOC);
  4082.        .
  4083.        .
  4084.        .
  4085.    GpiDestroyPS(hps);    /* destroy the presentation space */
  4086.    DevCloseDC(hdc);      /* close the device context       */
  4087.  
  4088.  See Also
  4089.  
  4090.    GpiCreatePS
  4091.  
  4092.  
  4093.  ────────────────────────────────────────────────────────────────────────────
  4094.  GpiDestroyRegion
  4095.  ────────────────────────────────────────────────────────────────────────────
  4096.    BOOL GpiDestroyRegion (hps, hrgn)
  4097.    HPS hps;                /*presentation-space handle                     */
  4098.    HRGN hrgn;              /*handle of region to destroy                   */
  4099.  
  4100.    The GpiDestroyRegion function destroys the region specified by hrgn. The
  4101.    function destroys the region only if the device context containing the
  4102.    region is associated with the given presentation space.
  4103.  
  4104.  Parameters
  4105.  
  4106.    hps  Identifies the presentation space.
  4107.  
  4108.    hrgn  Identifies the region to destroy.
  4109.  
  4110.  Return Value
  4111.  
  4112.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  4113.    an error occurred.
  4114.  
  4115.  Example
  4116.  
  4117.    This example uses the GpiDestroyRegion function to destroy a region after
  4118.    drawing a complex figure:
  4119.  
  4120.    HRGN hrgn;
  4121.    RECTL arcl[3] = { 10, 10, 20, 20, 15, 15, 25, 25, 20, 20, 30, 30 };
  4122.  
  4123.    hrgn = GpiCreateRegion(hps, 3L, arcl); /* use 3 rectangles   */
  4124.    GpiPaintRegion(hps, hrgn);             /* paint the region   */
  4125.    GpiDestroyRegion(hps, hrgn);           /* destroy the region */
  4126.  
  4127.  See Also
  4128.  
  4129.    GpiCreateRegion
  4130.  
  4131.  
  4132.  ────────────────────────────────────────────────────────────────────────────
  4133.  GpiDrawChain
  4134.  ────────────────────────────────────────────────────────────────────────────
  4135.    BOOL GpiDrawChain (hps)
  4136.    HPS hps;                /*presentation-space handle                     */
  4137.  
  4138.    The GpiDrawChain function draws the picture chain. The function draws all
  4139.    segments in the picture chain, including called segments. GpiDrawChain
  4140.    draws the segments using the current draw controls (except correlation
  4141.    control), as set by the GpiSetDrawControl function. The function does not
  4142.    affect drawing modes or open segments.
  4143.  
  4144.    The function cannot be used in an area, path, or element bracket.
  4145.  
  4146.  Parameters
  4147.  
  4148.    hps  Identifies the presentation space.
  4149.  
  4150.  Return Value
  4151.  
  4152.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  4153.    an error occurred.
  4154.  
  4155.  Errors
  4156.  
  4157.    Use the WinGetLastError function to retrieve the error value, which may be
  4158.    one of the following:
  4159.  
  4160.          PMERR_AREA_INCOMPLETE
  4161.          PMERR_IMAGE_INCOMPLETE
  4162.          PMERR_INV_MICROPS_FUNCTION
  4163.          PMERR_PATH_INCOMPLETE
  4164.          PMERR_STOP_DRAW_OCCURRED
  4165.  
  4166.  See Also
  4167.  
  4168.    GpiCloseSegment, GpiDrawDynamics, GpiDrawFrom, GpiDrawSegment,
  4169.    GpiQuerySegmentNames, GpiSetDrawControl
  4170.  
  4171.  
  4172.  ────────────────────────────────────────────────────────────────────────────
  4173.  GpiDrawDynamics
  4174.  ────────────────────────────────────────────────────────────────────────────
  4175.    BOOL GpiDrawDynamics (hps)
  4176.    HPS hps;                /*presentation-space handle                     */
  4177.  
  4178.    The GpiDrawDynamics function draws the dynamic segments in the picture
  4179.    chain. The function draws all dynamic segments unless a previous call to
  4180.    the GpiRemoveDynamics function restricts the drawing to a selected range.
  4181.    The function draws the segments using the current draw controls (except
  4182.    correlation control), as set by the GpiSetDrawControl function.
  4183.  
  4184.  Parameters
  4185.  
  4186.    hps  Identifies the presentation space.
  4187.  
  4188.  Return Value
  4189.  
  4190.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  4191.    an error occurred.
  4192.  
  4193.  Errors
  4194.  
  4195.    Use the WinGetLastError function to retrieve the error value, which may be
  4196.    one of the following:
  4197.  
  4198.          PMERR_AREA_INCOMPLETE
  4199.          PMERR_INV_MICROPS_FUNCTION
  4200.          PMERR_PATH_INCOMPLETE
  4201.          PMERR_STOP_DRAW_OCCURRED
  4202.  
  4203.  See Also
  4204.  
  4205.    GpiCloseSegment, GpiDrawChain, GpiDrawFrom, GpiDrawSegment,
  4206.    GpiQuerySegmentNames, GpiRemoveDynamics, GpiSetDrawControl
  4207.  
  4208.  
  4209.  ────────────────────────────────────────────────────────────────────────────
  4210.  GpiDrawFrom
  4211.  ────────────────────────────────────────────────────────────────────────────
  4212.    BOOL GpiDrawFrom (hps, idFirstSegment, idLastSegment)
  4213.    HPS hps;                /*presentation-space handle                     */
  4214.    LONG idFirstSegment;    /*first chain segment to draw                   */
  4215.    LONG idLastSegment;     /*last chain segment to draw                    */
  4216.  
  4217.    The GpiDrawFrom function draws one or more segments in the picture chain.
  4218.    The function draws all chained and called segments between and including
  4219.    the segments identified by the idFirstSegment and idLastSegment
  4220.    parameters. Although idFirstSegment must identify an existing segment,
  4221.    idLastSegment need not. If idLastSegment does not specify an existing
  4222.    segment, the function draws to the end of the picture chain.
  4223.  
  4224.    GpiDrawFrom draws the segments using the current draw controls (except
  4225.    correlation control), as set by the GpiSetDrawControl function. The
  4226.    function does not affect drawing modes or open segments. Also, GpiDrawFrom
  4227.    cannot be used in an area, path, or element bracket.
  4228.  
  4229.  Parameters
  4230.  
  4231.    hps  Identifies the presentation space.
  4232.  
  4233.    idFirstSegment  Specifies the identifier of the first segment to draw.
  4234.    This parameter must be greater than zero.
  4235.  
  4236.    idLastSegment  Specifies the identifier of the last segment to draw. This
  4237.    parameter must be greater than zero.
  4238.  
  4239.  Return Value
  4240.  
  4241.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  4242.    an error occurred.
  4243.  
  4244.  Errors
  4245.  
  4246.    Use the WinGetLastError function to retrieve the error value, which may be
  4247.    one of the following:
  4248.  
  4249.          PMERR_AREA_INCOMPLETE
  4250.          PMERR_IMAGE_INCOMPLETE
  4251.          PMERR_INV_MICROPS_FUNCTION
  4252.          PMERR_INV_SEG_NAME
  4253.          PMERR_PATH_INCOMPLETE
  4254.          PMERR_STOP_DRAW_OCCURRED
  4255.  
  4256.  Example
  4257.  
  4258.    This example uses the GpiDrawFrom function to draw all segments in the
  4259.    picture chain between and including the segments 1 and 4:
  4260.  
  4261.    GpiDrawFrom(hps, 1L, 4L);
  4262.  
  4263.  See Also
  4264.  
  4265.    GpiCloseSegment, GpiDrawChain, GpiDrawDynamics, GpiDrawSegment,
  4266.    GpiQuerySegmentNames, GpiSetDrawControl
  4267.  
  4268.  
  4269.  ────────────────────────────────────────────────────────────────────────────
  4270.  GpiDrawSegment
  4271.  ────────────────────────────────────────────────────────────────────────────
  4272.    BOOL GpiDrawSegment (hps, idSegment)
  4273.    HPS hps;                /*presentation-space handle                     */
  4274.    LONG idSegment;         /*identifier of segment to draw                 */
  4275.  
  4276.    The GpiDrawSegment function draws the specified segment. The function
  4277.    draws the segments using the current draw controls (except correlation
  4278.    control), as set by the GpiSetDrawControl function. The function does not
  4279.    affect drawing modes or open segments.
  4280.  
  4281.    GpiDrawSegment cannot be used in an area, path, or element bracket.
  4282.  
  4283.  Parameters
  4284.  
  4285.    hps  Identifies the presentation space.
  4286.  
  4287.    idSegment  Identifies the segment to draw. This parameter must be greater
  4288.    than zero.
  4289.  
  4290.  Return Value
  4291.  
  4292.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  4293.    an error occurred.
  4294.  
  4295.  Errors
  4296.  
  4297.    Use the WinGetLastError function to retrieve the error value, which may be
  4298.    one of the following:
  4299.  
  4300.          PMERR_AREA_INCOMPLETE
  4301.          PMERR_IMAGE_INCOMPLETE
  4302.          PMERR_INV_MICROPS_FUNCTION
  4303.          PMERR_INV_SEG_NAME
  4304.          PMERR_PATH_INCOMPLETE
  4305.          PMERR_STOP_DRAW_OCCURRED
  4306.  
  4307.  Example
  4308.  
  4309.    This example uses the GpiDrawSegment function to draw segment 4:
  4310.  
  4311.    POINTL ptlStart = { 0, 0 };
  4312.    POINTL ptlTriangle[] = { 100, 100, 200, 0, 0, 0 };
  4313.  
  4314.    GpiOpenSegment(hps, 4L);               /* open the segment           */
  4315.    GpiMove(hps, &ptlStart);               /* move to start point (0, 0) */
  4316.    GpiPolyLine(hps, 3L, ptlTriangle);     /* draw triangle              */
  4317.    GpiCloseSegment(hps);                  /* close the segment          */
  4318.        .
  4319.        .
  4320.        .
  4321.    GpiDrawSegment(hps, 4L);               /* draw segment #4            */
  4322.  
  4323.  
  4324.  
  4325.  See Also
  4326.  
  4327.    GpiCloseSegment, GpiDrawChain, GpiDrawDynamics, GpiDrawFrom,
  4328.    GpiQuerySegmentNames, GpiSetDrawControl
  4329.  
  4330.  
  4331.  ────────────────────────────────────────────────────────────────────────────
  4332.  GpiElement
  4333.  ────────────────────────────────────────────────────────────────────────────
  4334.    LONG GpiElement (hps, lType, psz, cb, pb)
  4335.    HPS hps;                /*presentation-space handle                     */
  4336.    LONG lType;             /*element type                                  */
  4337.    PSZ psz;                /*pointer to element descriptor                 */
  4338.    LONG cb;                /*length in bytes of buffer for graphics orders */
  4339.    PBYTE pb;               /*pointer to buffer for graphics orders         */
  4340.  
  4341.    The GpiElement function draws an element. The element consists of one or
  4342.    more graphics orders in the buffer pointed to by pb. The function executes
  4343.    each order as if it were the corresponding Gpi function.
  4344.  
  4345.    The function adds the element to the current open segment if the drawing
  4346.    mode is DM_RETAIN or DM_DRAWANDRETAIN. Otherwise, it just draws the
  4347.    element. The element must not contain graphics orders for an element
  4348.    bracket. Similarly, the function cannot be used in an element bracket.
  4349.  
  4350.    The function sets the type and descriptor for the element to the values
  4351.    given by lType and psz. The type and descriptor are a useful way of
  4352.    uniquely identifying the element when it is added to a segment. The type
  4353.    and descriptor can be retrieved at any time by using the
  4354.    GpiQueryElementType function.
  4355.  
  4356.  Parameters
  4357.  
  4358.    hps  Identifies the presentation space.
  4359.  
  4360.    lType  Specifies the integer value to use for the element type.
  4361.  
  4362.    psz  Points to the null-terminated string to use for the element
  4363.    descriptor.
  4364.  
  4365.    cb  Specifies the length of graphics order data for the element.
  4366.  
  4367.    pb  Points to the buffer that contains the graphics orders for the
  4368.    element. The buffer must not exceed 63K.
  4369.  
  4370.  Return Value
  4371.  
  4372.    The return value is GPI_OK or GPI_HITS if the function is successful. (It
  4373.    is GPI_HITS if the detectable attribute is set for the presentation space
  4374.    and a correlation hit occurs.) The return value is GPI_ERROR if an error
  4375.    occurs.
  4376.  
  4377.  Errors
  4378.  
  4379.    Use the WinGetLastError function to retrieve the error value, which may be
  4380.    one of the following:
  4381.  
  4382.          PMERR_DATA_TOO_LONG
  4383.          PMERR_INV_LENGTH
  4384.          PMERR_INV_MICROPS_FUNCTION
  4385.  
  4386.  Comments
  4387.  
  4388.    GpiElement does not convert coordinates. This may affect drawing the
  4389.    element if the format for the coordinates in the graphics orders is not
  4390.    the correct format for the presentation space.
  4391.  
  4392.  See Also
  4393.  
  4394.    GpiBeginElement, GpiDeleteElement, GpiEndElement, GpiQueryElement,
  4395.    GpiQueryElementPointer, GpiQueryElementType, GpiSetElementPointer
  4396.  
  4397.  
  4398.  ────────────────────────────────────────────────────────────────────────────
  4399.  GpiEndArea
  4400.  ────────────────────────────────────────────────────────────────────────────
  4401.    LONG GpiEndArea (hps)
  4402.    HPS hps;                /*presentation-space handle                     */
  4403.  
  4404.    The GpiEndArea function ends an area bracket──that is, it ends the
  4405.    sequence of functions (starting with the GpiBeginArea function) that
  4406.    define the outline of an area. The function automatically closes any open
  4407.    figure in the area, if necessary, by drawing a line from the current
  4408.    position to the starting point of the figure, then draws the area using
  4409.    the filling mode specified by the GpiBeginArea function that started the
  4410.    area bracket.
  4411.  
  4412.    The GpiEndArea function does not change the current position unless it
  4413.    must draw a line to close a figure in the area. In this case the new
  4414.    position is the last point in the line.
  4415.  
  4416.  Parameters
  4417.  
  4418.    hps  Identifies the presentation space.
  4419.  
  4420.  Return Value
  4421.  
  4422.    The return value is GPI_OK or GPI_HITS if the function is successful. (It
  4423.    is GPI_HITS if the detectable attribute is set for the presentation space
  4424.    and a correlation hit occurs.) The return value is GPI_ERROR if an error
  4425.    occurs.
  4426.  
  4427.  Example
  4428.  
  4429.    This example uses the GpiEndArea function to end an area bracket. The
  4430.    function draws the area (a triangle) by filling the outline with the
  4431.    current fill pattern.
  4432.  
  4433.    POINTL ptlStart = { 0, 0 };
  4434.    POINTL ptlTriangle[] = { 100, 100, 200, 0, 0, 0 };
  4435.  
  4436.    GpiBeginArea(hps, BA_NOBOUNDARY | BA_ALTERNATE);
  4437.    GpiMove(hps, &ptlStart);
  4438.    GpiPolyLine(hps, 3L, ptlTriangle);
  4439.    GpiEndArea(hps);
  4440.  
  4441.  See Also
  4442.  
  4443.    GpiBeginArea
  4444.  
  4445.  
  4446.  ────────────────────────────────────────────────────────────────────────────
  4447.  GpiEndElement
  4448.  ────────────────────────────────────────────────────────────────────────────
  4449.    BOOL GpiEndElement (hps)
  4450.    HPS hps;                /*presentation-space handle                     */
  4451.  
  4452.    The GpiEndElement function ends an element bracket──that is, it ends the
  4453.    sequence of functions (starting with the GpiBeginElement function) that
  4454.    define the contents of an element. The GpiEndElement function may only be
  4455.    used while creating a segment.
  4456.  
  4457.  Parameters
  4458.  
  4459.    hps  Identifies the presentation space.
  4460.  
  4461.  Return Value
  4462.  
  4463.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  4464.    an error occurred.
  4465.  
  4466.  Errors
  4467.  
  4468.    Use the WinGetLastError function to retrieve the error value, which may be
  4469.    the following:
  4470.  
  4471.          PMERR_INV_MICROPS_FUNCTION
  4472.  
  4473.  Example
  4474.  
  4475.    This example uses the GpiEndElement function to end an element bracket:
  4476.  
  4477.    POINTL ptlStart = { 0, 0 };
  4478.    POINTL ptlTriangle[] = { 100, 100, 200, 0, 0, 0 };
  4479.        .
  4480.        .
  4481.        .
  4482.    GpiBeginElement(hps, 1L, "Triangle");  /* begin the element bracket  */
  4483.    GpiMove(hps, &ptlStart);               /* move to start point (0, 0) */
  4484.    GpiPolyLine(hps, 3L, ptlTriangle);     /* draw triangle              */
  4485.    GpiEndElement(hps);                    /* end element bracket        */
  4486.  
  4487.  See Also
  4488.  
  4489.    GpiBeginElement, GpiDeleteElement, GpiQueryElement,
  4490.    GpiQueryElementPointer, GpiSetElementPointer
  4491.  
  4492.  
  4493.  ────────────────────────────────────────────────────────────────────────────
  4494.  GpiEndPath
  4495.  ────────────────────────────────────────────────────────────────────────────
  4496.    BOOL GpiEndPath (hps)
  4497.    HPS hps;                /*presentation-space handle                     */
  4498.  
  4499.    The GpiEndPath function ends a path bracket──that is, it ends the sequence
  4500.    of functions (starting with the GpiBeginPath function) that define the
  4501.    outline of a path.
  4502.  
  4503.  Parameters
  4504.  
  4505.    hps  Identifies the presentation space.
  4506.  
  4507.  Return Value
  4508.  
  4509.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  4510.    an error occurred.
  4511.  
  4512.  Example
  4513.  
  4514.    This example uses the GpiEndPath function to end a path bracket. When the
  4515.    path bracket is ended, a subsequent call to the GpiFillPath function draws
  4516.    and fills the path.
  4517.  
  4518.    POINTL ptlStart = { 0, 0 };
  4519.    POINTL ptlTriangle[] = { 100, 100, 200, 0 };
  4520.  
  4521.    GpiBeginPath(hps, 1L);                  /* start the path bracket */
  4522.    GpiMove(hps, &ptlStart);                /* move to starting point */
  4523.    GpiPolyLine(hps, 2L, ptlTriangle);      /* draw the three sides   */
  4524.    GpiCloseFigure(hps);                    /* close the triangle     */
  4525.    GpiEndPath(hps);                        /* end the path bracket   */
  4526.    GpiFillPath(hps, 1L, FPATH_ALTERNATE);  /* draw and fill the path */
  4527.  
  4528.  See Also
  4529.  
  4530.    GpiBeginPath
  4531.  
  4532.  
  4533.  ────────────────────────────────────────────────────────────────────────────
  4534.  GpiEqualRegion
  4535.  ────────────────────────────────────────────────────────────────────────────
  4536.    LONG GpiEqualRegion (hps, hrgn1, hrgn2)
  4537.    HPS hps;                /*presentation-space handle                     */
  4538.    HRGN hrgn1;             /*handle of the first region                    */
  4539.    HRGN hrgn2;             /*handle of the second region                   */
  4540.  
  4541.    The GpiEqualRegion function checks two regions for equality. Regions are
  4542.    equal if the difference between the two regions is an empty region. The
  4543.    function compares the regions only if the device context containing the
  4544.    regions is associated with the given presentation space.
  4545.  
  4546.  Parameters
  4547.  
  4548.    hps  Identifies the presentation space.
  4549.  
  4550.    hrgn1  Identifies the first region.
  4551.  
  4552.    hrgn2  Identifies the second region.
  4553.  
  4554.  Return Value
  4555.  
  4556.    The return value is EQRGN_NOTEQUAL or EQRGN_EQUAL if the function is
  4557.    successful, or EQRGN_ERROR if an error occurred.
  4558.  
  4559.  See Also
  4560.  
  4561.    WinEqualRect
  4562.  
  4563.  
  4564.  ────────────────────────────────────────────────────────────────────────────
  4565.  GpiErase
  4566.  ────────────────────────────────────────────────────────────────────────────
  4567.    BOOL GpiErase (hps)
  4568.    HPS hps;                /*presentation-space handle                     */
  4569.  
  4570.    The GpiErase function clears the display associated with the specified
  4571.    presentation space. The function clears the display by filling it with the
  4572.    color specified by the CLR_BACKGROUND color index for the presentation
  4573.    space. The function clips the output to the current clipping region,
  4574.    graphics field, and visual region (if any), but does not clip to the
  4575.    current viewing limits and clipping path. Also, the function ignores the
  4576.    the current draw controls (as set by the GpiSetDrawControl function).
  4577.  
  4578.  Parameters
  4579.  
  4580.    hps  Identifies the presentation space.
  4581.  
  4582.  Return Value
  4583.  
  4584.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  4585.    an error occurred.
  4586.  
  4587.  Example
  4588.  
  4589.    This example uses the GpiErase function to clear the display before
  4590.    drawing:
  4591.  
  4592.    GpiErase(hps);                        /* clear the display */
  4593.    GpiMove(hps, &ptlStart);              /* draw a triangle   */
  4594.    GpiPolyLine(hps, 3L, ptlTriangle);
  4595.  
  4596.  See Also
  4597.  
  4598.    GpiCloseSegment, GpiSetColor, GpiSetDrawControl
  4599.  
  4600.  
  4601.  ────────────────────────────────────────────────────────────────────────────
  4602.  GpiErrorSegmentData
  4603.  ────────────────────────────────────────────────────────────────────────────
  4604.    LONG GpiErrorSegmentData (hps, pidSegment, plContext)
  4605.    HPS hps;                /*presentation-space handle                     */
  4606.    PLONG pidSegment;       /*pointer to segment identifier                 */
  4607.    PLONG plContext;        /*pointer to variable for error type            */
  4608.  
  4609.    The GpiErrorSegmentData function returns information about the last error
  4610.    that occurred while drawing a segment. The function copies the segment
  4611.    identifier and error type to the variables pointed to by pidSegment and
  4612.    plContext, then returns either a byte offset or an element pointer
  4613.    position, depending on the type of error.
  4614.  
  4615.  Parameters
  4616.  
  4617.    hps  Identifies the presentation space.
  4618.  
  4619.    pidSegment  Points to a variable to receive the identifier of the segment
  4620.    causing the error.
  4621.  
  4622.    plContext  Points to a variable to receive the error type. It can be one
  4623.    of the following values:
  4624.  
  4625.    Value             Meaning
  4626.    ──────────────────────────────────────────────────────────────────────────
  4627.    GPIE_DATA         A graphics order in the buffer for the GpiPutData
  4628.                      function caused an error. The return value is the byte
  4629.                      offset from the beginning of the buffer to this graphics
  4630.                      order.
  4631.  
  4632.    GPIE_ELEMENT      A graphics order in the buffer for the GpiElement
  4633.                      function caused an error. The return value is the byte
  4634.                      offset from the beginning of the buffer to this graphics
  4635.                      order.
  4636.  
  4637.    GPIE_SEGMENT      An element in the given segment caused an error. The
  4638.                      return value is the position of the element pointer for
  4639.                      this element.
  4640.    ──────────────────────────────────────────────────────────────────────────
  4641.  
  4642.  Return Value
  4643.  
  4644.    The return value is either a byte offset or an element pointer position if
  4645.    the function is successful. Otherwise, it is GPI_ALTERROR.
  4646.  
  4647.  Errors
  4648.  
  4649.    Use the WinGetLastError function to retrieve the error value, which may be
  4650.    the following:
  4651.  
  4652.          PMERR_INV_MICROPS_FUNCTION
  4653.  
  4654.  See Also
  4655.  
  4656.    GpiCloseSegment, GpiElement, GpiOpenSegment, GpiPutData
  4657.  
  4658.  
  4659.  ────────────────────────────────────────────────────────────────────────────
  4660.  GpiExcludeClipRectangle
  4661.  ────────────────────────────────────────────────────────────────────────────
  4662.    LONG GpiExcludeClipRectangle (hps, prcl)
  4663.    HPS hps;                /*presentation-space handle                     */
  4664.    PRECTL prcl;            /*pointer to structure for rectangle            */
  4665.                            /*coordinates                                   */
  4666.  
  4667.    The GpiExcludeClipRectangle function excludes a rectangle from the clip
  4668.    region. The function excludes all points in the rectangle except points on
  4669.    the top and right boundary.
  4670.  
  4671.  Parameters
  4672.  
  4673.    hps  Identifies the presentation space.
  4674.  
  4675.    prcl  Points to a RECTL structure containing the rectangle. The RECTL
  4676.    structure has the following form:
  4677.  
  4678.    typedef struct _RECTL {
  4679.        LONG  xLeft;
  4680.        LONG  yBottom;
  4681.        LONG  xRight;
  4682.        LONG  yTop;
  4683.    } RECTL;
  4684.  
  4685.    For a full description, see Chapter 4, "Types, Macros, Structures."
  4686.  
  4687.  Return Value
  4688.  
  4689.    The return value is RGN_COMPLEX, RGN_NULL, or RGN_RECT if the function is
  4690.    successful or RGN_ERROR if an error occurred.
  4691.  
  4692.  See Also
  4693.  
  4694.    GpiIntersectClipRectangle, WinExcludeUpdateRegion
  4695.  
  4696.  
  4697.  ────────────────────────────────────────────────────────────────────────────
  4698.  GpiFillPath
  4699.  ────────────────────────────────────────────────────────────────────────────
  4700.    LONG GpiFillPath (hps, idPath, flFill)
  4701.    HPS hps;                /*presentation-space handle                     */
  4702.    LONG idPath;            /*identifier of path                            */
  4703.    LONG flFill;            /*fill mode                                     */
  4704.  
  4705.    The GpiFillPath function draws the interior of the path specified by
  4706.    idPath by filling it with the current fill pattern. The function first
  4707.    closes any open figures in the path, then fills the closed figures using
  4708.    the filling mode specified by flFill. Finally, the function deletes the
  4709.    path.
  4710.  
  4711.  Parameters
  4712.  
  4713.    hps  Identifies the presentation space.
  4714.  
  4715.    idPath  Specifies the path whose interior is to be drawn; it must equal 1.
  4716.  
  4717.    flFill  Specifies the fill option. It can be one of the following values:
  4718.  
  4719.    Value             Meaning
  4720.    ──────────────────────────────────────────────────────────────────────────
  4721.    FPATH_ALTERNATE   Fills the path using the alternate (even/odd) rule.
  4722.  
  4723.    FPATH_WINDING     Fills the path using the winding rule.
  4724.    ──────────────────────────────────────────────────────────────────────────
  4725.  
  4726.    The default is FPATH_ALTERNATE.
  4727.  
  4728.  Return Value
  4729.  
  4730.    The return value is GPI_OK or GPI_HITS if the function is successful. (It
  4731.    is GPI_HITS if the detectable attribute is set for the presentation space
  4732.    and a correlation hit occurs.) The return value is GPI_ERROR if an error
  4733.    occurs.
  4734.  
  4735.  Errors
  4736.  
  4737.    Use the WinGetLastError function to retrieve the error value, which may be
  4738.    one of the following:
  4739.  
  4740.          PMERR_INV_PATH_ID
  4741.          PMERR_PATH_UNKNOWN
  4742.  
  4743.  Example
  4744.  
  4745.    This example uses the GpiFillPath function to draw the interior of the
  4746.    given path. The path, an isosceles triangle, is not closed when it is
  4747.    created, so the GpiFillPath function closes it before filling.
  4748.  
  4749.    POINTL ptlStart = { 0, 0 };
  4750.    POINTL ptlTriangle[] = { 100, 100, 200, 0, 0, 0 };
  4751.  
  4752.    GpiBeginPath(hps, 1L);                  /* create a path */
  4753.    GpiMove(hps, &ptlStart);
  4754.    GpiPolyLine(hps, 3L, ptlTriangle);
  4755.    GpiEndPath(hps);
  4756.  
  4757.    GpiFillPath(hps, 1L, FPATH_ALTERNATE);  /* fill the path */
  4758.  
  4759.  See Also
  4760.  
  4761.    GpiBeginPath, GpiEndPath
  4762.  
  4763.  ────────────────────────────────────────────────────────────────────────────
  4764.  GpiFullArc
  4765.  ────────────────────────────────────────────────────────────────────────────
  4766.    LONG GpiFullArc (hps, flFlags, fxMultiplier)
  4767.    HPS hps;                /*presentation-space handle                     */
  4768.    LONG flFlags;           /*fill and outline indicator                    */
  4769.    FIXED fxMultiplier;     /*arc-size multiplier                           */
  4770.  
  4771.    The GpiFullArc function creates a full arc. A full arc is a complete
  4772.    circle or ellipse, drawn by using the current arc parameters. The function
  4773.    first scales the width and height of the arc by using the multipier
  4774.    specified by the fxMultiplier parameter, then draws either the outline of
  4775.    the arc, the interior of the arc, or both, depending on the flags
  4776.    specified by the flFlags parameter.
  4777.  
  4778.    The function uses the current position as the center of the arc but does
  4779.    not change the current position. The function uses the arc parameters to
  4780.    determine whether to draw the full arc clockwise or counterclockwise. When
  4781.    an arc is used as part of an area or path, the direction in which the arc
  4782.    is drawn can affect how it is filled.
  4783.  
  4784.  Parameters
  4785.  
  4786.    hps  Identifies the presentation space.
  4787.  
  4788.    flFlags  Specifies whether to fill and/or outline the arc. It can be one
  4789.    of the following values:
  4790.  
  4791.    Value             Meaning
  4792.    ──────────────────────────────────────────────────────────────────────────
  4793.    DRO_FILL          Fills the interior of the arc with the current fill
  4794.                      pattern.
  4795.  
  4796.    DRO_OUTLINE       Draws the outline of the arc by using the current line
  4797.                      style and color.
  4798.  
  4799.    DRO_OUTLINEFILL   Draws the outline and fills the arc interior.
  4800.    ──────────────────────────────────────────────────────────────────────────
  4801.  
  4802.    Do not use DRO_FILL or DRO_OUTLINEFILL when using GpiFullArc in an area
  4803.    bracket.
  4804.  
  4805.    fxMultiplier  Specifies how much to scale the width and height of the arc.
  4806.    It must be a fixed-point value in the range 1 through 255 (or in the range
  4807.    0x10000 through 0xFF0000 if expressed as 32-bit values). This means the
  4808.    function can scale the arc from 1 to 255 times the current arc-parameter
  4809.    dimensions.
  4810.  
  4811.  Return Value
  4812.  
  4813.    The return value is GPI_OK or GPI_HITS if the function is successful (it
  4814.    is GPI_HITS if the detectable attribute is set for the presentation space
  4815.    and a correlation hit occurs). The return value is GPI_ERROR if an error
  4816.    occurs.
  4817.  
  4818.  Errors
  4819.  
  4820.    Use the WinGetLastError function to retrieve the error value, which may be
  4821.    one of the following:
  4822.  
  4823.          PMERR_INV_ARC_CONTROL
  4824.          PMERR_INV_MULTIPLIER
  4825.  
  4826.  Comments
  4827.  
  4828.    When correlating an arc, the system generates a hit if the arc boundary
  4829.    intersects the pick aperture. If the pick aperture is inside the arc, the
  4830.    system generates a hit only if the interior of the arc has been filled.
  4831.  
  4832.  Example
  4833.  
  4834.    This example uses GpiFullArc to draw five concentric circles. The arc
  4835.    parameters are set before drawing the arc. Only the outline is drawn for
  4836.    the arc.
  4837.  
  4838.    SHORT i;
  4839.    ARCPARAMS arcp = { 1, 1, 0, 0 };
  4840.  
  4841.    GpiSetArcParams(hps, &arcp);
  4842.  
  4843.    for (i = 5; i > 0; i --)
  4844.        GpiFullArc(hps,             /* presentation-space handle       */
  4845.            DRO_OUTLINE,            /* outline                         */
  4846.            MAKEFIXED(i, 0));       /* converts integer to fixed point */
  4847.  
  4848.  See Also
  4849.  
  4850.    GpiMove, GpiPointArc, GpiQueryArcParams, GpiSetArcParams,
  4851.    GpiSetAttrs, GpiSetColor, GpiSetCurrentPosition, GpiSetLineType
  4852.  
  4853.  
  4854.  ────────────────────────────────────────────────────────────────────────────
  4855.  GpiGetData
  4856.  ────────────────────────────────────────────────────────────────────────────
  4857.    LONG GpiGetData (hps, idSegment, off, pcmdFormat, cb, pb)
  4858.    HPS hps;                /*presentation-space handle                     */
  4859.    LONG idSegment;         /*segment identifier                            */
  4860.    PLONG off;              /*pointer to variable for segment offset        */
  4861.    LONG pcmdFormat;        /*conversion type                               */
  4862.    LONG cb;                /*length in bytes of the data buffer            */
  4863.    PBYTE pb;               /*pointer to buffer for data                    */
  4864.  
  4865.    The GpiGetData function copies graphics orders from the specified segment
  4866.    to the specified buffer. The function continues to copy the graphics
  4867.    orders from the segment to the buffer until all orders in the segment have
  4868.    been copied or the number of bytes specified by the cb parameter have been
  4869.    copied. If the function fills the buffer, the last order in the buffer may
  4870.    not be complete since the function does not stop on an order boundary when
  4871.    copying to the buffer. In any case, the function returns the number of
  4872.    bytes copied to the buffer.
  4873.  
  4874.    The function starts copying graphics-order data from the location
  4875.    specified by the off parameter. If this parameter is zero, the function
  4876.    copies from the beginning of the segment. After copying the data, the
  4877.    function replaces the value in off with the offset to the next byte of
  4878.    data to copy from the segment (if any). This value can be used to specify
  4879.    the next location to copy.
  4880.  
  4881.    The GpiGetData function cannot be used to copy data from an open segment,
  4882.    but it can be used to copy data while some other segment is open.
  4883.  
  4884.  Parameters
  4885.  
  4886.    hps  Identifies the presentation space.
  4887.  
  4888.    idSegment  Specifies the segment identifier.
  4889.  
  4890.    off  Specifies the offset from the beginning of the segment to the next
  4891.    byte of graphics order data to copy. If this parameter is zero, the
  4892.    function copies from the beginning of the segment.
  4893.  
  4894.    pcmdFormat  Points to the variable that contains the coordinate conversion
  4895.    type. The variable can be one of the following values:
  4896.  
  4897.    Value             Meaning
  4898.    ──────────────────────────────────────────────────────────────────────────
  4899.    DFORM_NOCONV      Copies coordinates without converting. The coordinates
  4900.                      are in the format used by the presentation space.
  4901.  
  4902.    DFORM_PCLONG      Converts coordinates to PC-format long (4-byte)
  4903.                      integers.
  4904.  
  4905.    DFORM_PCSHORT     Converts coordinates to PC-format short (2-byte)
  4906.                      integers.
  4907.  
  4908.    DFORM_S370SHORT   Converts coordinates to S/370-format short (2-byte)
  4909.                      integers.
  4910.    ──────────────────────────────────────────────────────────────────────────
  4911.  
  4912.    cb  Specifies the length in bytes of the buffer to receive the graphics
  4913.    orders.
  4914.  
  4915.    pb  Points to the buffer that receives the graphics-order data.
  4916.  
  4917.  Return Value
  4918.  
  4919.    The return value is the number of graphics-order bytes copied if the
  4920.    function is successful or GPI_ALTERROR if an error occurred.
  4921.  
  4922.  Errors
  4923.  
  4924.    Use the WinGetLastError function to retrieve the error value, which may be
  4925.    one of the following:
  4926.  
  4927.          PMERR_DATA_TOO_LONG
  4928.          PMERR_INV_GETDATA_CONTROL
  4929.          PMERR_INV_LENGTH
  4930.          PMERR_INV_MICROPS_FUNCTION
  4931.          PMERR_INV_SEG_OFFSET
  4932.          PMERR_SEG_NOT_FOUND
  4933.  
  4934.  Example
  4935.  
  4936.    This example uses the GpiGetData function to copy data from one segment to
  4937.    another:
  4938.  
  4939.    LONG fFormat = DFORM_NOCONV;    /* do not convert coordinates        */
  4940.    LONG offSegment = 0L;           /* offset in segment                 */
  4941.    LONG offNextElement = 0L;       /* offset in segment to next element */
  4942.    LONG cb = 0L;                   /* bytes retrieved                   */
  4943.    BYTE abBuffer[512];
  4944.  
  4945.    GpiOpenSegment(hps, 3L);        /* open segment to receive the data  */
  4946.    do {
  4947.        offSegment += cb;
  4948.        offNextElement = offSegment;
  4949.        cb = GpiGetData(hps, 2L, &offNextElement, fFormat, 512L, abBuffer);
  4950.        /* put data in other segment */
  4951.  
  4952.        if (cb > 0L) GpiPutData(hps,  /* presentation-space handle        */
  4953.            fFormat,                  /* format of coordinates            */
  4954.            &cb,                      /* number of bytes in buffer        */
  4955.            abBuffer);                /* buffer with graphics-order data  */
  4956.  
  4957.    } while (cb > 0);
  4958.    GpiCloseSegment(hps);         /* close segment that received the data */
  4959.  
  4960.  See Also
  4961.  
  4962.    GpiPutData
  4963.  
  4964.  
  4965.  ────────────────────────────────────────────────────────────────────────────
  4966.  GpiImage
  4967.  ────────────────────────────────────────────────────────────────────────────
  4968.    LONG GpiImage (hps, lFormat, psizl, cbData, pbData)
  4969.    HPS hps;                /*presentation-space handle                     */
  4970.    LONG lFormat;           /*image data format                             */
  4971.    PSIZEL psizl;           /*pointer to structure for image width and      */
  4972.                            /*height                                        */
  4973.    LONG cbData;            /*length in bytes of the image data             */
  4974.    PBYTE pbData;           /*pointer to image data                         */
  4975.  
  4976.    The GpiImage function draws an image. An image is a rectangular array of
  4977.    pels, each pel having either the current foreground or background color.
  4978.    Each image has a width and height specified by the psizl parameter. The
  4979.    width and height determines how many pels there are in the horizontal and
  4980.    vertical directions.
  4981.  
  4982.    GpiImage draws the image by using the image data pointed to by the pbData
  4983.    parameter to set the color of each pel in the image. Each pel is
  4984.    represented by one bit in the image data. If the bit is 1, the pel has the
  4985.    foreground color; if the bit is 0, the pel has the background color. The
  4986.    function combines each pel with the color already on the display by using
  4987.    the foreground mix mode for foreground pels and the background mix mode
  4988.    for background pels. The function places the upper-left corner of the
  4989.    image at the current position but does not change the current position.
  4990.  
  4991.  Parameters
  4992.  
  4993.    hps  Identifies the presentation space.
  4994.  
  4995.    lFormat  Specifies the format of the image data. This is a reserved field;
  4996.    it must be set to zero.
  4997.  
  4998.    psizl  Points to a SIZEL structure containing the width and height of the
  4999.    image in pels. The maximum width allowed is 2040 pixels. The SIZEL
  5000.    structure has the following form:
  5001.  
  5002.    typedef struct _SIZEL {
  5003.        LONG cx;
  5004.        LONG cy;
  5005.    } SIZEL;
  5006.  
  5007.    For a full description, see Chapter 4, "Types, Macros, Structures."
  5008.  
  5009.    cbData  Specifies the length in bytes of the image data.
  5010.  
  5011.    pbData  Points to the image data. The pels must be given, row by row,
  5012.    starting at the top and running from left to right within each row.
  5013.  
  5014.  Return Value
  5015.  
  5016.    The return value is GPI_OK or GPI_HITS if the function is successful (it
  5017.    is GPI_HITS if the detectable attribute is set for the presentation space
  5018.    and a correlation hit occurs). The return value is GPI_ERROR if an error
  5019.    occurs.
  5020.  
  5021.  Errors
  5022.  
  5023.    Use the WinGetLastError function to retrieve the error value, which may be
  5024.    one of the following:
  5025.  
  5026.          PMERR_INV_IMAGE_DATA_LENGTH
  5027.          PMERR_INV_IMAGE_DIMENSION
  5028.          PMERR_INV_IMAGE_FORMAT
  5029.  
  5030.  Comments
  5031.  
  5032.    The image data is an array of bytes. Each byte in the array represents
  5033.    eight pels, with the high bit representing the leftmost pel. The function
  5034.    draws the image from left to right and top to bottom. For each row of the
  5035.    image, the function continues to read bytes from the array until all pels
  5036.    in the row are set. If the image width is not a multiple of 8, any
  5037.    remaining bits in the last byte for the row are ignored. The function
  5038.    continues until all rows are set. This means the number of bytes in the
  5039.    image data (and the length specified for the data) must be equal to the
  5040.    height in pels multiplied by the width in bytes.
  5041.  
  5042.  Example
  5043.  
  5044.    This example uses GpiImage to draw an 8-by-8 image. The image data is
  5045.    specified as an array of bytes.
  5046.  
  5047.    SIZEL sizl = { 8, 8 };        /* image is 8 pels wide by 8 pels high */
  5048.    BYTE abImage[] = { 0x00, 0x18, 0x3c, 0x7e, 0xff,
  5049.        0xff, 0x7e, 0x3c, 0x18, 0x00 };
  5050.  
  5051.    GpiImage(hps, 0L, &sizl, 8L, abImage);            /* draws the image */
  5052.  
  5053.  See Also
  5054.  
  5055.    GpiSetAttrs
  5056.  
  5057.  
  5058.  ────────────────────────────────────────────────────────────────────────────
  5059.  GpiIntersectClipRectangle
  5060.  ────────────────────────────────────────────────────────────────────────────
  5061.    LONG GpiIntersectClipRectangle (hps, prcl)
  5062.    HPS hps;                /*presentation-space handle                     */
  5063.    PRECTL prcl;            /*pointer to structure for rectangle            */
  5064.                            /*coordinates                                   */
  5065.  
  5066.    The GpiIntersectClipRectangle function sets the new clip region (in device
  5067.    coordinates) to the intersection of the current clip region and the
  5068.    specified rectangle.
  5069.  
  5070.  Parameters
  5071.  
  5072.    hps  Identifies the presentation space.
  5073.  
  5074.    prcl  Points to a RECTL structure. The RECTL structure has the following
  5075.    form:
  5076.  
  5077.    typedef struct _RECTL {
  5078.        LONG  xLeft;
  5079.        LONG  yBottom;
  5080.        LONG  xRight;
  5081.        LONG  yTop;
  5082.    } RECTL;
  5083.  
  5084.    For a full description, see Chapter 4, "Types, Macros, Structures."
  5085.  
  5086.  Return Value
  5087.  
  5088.    The return value is RGN_NULL, RGN_RECT, or RGN_COMPLEX if the function is
  5089.    successful, or RGN_ERROR if an error occurred.
  5090.  
  5091.  See Also
  5092.  
  5093.    GpiExcludeClipRectangle
  5094.  
  5095.  
  5096.  ────────────────────────────────────────────────────────────────────────────
  5097.  GpiLabel
  5098.  ────────────────────────────────────────────────────────────────────────────
  5099.    BOOL GpiLabel (hps, idLabel)
  5100.    HPS hps;                /*presentation-space handle                     */
  5101.    LONG idLabel;           /*label                                         */
  5102.  
  5103.    The GpiLabel function creates a label element. A label element is an
  5104.    element in a segment that contains nothing more than a 32-bit value. The
  5105.    function creates a label for an element in the current open segment. If no
  5106.    segment is open, no label is created.
  5107.  
  5108.    The GpiLabel function cannot be used in an element bracket.
  5109.  
  5110.  Parameters
  5111.  
  5112.    hps  Identifies the presentation space.
  5113.  
  5114.    idLabel  Specifies the label. It can be any value in the range 0x00000000
  5115.    through 0xFFFFFFFF.
  5116.  
  5117.  Return Value
  5118.  
  5119.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  5120.    an error occurred.
  5121.  
  5122.  Errors
  5123.  
  5124.    Use the WinGetLastError function to retrieve the error value, which may be
  5125.    the following:
  5126.  
  5127.          PMERR_INV_MICROPS_FUNCTION
  5128.  
  5129.  Comments
  5130.  
  5131.    The GpiLabel function is intended to be used to uniquely identify elements
  5132.    in a segment that may be edited. Label elements are typically placed near
  5133.    elements to be edited. The label can be used with the
  5134.    GpiSetElementPointerAtLabel function to move the element pointer to the
  5135.    given element.
  5136.  
  5137.  Example
  5138.  
  5139.    This example uses the GpiLabel function to create label elements in a
  5140.    segment. If the segment is subsequently edited, the label elements can
  5141.    still be used to locate the elements near it.
  5142.  
  5143.    POINTL ptlStart = { 0, 0 };
  5144.    POINTL ptlTriangle[] = { 100, 100, 200, 0, 0, 0 };
  5145.  
  5146.    GpiOpenSegment(hps, 4L);          /* creates a segment */
  5147.    GpiLabel(hps, 5L);                /* creates label 5   */
  5148.    GpiLabel(hps, 10L);               /* creates label 10  */
  5149.    GpiMove(hps, &ptlStart);
  5150.    GpiCloseSegment(hps);
  5151.    GpiPolyLine(hps, 3L, ptlTriangle);
  5152.  
  5153.  See Also
  5154.  
  5155.    GpiSetElementPointerAtLabel
  5156.  
  5157.  
  5158.  ────────────────────────────────────────────────────────────────────────────
  5159.  GpiLine
  5160.  ────────────────────────────────────────────────────────────────────────────
  5161.    LONG GpiLine (hps, pptl)
  5162.    HPS hps;                /*presentation-space handle                     */
  5163.    PPOINTL pptl;           /*pointer to structure for the end point        */
  5164.  
  5165.    The GpiLine function draws a straight line from the current position to
  5166.    the specified end point. The function then moves the current position to
  5167.    the end point.
  5168.  
  5169.    The function draws the line by using the current values of the line-color,
  5170.    line-mix, line-width, and line-type attributes. These values are set by
  5171.    using the GpiSetAttrs function.
  5172.  
  5173.  Parameters
  5174.  
  5175.    hps  Identifies the presentation space.
  5176.  
  5177.    pptl  Points to a POINTL structure that contains the end point of the
  5178.    line. The POINTL structure has the following form:
  5179.  
  5180.    typedef struct _POINTL  {
  5181.        LONG  x;
  5182.        LONG  y;
  5183.    } POINTL;
  5184.  
  5185.    For a full description, see Chapter 4, "Types, Macros, Structures."
  5186.  
  5187.  Return Value
  5188.  
  5189.    The return value is GPI_OK or GPI_HITS if the function is successful (it
  5190.    is GPI_HITS if the detectable attribute is set for the presentation space
  5191.    and a correlation hit occurs). The return value is GPI_ERROR if an error
  5192.    occurs.
  5193.  
  5194.  Example
  5195.  
  5196.    This example uses GpiLine to draw an X.
  5197.  
  5198.    POINTL ptl[4] = { 0, 0, 100, 100, 0, 100, 100, 0 };
  5199.  
  5200.    GpiMove(hps, &ptl[0]);
  5201.    GpiLine(hps, &ptl[1]);
  5202.    GpiMove(hps, &ptl[2]);
  5203.    GpiLine(hps, &ptl[3]);
  5204.  
  5205.  See Also
  5206.  
  5207.    GpiMove, GpiPolyLine, GpiSetAttrs, GpiSetColor,
  5208.    GpiSetCurrentPosition, GpiSetLineType
  5209.  
  5210.  
  5211.  ────────────────────────────────────────────────────────────────────────────
  5212.  GpiLoadBitmap
  5213.  ────────────────────────────────────────────────────────────────────────────
  5214.    HBITMAP GpiLoadBitmap (hps, hmod, idBitmap, lWidth, lHeight)
  5215.    HPS hps;                /*presentation-space handle                     */
  5216.    HMODULE hmod;           /*module handle                                 */
  5217.    USHORT idBitmap;        /*bitmap identifier                             */
  5218.    LONG lWidth;            /*width in pels of the bitmap                   */
  5219.    LONG lHeight;           /*height in pels of the bitmap                  */
  5220.  
  5221.    The GpiLoadBitmap function loads a bitmap resource from the specified
  5222.    module and uses it to create a bitmap having the specified width and
  5223.    height. The function uses the image data in the bitmap resource to
  5224.    initialize the bitmap image. If the lWidth or lHeight parameter is zero,
  5225.    the function creates a bitmap having the width or height given in the
  5226.    bitmap resource. If lWidth or lHeight is not zero, the function stretches
  5227.    or compresses the bitmap image to the specified width or height.
  5228.  
  5229.    The bitmap handle can be used in subsequent functions that accept bitmap
  5230.    handles. In most cases, the bitmap is set to a memory presentation space
  5231.    by using the GpiSetBitmap function then copied to the screen or a printer
  5232.    by using the GpiBitBlt function.
  5233.  
  5234.  Parameters
  5235.  
  5236.    hps  Identifies the presentation space.
  5237.  
  5238.    hmod  Specifies the module handle of the dynamic-link library containing
  5239.    the bitmap resource. If this parameter is NULL, the function loads the
  5240.    bitmap from the application's executable file.
  5241.  
  5242.    idBitmap  Specifies the identifier of the bitmap within the resource file.
  5243.  
  5244.    lWidth  Specifies the width in pels of the bitmap.
  5245.  
  5246.    lHeight  Specifies the height in pels of the bitmap.
  5247.  
  5248.  Return Value
  5249.  
  5250.    The return value is a handle to the bitmap if the function is successful
  5251.    or GPI_ERROR if an error occurred.
  5252.  
  5253.  Errors
  5254.  
  5255.    Use the WinGetLastError function to retrieve the error value, which may be
  5256.    the following:
  5257.  
  5258.          PMERR_INV_BITMAP_DIMENSION
  5259.  
  5260.  Example
  5261.  
  5262.    This example uses the GpiLoadBitmap function to create a bitmap by using
  5263.    the bitmap resource in the application's executable file. The bitmap must
  5264.    have been added to the executable file by using Resource Compiler.
  5265.  
  5266.    HBITMAP hbm;                     /* handle of the bitmap          */
  5267.  
  5268.    hbm = GpiLoadBitmap(hps,         /* presentation-space handle     */
  5269.        NULL,                        /* loads from application's file */
  5270.        1,                           /* bitmap resource #1            */
  5271.        64L,                         /* sets width to 64 pels         */
  5272.        64L);                        /* sets height to 64 pels        */
  5273.  
  5274.  See Also
  5275.  
  5276.    GpiCreateBitmap, GpiDeleteBitmap, GpiSetBitmap, GpiSetBitmapBits,
  5277.    GpiSetBitmapDimension, GpiSetBitmapId, WinGetSysBitmap
  5278.  
  5279.  
  5280.  ────────────────────────────────────────────────────────────────────────────
  5281.  GpiLoadFonts
  5282.  ────────────────────────────────────────────────────────────────────────────
  5283.    BOOL GpiLoadFonts (hab, pszModName)
  5284.    HAB hab;                /*anchor-block handle                           */
  5285.    PSZ pszModName;         /*pointer to module name                        */
  5286.  
  5287.    The GpiLoadFonts function loads fonts from the specified resource file.
  5288.    Once loaded, the fonts are private fonts and can be used by any thread in
  5289.    the process. Any other process can use the fonts but only if it also loads
  5290.    the font by using the GpiLoadFonts. The function loads a copy of the fonts
  5291.    once only. Any subsequent call to the function by another process for the
  5292.    same fonts simply increments the use count for the resource and gives that
  5293.    process access.
  5294.  
  5295.  Parameters
  5296.  
  5297.    hab  Identifies the anchor block.
  5298.  
  5299.    pszModName  Points to a null-terminated string. This string must be a
  5300.    valid MS OS/2 filename. If it does not specify a path and the filename
  5301.    extension, the function appends the default extension (.dll) and searches
  5302.    for the font resource file in the directories specified by the libpath
  5303.    command in the config.sys file.
  5304.  
  5305.  Return Value
  5306.  
  5307.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  5308.    an error occurred.
  5309.  
  5310.  Example
  5311.  
  5312.    This example uses the GpiLoadFonts function to load all fonts from the
  5313.    font resource file helv.fon. The GpiQueryFonts function retrieves the
  5314.    number of fonts loaded.
  5315.  
  5316.    LONG cFonts = 0L;
  5317.  
  5318.    GpiLoadFonts(hab, "helv");
  5319.    cFonts = GpiQueryFonts(hps, QF_PRIVATE, NULL, &cFonts, 0L, NULL);
  5320.  
  5321.  See Also
  5322.  
  5323.    GpiCreateLogFont, GpiDeleteSetId, GpiQueryFonts, GpiUnloadFonts
  5324.  
  5325.  
  5326.  ────────────────────────────────────────────────────────────────────────────
  5327.  GpiLoadMetaFile
  5328.  ────────────────────────────────────────────────────────────────────────────
  5329.    HMF GpiLoadMetaFile (hab, pszFilename)
  5330.    HAB hab;                /*anchor-block handle                           */
  5331.    PSZ pszFilename;        /*pointer to filename of metafile               */
  5332.  
  5333.    The GpiLoadMetaFile function loads data from a file into a metafile. The
  5334.    function first creates the metafile, then copies the data and returns the
  5335.    metafile handle. The metafile handle can be used in subsequent calls to
  5336.    the GpiPlayMetaFile or GpiDeleteMetaFile function.
  5337.  
  5338.  Parameters
  5339.  
  5340.    hab  Identifies the anchor block.
  5341.  
  5342.    pszFilename  Points to a null-terminated string. This string must be a
  5343.    valid MS OS/2 filename that specifies the path and filename of the file to
  5344.    load into a metafile.
  5345.  
  5346.  Return Value
  5347.  
  5348.    The return value is a handle to the metafile if the function is successful
  5349.    or GPI_ERROR if an error occurred.
  5350.  
  5351.  Example
  5352.  
  5353.    This example uses the GpiLoadMetaFile function to load a metafile with
  5354.    data from the file sample.met. Later, the metafile is deleted by using the
  5355.    GpiDeleteMetaFile function.
  5356.  
  5357.    HMF hmf;
  5358.  
  5359.    GpiLoadMetaFile(hmf, "sample.met"); /* loads metafile from disk */
  5360.        .
  5361.        .
  5362.        .
  5363.    GpiDeleteMetaFile(hmf);             /* deletes metafile         */
  5364.  
  5365.  See Also
  5366.  
  5367.    GpiCopyMetaFile, GpiDeleteMetaFile, GpiPlayMetaFile, GpiSaveMetaFile,
  5368.    GpiSetMetaFileBits
  5369.  
  5370.  
  5371.  ────────────────────────────────────────────────────────────────────────────
  5372.  GpiMarker
  5373.  ────────────────────────────────────────────────────────────────────────────
  5374.    LONG GpiMarker (hps, pptl)
  5375.    HPS hps;                /*presentation-space handle                     */
  5376.    PPOINTL pptl;           /*pointer to structure for marker position      */
  5377.  
  5378.    The GpiMarker function draws a marker, placing the center of the marker at
  5379.    the point specified by the pptl parameter. The current marker set and
  5380.    marker symbol attributes specify the marker to draw.
  5381.  
  5382.    The function moves the current position to the specified point.
  5383.  
  5384.  Parameters
  5385.  
  5386.    hps  Identifies the presentation space.
  5387.  
  5388.    pptl  Points to a POINTL structure that contains the position of the
  5389.    marker. The POINTL structure has the following form:
  5390.  
  5391.    typedef struct _POINTL  {
  5392.        LONG  x;
  5393.        LONG  y;
  5394.    } POINTL;
  5395.  
  5396.    For a full description, see Chapter 4, "Types, Macros, and Structures."
  5397.  
  5398.  Return Value
  5399.  
  5400.    The return value is GPI_OK or GPI_HITS if the function is successful (it
  5401.    is GPI_HITS if the detectable attribute is set for the presentation space
  5402.    and a correlation hit occurs). The return value is GPI_ERROR if an error
  5403.    occurs.
  5404.  
  5405.  Example
  5406.  
  5407.    This example uses the GpiMarker function to draw a marker at the point
  5408.    (10,10).
  5409.  
  5410.    POINTL ptl = { 10, 10 };
  5411.  
  5412.    GpiMarker(hps, &ptl);
  5413.  
  5414.  See Also
  5415.  
  5416.    GpiMove, GpiPolyMarker, GpiSetAttrs, GpiSetCurrentPosition,
  5417.    GpiSetMarkerBox, GpiSetMarkerSet
  5418.  
  5419.  
  5420.  ────────────────────────────────────────────────────────────────────────────
  5421.  GpiModifyPath
  5422.  ────────────────────────────────────────────────────────────────────────────
  5423.    BOOL GpiModifyPath (hps, idPath, cmdMode)
  5424.    HPS hps;                /*presentation-space handle                     */
  5425.    LONG idPath;            /*path identifier                               */
  5426.    LONG cmdMode;           /*modification options                          */
  5427.  
  5428.    The GpiModifyPath function modifies a path. Modifying a path affects the
  5429.    way the GpiFillPath function draws the path. For example, a modified path
  5430.    can be used to draw a wide line; that is, a line having a width specified
  5431.    by the current geometric-line width. The function modifies the path as
  5432.    specified by the cmdMode parameter.
  5433.  
  5434.    The GpiModifyPath can modify the path for drawing as a wide line. In this
  5435.    case, the GpiFillPath function draws a line that follows the path. The
  5436.    line has the current geometric-line width and is filled with the current
  5437.    fill pattern. Furthermore, the current line-join attribute defines how to
  5438.    draw the intersection of two lines at their end points and the current
  5439.    line-end attribute defines how to draw the end of a line, respectively.
  5440.    GpiModifyPath prevents GpiFillPath from closing open figures in the path.
  5441.    The line-end attribute applies to the start and end points of open
  5442.    figures. If a figure is closed by using the GpiCloseFigure function, the
  5443.    line-join attribute applies to the start and end points. If a line is
  5444.    joined to an arc, the line-join attribute applies to the intersection at
  5445.    the end points. If two lines intersect at any place other than their end
  5446.    points, the GpiFillPath function draws the wide line so that the
  5447.    intersection is filled despite the fill mode.
  5448.  
  5449.  Parameters
  5450.  
  5451.    hps  Identifies the presentation space.
  5452.  
  5453.    idPath  Specifies the identifier of the path to modify; it must be 1.
  5454.  
  5455.    cmdMode  Specifies how to modify the path. It can be the following value:
  5456.  
  5457.    Value             Meaning
  5458.    ──────────────────────────────────────────────────────────────────────────
  5459.    MPATH_STROKE      Converts the path to a wide line. The line width is the
  5460.                      current geometric-line width set by using the
  5461.                      GpiSetLineWidthGeom function.
  5462.    ──────────────────────────────────────────────────────────────────────────
  5463.  
  5464.  Return Value
  5465.  
  5466.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  5467.    an error occurred.
  5468.  
  5469.  Errors
  5470.  
  5471.    Use the WinGetLastError function to retrieve the error value, which may be
  5472.    one of the following:
  5473.  
  5474.          PMERR_INV_PATH_ID
  5475.          PMERR_PATH_UNKNOWN
  5476.  
  5477.  Example
  5478.  
  5479.    This example uses the GpiModifyPath function to modify the given path. The
  5480.    GpiFillPath function then draws the path.
  5481.  
  5482.    POINTL ptlStart = { 0, 0 };
  5483.    POINTL ptlTriangle[] = { 100, 100, 200, 0, 0, 0 };
  5484.  
  5485.    GpiBeginPath(hps, 1L);                       /* creates path    */
  5486.    GpiMove(hps, &ptlStart);
  5487.    GpiPolyLine(hps, 3L, ptlTriangle);
  5488.    GpiEndPath(hps);
  5489.  
  5490.    GpiModifyPath(hps,
  5491.                  1L,
  5492.                  MPATH_STROKE);     /* modifies path for wide line */
  5493.    GpiFillPath(hps, 1L, FPATH_ALTERNATE);   /* draws the wide line */
  5494.  
  5495.  See Also
  5496.  
  5497.    GpiBeginPath, GpiCloseFigure, GpiEndPath, GpiSetLineEnd,
  5498.    GpiSetLineJoin, GpiSetLineWidthGeom
  5499.  
  5500.  
  5501.  ────────────────────────────────────────────────────────────────────────────
  5502.  GpiMove
  5503.  ────────────────────────────────────────────────────────────────────────────
  5504.    BOOL GpiMove (hps, pptl)
  5505.    HPS hps;                /*presentation-space handle                     */
  5506.    PPOINTL pptl;           /*pointer to structure for new position         */
  5507.  
  5508.    The GpiMove function moves the current position to the specified point.
  5509.    When used in an area bracket, the function closes the current open figure
  5510.    (if any) and marks the start of a new figure.
  5511.  
  5512.  Parameters
  5513.  
  5514.    hps  Identifies the presentation space.
  5515.  
  5516.    pptl  Points to a POINTL structure containing the position to move to. The
  5517.    POINTL structure has the following form:
  5518.  
  5519.    typedef struct _POINTL  {
  5520.        LONG  x;
  5521.        LONG  y;
  5522.    } POINTL;
  5523.  
  5524.    For a full description, see Chapter 4, "Types, Macros, Structures."
  5525.  
  5526.  Return Value
  5527.  
  5528.    The return value is GPI_OK or GPI_HITS if the function is successful (it
  5529.    is GPI_HITS if the detectable attribute is set for the presentation space
  5530.    and a correlation hit occurs). The return value is GPI_ERROR if an error
  5531.    occurs.
  5532.  
  5533.  Example
  5534.  
  5535.    This example uses the GpiMove function to draw an X. The function moves
  5536.    the current position to the starting point of each leg of the character.
  5537.  
  5538.    POINTL ptl[4] = { 0, 0, 100, 100, 0, 100, 100, 0 };
  5539.  
  5540.    GpiMove(hps, &ptl[0]);    /* move to (0,0)   */
  5541.    GpiLine(hps, &ptl[1]);
  5542.    GpiMove(hps, &ptl[2]);    /* move to (0,100) */
  5543.    GpiLine(hps, &ptl[3]);
  5544.  
  5545.  See Also
  5546.  
  5547.    GpiSetCurrentPosition
  5548.  
  5549.  
  5550.  ────────────────────────────────────────────────────────────────────────────
  5551.  GpiOffsetClipRegion
  5552.  ────────────────────────────────────────────────────────────────────────────
  5553.    LONG GpiOffsetClipRegion (hps, pptl)
  5554.    HPS hps;                /*presentation-space handle                     */
  5555.    PPOINTL pptl;           /*pointer to structure for offset increments    */
  5556.  
  5557.    The GpiOffsetClipRegion function moves the clip region. The function moves
  5558.    the clip region by adding the x- and y-coordinates in the point specified
  5559.    by the pptl parameter to the region's current position. The x- and
  5560.    y-coordinates may be either positive or negative, so the region can move
  5561.    in any direction.
  5562.  
  5563.  Parameters
  5564.  
  5565.    hps  Identifies the presentation space.
  5566.  
  5567.    pptl  Points to a POINTL structure that contains the offset increments in
  5568.    world coordinates. The POINTL structure has the following form:
  5569.  
  5570.    typedef struct _POINTL  {
  5571.        LONG  x;
  5572.        LONG  y;
  5573.    } POINTL;
  5574.  
  5575.    For a full description, see Chapter 4, "Types, Macros, Structures."
  5576.  
  5577.  Return Value
  5578.  
  5579.    The return value is RGN_NULL, RGN_RECT, or RGN_COMPLEX if the function is
  5580.    successful, or RGN_ERROR if an error occurred.
  5581.  
  5582.  See Also
  5583.  
  5584.    GpiSetClipRegion
  5585.  
  5586.  
  5587.  ────────────────────────────────────────────────────────────────────────────
  5588.  GpiOffsetElementPointer
  5589.  ────────────────────────────────────────────────────────────────────────────
  5590.    BOOL GpiOffsetElementPointer (hps, off)
  5591.    HPS hps;                /*presentation-space handle                     */
  5592.    LONG off;               /*offset to add to element pointer              */
  5593.  
  5594.    The GpiOffsetElementPointer function moves the element pointer by the
  5595.    number of elements specified by the off parameter. The function starts the
  5596.    move at the current element-pointer position, and moves the element
  5597.    pointer either toward the beginning or end of the segment, depending on
  5598.    whether off is negative or positive. If off specifies more elements than
  5599.    actually exist between the current position and the beginning or end, the
  5600.    function sets the element pointer to zero or to the last element in the
  5601.    segment, depending on the direction of the move.
  5602.  
  5603.    The GpiOffsetElementPointer function affects the current open segment. If
  5604.    no segment is open, the function is ignored. Also, the function cannot be
  5605.    used in an element bracket.
  5606.  
  5607.  Parameters
  5608.  
  5609.    hps  Identifies the presentation space.
  5610.  
  5611.    off  Specifies the offset to be added to the element pointer.
  5612.  
  5613.  Return Value
  5614.  
  5615.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  5616.    an error occurred.
  5617.  
  5618.  Errors
  5619.  
  5620.    Use the WinGetLastError function to retrieve the error value, which may be
  5621.    the following:
  5622.  
  5623.          PMERR_INV_MICROPS_FUNCTION
  5624.  
  5625.  Example
  5626.  
  5627.    This example uses the GpiOffsetElementPointer function to move to the
  5628.    element associated with a label element. Combining the
  5629.    GpiSetElementPointerAtLabel and GpiOffsetElementPointer functions is a
  5630.    convenient way to locate elements in segments that have been edited.
  5631.  
  5632.    POINTL ptlStart = { 0, 0 };
  5633.    POINTL ptlTriangle[] = { 100, 100, 200, 0, 0, 0 };
  5634.  
  5635.    GpiOpenSegment(hps, 4L);         /* creates a segment with labels */
  5636.    GpiLabel(hps, 5L);   GpiMove(hps, &ptlStart);
  5637.    GpiLabel(hps, 10L);  GpiPolyLine(hps, 3L, ptlTriangle);
  5638.    GpiCloseSegment(hps);
  5639.        .
  5640.        .
  5641.        .
  5642.    GpiOpenSegment(hps, 4L);
  5643.    GpiSetElementPointerAtLabel(hps, 10L) /* move to label 10         */
  5644.    GpiOffsetElementPointer(hps, 1L);     /* move to polyline element */
  5645.  
  5646.  See Also
  5647.  
  5648.    GpiSetEditMode, GpiSetElementPointer, GpiSetElementPointerAtLabel
  5649.  
  5650.  
  5651.  ────────────────────────────────────────────────────────────────────────────
  5652.  GpiOffsetRegion
  5653.  ────────────────────────────────────────────────────────────────────────────
  5654.    BOOL GpiOffsetRegion (hps, hrgn, pptl)
  5655.    HPS hps;                /*presentation-space handle                     */
  5656.    HRGN hrgn;              /*region handle                                 */
  5657.    PPOINTL pptl;           /*pointer to structure for offset increments    */
  5658.  
  5659.    The GpiOffsetRegion function moves a region. The function moves the region
  5660.    by adding the x- and y-coordinates in the point specified by the pptl
  5661.    parameter to the region's current position. The x- and y-coordinates may
  5662.    be either positive or negative, so the region can move in any direction.
  5663.  
  5664.  Parameters
  5665.  
  5666.    hps  Identifies the presentation space.
  5667.  
  5668.    hrgn  Identifies the region to move. The region must belong to the device
  5669.    context associated with the presentation space.
  5670.  
  5671.    pptl  Points to a POINTL structure that contains the offset increments for
  5672.    the move. The POINTL structure has the following form:
  5673.  
  5674.    typedef struct _POINTL  {
  5675.        LONG  x;
  5676.        LONG  y;
  5677.    } POINTL;
  5678.  
  5679.    For a full description, see Chapter 4, "Types, Macros, Structures."
  5680.  
  5681.  Return Value
  5682.  
  5683.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  5684.    an error occurred.
  5685.  
  5686.  See Also
  5687.  
  5688.    GpiCreateRegion, GpiDestroyRegion
  5689.  
  5690.  
  5691.  ────────────────────────────────────────────────────────────────────────────
  5692.  GpiOpenSegment
  5693.  ────────────────────────────────────────────────────────────────────────────
  5694.    BOOL GpiOpenSegment (hps, idSegment)
  5695.    HPS hps;                /*presentation-space handle                     */
  5696.    LONG idSegment;         /*segment identifier                            */
  5697.  
  5698.    The GpiOpenSegment function opens the segment specified by the idSegment
  5699.    parameter. The function creates a new segment if a segment having the
  5700.    specified identifier does not already exist. Otherwise, it opens the
  5701.    segment. Once a segment is opened or created, the system stores an element
  5702.    in the segment for each subsequent primitive and attribute function, up to
  5703.    the next call to the GpiCloseSegment function. If the segment previously
  5704.    existed, the system either replaces the old elements with the new or
  5705.    inserts the new elements, depending on the segment editing mode.
  5706.  
  5707.    The function can create a segment when the drawing mode is set to either
  5708.    DM_RETAIN or DM_DRAWANDRETAIN but can open an existing segment only when
  5709.    the drawing mode is DM_RETAIN. (The GpiOpenSegment function can also
  5710.    create a segment when the drawing mode is DM_DRAW, but subsequent elements
  5711.    are not stored.)
  5712.  
  5713.  Parameters
  5714.  
  5715.    hps  Identifies the presentation space.
  5716.  
  5717.    idSegment  Specifies the segment identifier. The segment identifier must
  5718.    be a positive integer. If the identifier is unique──that is, has not been
  5719.    used before with the presentation space──the function creates a new
  5720.    segment. Zero is reserved for unnamed segments.
  5721.  
  5722.  Return Value
  5723.  
  5724.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  5725.    an error occurred.
  5726.  
  5727.  Errors
  5728.  
  5729.    Use the WinGetLastError function to retrieve the error value, which may be
  5730.    one of the following:
  5731.  
  5732.          PMERR_AREA_INCOMPLETE
  5733.          PMERR_DYNAMIC_SEG_ZERO_INV
  5734.          PMERR_IMAGE_INCOMPLETE
  5735.          PMERR_INV_MICROPS_FUNCTION
  5736.          PMERR_INV_MODE_FOR_OPEN_DYN
  5737.          PMERR_INV_MODE_FOR_REOPEN_SEG
  5738.          PMERR_PATH_INCOMPLETE
  5739.  
  5740.  Comments
  5741.  
  5742.    If the segment identifier is zero, the function creates an unnamed
  5743.    segment. An unnamed segment is like any other segment except it cannot be
  5744.    referenced by identifiers in subsequent segment functions. For example, an
  5745.    unnamed segment cannot be drawn directly since the GpiDrawSegment function
  5746.    requires a segment identifier, but the unnamed segment can be drawn if it
  5747.    is added to the picture chain. GpiOpenSegment creates a new unnamed
  5748.    segment for each call specifying the zero identifier. Any number of
  5749.    unnamed segments can be created, and the unnamed segments continue to
  5750.    exist until all segments are deleted.
  5751.  
  5752.    The GpiOpenSegment function assigns segment attributes to each new
  5753.    segment. The initial segment attributes are set by the
  5754.    GpiSetInitialSegmentAttrs function. If the initial attributes specify a
  5755.    dynamic segment, the segment can be created only in DM_RETAIN drawing
  5756.    mode.
  5757.  
  5758.    Only one segment per presentation space can be open at a time.
  5759.  
  5760.  Example
  5761.  
  5762.    This example uses the GpiOpenSegment to create a new segment. The segment
  5763.    is subsequently drawn by using the GpiDrawSegment function.
  5764.  
  5765.    POINTL ptlStart = { 0, 0 };
  5766.    POINTL ptlTriangle[] = { 100, 100, 200, 0, 0, 0 };
  5767.  
  5768.    GpiOpenSegment(hps, 1L);            /* opens the segment             */
  5769.    GpiMove(hps, &ptlStart);            /* moves to starting point (0,0) */
  5770.    GpiPolyLine(hps, 3L, ptlTriangle);  /* draws triangle                */
  5771.    GpiCloseSegment(hps);               /* closes the segment            */
  5772.  
  5773.    GpiDrawSegment(hps, 1L);
  5774.  
  5775.  See Also
  5776.  
  5777.    GpiCloseSegment, GpiErrorSegmentData, GpiSetInitialSegmentAttrs,
  5778.    GpiSetSegmentAttrs, GpiSetViewingTransformMatrix
  5779.  
  5780.  
  5781.  ────────────────────────────────────────────────────────────────────────────
  5782.  GpiPaintRegion
  5783.  ────────────────────────────────────────────────────────────────────────────
  5784.    LONG GpiPaintRegion (hps, hrgn)
  5785.    HPS hps;                /*presentation-space handle                     */
  5786.    HRGN hrgn;              /*region handle                                 */
  5787.  
  5788.    The GpiPaintRegion function paints the region specified by the hrgn
  5789.    parameter. The function paints a region by filling it with the current
  5790.    fill pattern, applying the current area colors and mix modes as it fills
  5791.    the region.
  5792.  
  5793.  Parameters
  5794.  
  5795.    hps  Identifies the presentation space.
  5796.  
  5797.    hrgn  Identifies the region.
  5798.  
  5799.  Return Value
  5800.  
  5801.    The return value is GPI_OK or GPI_HITS if the function is successful (it
  5802.    is GPI_HITS if the detectable attribute is set for the presentation space
  5803.    and a correlation hit occurs). The return value is GPI_ERROR if an error
  5804.    occurs.
  5805.  
  5806.  Example
  5807.  
  5808.    This example uses the GpiPaintRegion function to fill a complex region
  5809.    consisting of three, intersecting rectangles. The region is filled with a
  5810.    red, diagonal pattern.
  5811.  
  5812.    HRGN hrgn;                               /* handle for region */
  5813.    RECTL arcl[3] = { 100, 100, 200, 200,    /* 1st rectangle     */
  5814.        150, 150, 250, 250,                  /* 2nd rectangle     */
  5815.        200, 200, 300, 300 };                /* 3rd rectangle     */
  5816.  
  5817.    hrgn = GpiCreateRegion(hps, 3L, arcl);
  5818.    GpiSetColor(hps, CLR_RED);
  5819.    GpiSetPattern(hps, PATSYM_DIAG1);
  5820.    GpiPaintRegion(hps, hrgn);
  5821.  
  5822.  See Also
  5823.  
  5824.    GpiCreateRegion, GpiSetAttrs, GpiSetColor, GpiSetPattern,
  5825.    GpiSetPatternRefPoint, GpiSetPatternSet
  5826.  
  5827.  
  5828.  ────────────────────────────────────────────────────────────────────────────
  5829.  GpiPartialArc
  5830.  ────────────────────────────────────────────────────────────────────────────
  5831.    LONG GpiPartialArc (hps, pptl, fxMultiplier, fxStartAngle, fxSweepAngle)
  5832.    HPS hps;                /*presentation-space handle                     */
  5833.    PPOINTL pptl;           /*pointer to structure for center point         */
  5834.    FIXED fxMultiplier;     /*arc-size multiplier                           */
  5835.    FIXED fxStartAngle;     /*start angle of arc                            */
  5836.    FIXED fxSweepAngle;     /*sweep angle of arc                            */
  5837.  
  5838.    The GpiPartialArc function draws a partial arc. The function actually
  5839.    draws two figures: a straight line, from the current position to the start
  5840.    point of an arc; and the arc itself, with its center at the specified
  5841.    point. The function determines the start and end points of the arc by
  5842.    using the start and sweep angles specified by the fxStartAngle and
  5843.    fxSweepAngle functions.
  5844.  
  5845.    The GpiPartialArc function moves the current position to the end point on
  5846.    the partial arc.
  5847.  
  5848.  Parameters
  5849.  
  5850.    hps  Identifies the presentation space.
  5851.  
  5852.    pptl  Points to a POINTL structure that contains the center point. The
  5853.    POINTL structure has the following form:
  5854.  
  5855.    typedef struct _POINTL  {
  5856.        LONG  x;
  5857.        LONG  y;
  5858.    } POINTL;
  5859.  
  5860.    For a full description, see Chapter 4, "Types, Macros, Structures."
  5861.  
  5862.    fxMultiplier  Specifies the amount to scale the width and height of the
  5863.    arc. It must be a fixed-point value in the range 1 through 255 (or in the
  5864.    range 0x10000 to 0xFF0000 if expressed as a 32-bit value). This means the
  5865.    function can scale the arc from 1 to 255 times the current arc-parameter
  5866.    dimensions.
  5867.  
  5868.    fxStartAngle  Specifies the start angle in degrees. It must be a positive,
  5869.    fixed-point value.
  5870.  
  5871.    fxSweepAngle  Specifies the sweep angle in degrees. It must be a positive,
  5872.    fixed-point value.
  5873.  
  5874.  Return Value
  5875.  
  5876.    The return value is GPI_OK or GPI_HITS if the function is successful (it
  5877.    is GPI_HITS if the detectable attribute is set for the presentation space
  5878.    and a correlation hit occurs). The return value is GPI_ERROR if an error
  5879.    occurs.
  5880.  
  5881.  Errors
  5882.  
  5883.    Use the WinGetLastError function to retrieve the error value, which may be
  5884.    the following:
  5885.  
  5886.          PMERR_INV_MULTIPLIER
  5887.  
  5888.  Comments
  5889.  
  5890.    To draw the arc, the GpiPartialArc function first constructs an imaginary
  5891.    unit circle at the specified center point. The function locates the start
  5892.    point of the arc by measuring counterclockwise from the x-axis of the
  5893.    circle by the number of degrees in the start angle. It then locates the
  5894.    end point of the arc by measuring counterclockwise from the start point by
  5895.    the number of degrees in the sweep angle. Finally, the function draws the
  5896.    arc by applying the current arc parameters and the arc-size multiplier.
  5897.    The direction in which the function draws the arc depends on the arc
  5898.    parameters. The direction may affect the way a closed figure containing an
  5899.    arc is filled.
  5900.  
  5901.    If the sweep angle is greater than 360 degrees, the function draws one or
  5902.    more complete circles or ellipses (depending on the original sweep-angle
  5903.    value) followed by an arc. The sweep angle of the final arc is the
  5904.    remainder after dividing the original sweep angle by 360.
  5905.  
  5906.  Example
  5907.  
  5908.    This example uses the GpiPartialArc function to draw a chord. A chord is
  5909.    an arc whose end points are connected by a straight line.
  5910.  
  5911.    POINTL ptl = { 100, 100 };             /* center point for arc */
  5912.  
  5913.    GpiSetLineType(hps, LINETYPE_INVISIBLE);
  5914.    GpiPartialArc(hps, &ptl, MAKEFIXED(50, 0), MAKEFIXED(0, 0),
  5915.        MAKEFIXED(180, 0));
  5916.    GpiSetLineType(hps, LINETYPE_SOLID);
  5917.    GpiPartialArc(hps, &ptl, MAKEFIXED(50, 0), MAKEFIXED(0, 0),
  5918.        MAKEFIXED(180, 0));
  5919.  
  5920.  See Also
  5921.  
  5922.    GpiFullArc, GpiLine, GpiMove, GpiPointArc, GpiQueryArcParams,
  5923.    GpiSetArcParams, GpiSetAttrs, GpiSetColor, GpiSetCurrentPosition,
  5924.    GpiSetLineType
  5925.  
  5926.  
  5927.  ────────────────────────────────────────────────────────────────────────────
  5928.  GpiPlayMetaFile
  5929.  ────────────────────────────────────────────────────────────────────────────
  5930.    LONG GpiPlayMetaFile (hps, hmf, cOptions, alOptions, pcSegments, cchDesc,
  5931.    pszDesc)
  5932.    HPS hps;                /*presentation-space handle                     */
  5933.    HMF hmf;                /*metafile handle                               */
  5934.    LONG cOptions;          /*number of elements in array                   */
  5935.    PLONG alOptions;        /*pointer to array of load options              */
  5936.    PLONG pcSegments;       /*pointer to count of renumbered segments       */
  5937.    LONG cchDesc;           /*number of bytes in record                     */
  5938.    PSZ pszDesc;            /*pointer to buffer for descriptive record      */
  5939.  
  5940.    The GpiPlayMetaFile function plays the metafile specified by the hmf
  5941.    parameter. The function plays the metafile file by converting the graphics
  5942.    data in the file to graphics operations for the given presentation space.
  5943.    The function uses the load options specified by the alOptions parameter to
  5944.    determine how to prepare the presentation space for playing the metafile.
  5945.    This may include resetting the presentation space, replacing tagged
  5946.    bitmaps and logical fonts, and replacing the logical color table.
  5947.  
  5948.    Since the metafile may create segments, the application must close any
  5949.    open segment before calling GpiPlayMetaFile. If the metafile creates
  5950.    segments, the function retains the segments only if the current drawing
  5951.    mode is DM_RETAIN or DM_DRAWANDRETAIN. If chained segments are retained,
  5952.    the function adds them to the end of the existing segment chain.
  5953.  
  5954.    The GpiPlayMetaFile function can play a metafile any number of times.
  5955.  
  5956.  Parameters
  5957.  
  5958.    hps  Identifies a presentation space.
  5959.  
  5960.    hmf  Identifies the metafile to play. It must have been created or loaded
  5961.    previously by using the DevOpenDC or GpiLoadMetaFile function.
  5962.  
  5963.    cOptions  Specifies the number of elements in the array pointed to by the
  5964.    alOptions parameter.
  5965.  
  5966.    alOptions  Points to the array specifying the load options. For a full
  5967.    description, see the following "Comments" section.
  5968.  
  5969.    pcSegments  Points to a variable for the count of renumbered segments.
  5970.    This parameter is reserved and is set to zero.
  5971.  
  5972.    cchDesc  Specifies the number of bytes in the buffer pointed to by the
  5973.    pszDesc parameter.
  5974.  
  5975.    pszDesc  Points to the buffer that receives the null-terminated string
  5976.    describing the metafile. This descriptive record is the record set by the
  5977.    DevOpenDC function for the metafile. If the buffer is smaller than the
  5978.    record, the function truncates the record.
  5979.  
  5980.  Return Value
  5981.  
  5982.    The return value is GPI_OK or GPI_HITS if the function is successful (it
  5983.    is GPI_HITS if the detectable attribute is set for the presentation space
  5984.    and a correlation hit occurs). The return value is GPI_ERROR if an error
  5985.    occurs.
  5986.  
  5987.  Errors
  5988.  
  5989.    Use the WinGetLastError function to retrieve the error value, which may be
  5990.    one of the following:
  5991.  
  5992.          PMERR_INCOMPATIBLE_METAFILE
  5993.          PMERR_INV_LENGTH
  5994.          PMERR_INV_PLAY_METAFILE_OPTION
  5995.          PMERR_STOP_DRAW_OCCURRED
  5996.  
  5997.  Comments
  5998.  
  5999.    The GpiPlayMetaFile function uses several options to control how a
  6000.    metafile is played. The options are specified in an array passed to the
  6001.    function by using the alOptions parameter. The array has at most ten
  6002.    elements, and there are eight predefined array indexes that can be used to
  6003.    access these elements. The following list describes the purpose and
  6004.    possible values for each element:
  6005.  
  6006. ╓┌─┌─────────────────┌───────────────────────────────────────────────────────╖
  6007.    Index             Meaning
  6008.    Index             Meaning
  6009.    ──────────────────────────────────────────────────────────────────────────
  6010.    PMF_SEGBASE       Specifies a reserved element. It must be zero.
  6011.  
  6012.    PMF_LOADTYPE      Specifies the transformation to use when playing the
  6013.                      metafile. It can be one of the following:
  6014.  
  6015.                      Value             Meaning
  6016.                      ────────────────────────────────────────────────────────
  6017.                      LT_DEFAULT        Default; same as LT_NOMODIFY.
  6018.                      LT_NOMODIFY       Use the current viewing transformation
  6019.                                        as set by the application by using the
  6020.                                        GpiSetViewingTransformMatrix function.
  6021.                                        This is the default action.
  6022.                      LT_ORIGINALVIEW   Use the viewing transformations
  6023.                                        defined in the metafile.
  6024.  
  6025.    PMF_RESOLVE       Specifies a reserved element. It must be RS_DEFAULT or
  6026.                      RS_NODISCARD.
  6027.  
  6028.    PMF_LCIDS         Specifies whether to use tagged bitmaps and logical
  6029.    Index             Meaning
  6030.    ──────────────────────────────────────────────────────────────────────────
  6031.   PMF_LCIDS         Specifies whether to use tagged bitmaps and logical
  6032.                      fonts from the metafile or from the application. It can
  6033.                      be one of the following:
  6034.  
  6035.                      Value             Meaning
  6036.                      ────────────────────────────────────────────────────────
  6037.                      LC_DEFAULT        Default; same as LC_NOLOAD.
  6038.                      LC_NOLOAD         Use the tagged bitmaps and logical
  6039.                                        fonts defined by the application. The
  6040.                                        application must define the
  6041.                                        appropriate objects and local
  6042.                                        identifiers before playing the
  6043.                                        metafile. This is the default.
  6044.                      LC_LOADDISC       Use the tagged bitmaps and logical
  6045.                                        fonts defined in the metafile. The
  6046.                                        function loads the object from the
  6047.                                        metafile and assigns a local
  6048.                                        identifier. If the local identifier is
  6049.                                        already defined by the application,
  6050.    Index             Meaning
  6051.    ──────────────────────────────────────────────────────────────────────────
  6052.                                       already defined by the application,
  6053.                                        the function deletes the identifier
  6054.                                        before creating the new object.
  6055.  
  6056.    PMF_RESET         Specifies whether the presentation space should be reset
  6057.                      before playing the metafile, with the page units and
  6058.                      size being set as defined in the metafile. It can be one
  6059.                      of the following:
  6060.  
  6061.                      Value             Meaning
  6062.                      ────────────────────────────────────────────────────────
  6063.                      RES_DEFAULT       Default; same as RES_NORESET.
  6064.                      RES_NORESET       Does not reset the presentation space.
  6065.                      RES_RESET         Resets the presentation space. The
  6066.                                        function resets the page units and
  6067.                                        page size to the values specified by
  6068.                                        the metafile. It then sets up default
  6069.                                        transformations, based on page units
  6070.                                        and size, as if the presentation space
  6071.    Index             Meaning
  6072.    ──────────────────────────────────────────────────────────────────────────
  6073.                                       and size, as if the presentation space
  6074.                                        had just been created with these
  6075.                                        values, and modifies the device
  6076.                                        transformation (if necessary) to
  6077.                                        ensure that the physical size of the
  6078.                                        metafile picture is preserved.
  6079.                                        Finally, it resets the presentation
  6080.                                        space as if calling the GpiResetPS
  6081.                                        function with the GRES_ALL option.
  6082.  
  6083.    PMF_SUPPRESS      Specifies whether to continue playing the metafile after
  6084.                      resetting the presentation space. It can be one of the
  6085.                      following values:
  6086.  
  6087.                      Value             Meaning
  6088.                      ────────────────────────────────────────────────────────
  6089.                      SUP_DEFAULT       Default; same as SUP_NOSUPPRESS.
  6090.                      SUP_NOSUPPRESS    Does not suppress the metafile.
  6091.                      SUP_SUPPRESS      Suppresses the metafile after the
  6092.    Index             Meaning
  6093.    ──────────────────────────────────────────────────────────────────────────
  6094.                     SUP_SUPPRESS      Suppresses the metafile after the
  6095.                                        presentation space is reset as
  6096.                                        specified by the PMF_RESET option. All
  6097.                                        other options are ignored.
  6098.  
  6099.    PMF_COLORTABLES   Specifies whether to use logical color tables from the
  6100.                      metafile or from the application. It can be one of the
  6101.                      following:
  6102.  
  6103.                      Value             Meaning
  6104.                      ────────────────────────────────────────────────────────
  6105.                      CTAB_DEFAULT      Default; same as CTAB_NOMODIFY.
  6106.                      CTAB_NOMODIFY     Uses the logical color table defined
  6107.                                        by the application. This is the
  6108.                                        default.
  6109.                      CTAB_REPLACE      Uses the logical color tables implied
  6110.                                        by or given in the metafile. The
  6111.                                        application's existing logical color
  6112.                                        table is overwritten.
  6113.    Index             Meaning
  6114.    ──────────────────────────────────────────────────────────────────────────
  6115.                                       table is overwritten.
  6116.  
  6117.    PMF_COLORREALIZAB Specifies whether the logical color tables defined by
  6118.    LE                the metafile should be realizable. It can be one of the
  6119.                      following values:
  6120.  
  6121.                      Value             Meaning
  6122.                      ────────────────────────────────────────────────────────
  6123.                      CREA_DEFAULT      Default; same as CREA_REALIZE.
  6124.                      CREA_REALIZE      Creates realizable color tables. This
  6125.                                        is the default.
  6126.                      CREA_NOREALIZE    Does not create realizable color
  6127.                                        tables.
  6128.  
  6129.    PMF_PATHBASE      Specifies a reserved element. It must be zero.
  6130.  
  6131.    PMF_RESOLVEPATH   Specifies a reserved element. It must be RSP_DEFAULT or
  6132.                      RSP_NODISCARD.
  6133.    ──────────────────────────────────────────────────────────────────────────
  6134.    Index             Meaning
  6135.    ──────────────────────────────────────────────────────────────────────────
  6136.   ──────────────────────────────────────────────────────────────────────────
  6137.  
  6138.  
  6139.  Example
  6140.  
  6141.    This example uses the GpiPlayMetaFile function to play the given metafile.
  6142.    The function uses all the default actions for playing the metafile.
  6143.  
  6144.    HMF hmf;
  6145.    LONG cSegments;
  6146.    CHAR szBuffer[80];
  6147.  
  6148.    hmf = GpiLoadMetafile(hab, "sample.met");
  6149.    GpiPlayMetafile(hps, hmf, 0L, NULL, &cSegments, 80L, szBuffer);
  6150.  
  6151.  See Also
  6152.  
  6153.    DevCloseDC, DevOpenDC, GpiCreateLogColorTable, GpiCreateLogFont,
  6154.    GpiLoadMetaFile, GpiResetPS, GpiSetDrawingMode,
  6155.    GpiSetViewingTransformMatrix
  6156.  
  6157.  
  6158.  ────────────────────────────────────────────────────────────────────────────
  6159.  GpiPointArc
  6160.  ────────────────────────────────────────────────────────────────────────────
  6161.    LONG GpiPointArc (hps, pptl)
  6162.    HPS hps;                /*presentation-space handle                     */
  6163.    PPOINTL pptl;           /*pointer to structure for points               */
  6164.  
  6165.    The GpiPointArc function draws an arc through three points. The function
  6166.    uses the current arc parameters to determine the shape of the arc, then
  6167.    starts the arc at the current position, draws it through the first point
  6168.    specified by pptl, and ends the arc at the second point specified by pptl.
  6169.  
  6170.    The GpiPointArc function moves the current position to the end point of
  6171.    the point arc.
  6172.  
  6173.  Parameters
  6174.  
  6175.    hps  Identifies the presentation space.
  6176.  
  6177.    pptl  Points to a POINTL structure that contains intermediate and end
  6178.    points. The POINTL structure has the following form:
  6179.  
  6180.    typedef struct _POINTL  {
  6181.        LONG  x;
  6182.        LONG  y;
  6183.    } POINTL;
  6184.  
  6185.    For a full description, see Chapter 4, "Types, Macros, Structures."
  6186.  
  6187.  Return Value
  6188.  
  6189.    The return value is GPI_OK or GPI_HITS if the function is successful (it
  6190.    is GPI_HITS if the detectable attribute is set for the presentation space
  6191.    and a correlation hit occurs). The return value is GPI_ERROR if an error
  6192.    occurs.
  6193.  
  6194.  Example
  6195.  
  6196.    This example uses the GpiPointArc function to draw an arc through the
  6197.    three points of a triangle. The GpiPolyLine function then draws the
  6198.    triangle:
  6199.  
  6200.    POINTL ptlTriangle[] = { 0, 0, 100, 100, 200, 0 };
  6201.  
  6202.    GpiMove(hps, &ptlTriangle[0]);      /* moves to start point (0, 0) */
  6203.    GpiPointArc(hps, &ptlTriangle[1]);  /* draws the arc               */
  6204.    GpiMove(hps, &ptlTriangle[0]);      /* moves to start point (0, 0) */
  6205.    GpiPolyLine(hps, &ptlTriangle[1]);  /* draws the triangle          */
  6206.  
  6207.  See Also
  6208.  
  6209.    GpiFullArc, GpiMove, GpiQueryArcParams, GpiSetArcParams, GpiSetAttrs,
  6210.    GpiSetColor, GpiSetCurrentPosition, GpiSetLineType
  6211.  
  6212.  
  6213.  ────────────────────────────────────────────────────────────────────────────
  6214.  GpiPolyFillet
  6215.  ────────────────────────────────────────────────────────────────────────────
  6216.    LONG GpiPolyFillet (hps, cptl, aptl)
  6217.    HPS hps;                /*presentation-space handle                     */
  6218.    LONG cptl;              /*number of points in array                     */
  6219.    PPOINTL aptl;           /*pointer to array of structures for points     */
  6220.  
  6221.    The GpiPolyFillet function draws one or more fillets. The function draws
  6222.    the fillets by using the points specified by the aptl parameter. The
  6223.    function needs at least two points to draw a fillet. If exactly two points
  6224.    are specified, the function draws the fillet from the current position to
  6225.    the second point, using the first point as a control point. If more than
  6226.    two points are given, the function uses each point (except the last) as a
  6227.    control point, computing the end point of each fillet as needed. The
  6228.    function draws each fillet by using the current line-color, line-mix,
  6229.    line-width, and line-type attributes.
  6230.  
  6231.    The GpiPolyFillet function moves the current position to the end point of
  6232.    the last fillet.
  6233.  
  6234.  Parameters
  6235.  
  6236.    hps  Identifies the presentation space.
  6237.  
  6238.    cptl  Specifies the number of points.
  6239.  
  6240.    aptl  Points to an array of POINTL structures that contain the points. The
  6241.    POINTL structure has the following form:
  6242.  
  6243.    typedef struct _POINTL  {
  6244.        LONG  x;
  6245.        LONG  y;
  6246.    } POINTL;
  6247.  
  6248.    For a full description, see Chapter 4, "Types, Macros, Structures."
  6249.  
  6250.  Return Value
  6251.  
  6252.    The return value is GPI_OK or GPI_HITS if the function is successful (it
  6253.    is GPI_HITS if the detectable attribute is set for the presentation space
  6254.    and a correlation hit occurs). The return value is GPI_ERROR if an error
  6255.    occurs.
  6256.  
  6257.  Comments
  6258.  
  6259.    A fillet is a smooth curve whose path is controlled by three points: a
  6260.    start point, an end point, and a control point.
  6261.  
  6262.    When given two points, the GpiPolyFillet function draws a fillet by first
  6263.    constructing two imaginary straight lines, one from the current position
  6264.    to the control point (the first point) and another from the control point
  6265.    to the end point (the second point). The function then draws the curve
  6266.    from the current position to the end point. The curve is drawn so that the
  6267.    first imaginary line is tangent to the curve at the current position and
  6268.    the second imaginary line is tangent to the curve at the second point.
  6269.    Only the curve is drawn, never the imaginary lines.
  6270.  
  6271.    When given more than two points, the function constructs a series of
  6272.    imaginary straight lines, then draws a series of curves. The function
  6273.    draws the first curve from the current position to the midpoint of the
  6274.    second imaginary line, the second curve from the midpoint of the second
  6275.    line to the midpoint of the third, and so on until it draws the last curve
  6276.    from a midpoint to the last point specified.
  6277.  
  6278.    The maximum number of fillets allowed in the polyfillet depends on the
  6279.    length of coordinates, but is at least 4000.
  6280.  
  6281.  Example
  6282.  
  6283.    This example uses the GpiPolyFillet function to draw a curve with a loop.
  6284.    The four points are the four points of a rectangle. The curve is drawn
  6285.    from the lower-left corner, through the midpoint of the top edge, and back
  6286.    to the lower-right corner.
  6287.  
  6288.    POINTL ptlStart = { 0, 0 };
  6289.    POINTL aptl[3] = { 200, 100, 0, 100, 200, 0 };
  6290.  
  6291.    GpiMove(hps, &ptlStart);        /* move to the lower-left corner */
  6292.    GpiPolyFillet(hps, 3L, aptl};   /* draw the curve                */
  6293.  
  6294.  See Also
  6295.  
  6296.    GpiMove, GpiPolyFilletSharp, GpiPolyLine, GpiSetAttrs, GpiSetColor,
  6297.    GpiSetCurrentPosition, GpiSetLineType
  6298.  
  6299.  
  6300.  ────────────────────────────────────────────────────────────────────────────
  6301.  GpiPolyFilletSharp
  6302.  ────────────────────────────────────────────────────────────────────────────
  6303.    LONG GpiPolyFilletSharp (hps, cptl, aptl, afxSharpness)
  6304.    HPS hps;                /*presentation-space handle                     */
  6305.    LONG cptl;              /*number of points                              */
  6306.    PPOINTL aptl;           /*pointer to array of structures for points     */
  6307.    PFIXED afxSharpness;    /*pointer of array of structures for            */
  6308.                            /*sharpness values                              */
  6309.  
  6310.    The GpiPolyFilletSharp function creates one or more fillets. The function
  6311.    draws the fillets by using the control and end points specified by the
  6312.    aptl parameter and the fillet sharpness values specified by the
  6313.    afxSharpness parameter. The function draws the first fillet from the
  6314.    current position to the first end point, by using the first control point
  6315.    and first sharpness value to construct the path of the fillet. The second
  6316.    fillet is drawn from the first end point to the second end point using the
  6317.    second control point and sharpness values. The function continues with
  6318.    each successive point, using the last end point as the starting point for
  6319.    the next fillet, until the function draws one fillet for each control and
  6320.    end-point pair.
  6321.  
  6322.    For each fillet, the array pointed to by aptl contains a control and
  6323.    end-point pair. The first pair of points is the control and end points for
  6324.    the first fillet, with the control point given first. The array pointed to
  6325.    by afxSharpness contains the sharpness values for each fillet, with the
  6326.    sharpness value for the first fillet given first.
  6327.  
  6328.    The GpiPolyFilletSharp function moves the current position to the end
  6329.    point of the last fillet.
  6330.  
  6331.  Parameters
  6332.  
  6333.    hps  Identifies the presentation space.
  6334.  
  6335.    cptl  Specifies the number of points in the array pointed to by aptl. This
  6336.    must be twice the number of fillets since each fillet requires a control
  6337.    and end-point pair.
  6338.  
  6339.    aptl  Points to an array of POINTL structures that contain the points. The
  6340.    POINTL structure has the following form:
  6341.  
  6342.    typedef struct _POINTL  {
  6343.        LONG  x;
  6344.        LONG  y;
  6345.    } POINTL;
  6346.  
  6347.    For a full description, see Chapter 4, "Types, Macros, Structures."
  6348.  
  6349.    afxSharpness  Points to an array of sharpness values giving the sharpness
  6350.    of successive fillets. Each value must be a fixed-point value. Each value
  6351.    controls the type of curve drawn for the fillet. If this value is greater
  6352.    than 1.0, the curve is a hyperbola. If the value is 1.0, the curve is a
  6353.    parabola. If the value is less than 1.0, the curve is an ellipse.
  6354.  
  6355.  Return Value
  6356.  
  6357.    The return value is GPI_OK or GPI_HITS if the function is successful (it
  6358.    is GPI_HITS if the detectable attribute is set for the presentation space
  6359.    and a correlation hit occurs). The return value is GPI_ERROR if an error
  6360.    occurs.
  6361.  
  6362.  Comments
  6363.  
  6364.    A fillet is a smooth curve whose path is controlled by three points: a
  6365.    start point, an end point, and a control point. The smoothness of the
  6366.    fillet is controlled by a sharpness value.
  6367.  
  6368.    The GpiPolyFilletSharp function draws a fillet by first constructing two
  6369.    imaginary straight lines, one from the start point to the control point
  6370.    and another from the control point to the end point. The function then
  6371.    draws the fillet from the start to end point, such that the first
  6372.    imaginary line is tangent to the fillet at the current position and the
  6373.    second imaginary line is tangent to the fillet at the end point.
  6374.  
  6375.    GpiPolyFilletSharp uses the control point and the sharpness value to
  6376.    determine the path of the curve. The function always draws the curve
  6377.    through a fourth point. It locates the point by constructing two more
  6378.    imaginary straight lines, one from the start to end point, and another
  6379.    from the control point to the midpoint of this first line. The fourth
  6380.    point lies on the imaginary line drawn from the control point to the
  6381.    midpoint. It is placed such that the ratio of the lengths of the bottom
  6382.    and top pieces of this line is equal to the sharpness value.
  6383.  
  6384.    The maximum number of fillets allowed depends upon the length of
  6385.    coordinates and is not less than 2000.
  6386.  
  6387.  Example
  6388.  
  6389.    This example uses the GpiPolyFilletSharp function to draw a curve with a
  6390.    loop. The curve is drawn within a rectangle. The sharpness values are
  6391.    chosen to draw the curve close to the control points.
  6392.  
  6393.    POINTL ptlStart = { 0, 0 };
  6394.    POINTL aptl[4] = { 100, 100, 200, 100, 0, 100, 200, 0 };
  6395.    FIXED afx[2] = { MAKEFIXED(4, 0), MAKEFIXED(4, 0) };
  6396.  
  6397.    GpiMove(hps, &ptlStart);   /* move to first starting point         */
  6398.    GpiPolyFilletSharp(hps,    /* presentation-space handle            */
  6399.        4L,                    /* 4 points in the array                */
  6400.        aptl,                  /* pointer to array of points           */
  6401.        afx);                  /* pointer to array of sharpness values */
  6402.  
  6403.  See Also
  6404.  
  6405.    GpiMove, GpiPolyFillet, GpiPolyLine, GpiSetAttrs, GpiSetColor,
  6406.    GpiSetCurrentPosition, GpiSetLineType
  6407.  
  6408.  
  6409.  ────────────────────────────────────────────────────────────────────────────
  6410.  GpiPolyLine
  6411.  ────────────────────────────────────────────────────────────────────────────
  6412.    LONG GpiPolyLine (hps, cptl, aptl)
  6413.    HPS hps;                /*presentation-space handle                     */
  6414.    LONG cptl;              /*number of points in array                     */
  6415.    PPOINTL aptl;           /*pointer to array of structures for points     */
  6416.  
  6417.    The GpiPolyLine function draws one or more straight lines. The function
  6418.    draws the lines by using the points specified by the aptl parameter. The
  6419.    function needs at least one point to draw a line. If a point is specified,
  6420.    the function draws the line from the current position to the point. For
  6421.    each additional line, the function needs exactly one more point, and uses
  6422.    the end point of the last line as the starting point for the next. The
  6423.    function draws the lines by using the current values of the line-color,
  6424.    line-mix, line-width, and line-type attributes.
  6425.  
  6426.    The GpiPolyLine function moves the current position to the end point of
  6427.    the last line.
  6428.  
  6429.  Parameters
  6430.  
  6431.    hps  Identifies a presentation space.
  6432.  
  6433.    cptl  Specifies the number of points. This parameter must be greater than
  6434.    or equal to zero.
  6435.  
  6436.    aptl  Points to an array of POINTL structures that contains the points.
  6437.    The POINTL structure has the following form:
  6438.  
  6439.    typedef struct _POINTL {
  6440.        LONG  x;
  6441.        LONG  y;
  6442.    } POINTL;
  6443.  
  6444.    For a full description, see Chapter 4, "Types, Macros, Structures."
  6445.  
  6446.  Return Value
  6447.  
  6448.    The return value is GPI_OK or GPI_HITS if the function is successful (it
  6449.    is GPI_HITS if the detectable attribute is set for the presentation space
  6450.    and a correlation hit occurs). The return value is GPI_ERROR if an error
  6451.    occurs.
  6452.  
  6453.  Example
  6454.  
  6455.    This example uses the GpiPolyLine function to draw a triangle:
  6456.  
  6457.    POINTL ptlTriangle[] = { 0, 0, 100, 100, 200, 0 };
  6458.  
  6459.    GpiMove(hps, &ptlTriangle[0]);       /* moves to start point (0, 0) */
  6460.    GpiPolyLine(hps, &ptlTriangle[1]);   /* draws the triangle          */
  6461.  
  6462.  See Also
  6463.  
  6464.    GpiLine, GpiMove, GpiSetAttrs, GpiSetColor, GpiSetCurrentPosition,
  6465.    GpiSetLineType
  6466.  
  6467.  
  6468.  ────────────────────────────────────────────────────────────────────────────
  6469.  GpiPolyMarker
  6470.  ────────────────────────────────────────────────────────────────────────────
  6471.    LONG GpiPolyMarker (hps, cptl, aptl)
  6472.    HPS hps;                /*presentation-space handle                     */
  6473.    LONG cptl;              /*number of points                              */
  6474.    PPOINTL aptl;           /*pointer to array of structures for point      */
  6475.  
  6476.    The GpiPolyMarker function draws a marker at each point specified by the
  6477.    aptl parameter. The function places the center of each marker at the given
  6478.    point. The current marker set and marker-symbol attributes specify the
  6479.    marker to draw.
  6480.  
  6481.    The function moves the current position to the point of the last marker.
  6482.  
  6483.  Parameters
  6484.  
  6485.    hps  Identifies a presentation space.
  6486.  
  6487.    cptl  Specifies the number of points.
  6488.  
  6489.    aptl  Points to an array of POINTL structures that contain the points. The
  6490.    POINTL structure has the following form:
  6491.  
  6492.    typedef struct _POINTL  {
  6493.        LONG  x;
  6494.        LONG  y;
  6495.    } POINTL;
  6496.  
  6497.    For a full description, see Chapter 4, "Types, Macros, Structures."
  6498.  
  6499.  Return Value
  6500.  
  6501.    The return value is GPI_OK or GPI_HITS if the function is successful (it
  6502.    is GPI_HITS if the detectable attribute is set for the presentation space
  6503.    and a correlation hit occurs). The return value is GPI_ERROR if an error
  6504.    occurs.
  6505.  
  6506.  Example
  6507.  
  6508.    This example uses the GpiPolyMarker function to draw a series of markers.
  6509.    It then uses the GpiPolyLine function to connect to markers with lines.
  6510.  
  6511.    POINTL ptlStart = { 0, 0 };
  6512.    POINTL aptl[5] = { 10, 8, 20, 17, 30, 28, 40, 51, 50, 46 };
  6513.  
  6514.    GpiPolyMarker(hps, 5l, aptl);
  6515.    GpiMove(hps, &ptlStart);
  6516.    GpiPolyLine(hps, 5L, aptl);
  6517.  
  6518.  See Also
  6519.  
  6520.    GpiMarker, GpiMove, GpiSetAttrs, GpiSetCurrentPosition,
  6521.    GpiSetMarkerBox, GpiSetMarkerSet
  6522.  
  6523.  
  6524.  ────────────────────────────────────────────────────────────────────────────
  6525.  GpiPolySpline
  6526.  ────────────────────────────────────────────────────────────────────────────
  6527.    LONG GpiPolySpline (hps, cptl, aptl)
  6528.    HPS hps;                /*presentation-space handle                     */
  6529.    LONG cptl;              /*number of points in array                     */
  6530.    PPOINTL aptl;           /*pointer to array of structures for points     */
  6531.  
  6532.    The GpiPolySpline function creates one or more Bezier splines. The
  6533.    function draws the Bezier splines by using the points specified by the
  6534.    aptl parameter. The function needs at least three points to draw a spline.
  6535.    If exactly three points are specified, the function draws the spline from
  6536.    the current position to the third point, by using the first and second
  6537.    points as control points. For each additional spline, the function needs
  6538.    exactly three more points, and uses the end point of the last spline as
  6539.    the next starting point. The function draws each fillet by using the
  6540.    current line-color, line-mix, line-width, and line-type attributes.
  6541.  
  6542.    For each Bezier spline, the array pointed to by aptl contains two control
  6543.    points and an end point. The first triplet of points are the control and
  6544.    end points for the first spline, with the control points given first.
  6545.  
  6546.    The GpiPolySpline function moves the current position to the last
  6547.    specified point.
  6548.  
  6549.  Parameters
  6550.  
  6551.    hps  Identifies a presentation space.
  6552.  
  6553.    cptl  Specifies the number of points in the array pointed to by aptl. This
  6554.    must be three times the number of splines since each spline requires two
  6555.    control points and an end point.
  6556.  
  6557.    aptl  Points to an array of POINTL structures that contains the points.
  6558.    The POINTL structure has the following form:
  6559.  
  6560.    typedef struct _POINTL  {
  6561.        LONG  x;
  6562.        LONG  y;
  6563.    } POINTL;
  6564.  
  6565.    For a full description, see Chapter 4, "Types, Macros, Structures."
  6566.  
  6567.  Return Value
  6568.  
  6569.    The return value is GPI_OK or GPI_HITS if the function is successful (it
  6570.    is GPI_HITS if the detectable attribute is set for the presentation space
  6571.    and a correlation hit occurs). The return value is GPI_ERROR if an error
  6572.    occurs.
  6573.  
  6574.  Comments
  6575.  
  6576.    A Bezier spline is a smooth curve whose path is controlled by four points:
  6577.    a start point, an end point, and two control points.
  6578.  
  6579.    As the GpiPolySpline function draws a spline, all points contribute to the
  6580.    direction of the path, with one point having the greatest amount of
  6581.    control. The point with the greatest control tends to pull the path toward
  6582.    it. Greatest control moves from the start point, to the first control
  6583.    point, to the second control point, and finally to the end point as the
  6584.    path progresses.
  6585.  
  6586.    If the function draws more than one spline, it does not automatically
  6587.    ensure continuity of the curve at the end points. If an application wants
  6588.    a smooth transition from one curve to the next, it must supply the
  6589.    appropriate end and control points.
  6590.  
  6591.  Example
  6592.  
  6593.    This example uses the GpiPolySpline function to draw a curve. The curve is
  6594.    drawn within a skewed rectangle, with the bottom corners being the start
  6595.    and end points and the top corners being the control points.
  6596.  
  6597.    POINTL ptlStart = { 0, 0 };
  6598.    POINTL aptl[3] = { 0, 100, 200, 150, 200, 50 };
  6599.  
  6600.    GpiMove(hps, &ptlStart);         /* moves to start point       */
  6601.    GpiPolySpline(hps,               /* presentation-space handle  */
  6602.        3L,                          /* 3 points in the array      */
  6603.        aptl);                       /* pointer to array of points */
  6604.  
  6605.  See Also
  6606.  
  6607.    GpiMove, GpiSetAttrs, GpiSetColor, GpiSetCurrentPosition,
  6608.    GpiSetLineType
  6609.  
  6610.  
  6611.  ────────────────────────────────────────────────────────────────────────────
  6612.  GpiPop
  6613.  ────────────────────────────────────────────────────────────────────────────
  6614.    BOOL GpiPop (hps, cAttrs)
  6615.    HPS hps;                /*presentation-space handle                     */
  6616.    LONG cAttrs;            /*number of attributes to restore               */
  6617.  
  6618.    The GpiPop function restores one or more primitive attributes by popping
  6619.    the previous attribute values from the attribute stack. The system saves
  6620.    the previous value of a primitive attribute, such as color, line type, and
  6621.    fill pattern, on the attribute stack whenever an application changes an
  6622.    attribute while the attribute mode is AM_PRESERVE. The function pops the
  6623.    number of attributes specified by cAttrs from the stack in last-in,
  6624.    first-out order.
  6625.  
  6626.  Parameters
  6627.  
  6628.    hps  Identifies a presentation space.
  6629.  
  6630.    cAttrs  Specifies the number of attributes to restore.
  6631.  
  6632.  Return Value
  6633.  
  6634.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  6635.    an error occurred.
  6636.  
  6637.  Errors
  6638.  
  6639.    Use the WinGetLastError function to retrieve the error value, which may be
  6640.    one of the following:
  6641.  
  6642.          PMERR_INV_MICROPS_FUNCTION
  6643.          PMERR_PRIMITIVE_STACK_EMPTY
  6644.  
  6645.  Comments
  6646.  
  6647.    Although GpiPop can be used in an area or path bracket, an application
  6648.    must ensure that the attribute to be restored is valid within the bracket.
  6649.    Once an attribute is on the stack, there is no way to check it for
  6650.    validity.
  6651.  
  6652.    The attribute stack is especially useful when you are drawing segments.
  6653.    Any attributes changed by the segment can be quickly restored by popping
  6654.    the stack. Note that a segment automatically pops the stack when it
  6655.    returns, so a call to the GpiPop function is not required.
  6656.  
  6657.  Example
  6658.  
  6659.    This example uses the GpiPop function to restore the fill pattern and
  6660.    color attribute after painting a path:
  6661.  
  6662.    GpiSetAttrMode(hps, AM_PRESERVE);   /* preserves attributes on stack */
  6663.        .
  6664.        .
  6665.        .
  6666.    GpiSetColor(hps, CLR_RED);          /* sets color to red             */
  6667.    GpiSetPattern(hps, PATSYM_DIAG1);   /* sets pattern to a diagonal    */
  6668.    GpiPaintRegion(hps, 3L);
  6669.    GpiPop(hps, 2L);       /* restores values of last two attributes set */
  6670.  
  6671.  See Also
  6672.  
  6673.    GpiRestorePS, GpiSavePS
  6674.  
  6675.  
  6676.  ────────────────────────────────────────────────────────────────────────────
  6677.  GpiPtInRegion
  6678.  ────────────────────────────────────────────────────────────────────────────
  6679.    LONG GpiPtInRegion (hps, hrgn, pptl)
  6680.    HPS hps;                /*presentation-space handle                     */
  6681.    HRGN hrgn;              /*region handle                                 */
  6682.    PPOINTL pptl;           /*pointer to structure for point                */
  6683.  
  6684.    The GpiPtInRegion function checks whether a point lies in the region
  6685.    specified by the hrgn parameter. The function checks the region only if
  6686.    the device context containing the region is associated with the given
  6687.    presentation space.
  6688.  
  6689.  Parameters
  6690.  
  6691.    hps  Identifies a presentation space.
  6692.  
  6693.    hrgn  Identifies a region.
  6694.  
  6695.    pptl  Points to a POINTL data structure that contains the coordinates of
  6696.    the point. The POINTL structure has the following form:
  6697.  
  6698.    typedef struct _POINTL  {
  6699.        LONG  x;
  6700.        LONG  y;
  6701.    } POINTL;
  6702.  
  6703.    For a full description, see Chapter 4, "Types, Macros, Structures."
  6704.  
  6705.  Return Value
  6706.  
  6707.    The return value is PRGN_OUTSIDE or PRGN_INSIDE if the function is
  6708.    successful, or PRGN_ERROR if an error occurs.
  6709.  
  6710.  See Also
  6711.  
  6712.    GpiRectInRegion
  6713.  
  6714.  
  6715.  ────────────────────────────────────────────────────────────────────────────
  6716.  GpiPtVisible
  6717.  ────────────────────────────────────────────────────────────────────────────
  6718.    LONG GpiPtVisible (hps, pptl)
  6719.    HPS hps;                /*presentation-space handle                     */
  6720.    PPOINTL pptl;           /*pointer to structure for point                */
  6721.  
  6722.    The GpiPtVisible function checks whether a point is visible on the device
  6723.    associated with the specified presentation space. A point is visible if it
  6724.    lies within the intersection of the current graphics field, viewing limit,
  6725.    clip path, clip region, and visible region (if any).
  6726.  
  6727.  Parameters
  6728.  
  6729.    hps  Identifies a presentation space.
  6730.  
  6731.    pptl  Points to a POINTL data structure that contains the coordinates of
  6732.    the point. The POINTL structure has the following form:
  6733.  
  6734.    typedef struct _POINTL  {
  6735.        LONG  x;
  6736.        LONG  y;
  6737.    } POINTL;
  6738.  
  6739.    For a full description, see Chapter 4, "Types, Macros, Structures."
  6740.  
  6741.  Return Value
  6742.  
  6743.    The return value is PVIS_VISIBLE or PVIS_INVISIBLE if the function is
  6744.    successful or PVIS_ERROR if an error occurred.
  6745.  
  6746.  See Also
  6747.  
  6748.    GpiConvert, GpiQueryPel
  6749.  
  6750.  
  6751.  ────────────────────────────────────────────────────────────────────────────
  6752.  GpiPutData
  6753.  ────────────────────────────────────────────────────────────────────────────
  6754.    LONG GpiPutData (hps, cmdFormat, pcb, pb)
  6755.    HPS hps;                /*presentation-space handle                     */
  6756.    LONG cmdFormat;         /*coordinate type                               */
  6757.    PLONG pcb;              /*pointer to variable for length of order data  */
  6758.    PBYTE pb;               /*pointer to buffer for order data              */
  6759.  
  6760.    The GpiPutData function draws the graphics orders given in the buffer
  6761.    pointed to by the pb parameter. The function carries out the graphics
  6762.    operation specified by each graphics order. The buffer can contain any
  6763.    number of graphics orders as long as the buffer does not exceed 63K. The
  6764.    pcb parameter specifies the number of bytes of graphics-order data in the
  6765.    buffer. The function converts the coordinates in the graphics orders if
  6766.    the format specified by the cmdFormat parameter is not the same as the
  6767.    format used by the presentation space.
  6768.  
  6769.    The GpiPutData function is used typically with the GpiGetData function to
  6770.    copy graphics orders from one segment to another. For convenience, the
  6771.    last order in the buffer does not have to be complete. If the order is not
  6772.    complete, the function does not copy the order. Instead, it replaces the
  6773.    count in pcb with the count of bytes copied. This count can be used to
  6774.    locate the incomplete order in the buffer.
  6775.  
  6776.  Parameters
  6777.  
  6778.    hps  Identifies a presentation space.
  6779.  
  6780.    cmdFormat  Specifies the type of coordinates used in the graphics orders.
  6781.    It can be one of the following values:
  6782.  
  6783.    Value             Meaning
  6784.    ──────────────────────────────────────────────────────────────────────────
  6785.    DFORM_S370SHORT   Uses S/370-format short (2-byte) integers.
  6786.  
  6787.    DFORM_PCSHORT     Uses PC-format short (2-byte) integers.
  6788.  
  6789.    DFORM_PCLONG      Uses PC-format long (4-byte) integers.
  6790.    ──────────────────────────────────────────────────────────────────────────
  6791.  
  6792.    pcb  Points to the count of bytes in the buffer pointed to by the pb
  6793.    parameter. After copying the data, the function replaces the count with
  6794.    the number of bytes copied.
  6795.  
  6796.    pb  Points to the buffer that contains the graphics-order data. It must
  6797.    not contain more than 63K of data.
  6798.  
  6799.  Return Value
  6800.  
  6801.    The return value is GPI_OK or GPI_HITS if the function is successful (it
  6802.    is GPI_HITS if the detectable attribute is set for the presentation space
  6803.    and a correlation hit occurs). The return value is GPI_ERROR if an error
  6804.    occurs.
  6805.  
  6806.  Errors
  6807.  
  6808.    Use the WinGetLastError function to retrieve the error value, which may be
  6809.    one of the following:
  6810.  
  6811.          PMERR_DATA_TOO_LONG
  6812.          PMERR_INV_EDIT_MODE
  6813.          PMERR_INV_ELEMENT_POINTER
  6814.          PMERR_INV_LENGTH_OR_COUNT
  6815.          PMERR_INV_MICROPS_FUNCTION
  6816.          PMERR_INV_ORDER_LENGTH
  6817.  
  6818.  Comments
  6819.  
  6820.    The current drawing mode determines whether the function draws the
  6821.    graphics orders or copies them to a segment. To copy the graphics orders
  6822.    to the currently open segment, an application must set the current segment
  6823.    editing mode to SEGEM_INSERT and move the element pointer to the last
  6824.    element in the segment. The function can be used in an element bracket if
  6825.    the graphics-order data does not contain an element bracket.
  6826.  
  6827.  Example
  6828.  
  6829.    This example uses the GpiPutData function to copy graphics orders from one
  6830.    segment to another:
  6831.  
  6832.    LONG fFormat = DFORM_NOCONV;   /* do not convert coordinates        */
  6833.    LONG offSegment = 0L;          /* offset in segment                 */
  6834.    LONG offNextElement = 0L;      /* offset in segment to next element */
  6835.    LONG cb = 0L;                  /* bytes retrieved                   */
  6836.    BYTE abBuffer[512];
  6837.  
  6838.    GpiOpenSegment(hps, 3L);       /* open segment to receive the data  */
  6839.    do {
  6840.        offSegment += cb;
  6841.        offNextElement = offSegment;
  6842.        cb = GpiGetData(hps, 2L, &offNextElement, fFormat, 512L, abBuffer);
  6843.  
  6844.        /* Put data in other segment. */
  6845.  
  6846.        if (cb > 0L) GpiPutData(hps, /* presentation-space handle        */
  6847.            fFormat,                 /* format of coordinates            */
  6848.            &cb,                     /* number of bytes in buffer        */
  6849.            abBuffer);               /* buffer with graphics-order data  */
  6850.  
  6851.    } while (cb > 0L);
  6852.    GpiCloseSegment(hps);            /* close segment that received data */
  6853.  
  6854.  See Also
  6855.  
  6856.    GpiBeginElement, GpiEndElement, GpiGetData, GpiSetDrawingMode,
  6857.    GpiSetEditMode
  6858.  
  6859.  
  6860.  ────────────────────────────────────────────────────────────────────────────
  6861.  GpiQueryArcParams
  6862.  ────────────────────────────────────────────────────────────────────────────
  6863.    BOOL GpiQueryArcParams (hps, parcp)
  6864.    HPS hps;                /*presentation-space handle                     */
  6865.    PARCPARAMS parcp;       /*pointer to structure for arc parameters       */
  6866.  
  6867.    The GpiQueryArcParams function retrieves the current arc parameters used
  6868.    to draw arcs, circles, and ellipses. The function cannot be used in an
  6869.    open segment when the drawing mode is DM_RETAIN.
  6870.  
  6871.  Parameters
  6872.  
  6873.    hps  Identifies the presentation space.
  6874.  
  6875.    parcp  Points to the ARCPARAMS structure that receives the current arc
  6876.    parameters. The ARCPARAMS structure has the following form:
  6877.  
  6878.    typedef struct _ARCPARAMS {
  6879.        LONG lP;
  6880.        LONG lQ;
  6881.        LONG lR;
  6882.        LONG lS;
  6883.    } ARCPARAMS;
  6884.  
  6885.    For a full description, see Chapter 4, "Types, Macros, Structures."
  6886.  
  6887.  Return Value
  6888.  
  6889.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  6890.    an error occurred.
  6891.  
  6892.  See Also
  6893.  
  6894.    GpiSetArcParams, GpiSetDrawingMode
  6895.  
  6896.  
  6897.  ────────────────────────────────────────────────────────────────────────────
  6898.  GpiQueryAttrMode
  6899.  ────────────────────────────────────────────────────────────────────────────
  6900.    LONG GpiQueryAttrMode (hps)
  6901.    HPS hps;                /*presentation-space handle                     */
  6902.  
  6903.    The GpiQueryAttrMode function retrieves the current value of the attribute
  6904.    mode, as set by the GpiSetAttrMode function.
  6905.  
  6906.  Parameters
  6907.  
  6908.    hps  Identifies the presentation space.
  6909.  
  6910.  Return Value
  6911.  
  6912.    The return value is the current attribute mode if the function is
  6913.    successful or AM_ERROR if an error occurs.
  6914.  
  6915.  Errors
  6916.  
  6917.    Use the WinGetLastError function to retrieve the error value, which may be
  6918.    the following:
  6919.  
  6920.          PMERR_INV_MICROPS_FUNCTION
  6921.  
  6922.  See Also
  6923.  
  6924.    GpiSetAttrMode
  6925.  
  6926.  
  6927.  ────────────────────────────────────────────────────────────────────────────
  6928.  GpiQueryAttrs
  6929.  ────────────────────────────────────────────────────────────────────────────
  6930.    LONG GpiQueryAttrs (hps, lPrimType, flAttrsMask, pbunAttrs)
  6931.    HPS hps;                /*presentation-space handle                     */
  6932.    LONG lPrimType;         /*primitive type                                */
  6933.    ULONG flAttrsMask;      /*attribute mask                                */
  6934.    PBUNDLE pbunAttrs;      /*pointer to buffer for nondefault attributes   */
  6935.  
  6936.    The GpiQueryAttrs function retrieves the current attributes for the
  6937.    specified primitive type. The function copies the attribute values
  6938.    specified by the flAttrsMask parameter to the buffer pointed to by the
  6939.    pbunAttrs parameter, then returns a mask that specifies which attributes
  6940.    have the default values. The function sets the bit in the mask if the
  6941.    corresponding attribute has its default value.
  6942.  
  6943.    The GpiQueryAttrs function cannot be used in an open segment when the
  6944.    drawing mode is DM_RETAIN.
  6945.  
  6946.  Parameters
  6947.  
  6948.    hps  Identifies the presentation space.
  6949.  
  6950.    lPrimType  Specifies which primitive type to retrieve attributes for. It
  6951.    can be one of the following values:
  6952.  
  6953.    Value             Meaning
  6954.    ──────────────────────────────────────────────────────────────────────────
  6955.    PRIM_AREA         Area primitives
  6956.  
  6957.    PRIM_CHAR         Character primitives
  6958.  
  6959.    PRIM_IMAGE        Image primitives
  6960.  
  6961.    PRIM_LINE         Line and arc primitives
  6962.  
  6963.    PRIM_MARKER       Marker primitives
  6964.    ──────────────────────────────────────────────────────────────────────────
  6965.  
  6966.    flAttrsMask  Specifies which attributes to retrieve. The values for this
  6967.    parameter depend on the primitive type specified by the lPrimType
  6968.    parameter. This parameter can be any combination of the following values
  6969.    for a specific type:
  6970.  
  6971.    Type          Values
  6972.    ──────────────────────────────────────────────────────────────────────────
  6973.    PRIM_AREA     ABB_COLOR, ABB_BACK_COLOR, ABB_MIX_MODE, ABB_BACK_MIX_MODE,
  6974.                  ABB_SET, ABB_SYMBOL, ABB_REF_POINT
  6975.  
  6976.    PRIM_CHAR     CBB_COLOR, CBB_BACK_COLOR, CBB_MIX_MODE, CBB_BACK_MIX_MODE,
  6977.                  CBB_SET, CBB_MODE, CBB_BOX, CBB_ANGLE, CBB_SHEAR,
  6978.                  CBB_DIRECTION
  6979.  
  6980.    PRIM_IMAGE    IBB_COLOR, IBB_BACK_COLOR, IBB_MIX_MODE, IBB_BACK_MIX_MODE
  6981.  
  6982.    PRIM_LINE     LBB_COLOR, LBB_MIX_MODE, LBB_WIDTH, LBB_GEOM_WIDTH,
  6983.                  LBB_TYPE, LBB_END, LBB_JOIN
  6984.  
  6985.    PRIM_MARKER   MBB_COLOR, MBB_BACK_COLOR, MBB_MIX_MODE, MBB_BACK_MIX_MODE,
  6986.                  MBB_SET, MBB_SYMBOL, MBB_BOX
  6987.    ──────────────────────────────────────────────────────────────────────────
  6988.  
  6989.    If this parameter is zero, the function does not retrieve attributes but
  6990.    still returns a mask specifying the attributes with default values.
  6991.  
  6992.    pbunAttrs  Points to the buffer that receives the attribute values
  6993.    specified by the flAttrsMask parameter. The buffer format depends on the
  6994.    primitive type specified by the lPrimType parameter. The following
  6995.    structures can be used for the specified primitive types:
  6996.  
  6997.    Type                Structure
  6998.    ──────────────────────────────────────────────────────────────────────────
  6999.    PRIM_AREA           AREABUNDLE
  7000.  
  7001.    PRIM_CHAR           CHARBUNDLE
  7002.  
  7003.    PRIM_IMAGE          IMAGEBUNDLE
  7004.  
  7005.    PRIM_LINE           LINEBUNDLE
  7006.  
  7007.    PRIM_MARKER         MARKERBUNDLE
  7008.    ──────────────────────────────────────────────────────────────────────────
  7009.  
  7010.  Return Value
  7011.  
  7012.    The return value is the default mask if the function is successful or
  7013.    GPI_ALTERROR if an error occurred.
  7014.  
  7015.  Errors
  7016.  
  7017.    Use the WinGetLastError function to retrieve the error value, which may be
  7018.    the following:
  7019.  
  7020.          PMERR_INV_PRIMITIVE_TYPE
  7021.  
  7022.  Example
  7023.  
  7024.    This example uses the GpiQueryAttrs function to retrieve the current
  7025.    attributes for the line primitive:
  7026.  
  7027.    LINEBUNDLE lbnd;
  7028.    LONG flDefMask;
  7029.  
  7030.    flDefMask = GpiQueryAttrs(hps,  /* presentation-space handle */
  7031.        PRIM_LINE,                  /* line primitive            */
  7032.        LBB_COLOR |                 /* line color                */
  7033.        LBB_MIX_MODE |              /* color-mix mode            */
  7034.        LBB_WIDTH |                 /* line width                */
  7035.        LBB_GEOM_WIDTH |            /* geometric-line width      */
  7036.        LBB_TYPE |                  /* line style                */
  7037.        LBB_END |                   /* line-end style            */
  7038.        LBB_JOIN,                   /* line-join style           */
  7039.        &lbnd);                     /* buffer for attributes     */
  7040.  
  7041.    if (flDefMask & LBB_COLOR)
  7042.  
  7043.        /* The line color has the default value. */
  7044.  
  7045.  See Also
  7046.  
  7047.    GpiSetAttrs, GpiSetDrawingMode
  7048.  
  7049.  
  7050.  ────────────────────────────────────────────────────────────────────────────
  7051.  GpiQueryBackColor
  7052.  ────────────────────────────────────────────────────────────────────────────
  7053.    LONG GpiQueryBackColor (hps)
  7054.    HPS hps;                /*presentation-space handle                     */
  7055.  
  7056.    The GpiQueryBackColor function retrieves the current value of the line
  7057.    background-color attribute, as set by the GpiSetBackColor function. The
  7058.    function cannot be used in an open segment when the drawing mode is
  7059.    DM_RETAIN.
  7060.  
  7061.  Parameters
  7062.  
  7063.    hps  Identifies the presentation space.
  7064.  
  7065.  Return Value
  7066.  
  7067.    The return value is the background color if the function is successful or
  7068.    CLR_ERROR if an error occurred.
  7069.  
  7070.  See Also
  7071.  
  7072.    GpiQueryBackMix, GpiQueryColor, GpiSetBackColor
  7073.  
  7074.  
  7075.  ────────────────────────────────────────────────────────────────────────────
  7076.  GpiQueryBackMix
  7077.  ────────────────────────────────────────────────────────────────────────────
  7078.    LONG GpiQueryBackMix (hps)
  7079.    HPS hps;                /*presentation-space handle                     */
  7080.  
  7081.    The GpiQueryBackMix function retrieves the current value of the line
  7082.    background-color mix mode, as set by the GpiSetBackMix function.
  7083.  
  7084.  Parameters
  7085.  
  7086.    hps  Identifies the presentation space.
  7087.  
  7088.  Return Value
  7089.  
  7090.    The return value is the background-color mix mode if the function is
  7091.    successful or BM_ERROR if an error occurred.
  7092.  
  7093.  See Also
  7094.  
  7095.    GpiQueryBackColor, GpiQueryMix, GpiSetBackMix
  7096.  
  7097.  
  7098.  ────────────────────────────────────────────────────────────────────────────
  7099.  GpiQueryBitmapBits
  7100.  ────────────────────────────────────────────────────────────────────────────
  7101.    LONG GpiQueryBitmapBits (hps, lScanStart, cScan, pbBuffer, pbmi)
  7102.    HPS hps;                /*presentation-space handle                     */
  7103.    LONG lScanStart;        /*number for first scan line to retrieve        */
  7104.    LONG cScan;             /*number of scan lines to retrieve              */
  7105.    PBYTE pbBuffer;         /*pointer to buffer for bitmap image data       */
  7106.    PBITMAPINFO pbmi;       /*pointer to structure for bitmap info          */
  7107.  
  7108.    The GpiQueryBitmapBits function copies image data from a bitmap to the
  7109.    buffer pointed to by the pbBuffer parameter. The function copies the image
  7110.    data from the bitmap currently set for the presentation space. The
  7111.    presentation space must be associated with a memory device context.
  7112.  
  7113.    To copy the image data, the function needs the count of planes and
  7114.    adjacent color bits specified in the fields of the structure pointed to by
  7115.    the pbmi parameter. That is, the cPlanes and cBitCount fields must be set
  7116.    before you call the function. Also, the cbFix field must be set to 12. The
  7117.    function then copies the image data to the buffer. The buffer must have
  7118.    sufficient space to hold all the bytes of image data being copied. The
  7119.    number of bytes for the buffer is equal to the number of scan lines to
  7120.    copy, multiplied by the width of the bitmap in bytes (rounded up to the
  7121.    next multiple of 4), multiplied by the number of color planes. The width
  7122.    has to be a multiple of 4, since the function rounds the length of each
  7123.    scan line to a multiple of 4 bytes before copying. Also, the width must be
  7124.    multiplied by the number of adjacent color bits before rounding.
  7125.  
  7126.    After copying the image data, the GpiQueryBitmapBits function fills the
  7127.    remaining fields in the structure pointed to by pbmi. These fields are the
  7128.    width and height of the bitmap and the array of RGB color values for the
  7129.    bitmap pels. An application must make sure there is sufficient space in
  7130.    the structure to receive all elements of the array of RGB color values.
  7131.    The number of elements in the array depends on the format of the bitmap.
  7132.  
  7133.  Parameters
  7134.  
  7135.    hps  Identifies the presentation space.
  7136.  
  7137.    lScanStart  Specifies the number of the first scan line to copy to the
  7138.    buffer. If this parameter is zero, the function copies the first scan line
  7139.    in the bitmap.
  7140.  
  7141.    cScan  Specifies the number of scan lines to copy.
  7142.  
  7143.    pbBuffer  Points to the buffer that receives the bitmap image data. It
  7144.    must be large enough to hold all the bytes of the image data, from the
  7145.    scan line specified by the lScanStart parameter to the end of the bitmap.
  7146.  
  7147.    pbmi  Points to the BITMAPINFO structure that receives the bitmap
  7148.    information table. The BITMAPINFO structure has the following form:
  7149.  
  7150.    typedef struct _BITMAPINFO {
  7151.        ULONG  cbFix;
  7152.        USHORT cx;
  7153.        USHORT cy;
  7154.        USHORT cPlanes;
  7155.        USHORT cBitCount;
  7156.        RGB    argbColor[1];
  7157.    } BITMAPINFO;
  7158.  
  7159.    Depending on the format of the given bitmap, an application may need to
  7160.    allocate extra bytes for the structure to hold the additional elements for
  7161.    the argbColor field. For a full description, see Chapter 4, "Types,
  7162.    Macros, Structures."
  7163.  
  7164.  Return Value
  7165.  
  7166.    The return value is the number of scan lines retrieved if the function is
  7167.    successful or GPI_ALTERROR if an error occurred.
  7168.  
  7169.  Errors
  7170.  
  7171.    Use the WinGetLastError function to retrieve the error value, which may be
  7172.    one of the following:
  7173.  
  7174.          PMERR_INV_DC_TYPE
  7175.          PMERR_INV_INFO_TABLE
  7176.  
  7177.  Comments
  7178.  
  7179.    If the requested color format is not the same as the bitmap's color
  7180.    format, the function converts the bitmap image data to the requested
  7181.    format.
  7182.  
  7183.  Example
  7184.  
  7185.    This example uses the GpiQueryBitmapBits to copy the image data of a
  7186.    bitmap from a presentation space associated with a memory device context.
  7187.  
  7188.    BITMAPINFOHEADER bmp = { 12, 640, 350, 1, 1 };
  7189.    LONG cbBuffer, cbBitmapInfo;
  7190.    SEL selBuffer, selBitmapInfo;
  7191.    PBYTE pbBuffer;
  7192.    PBITMAPINFO pbmi;
  7193.  
  7194.    /*
  7195.     * Compute the size of the image-data buffer
  7196.     * and the bitmap information structure.
  7197.     */
  7198.  
  7199.    cbBuffer = (((bmp.cBitCount * bmp.cx) + 31) / 32)
  7200.        * 4 * bmp.cy * bmp.cPlanes;
  7201.    cbBitmapInfo = sizeof(BITMAPINFO) +
  7202.        (sizeof(RGB) * (1 << bmp.cBitCount));
  7203.  
  7204.    /* Allocate memory for the image data-buffer
  7205.     * and the bitmap information structure.
  7206.     */
  7207.  
  7208.    DosAllocSeg(cbBuffer, &selBuffer, SEG_NONSHARED);
  7209.    pbBuffer = MAKEP(selBuffer, 0);
  7210.    DosAllocSeg(cbBitmapInfo, &selBitmapInfo, SEG_NONSHARED);
  7211.    pbmi = MAKEP(selBitmapInfo, 0);
  7212.    /* Copy the image data. */
  7213.  
  7214.    pbmi->cbFix = 12; pbmi->cPlanes = 1; pbmi->cBitCount = 1;
  7215.    GpiQueryBitmapBits(hps, 0L, (LONG) bmp.cy, pbBuffer, pbmi);
  7216.  
  7217.  See Also
  7218.  
  7219.    GpiLoadBitmap, GpiQueryBitmapParameters, GpiSetBitmapBits
  7220.  
  7221.  
  7222.  ────────────────────────────────────────────────────────────────────────────
  7223.  GpiQueryBitmapDimension
  7224.  ────────────────────────────────────────────────────────────────────────────
  7225.    BOOL GpiQueryBitmapDimension (hbm, psizl)
  7226.    HBITMAP hbm;            /*bitmap handle                                 */
  7227.    PSIZEL psizl;           /*pointer to structure for bitmap size info     */
  7228.  
  7229.    The GpiQueryBitmapDimension function retrieves the width and height of a
  7230.    bitmap, as specified by a previous call to the GpiSetBitmapDimension
  7231.    function. If the bitmap dimensions have not been set by
  7232.    GpiSetBitmapDimension, the width and height are zero.
  7233.  
  7234.  Parameters
  7235.  
  7236.    hbm  Identifies the bitmap.
  7237.  
  7238.    psizl  Points to the SIZEL structure that receives the width and height of
  7239.    the bitmap in 0.1 millimeter units. The SIZEL structure has the following
  7240.    form:
  7241.  
  7242.    typedef struct _SIZEL {
  7243.        LONG cx;
  7244.        LONG cy;
  7245.    } SIZEL;
  7246.  
  7247.    For a full description, see Chapter 4, "Types, Macros, Structures."
  7248.  
  7249.  Return Value
  7250.  
  7251.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  7252.    an error occurred.
  7253.  
  7254.  See Also
  7255.  
  7256.    GpiQueryBitmapParameters, GpiSetBitmapDimension
  7257.  
  7258.  
  7259.  ────────────────────────────────────────────────────────────────────────────
  7260.  GpiQueryBitmapHandle
  7261.  ────────────────────────────────────────────────────────────────────────────
  7262.    HBITMAP GpiQueryBitmapHandle (hps, lcid)
  7263.    HPS hps;                /*presentation-space handle                     */
  7264.    LONG lcid;              /*local identifier                              */
  7265.  
  7266.    The GpiQueryBitmapHandle function retrieves the handle of the bitmap
  7267.    currently tagged with the specified local identifier. The function returns
  7268.    a null handle if a bitmap is not currently tagged with the specified local
  7269.    identifier.
  7270.  
  7271.  Parameters
  7272.  
  7273.    hps  Identifies the presentation space.
  7274.  
  7275.    lcid  Specifies the local identifier.
  7276.  
  7277.  Return Value
  7278.  
  7279.    The return value is a handle to the bitmap if the function is successful
  7280.    or GPI_ERROR if an error occurred.
  7281.  
  7282.  Errors
  7283.  
  7284.    Use the WinGetLastError function to retrieve the error value, which may be
  7285.    the following:
  7286.  
  7287.          PMERR_BITMAP_NOT_FOUND
  7288.  
  7289.  See Also
  7290.  
  7291.    GpiSetBitmapId
  7292.  
  7293.  
  7294.  ────────────────────────────────────────────────────────────────────────────
  7295.  GpiQueryBitmapParameters
  7296.  ────────────────────────────────────────────────────────────────────────────
  7297.    BOOL GpiQueryBitmapParameters (hbm, pbmp)
  7298.    HBITMAP hbm;            /*bitmap handle                                 */
  7299.    PBITMAPINFOHEADER pbmp; /*pointer to structure for bitmap info          */
  7300.  
  7301.    The GpiQueryBitmapParameters function retrieves information about the
  7302.    bitmap identified by the hbm parameter. The function copies the bitmap
  7303.    width, height, and number of color planes and adjacent color bits to the
  7304.    structure pointed to by the pbmp parameter.
  7305.  
  7306.  Parameters
  7307.  
  7308.    hbm  Identifies the bitmap.
  7309.  
  7310.    pbmp  Points to the BITMAPINFOHEADER structure that receives the
  7311.    information for the specified bitmap. The BITMAPINFOHEADER structure has
  7312.    the following form:
  7313.  
  7314.    typedef struct _BITMAPINFOHEADER {
  7315.        ULONG  cbFix;
  7316.        USHORT cx;
  7317.        USHORT cy;
  7318.        USHORT cPlanes;
  7319.        USHORT cBitCount;
  7320.    } BITMAPINFOHEADER;
  7321.  
  7322.    For a full description, see Chapter 4, "Types, Macros, Structures."
  7323.  
  7324.  Return Value
  7325.  
  7326.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  7327.    an error occurred.
  7328.  
  7329.  See Also
  7330.  
  7331.    GpiCreateBitmap, GpiLoadBitmap, GpiQueryBitmapDimension
  7332.  
  7333.  
  7334.  ────────────────────────────────────────────────────────────────────────────
  7335.  GpiQueryBoundaryData
  7336.  ────────────────────────────────────────────────────────────────────────────
  7337.    BOOL GpiQueryBoundaryData (hps, prcl)
  7338.    HPS hps;                /*presentation-space handle                     */
  7339.    PRECTL prcl;            /*pointer to structure for boundary data        */
  7340.  
  7341.    The GpiQueryBoundaryData function retrieves the current boundary data.
  7342.    Boundary data is the smallest rectangle in model space that encloses
  7343.    previous graphics output. The previous output includes all output since
  7344.    the application reset the boundary data by using the GpiResetBoundaryData
  7345.    function or started accumulating boundary data by using the DCTL_BOUNDARY
  7346.    option of the GpiSetDrawControl function.
  7347.  
  7348.    The boundary data is inclusive, meaning some output may lie on one or more
  7349.    edges of the given rectangle. If there has been no output, the boundary
  7350.    data is empty. In this case, the values for the upper-right corner in the
  7351.    given rectangle will be less than the values for the lower-left corner.
  7352.  
  7353.  Parameters
  7354.  
  7355.    hps  Identifies the presentation space.
  7356.  
  7357.    prcl  Points to the RECTL structure that receives the boundary data. The
  7358.    RECTL structure has the following form:
  7359.  
  7360.    typedef struct _RECTL {
  7361.        LONG  xLeft;
  7362.        LONG  yBottom;
  7363.        LONG  xRight;
  7364.        LONG  yTop;
  7365.    } RECTL;
  7366.  
  7367.    For a full description, see Chapter 4, "Types, Macros, Structures."
  7368.  
  7369.  Return Value
  7370.  
  7371.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  7372.    an error occurred.
  7373.  
  7374.  Errors
  7375.  
  7376.    Use the WinGetLastError function to retrieve the error value, which may be
  7377.    the following:
  7378.  
  7379.          PMERR_INV_MICROPS_FUNCTION
  7380.  
  7381.  Example
  7382.  
  7383.    This example uses the GpiQueryBoundaryData function to retrieve the
  7384.    rectangle enclosing the output. The boundary data is then used to draw a
  7385.    border around the output.
  7386.  
  7387.    POINTL ptlStart = { 0, 0 };
  7388.    POINTL ptlTriangle[3] = { 100, 100, 200, 0, 0, 0 };
  7389.    RECTL rcl;
  7390.  
  7391.    GpiSetDrawControl(hps,
  7392.        DCTL_BOUNDARY, DCTL_ON);          /* accumulate boundary data   */
  7393.  
  7394.    GpiMove(hps, &ptlStart);              /* produce output             */
  7395.    GpiPolyLine(hps, 3L, &ptlTriangle);
  7396.  
  7397.    GpiQueryBoundaryData(hps, &rcl);      /* copy boundary data to rcl  */
  7398.    if (rcl.xLeft < rcl.xRight) {         /* verify output exists       */
  7399.        ptlStart.x = rcl.xLeft; ptlStart.y = rcl.yBottom;
  7400.        GpiMove(hps, &ptlStart);          /* move to lower-right corner */
  7401.        ptlStart.x = rcl.xRight; ptlStart.y = rcl.yTop;
  7402.        GpiBox(hps, DRO_OUTLINE, &ptlStart, 0L, 0L);     /* draw border */
  7403.    }
  7404.  
  7405.  See Also
  7406.  
  7407.    GpiResetBoundaryData, GpiSetDrawControl
  7408.  
  7409.  
  7410.  ────────────────────────────────────────────────────────────────────────────
  7411.  GpiQueryCharAngle
  7412.  ────────────────────────────────────────────────────────────────────────────
  7413.    BOOL GpiQueryCharAngle (hps, pgradlAngle)
  7414.    HPS hps;                /*presentation-space handle                     */
  7415.    PGRADIENTL pgradlAngle; /*pointer to structure for baseline-angle point */
  7416.  
  7417.    The GpiQueryCharAngle function retrieves the current value of the
  7418.    character-baseline angle. The character-baseline angle is set by the
  7419.    GpiSetCharAngle function.
  7420.  
  7421.    The GpiQueryCharAngle function cannot be used in an open segment when the
  7422.    drawing mode is DM_RETAIN.
  7423.  
  7424.  Parameters
  7425.  
  7426.    hps  Identifies the presentation space.
  7427.  
  7428.    pgradlAngle  Points to the GRADIENTL structure that receives a point that
  7429.    specifies the end of a vector defining the baseline angle. The GRADIENTL
  7430.    structure has the following form:
  7431.  
  7432.    typedef struct _GRADIENTL {
  7433.        LONG x;
  7434.        LONG y;
  7435.    } GRADIENTL;
  7436.  
  7437.    For a full description, see Chapter 4, "Types, Macros, Structures."
  7438.  
  7439.  Return Value
  7440.  
  7441.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  7442.    an error occurred.
  7443.  
  7444.  See Also
  7445.  
  7446.    GpiQueryAttrs, GpiQueryCharMode, GpiQueryCharShear, GpiSetCharAngle
  7447.  
  7448.  
  7449.  ────────────────────────────────────────────────────────────────────────────
  7450.  GpiQueryCharBox
  7451.  ────────────────────────────────────────────────────────────────────────────
  7452.    BOOL GpiQueryCharBox (hps, psizfxBox)
  7453.    HPS hps;                /*presentation-space handle                     */
  7454.    PSIZEF psizfxBox;       /*pointer to structure for character-box size   */
  7455.  
  7456.    The GpiQueryCharBox function retrieves the current value of the
  7457.    character-box attribute, as set by the GpiSetCharBox function. This
  7458.    function cannot be used in an open segment when the drawing mode is
  7459.    DM_RETAIN.
  7460.  
  7461.  Parameters
  7462.  
  7463.    hps  Identifies the presentation space.
  7464.  
  7465.    psizfxBox  Points to the SIZEF structure that receives the character-box
  7466.    size. The SIZEF structure has the following form:
  7467.  
  7468.    typedef struct _SIZEF {
  7469.        FIXED cx;
  7470.        FIXED cy;
  7471.    } SIZEF;
  7472.  
  7473.    For a full description, see Chapter 4, "Types, Macros, Structures."
  7474.  
  7475.  Return Value
  7476.  
  7477.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  7478.    an error occurred.
  7479.  
  7480.  See Also
  7481.  
  7482.    GpiQueryAttrs, GpiQueryCharMode, GpiQueryDefCharBox, GpiSetCharBox,
  7483.    GpiSetDrawingMode
  7484.  
  7485.  
  7486.  ────────────────────────────────────────────────────────────────────────────
  7487.  GpiQueryCharDirection
  7488.  ────────────────────────────────────────────────────────────────────────────
  7489.    LONG GpiQueryCharDirection (hps)
  7490.    HPS hps;                /*presentation-space handle                     */
  7491.  
  7492.    The GpiQueryCharDirection function retrieves the current value of the
  7493.    character-direction attribute. This function cannot be used in an open
  7494.    segment when the drawing mode is DM_RETAIN.
  7495.  
  7496.  Parameters
  7497.  
  7498.    hps  Identifies the presentation space.
  7499.  
  7500.  Return Value
  7501.  
  7502.    The return value is the current character-direction attribute if the
  7503.    function is successful or CHDIRN_ERROR if an error occurred.
  7504.  
  7505.  Comments
  7506.  
  7507.    Under MS OS/2 version 1.1, the only character directions available are
  7508.    CHDIRN_DEFAULT and CHDIRN_LEFTRIGHT.
  7509.  
  7510.  See Also
  7511.  
  7512.    GpiSetCharDirection, GpiSetDrawingMode
  7513.  
  7514.  
  7515.  ────────────────────────────────────────────────────────────────────────────
  7516.  GpiQueryCharMode
  7517.  ────────────────────────────────────────────────────────────────────────────
  7518.    LONG GpiQueryCharMode (hps)
  7519.    HPS hps;                /*presentation-space handle                     */
  7520.  
  7521.    The GpiQueryCharMode function retrieves the current value of the
  7522.    character-mode attribute, as set by the GpiSetCharMode function. This
  7523.    function cannot be used in an open segment when the drawing mode is
  7524.    DM_RETAIN.
  7525.  
  7526.  Parameters
  7527.  
  7528.    hps  Identifies the presentation space.
  7529.  
  7530.  Return Value
  7531.  
  7532.    The return value is the current character-mode attribute if the function
  7533.    is successful or CM_ERROR if an error occurred.
  7534.  
  7535.  See Also
  7536.  
  7537.    GpiQueryAttrs, GpiQueryCharAngle, GpiQueryCharShear, GpiSetCharMode,
  7538.    GpiSetDrawingMode
  7539.  
  7540.  
  7541.  ────────────────────────────────────────────────────────────────────────────
  7542.  GpiQueryCharSet
  7543.  ────────────────────────────────────────────────────────────────────────────
  7544.    LONG GpiQueryCharSet (hps)
  7545.    HPS hps;                /*presentation-space handle                     */
  7546.  
  7547.    The GpiQueryCharSet function retrieves the character-set local identifier.
  7548.    This function cannot be used in an open segment when the drawing mode is
  7549.    set to DM_RETAIN.
  7550.  
  7551.  Parameters
  7552.  
  7553.    hps  Identifies the presentation space.
  7554.  
  7555.  Return Value
  7556.  
  7557.    The return value is the local identifier for the current character set if
  7558.    the function is successful or LCID_ERROR if an error occurred.
  7559.  
  7560.  See Also
  7561.  
  7562.    GpiQueryAttrs, GpiSetCharSet, GpiSetDrawingMode
  7563.  
  7564.  
  7565.  ────────────────────────────────────────────────────────────────────────────
  7566.  GpiQueryCharShear
  7567.  ────────────────────────────────────────────────────────────────────────────
  7568.    BOOL GpiQueryCharShear (hps, pptlShear)
  7569.    HPS hps;                /*presentation-space handle                     */
  7570.    PPOINTL pptlShear;      /*pointer to structure for shear-vector point   */
  7571.  
  7572.    The GpiQueryCharShear function retrieves the value of the current
  7573.    character-shear angle. This function cannot be used in an open segment
  7574.    when the drawing mode is DM_RETAIN.
  7575.  
  7576.  Parameters
  7577.  
  7578.    hps  Identifies the presentation space.
  7579.  
  7580.    pptlShear  Points to the POINTL structure that receives the point defining
  7581.    the character-shear vector. The POINTL structure has the following form:
  7582.  
  7583.    typedef struct _POINTL  {
  7584.        LONG  x;
  7585.        LONG  y;
  7586.    } POINTL;
  7587.  
  7588.    For a full description, see Chapter 4, "Types, Macros, Structures."
  7589.  
  7590.  Return Value
  7591.  
  7592.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  7593.    an error occurred.
  7594.  
  7595.  See Also
  7596.  
  7597.    GpiQueryAttrs, GpiQueryCharAngle, GpiQueryCharMode, GpiSetCharShear,
  7598.    GpiSetDrawingMode
  7599.  
  7600.  
  7601.  ────────────────────────────────────────────────────────────────────────────
  7602.  GpiQueryCharStringPos
  7603.  ────────────────────────────────────────────────────────────────────────────
  7604.    BOOL GpiQueryCharStringPos (hps, flOptions, cchString, pchString, adx,
  7605.    aptl)
  7606.    HPS hps;                /*presentation-space handle                     */
  7607.    ULONG flOptions;        /*option flags                                  */
  7608.    LONG cchString;         /*length of the string                          */
  7609.    PCH pchString;          /*pointer to string to examine                  */
  7610.    PLONG adx;              /*pointer to array for increment values         */
  7611.    PPOINTL aptl;           /*pointer to array of structures for points     */
  7612.  
  7613.    The GpiQueryCharStringPos function determines a position for each
  7614.    character in the string pointed to by the pchString parameter. Each
  7615.    position is the position of the character in world coordinates as if it
  7616.    were drawn by using the GpiCharStringPos function.
  7617.  
  7618.    The GpiQueryCharStringPos function copies the character positions to the
  7619.    array of structures pointed to by the aptl parameter. It uses the current
  7620.    character attributes or the array of vector increments specified by the
  7621.    adx parameter to determine the positions. The function cannot be used in
  7622.    an open segment when the drawing mode is DM_RETAIN.
  7623.  
  7624.  Parameters
  7625.  
  7626.    hps  Identifies the presentation space.
  7627.  
  7628.    flOptions  Specifies whether to use the vector increments specified by the
  7629.    adx parameter. It can be one of the following values:
  7630.  
  7631.    Value             Meaning
  7632.    ──────────────────────────────────────────────────────────────────────────
  7633.    0                 Advances the current position after each character by
  7634.                      using the width of the character. The adx parameter is
  7635.                      ignored.
  7636.  
  7637.    CHS_VECTOR        Advances the current position after each character by
  7638.                      using the next value in the array adx. The current
  7639.                      character direction defines the direction in which the
  7640.                      current position is advanced.
  7641.    ──────────────────────────────────────────────────────────────────────────
  7642.  
  7643.    cchString  Specifies the length of the string pointed to by the pchString
  7644.    parameter.
  7645.  
  7646.    pchString  Points to the character string to examine.
  7647.  
  7648.    adx  Points to an array of increment values. Each value is a 4-byte signed
  7649.    integer specifying the distance (in world coordinates) to advance the
  7650.    current position for each character. There must be one value for each
  7651.    character in the string. The first element specifies the distance for the
  7652.    first character, the second element for the second character, and so on.
  7653.  
  7654.    aptl  Points to the array of POINTL structures that receives the position
  7655.    (in world coordinates) of each character in the string. The POINTL
  7656.    structure has the following form:
  7657.  
  7658.    typedef struct _POINTL  {
  7659.        LONG  x;
  7660.        LONG  y;
  7661.    } POINTL;
  7662.  
  7663.    For a full description, see Chapter 4, "Types, Macros, Structures."
  7664.  
  7665.  Return Value
  7666.  
  7667.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  7668.    an error occurred.
  7669.  
  7670.  Example
  7671.  
  7672.    This example uses the GpiQueryCharStringPos function to determine the
  7673.    location of each character in the string. Vector increments are not used.
  7674.  
  7675.    POINTL aptl[11];
  7676.  
  7677.    GpiQueryCharStringPos(hps,     /* presentation-space handle      */
  7678.        0L,                        /* do not use vector increments   */
  7679.        11L,                       /* 11 characters in string        */
  7680.        "This string",             /* character string               */
  7681.        NULL,                      /* no vector increments           */
  7682.        aptl);                     /* array of structures for points */
  7683.  
  7684.  See Also
  7685.  
  7686.    GpiCharStringPos, GpiQueryCharStringPosAt, GpiSetDrawingMode
  7687.  
  7688.  
  7689.  ────────────────────────────────────────────────────────────────────────────
  7690.  GpiQueryCharStringPosAt
  7691.  ────────────────────────────────────────────────────────────────────────────
  7692.    BOOL GpiQueryCharStringPosAt (hps, pptlStart, flOptions, cchString,
  7693.    pchString, adx, aptl)
  7694.    HPS hps;                /*presentation-space handle                     */
  7695.    PPOINTL pptlStart;      /*pointer to structure for starting point       */
  7696.    ULONG flOptions;        /*option flag                                   */
  7697.    LONG cchString;         /*length of the string                          */
  7698.    PCH pchString;          /*pointer to string to examine                  */
  7699.    PLONG adx;              /*pointer to array for increment values         */
  7700.    PPOINTL aptl;           /*pointer to array of structures for points     */
  7701.  
  7702.    The GpiQueryCharStringPosAt function determines a position for each
  7703.    character in the character string pointed to by the pchString parameter.
  7704.    The positions are determined as if the application had called the
  7705.    GpiCharStringPosAt function and are specified in world coordinates.
  7706.  
  7707.    The GpiQueryCharStringPosAt function copies the character positions to the
  7708.    array of structures pointed to by the aptl parameter. It uses the current
  7709.    character attributes or the array of vector increments specified by the
  7710.    adx parameter to determine the positions. The function cannot be used in
  7711.    an open segment when the drawing mode is DM_RETAIN.
  7712.  
  7713.  Parameters
  7714.  
  7715.    hps  Identifies the presentation space.
  7716.  
  7717.    pptlStart  Points to the POINTL structure that specifies the starting
  7718.    point (in world coordinates) of the character string. The POINTL structure
  7719.    has the following form:
  7720.  
  7721.    typedef struct _POINTL  {
  7722.        LONG  x;
  7723.        LONG  y;
  7724.    } POINTL;
  7725.  
  7726.    For a full description, see Chapter 4, "Types, Macros, Structures."
  7727.  
  7728.    flOptions  Specifies whether to use the vector increments specified by the
  7729.    adx parameter. It can be one of the following values:
  7730.  
  7731.    Value             Meaning
  7732.    ──────────────────────────────────────────────────────────────────────────
  7733.    0                 Advances the current position after each character by
  7734.                      using the width of the character. The adx parameter is
  7735.                      ignored.
  7736.  
  7737.    CHS_VECTOR        Advances the current position after each character by
  7738.                      using the next value in the array adx. The current
  7739.                      character direction defines the direction in which the
  7740.                      current position is advanced.
  7741.    ──────────────────────────────────────────────────────────────────────────
  7742.  
  7743.    cchString  Specifies the length (in bytes) of the string pointed to by the
  7744.    pchString parameter.
  7745.  
  7746.    pchString  Points to the character string to examine.
  7747.  
  7748.    adx  Points to an array of increment values. Each value is a 4-byte signed
  7749.    integer specifying the distance (in world coordinates) to advance the
  7750.    current position for each character. There must be one value for each
  7751.    character in the string. The first element specifies the distance for the
  7752.    first character, the second element for the second character, and so on.
  7753.  
  7754.    aptl  Points to the array of POINTL structures that receives the position
  7755.    (in world coordinates) of each character in the string.
  7756.  
  7757.  Return Value
  7758.  
  7759.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  7760.    an error occurred.
  7761.  
  7762.  Example
  7763.  
  7764.    This example uses the GpiQueryCharStringPosAt function to determine the
  7765.    location of each character in the string. Vector increments are not used.
  7766.  
  7767.    POINTL ptlStart = { 100, 100 };
  7768.    POINTL aptl[11];
  7769.  
  7770.    GpiQueryCharStringPosAt(hps,    /* presentation-space handle      */
  7771.        &ptlStart,                  /* starting point for string      */
  7772.        0L,                         /* do not use vector increments   */
  7773.        11L,                        /* 11 characters in string        */
  7774.        "This string",              /* character string               */
  7775.        NULL,                       /* no vector increments           */
  7776.        aptl);                      /* array of structures for points */
  7777.  
  7778.  See Also
  7779.  
  7780.    GpiCharStringPosAt, GpiQueryCharStringPos, GpiSetDrawingMode
  7781.  
  7782.  
  7783.  ────────────────────────────────────────────────────────────────────────────
  7784.  GpiQueryClipBox
  7785.  ────────────────────────────────────────────────────────────────────────────
  7786.    LONG GpiQueryClipBox (hps, prcl)
  7787.    HPS hps;                /*presentation-space handle                     */
  7788.    PRECTL prcl;            /*pointer to structure for clip box             */
  7789.  
  7790.    The GpiQueryClipBox function retrieves the world coordinates of the
  7791.    smallest rectangle that encloses the intersection of the current graphics
  7792.    field, viewing limit, clip path, clip region, and visible region (if any).
  7793.    If the clip box is empty, the function sets the left and right sides of
  7794.    the rectangle to equal values.
  7795.  
  7796.  Parameters
  7797.  
  7798.    hps  Identifies the presentation space.
  7799.  
  7800.    prcl  Points to the RECTL structure that receives the coordinates of the
  7801.    clip box. The RECTL structure has the following form:
  7802.  
  7803.    typedef struct _RECTL {
  7804.        LONG  xLeft;
  7805.        LONG  yBottom;
  7806.        LONG  xRight;
  7807.        LONG  yTop;
  7808.    } RECTL;
  7809.  
  7810.    For a full description, see Chapter 4, "Types, Macros, Structures."
  7811.  
  7812.  Return Value
  7813.  
  7814.    The return value is RGN_NULL, RGN_RECT, or RGN_COMPLEX if the function is
  7815.    successful or RGN_ERROR if an error occurred.
  7816.  
  7817.  See Also
  7818.  
  7819.    GpiQueryClipRegion, GpiQueryGraphicsField, GpiQueryRegionBox,
  7820.    GpiQueryViewingLimits
  7821.  
  7822.  
  7823.  ────────────────────────────────────────────────────────────────────────────
  7824.  GpiQueryClipRegion
  7825.  ────────────────────────────────────────────────────────────────────────────
  7826.    HRGN GpiQueryClipRegion (hps)
  7827.    HPS hps;                /*presentation-space handle                     */
  7828.  
  7829.    The GpiQueryClipRegion function retrieves the handle of the currently
  7830.    selected clip region.
  7831.  
  7832.  Parameters
  7833.  
  7834.    hps  Identifies the presentation space.
  7835.  
  7836.  Return Value
  7837.  
  7838.    The return value is the handle of the clip region, if one is selected, or
  7839.    NULL if no clip region is selected. The return value is HRGN_ERROR if an
  7840.    error occurred.
  7841.  
  7842.  See Also
  7843.  
  7844.    GpiQueryClipBox, GpiQueryGraphicsField, GpiQueryViewingLimits,
  7845.    GpiSetClipRegion
  7846.  
  7847.  
  7848.  ────────────────────────────────────────────────────────────────────────────
  7849.  GpiQueryColor
  7850.  ────────────────────────────────────────────────────────────────────────────
  7851.    LONG GpiQueryColor (hps)
  7852.    HPS hps;                /*presentation-space handle                     */
  7853.  
  7854.    The GpiQueryColor function returns the current value of the line-color
  7855.    attribute, as set by the GpiSetColor function. The function cannot be used
  7856.    in an open segment when the drawing mode is DM_RETAIN.
  7857.  
  7858.  Parameters
  7859.  
  7860.    hps  Identifies the presentation space.
  7861.  
  7862.  Return Value
  7863.  
  7864.    The return value is the current line-color attribute if the function is
  7865.    successful or CLR_ERROR if an error occurred.
  7866.  
  7867.  See Also
  7868.  
  7869.    GpiQueryAttrs, GpiSetColor
  7870.  
  7871.  
  7872.  ────────────────────────────────────────────────────────────────────────────
  7873.  GpiQueryColorData
  7874.  ────────────────────────────────────────────────────────────────────────────
  7875.    BOOL GpiQueryColorData (hps, clData, alData)
  7876.    HPS hps;                /*presentation-space handle                     */
  7877.    LONG clData;            /*number of elements                            */
  7878.    PLONG alData;           /*three-element array                           */
  7879.  
  7880.    The GpiQueryColorData function retrieves the format flag and index-value
  7881.    range for the current logical color table. The format flag specifies
  7882.    whether the color table has the default, indexed-RGB, or RGB format. The
  7883.    index-value range specifies the first and last indexes in the table.
  7884.    (These apply to color tables having the default or indexed RGB formats.)
  7885.  
  7886.    The function typically copies the format flags and the first and last
  7887.    index values to the array pointed to by the alData parameter; however, the
  7888.    function uses the clData parameter to determine the number of values to
  7889.    copy. The clData parameter must be set to 3 in order to copy all values.
  7890.  
  7891.  Parameters
  7892.  
  7893.    hps  Identifies the presentation space.
  7894.  
  7895.    clData  Specifies the number of values to copy to the array pointed to by
  7896.    the alData parameter.
  7897.  
  7898.    alData  Points to the array that receives the format flag and index-value
  7899.    range. The elements of the array have the following meanings:
  7900.  
  7901.    Element index           Meaning
  7902.    ──────────────────────────────────────────────────────────────────────────
  7903.    QCD_LCT_FORMAT          Specifies the format of color table. It is
  7904.                            LCOLF_DEFAULT if the current color table is the
  7905.                            default color table; LCOLF_INDRGB if the color
  7906.                            table translates indices to RGB color values; or
  7907.                            LCOLF_RGB if the color-table indices and RGB color
  7908.                            values are equal.
  7909.  
  7910.    QCD_LCT_LOINDEX         Specifies the smallest color index. For the
  7911.                            default color table, the smallest index is zero.
  7912.  
  7913.    QCD_LCT_HIINDEX         Specifies the largest color index. For the default
  7914.                            color table, the largest index is one less than
  7915.                            the maximum number of entries in the table.
  7916.    ──────────────────────────────────────────────────────────────────────────
  7917.  
  7918.  Return Value
  7919.  
  7920.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  7921.    an error occurred.
  7922.  
  7923.  Example
  7924.  
  7925.    This example uses the GpiQueryColorData function to retrieve the smallest
  7926.    color-table index. The GpiQueryLogColorTable function is then used to
  7927.    retrieve the RGB color value for this index.
  7928.  
  7929.    LONG alData[3];
  7930.    LONG alColor[1];
  7931.  
  7932.    GpiQueryColorData(hps, 3L, alData);
  7933.    GpiQueryLogColorTable(hps, 0L, alData[QCD_LCT_LOINDEX], 1L, alColor);
  7934.  
  7935.  See Also
  7936.  
  7937.    GpiQueryLogColorTable, GpiQueryNearestColor, GpiQueryRealColors,
  7938.    GpiQueryRGBColor
  7939.  
  7940.  ────────────────────────────────────────────────────────────────────────────
  7941.  GpiQueryColorIndex
  7942.  ────────────────────────────────────────────────────────────────────────────
  7943.    LONG GpiQueryColorIndex (hps, flClrType, lRgbColor)
  7944.    HPS hps;                /*presentation-space handle                     */
  7945.    ULONG flClrType;        /*color type                                    */
  7946.    LONG lRgbColor;         /*RGB color value                               */
  7947.  
  7948.    The GpiQueryColorIndex function returns a color index for the specified
  7949.    RGB color value. The function maps the RGB color value to the closest
  7950.    match in the physical palette for the device associated with the
  7951.    presentation space. It then returns the index in the current logical color
  7952.    table that corresponds to this physical-palette color.
  7953.  
  7954.    If the current logical color table is realizable but has not been
  7955.    realized, the LCOLOPT_REALIZED option maps the RGB color value as if the
  7956.    logical color table has been realized. Since realizing a logical color
  7957.    table affects the contents of the physical palette, the color index value
  7958.    returned with this option may be different than the value returned without
  7959.    the option.
  7960.  
  7961.  Parameters
  7962.  
  7963.    hps  Identifies the presentation space.
  7964.  
  7965.    flClrType  Specifies whether the color index is based on realized colors.
  7966.    If it is LCOLOPT_REALIZED, the function returns a color index based on the
  7967.    colors in the physical palette after the current logical color table is
  7968.    realized. If the parameter is zero, the function returns a color index
  7969.    based on the colors in the current physical palette.
  7970.  
  7971.    lRgbColor  Specifies the RGB color value.
  7972.  
  7973.  Return Value
  7974.  
  7975.    The return value is a color index that is the closest possible match of
  7976.    the specified color if the function is successful, or QLCT_ERROR if an
  7977.    error occurred.
  7978.  
  7979.  See Also
  7980.  
  7981.    GpiQueryLogColorTable, GpiQueryRGBColor
  7982.  
  7983.  
  7984.  ────────────────────────────────────────────────────────────────────────────
  7985.  GpiQueryCp
  7986.  ────────────────────────────────────────────────────────────────────────────
  7987.    USHORT GpiQueryCp (hps)
  7988.    HPS hps;                /*presentation-space handle                     */
  7989.  
  7990.    The GpiQueryCp function returns the identifier of the current graphics
  7991.    code page, as set by the GpiSetCp function. The system uses the current
  7992.    graphics code-page identifier as the default code-page identifier when the
  7993.    GpiCreateLogFont function selects fonts.
  7994.  
  7995.  Parameters
  7996.  
  7997.    hps  Identifies the presentation space.
  7998.  
  7999.  Return Value
  8000.  
  8001.    The return value is the currently selected graphics code-page identifier
  8002.    if the function is successful, or GPI_ERROR if an error occurred.
  8003.  
  8004.  See Also
  8005.  
  8006.    GpiCreateLogFont, GpiQueryFontMetrics, GpiSetCp
  8007.  
  8008.  
  8009.  ────────────────────────────────────────────────────────────────────────────
  8010.  GpiQueryCurrentPosition
  8011.  ────────────────────────────────────────────────────────────────────────────
  8012.    BOOL GpiQueryCurrentPosition (hps, pptl)
  8013.    HPS hps;                /*presentation-space handle                     */
  8014.    PPOINTL pptl;           /*pointer to structure for current position     */
  8015.  
  8016.    The GpiQueryCurrentPosition function returns the value of the current
  8017.    position. The function cannot be used in an open segment when the drawing
  8018.    mode is DM_RETAIN.
  8019.  
  8020.  Parameters
  8021.  
  8022.    hps  Identifies the presentation space.
  8023.  
  8024.    pptl  Points to a POINTL structure that receives the current position. The
  8025.    POINTL structure has the following form:
  8026.  
  8027.    typedef struct _POINTL  {
  8028.        LONG  x;
  8029.        LONG  y;
  8030.    } POINTL;
  8031.  
  8032.    For a full description, see Chapter 4, "Types, Macros, Structures."
  8033.  
  8034.  Return Value
  8035.  
  8036.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  8037.    an error occurred.
  8038.  
  8039.  See Also
  8040.  
  8041.    GpiMove, GpiSetCurrentPosition
  8042.  
  8043.  
  8044.  ────────────────────────────────────────────────────────────────────────────
  8045.  GpiQueryDefaultViewMatrix
  8046.  ────────────────────────────────────────────────────────────────────────────
  8047.    BOOL GpiQueryDefaultViewMatrix (hps, cElements, pmatlf)
  8048.    HPS hps;                /*presentation-space handle                     */
  8049.    LONG cElements;         /*number of elements                            */
  8050.    PMATRIXLF pmatlf;       /*pointer to structure for transformation       */
  8051.                            /*matrix                                        */
  8052.  
  8053.    The GpiQueryDefaultViewMatrix function retrieves the current default
  8054.    viewing transformation.
  8055.  
  8056.  Parameters
  8057.  
  8058.    hps  Identifies the presentation space.
  8059.  
  8060.    cElements  Specifies the number of elements in the transformation to
  8061.    retrieve. It must be an integer in the range 0 through 9.
  8062.  
  8063.    pmatlf  Points to a MATRIXLF structure that receives the elements of the
  8064.    default viewing transformation matrix. The MATRIXLF structure has the
  8065.    following form:
  8066.  
  8067.    typedef struct _MATRIXLF {
  8068.        FIXED fxM11;
  8069.        FIXED fxM12;
  8070.        LONG  lM13;
  8071.        FIXED fxM21;
  8072.        FIXED fxM22;
  8073.        LONG  lM23;
  8074.        LONG  lM31;
  8075.        LONG  lM32;
  8076.        LONG  lM33;
  8077.    } MATRIXLF;
  8078.  
  8079.    For a full description, see Chapter 4, "Types, Macros, Structures."
  8080.  
  8081.  Return Value
  8082.  
  8083.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  8084.    an error occurred.
  8085.  
  8086.  See Also
  8087.  
  8088.    GpiSetDefaultViewMatrix
  8089.  
  8090.  
  8091.  ────────────────────────────────────────────────────────────────────────────
  8092.  GpiQueryDefCharBox
  8093.  ────────────────────────────────────────────────────────────────────────────
  8094.    BOOL GpiQueryDefCharBox (hps, psizl)
  8095.    HPS hps;                /*presentation-space handle                     */
  8096.    PSIZEL psizl;           /*pointer to structure for character-box size   */
  8097.  
  8098.    The GpiQueryDefCharBox function retrieves the size of the default
  8099.    graphics-character box in world coordinates.
  8100.  
  8101.  Parameters
  8102.  
  8103.    hps  Identifies the presentation space.
  8104.  
  8105.    psizl  Points to a SIZEL structure that receives the default character-box
  8106.    size. The SIZEL structure has the following form:
  8107.  
  8108.    typedef struct _SIZEL {
  8109.        LONG cx;
  8110.        LONG cy;
  8111.    } SIZEL;
  8112.  
  8113.    For a full description, see Chapter 4, "Types, Macros, Structures."
  8114.  
  8115.  Return Value
  8116.  
  8117.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  8118.    an error occurred.
  8119.  
  8120.  See Also
  8121.  
  8122.    GpiQueryCharBox
  8123.  
  8124.  
  8125.  ────────────────────────────────────────────────────────────────────────────
  8126.  GpiQueryDevice
  8127.  ────────────────────────────────────────────────────────────────────────────
  8128.    HDC GpiQueryDevice (hps)
  8129.    HPS hps;                /*presentation-space handle                     */
  8130.  
  8131.    The GpiQueryDevice function retrieves a device-context handle for the
  8132.    currently associated presentation space.
  8133.  
  8134.  Parameters
  8135.  
  8136.    hps  Identifies the presentation space.
  8137.  
  8138.  Return Value
  8139.  
  8140.    The return value is a handle to a device context if the function is
  8141.    successful or NULL if no device context is currently associated with the
  8142.    presentation space. The return value is HDC_ERROR if an error occurred.
  8143.  
  8144.  Example
  8145.  
  8146.    This example uses the GpiQueryDevice function to retrieve a device-context
  8147.    handle for the presentation space of the desktop window. The handle is
  8148.    used in the DevQueryCaps function to determine the width and height of the
  8149.    Presentation Manager screen.
  8150.  
  8151.    HPS hps;
  8152.    HDC hdc;
  8153.    LONG lWidth, lHeight;
  8154.    hps = WinGetScreenPS(HWND_DESKTOP);
  8155.    hdc = GpiQueryDevice(hps);
  8156.    DevQueryCaps(hdc, CAPS_WIDTH, 1L, &lWidth);
  8157.    DevQueryCaps(hdc, CAPS_HEIGHT, 1L, &lHeight);
  8158.  
  8159.  See Also
  8160.  
  8161.    DevOpenDC, GpiAssociate, WinQueryWindowDC
  8162.  
  8163.  
  8164.  ────────────────────────────────────────────────────────────────────────────
  8165.  GpiQueryDeviceBitmapFormats
  8166.  ────────────────────────────────────────────────────────────────────────────
  8167.    BOOL GpiQueryDeviceBitmapFormats (hps, clData, alData)
  8168.    HPS hps;                /*presentation-space handle                     */
  8169.    LONG clData;            /*number of elements                            */
  8170.    PLONG alData;           /*array of elements                             */
  8171.  
  8172.    The GpiQueryDeviceBitmapFormats function retrieves the bitmap formats for
  8173.    the raster or memory device associated with the given presentation space.
  8174.    The function copies the formats to the array pointed to by the alData
  8175.    parameter. A bitmap format consists of two 32-bit values, the first
  8176.    specifying the number of color planes, and the second specifying the
  8177.    number of color bits per pel. The first format copied to the array is the
  8178.    format that most closely matches the device.
  8179.  
  8180.    The GpiQueryDeviceBitmapFormats function uses the clData parameter to
  8181.    determine how many formats to return. Since each format fills two elements
  8182.    in the array, the clData must be a multiple of 2. Although there are
  8183.    several standard bitmap formats, most devices use just a few. If clData
  8184.    specifies more formats than the device supports, the functions fills the
  8185.    extra elements with zero. The DevQueryCaps function can be used to
  8186.    retrieve the actual number of bitmap formats for the device.
  8187.  
  8188.  Parameters
  8189.  
  8190.    hps  Identifies the presentation space.
  8191.  
  8192.    clData  Specifies the number of elements to copy to the array. Since each
  8193.    bitmap format fills two elements, this parameter must be a multiple of 2.
  8194.  
  8195.    alData  Points to the array to receive the bitmap formats.
  8196.  
  8197.  Return Value
  8198.  
  8199.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  8200.    an error occurred.
  8201.  
  8202.  Example
  8203.  
  8204.    This example uses the GpiQueryDeviceBitmapFormats function to retrieve a
  8205.    bitmap format for the given device. The format is then used to create a
  8206.    bitmap that is compatible with the device.
  8207.  
  8208.    LONG alFormats[2];
  8209.    BITMAPINFOHEADER bmp;
  8210.    HBITMAP hbm;
  8211.  
  8212.    /* Retrieve the format that most closely matches the device. */
  8213.  
  8214.    GpiQueryDeviceBitmapFormats(hps, 2L, alFormats);
  8215.  
  8216.    /* Set the bitmap dimensions and format and create the bitmap. */
  8217.  
  8218.    bmp.cbFix = 12;
  8219.    bmp.cx = 100;
  8220.    bmp.cy = 100;
  8221.    bmp.cPlanes = alFormats[0];
  8222.    bmp.cBitCount = alFormats[1];
  8223.    hbm = GpiCreateBitmap(hps, &bmp, 0L, NULL, NULL);
  8224.  
  8225.  See Also
  8226.  
  8227.    DevQueryCaps, GpiBitBlt, GpiCreateBitmap, GpiLoadBitmap
  8228.  
  8229.  
  8230.  ────────────────────────────────────────────────────────────────────────────
  8231.  GpiQueryDrawControl
  8232.  ────────────────────────────────────────────────────────────────────────────
  8233.    LONG GpiQueryDrawControl (hps, flDraw)
  8234.    HPS hps;                /*presentation-space handle                     */
  8235.    LONG flDraw;            /*drawing-control flag                          */
  8236.  
  8237.    The GpiQueryDrawControl function checks the state of the drawing control
  8238.    specified by flDraw. The function returns DCTL_ON or DCTL_OFF to specify
  8239.    whether the control is on or off.
  8240.  
  8241.  Parameters
  8242.  
  8243.    hps  Identifies the presentation space.
  8244.  
  8245.    flDraw  Specifies the drawing control to check. It can be one of the
  8246.    following values:
  8247.  
  8248.    Value                 Meaning
  8249.    ──────────────────────────────────────────────────────────────────────────
  8250.    DCTL_BOUNDARY         Accumulates boundary data.
  8251.  
  8252.    DCTL_CORRELATE        Correlates output with pick aperture.
  8253.  
  8254.    DCTL_DISPLAY          Allows drawing to occur on the output medium.
  8255.  
  8256.    DCTL_DYNAMIC          Draws dynamic segments.
  8257.  
  8258.    DCTL_ERASE            Erases before drawing.
  8259.    ──────────────────────────────────────────────────────────────────────────
  8260.  
  8261.  Return Value
  8262.  
  8263.    The return value is DCTL_ON or DCTL_OFF if the function is successful, or
  8264.    a negative number if an error occurred.
  8265.  
  8266.  Errors
  8267.  
  8268.    Use the WinGetLastError function to retrieve the error value, which may be
  8269.    one of the following:
  8270.  
  8271.          PMERR_INV_DRAW_CONTROL
  8272.          PMERR_INV_MICROPS_FUNCTION
  8273.  
  8274.  See Also
  8275.  
  8276.    GpiDrawDynamics, GpiRemoveDynamics, GpiSetDrawControl
  8277.  
  8278.  
  8279.  ────────────────────────────────────────────────────────────────────────────
  8280.  GpiQueryDrawingMode
  8281.  ────────────────────────────────────────────────────────────────────────────
  8282.    LONG GpiQueryDrawingMode (hps)
  8283.    HPS hps;                /*presentation-space handle                     */
  8284.  
  8285.    The GpiQueryDrawingMode function returns the drawing mode, as set by
  8286.    GpiSetDrawingMode.
  8287.  
  8288.  Parameters
  8289.  
  8290.    hps  Identifies the presentation space.
  8291.  
  8292.  Return Value
  8293.  
  8294.    The return value is the current drawing mode if the function is
  8295.    successful, or DM_ERROR if an error occurred.
  8296.  
  8297.  See Also
  8298.  
  8299.    GpiSetDrawingMode
  8300.  
  8301.  
  8302.  ────────────────────────────────────────────────────────────────────────────
  8303.  GpiQueryEditMode
  8304.  ────────────────────────────────────────────────────────────────────────────
  8305.    LONG GpiQueryEditMode (hps)
  8306.    HPS hps;                /*presentation-space handle                     */
  8307.  
  8308.    The GpiQueryEditMode function returns the current editing mode.
  8309.  
  8310.  Parameters
  8311.  
  8312.    hps  Identifies the presentation space.
  8313.  
  8314.  Return Value
  8315.  
  8316.    The return value is SEGEM_INSERT or SEGEM_REPLACE if the function is
  8317.    successful, or SEGEM_ERROR if an error occurred.
  8318.  
  8319.  Errors
  8320.  
  8321.    Use the WinGetLastError function to retrieve the error value, which may be
  8322.    the following:
  8323.  
  8324.          PMERR_INV_MICROPS_FUNCTION
  8325.  
  8326.  See Also
  8327.  
  8328.    GpiQueryElementPointer, GpiQueryElementType, GpiSetEditMode
  8329.  
  8330.  
  8331.  ────────────────────────────────────────────────────────────────────────────
  8332.  GpiQueryElement
  8333.  ────────────────────────────────────────────────────────────────────────────
  8334.    LONG GpiQueryElement (hps, off, cbMax, pb)
  8335.    HPS hps;                /*presentation-space handle                     */
  8336.    LONG off;               /*offset to first byte to copy                  */
  8337.    LONG cbMax;             /*size of the buffer                            */
  8338.    PBYTE pb;               /*pointer to buffer for graphics-order data     */
  8339.  
  8340.    The GpiQueryElement function retrieves the graphics-order data for an
  8341.    element in the currently open segment. The element pointer must point to
  8342.    the element to retrieve. The function copies the data to the buffer
  8343.    pointed to by the pb parameter, copying all bytes in the current element
  8344.    or the number of bytes specified by cbMax, whichever is smaller. If off is
  8345.    not zero, the function uses this parameter as an offset from the beginning
  8346.    of the element to the first byte to copy to the buffer.
  8347.  
  8348.    The function can be used only in an open segment and only when the drawing
  8349.    mode is DM_RETAIN. It cannot be used in an element bracket.
  8350.  
  8351.  Parameters
  8352.  
  8353.    hps  Identifies the presentation space.
  8354.  
  8355.    off  Specifies the offset from the beginning of the segment to the first
  8356.    byte of graphics-order data for the element.
  8357.  
  8358.    cbMax  Specifies the size in bytes of the pb buffer.
  8359.  
  8360.    pb  Points to a buffer that receives the graphics-order data for the
  8361.    element.
  8362.  
  8363.  Return Value
  8364.  
  8365.    The return value specifies the number of bytes returned if the function is
  8366.    successful or GPI_ALTERROR if an error occurred.
  8367.  
  8368.  Errors
  8369.  
  8370.    Use the WinGetLastError function to retrieve the error value, which may be
  8371.    one of the following:
  8372.  
  8373.          PMERR_INV_LENGTH
  8374.          PMERR_INV_MICROPS_FUNCTION
  8375.          PMERR_NO_CURRENT_ELEMENT
  8376.          PMERR_NOT_IN_RETAIN_MODE
  8377.  
  8378.  Example
  8379.  
  8380.    This example uses the GpiQueryElement function to retrieve the
  8381.    graphics-order data for an element.
  8382.  
  8383.    BYTE abElement[512];
  8384.  
  8385.    /* Move pointer to first element in segment. */
  8386.  
  8387.    GpiSetElementPointer(hps, 1L);
  8388.    GpiQueryElement(hps,         /* presentation space               */
  8389.        0L,                      /* start with first byte in element */
  8390.        512L,                    /* copy no more than 512 bytes      */
  8391.        abElement);              /* buffer to receive data           */
  8392.  
  8393.  See Also
  8394.  
  8395.    GpiBeginElement, GpiDeleteElement, GpiEndElement,
  8396.    GpiQueryElementPointer, GpiSetElementPointer
  8397.  
  8398.  
  8399.  ────────────────────────────────────────────────────────────────────────────
  8400.  GpiQueryElementPointer
  8401.  ────────────────────────────────────────────────────────────────────────────
  8402.    LONG GpiQueryElementPointer (hps)
  8403.    HPS hps;                /*presentation-space handle                     */
  8404.  
  8405.    The GpiQueryElementPointer function retrieves the current element pointer.
  8406.    The function can be used only in an open segment and only when the drawing
  8407.    mode is DM_RETAIN.
  8408.  
  8409.  Parameters
  8410.  
  8411.    hps  Identifies the presentation space.
  8412.  
  8413.  Return Value
  8414.  
  8415.    The return value is the current element pointer if the function is
  8416.    successful or GPI_ALTERROR if an error occurred.
  8417.  
  8418.  Errors
  8419.  
  8420.    Use the WinGetLastError function to retrieve the error value, which may be
  8421.    one of the following:
  8422.  
  8423.          PMERR_INV_MICROPS_FUNCTION
  8424.          PMERR_NOT_IN_RETAIN_MODE
  8425.  
  8426.  See Also
  8427.  
  8428.    GpiBeginElement, GpiDeleteElement, GpiEndElement, GpiQueryElement,
  8429.    GpiSetElementPointer
  8430.  
  8431.  
  8432.  ────────────────────────────────────────────────────────────────────────────
  8433.  GpiQueryElementType
  8434.  ────────────────────────────────────────────────────────────────────────────
  8435.    LONG GpiQueryElementType (hps, plType, cbDesc, pszDesc)
  8436.    HPS hps;                /*presentation-space handle                     */
  8437.    PLONG plType;           /*pointer to variable for type                  */
  8438.    LONG cbDesc;            /*length in bytes of buffer                     */
  8439.    PSZ pszDesc;            /*pointer to buffer for description             */
  8440.  
  8441.    The GpiQueryElementType function retrieves the type and description for an
  8442.    element in current open segment. It also returns the size in bytes of the
  8443.    element. The element pointer must point to the element to retrieve. The
  8444.    function copies the type to the variable pointed to by the plType
  8445.    parameter, and copies the description, up to the number of bytes specified
  8446.    by cbDesc, to the buffer pointed to by the pszDesc parameter.
  8447.  
  8448.    The function can be used only in an open segment and only when the drawing
  8449.    mode is DM_RETAIN. It cannot be used in an element bracket.
  8450.  
  8451.  Parameters
  8452.  
  8453.    hps  Identifies the presentation space.
  8454.  
  8455.    plType  Points to the variable that receives the element type.
  8456.  
  8457.    cbDesc  Specifies the maximum number of bytes of description to copy to
  8458.    the buffer specified by the pszDesc parameter.
  8459.  
  8460.    pszDesc  Points to the buffer that receives the description, a
  8461.    null-terminated string, for the element. The buffer must have the number
  8462.    of bytes specified by cbDesc. If the description is longer than the
  8463.    buffer, it is truncated.
  8464.  
  8465.  Return Value
  8466.  
  8467.    The return value is the size of the data required to hold the element if
  8468.    the function is successful or GPI_ALTERROR if an error occurred.
  8469.  
  8470.  Errors
  8471.  
  8472.    Use the WinGetLastError function to retrieve the error value, which may be
  8473.    one of the following:
  8474.  
  8475.          PMERR_INV_LENGTH
  8476.          PMERR_INV_MICROPS_FUNCTION
  8477.          PMERR_NO_CURRENT_ELEMENT
  8478.          PMERR_NOT_IN_RETAIN_MODE
  8479.  
  8480.  Example
  8481.  
  8482.    This example uses the GpiQueryElementType function to retrieve the size of
  8483.    the current element. The size is used to retrieve the graphics-order data
  8484.    in the element.
  8485.  
  8486.    BYTE abElement[512];
  8487.    LONG cbElement;
  8488.    LONG lType;
  8489.  
  8490.    /* move pointer to first element in segment */
  8491.  
  8492.    GpiSetElementPointer(hps, 1L);
  8493.    cbElement = GpiQueryElementType(
  8494.        hps,      /* presentation space             */
  8495.        &lType,   /* variable to receive type       */
  8496.        0L,       /* copy zero bytes of description */
  8497.        NULL);    /* no buffer for description      */
  8498.  
  8499.    GpiQueryElement(hps, 0L, cbElement, abElement);
  8500.  
  8501.  See Also
  8502.  
  8503.    GpiBeginElement, GpiElement, GpiQueryElement, GpiQueryElementPointer
  8504.  
  8505.  
  8506.  ────────────────────────────────────────────────────────────────────────────
  8507.  GpiQueryFontFileDescriptions
  8508.  ────────────────────────────────────────────────────────────────────────────
  8509.    LONG GpiQueryFontFileDescriptions (hab, pszFileName, pcFonts, pffdescs)
  8510.    HAB hab;                /*anchor-block handle                           */
  8511.    PSZ pszFileName;        /*pointer to the font-resource filename         */
  8512.    PLONG pcFonts;          /*pointer to variable with number of fonts      */
  8513.    PFFDESCS pffdescs;      /*array of names                                */
  8514.  
  8515.    The GpiQueryFontFileDescriptions function retrieves the typeface family
  8516.    and names contained in the specified file if the file is a font-resource
  8517.    file. The function copies the names to the array pointed to by the
  8518.    pffdescs parameter. Each name is a null-terminated string up to 32
  8519.    characters long. The function copies all names in the file up to the
  8520.    number of names specified by the pcFonts parameter.
  8521.  
  8522.  Parameters
  8523.  
  8524.    hab  Identifies the anchor block.
  8525.  
  8526.    pszFileName  Points to a null-terminated string. This string must be a
  8527.    valid MS OS/2 filename. If it does not specify a path and the .fon
  8528.    filename extension, the function appends the default extension (.dll) and
  8529.    looks for the font-resource file in the directories specified by the
  8530.    libpath command in the config.sys file.
  8531.  
  8532.    pcFonts  Points to a variable specifying the maximum number of typeface
  8533.    family and name pairs to retrieve. The function copies the actual number
  8534.    of descriptions it retrieved to this variable.
  8535.  
  8536.    pffdescs  Points to the array to receive the typeface family and names for
  8537.    each font. Each array element is itself a two-element array of type
  8538.    FFDESCS.
  8539.  
  8540.  Return Value
  8541.  
  8542.    The return value is the number of fonts for which details were not
  8543.    returned if the function is successful, or GPI_ALTERROR if an error
  8544.    occurred.
  8545.  
  8546.  Example
  8547.  
  8548.    This example uses the GpiQueryFontFileDescriptions to retrieve the
  8549.    typeface family and names for the fonts in the helv.fon file. The function
  8550.    is called twice, once to determine the actual number of fonts in the file,
  8551.    and again to retrieve the descriptions.
  8552.  
  8553.    PFFDESCS pffdescs;
  8554.    SEL sel;
  8555.    LONG cFonts;
  8556.  
  8557.    /* Retrieve a count of all fonts in the file. */
  8558.  
  8559.    cFonts = GpiQueryFontFileDescriptions(hab, "helv", &cFonts, NULL);
  8560.  
  8561.    /* Allocate space for the descriptions. */
  8562.  
  8563.    DosAllocSeg((USHORT) (cFonts * sizeof(FFDESCS)), &sel, SEG_NONSHARED);
  8564.    pffdescs = MAKEP(sel, 0);
  8565.  
  8566.    /* Retrieve the descriptions. */
  8567.  
  8568.    GpiQueryFontFileDescriptions(hab, "helv", &cFonts, pffdescs);
  8569.  
  8570.  See Also
  8571.  
  8572.    GpiQueryFonts
  8573.  
  8574.  
  8575.  ────────────────────────────────────────────────────────────────────────────
  8576.  GpiQueryFontMetrics
  8577.  ────────────────────────────────────────────────────────────────────────────
  8578.    BOOL GpiQueryFontMetrics (hps, cbMetrics, pfm)
  8579.    HPS hps;                /*presentation-space handle                     */
  8580.    LONG cbMetrics;         /*length of the structure                       */
  8581.    PFONTMETRICS pfm;       /*pointer to structure for font metrics         */
  8582.  
  8583.    The GpiQueryFontMetrics function retrieves the font metrics for the
  8584.    currently selected logical font. The font metrics describe the typeface
  8585.    family, name, maximum height, average width, and other information about
  8586.    the font. All sizes the function retrieves are in world coordinates.
  8587.  
  8588.  Parameters
  8589.  
  8590.    hps  Identifies the presentation space.
  8591.  
  8592.    cbMetrics  Specifies the length of the font metrics.
  8593.  
  8594.    pfm  Points to a FONTMETRICS structure that receives font metrics for the
  8595.    logical font. This FONTMETRICS structure has the following form:
  8596.  
  8597.    typedef struct _FONTMETRICS {
  8598.        CHAR    szFamilyname[FACESIZE];
  8599.        CHAR    szFacename[FACESIZE];
  8600.        SHORT   idRegistry;
  8601.        SHORT   usCodePage;
  8602.        LONG    lEmHeight;
  8603.        LONG    lXHeight;
  8604.        LONG    lMaxAscender;
  8605.        LONG    lMaxDescender;
  8606.        LONG    lLowerCaseAscent;
  8607.        LONG    lLowerCaseDescent;
  8608.        LONG    lInternalLeading;
  8609.        LONG    lExternalLeading;
  8610.        LONG    lAveCharWidth;
  8611.        LONG    lMaxCharInc;
  8612.        LONG    lEmInc;
  8613.        LONG    lMaxBaselineExt;
  8614.        SHORT   sCharSlope;
  8615.        SHORT   sInlineDir;
  8616.        SHORT   sCharRot;
  8617.        USHORT  usWeightClass;
  8618.        USHORT  usWidthClass;
  8619.        SHORT   sXDeviceRes;
  8620.        SHORT   sYDeviceRes;
  8621.        SHORT   sFirstChar;
  8622.        SHORT   sLastChar;
  8623.        SHORT   sDefaultChar;
  8624.        SHORT   sBreakChar;
  8625.        SHORT   sNominalPointSize;
  8626.        SHORT   sMinimumPointSize;
  8627.        SHORT   sMaximumPointSize;
  8628.        USHORT  fsType;
  8629.        USHORT  fsDefn;
  8630.        USHORT  fsSelection;
  8631.        USHORT  fsCapabilities;
  8632.        LONG    lSubscriptXSize;
  8633.        LONG    lSubscriptYSize;
  8634.        LONG    lSubscriptXOffset;
  8635.        LONG    lSubscriptYOffset;
  8636.        LONG    lSuperscriptXSize;
  8637.        LONG    lSuperscriptYSize;
  8638.        LONG    lSuperscriptXOffset;
  8639.        LONG    lSuperscriptYOffset;
  8640.        LONG    lUnderscoreSize;
  8641.        LONG    lUnderscorePosition;
  8642.        LONG    lStrikeoutSize;
  8643.        LONG    lStrikeoutPosition;
  8644.        SHORT   sKerningPairs;
  8645.        SHORT   sReserved;
  8646.        LONG    lMatch;
  8647.    } FONTMETRICS;
  8648.  
  8649.    For a full description, see Chapter 4, "Types, Macros, Structures."
  8650.  
  8651.  Return Value
  8652.  
  8653.    The return value is GPI_OK if the function is successful or GPI_ALTERROR
  8654.    if an error occurred.
  8655.  
  8656.  Errors
  8657.  
  8658.    Use the WinGetLastError function to retrieve the error value, which may be
  8659.    the following:
  8660.  
  8661.          PMERR_INV_LENGTH
  8662.  
  8663.  Example
  8664.  
  8665.    This example uses the GpiQueryFontMetrics function to retrieve the font
  8666.    metrics for the current font.
  8667.  
  8668.    FONTMETRICS fm;
  8669.  
  8670.    GpiQueryFontMetrics(hps, sizeof(FONTMETRICS), &fm);
  8671.  
  8672.  See Also
  8673.  
  8674.    GpiQueryCp, GpiQueryFonts, GpiQueryKerningPairs
  8675.  
  8676.  
  8677.  ────────────────────────────────────────────────────────────────────────────
  8678.  GpiQueryFonts
  8679.  ────────────────────────────────────────────────────────────────────────────
  8680.    LONG GpiQueryFonts (hps, flOptions, pszFacename, pcFonts, cbMetrics, pfm)
  8681.    HPS hps;                /*presentation-space handle                     */
  8682.    ULONG flOptions;        /*type of fonts to retrieve                     */
  8683.    PSZ pszFacename;        /*pointer to typeface name of the fonts         */
  8684.    PLONG pcFonts;          /*number of fonts to retrieve                   */
  8685.    LONG cbMetrics;         /*length of the structure                       */
  8686.    PFONTMETRICS pfm;       /*pointer to structure(s) for font metrics      */
  8687.  
  8688.    The GpiQueryFonts function retrieves the font metrics for loaded fonts.
  8689.    The function copies the font metrics for the fonts that have the typeface
  8690.    name specified by the pszFacename parameter to the structure or array of
  8691.    structures pointed to by the pfm parameter. The function retrieves font
  8692.    metrics for all fonts up to the number specified by the pcFonts
  8693.    parameters. If the function does not retrieve font metrics for all the
  8694.    fonts, it returns the number of remaining fonts.
  8695.  
  8696.    All sizes retrieved by the function are in world coordinates.
  8697.  
  8698.  Parameters
  8699.  
  8700.    hps  Identifies the presentation space.
  8701.  
  8702.    flOptions  Specifies the type of fonts to retrieve. It can be a
  8703.    combination of the following values:
  8704.  
  8705.    Value         Meaning
  8706.    ──────────────────────────────────────────────────────────────────────────
  8707.    QF_PUBLIC     Retrieve public fonts. Public fonts were loaded by the
  8708.                  system and are available to all applications.
  8709.  
  8710.    QF_PRIVATE    Retrieve private fonts. Private fonts were loaded by the
  8711.                  application and are available only to it.
  8712.    ──────────────────────────────────────────────────────────────────────────
  8713.  
  8714.    pszFacename  Points to the typeface name of the fonts. If the pszFacename
  8715.    parameter is a NULL pointer, the function retrieves metrics for all
  8716.    available fonts regardless of their typeface names.
  8717.  
  8718.    pcFonts  Points to a variable containing the number of fonts for which to
  8719.    retrieve metrics. The function copies to this variable the actual number
  8720.    of fonts it retrieved.
  8721.  
  8722.    cbMetrics  Specifies the length of one FONTMETRICS structure.
  8723.  
  8724.    pfm  Points to one or more FONTMETRICS structures that receive the metrics
  8725.    of the fonts. The number of structure required is specified by the pcFonts
  8726.    parameter. This FONTMETRICS structure has the following form:
  8727.  
  8728.    typedef struct _FONTMETRICS {
  8729.        CHAR    szFamilyname[FACESIZE];
  8730.        CHAR    szFacename[FACESIZE];
  8731.        USHORT  idRegistry;
  8732.        USHORT  usCodePage;
  8733.        LONG    lEmHeight;
  8734.        LONG    lXHeight;
  8735.        LONG    lMaxAscender;
  8736.        LONG    lMaxDescender;
  8737.        LONG    lLowerCaseAscent;
  8738.        LONG    lLowerCaseDescent;
  8739.        LONG    lInternalLeading;
  8740.        LONG    lExternalLeading;
  8741.        LONG    lAveCharWidth;
  8742.        LONG    lMaxCharInc;
  8743.        LONG    lEmInc;
  8744.        LONG    lMaxBaselineExt;
  8745.        SHORT   sCharSlope;
  8746.        SHORT   sInlineDir;
  8747.        SHORT   sCharRot;
  8748.        USHORT  usWeightClass;
  8749.        USHORT  usWidthClass;
  8750.        SHORT   sXDeviceRes;
  8751.        SHORT   sYDeviceRes;
  8752.        SHORT   sFirstChar;
  8753.        SHORT   sLastChar;
  8754.        SHORT   sDefaultChar;
  8755.        SHORT   sBreakChar;
  8756.        SHORT   sNominalPointSize;
  8757.        SHORT   sMinimumPointSize;
  8758.        SHORT   sMaximumPointSize;
  8759.        USHORT  fsType;
  8760.        USHORT  fsDefn;
  8761.        USHORT  fsSelection;
  8762.        USHORT  fsCapabilities;
  8763.        LONG    lSubscriptXSize;
  8764.        LONG    lSubscriptYSize;
  8765.        LONG    lSubscriptXOffset;
  8766.        LONG    lSubscriptYOffset;
  8767.        LONG    lSuperscriptXSize;
  8768.        LONG    lSuperscriptYSize;
  8769.        LONG    lSuperscriptXOffset;
  8770.        LONG    lSuperscriptYOffset;
  8771.        LONG    lUnderscoreSize;
  8772.        LONG    lUnderscorePosition;
  8773.        LONG    lStrikeoutSize;
  8774.        LONG    lStrikeoutPosition;
  8775.        SHORT   sKerningPairs;
  8776.        SHORT   sReserved;
  8777.        LONG    lMatch;
  8778.    } FONTMETRICS;
  8779.  
  8780.    For a full description, see Chapter 4, "Types, Macros, Structures."
  8781.  
  8782.  Return Value
  8783.  
  8784.    The return value is the number of fonts not returned if the function is
  8785.    successful, or GPI_ALTERROR if an error occurred.
  8786.  
  8787.  Example
  8788.  
  8789.    This example uses the GpiQueryFonts function to retrieve the font metrics
  8790.    for all private fonts having the "Helv" typeface name. The function is
  8791.    called twice, once to determine the number of fonts available, again to
  8792.    retrieve the font metrics for all the fonts.
  8793.  
  8794.    LONG cFonts, lTemp = 0L;
  8795.    SEL sel;
  8796.    PFONTMETRICS pfm;
  8797.  
  8798.    /* Determine the number of fonts. */
  8799.  
  8800.    cFonts = GpiQueryFonts(hps, QF_PRIVATE, "Helv", &lTemp,
  8801.        (ULONG) sizeof(FONTMETRICS), NULL);
  8802.  
  8803.    /* Allocate space for the font metrics. */
  8804.  
  8805.    DosAllocSeg((USHORT) (sizeof(FONTMETRICS) * cFonts),
  8806.        &sel, SEG_NONSHARED);
  8807.    pfm = MAKEP(sel, 0);
  8808.  
  8809.    /* Retrieve the font metrics. */
  8810.  
  8811.    cFonts = GpiQueryFonts(hps, QF_PRIVATE, "Helv", &cFonts,
  8812.        (ULONG) sizeof(FONTMETRICS), pfm);
  8813.  
  8814.  See Also
  8815.  
  8816.    GpiCreateLogFont, GpiQueryFontMetrics
  8817.  
  8818.  
  8819.  ────────────────────────────────────────────────────────────────────────────
  8820.  GpiQueryGraphicsField
  8821.  ────────────────────────────────────────────────────────────────────────────
  8822.    BOOL GpiQueryGraphicsField (hps, prclField)
  8823.    HPS hps;                /*presentation-space handle                     */
  8824.    PRECTL prclField;       /*pointer to structure for the graphics field   */
  8825.  
  8826.    The GpiQueryGraphicsField function retrieves the coordinates, in
  8827.    presentation-page units, of the graphics field. The function copies the
  8828.    coordinates of the lower-left and upper-right corners of the field to the
  8829.    structure pointed to by the prclField parameter.
  8830.  
  8831.  Parameters
  8832.  
  8833.    hps  Identifies the presentation space.
  8834.  
  8835.    prclField  Points to the RECTL structure that receives the graphics field.
  8836.    This RECTL structure has the following form:
  8837.  
  8838.    typedef struct _RECTL {
  8839.        LONG  xLeft;
  8840.        LONG  yBottom;
  8841.        LONG  xRight;
  8842.        LONG  yTop;
  8843.    } RECTL;
  8844.  
  8845.    For a full description, see Chapter 4, "Types, Macros, Structures."
  8846.  
  8847.  Return Value
  8848.  
  8849.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  8850.    an error occurred.
  8851.  
  8852.  See Also
  8853.  
  8854.    GpiQueryClipBox, GpiQueryClipRegion, GpiQueryGraphicsField,
  8855.    GpiQueryViewingLimits, GpiSetGraphicsField
  8856.  
  8857.  
  8858.  ────────────────────────────────────────────────────────────────────────────
  8859.  GpiQueryInitialSegmentAttrs
  8860.  ────────────────────────────────────────────────────────────────────────────
  8861.    LONG GpiQueryInitialSegmentAttrs (hps, lAttribute)
  8862.    HPS hps;                /*presentation-space handle                     */
  8863.    LONG lAttribute;        /*attribute                                     */
  8864.  
  8865.    The GpiQueryDrawControl function checks whether the initial segment attri-
  8866.    bute specified by lAttribute is enabled. The function returns ATTR_ON or
  8867.    ATTR_OFF to specify whether the given attribute is enabled or disabled.
  8868.  
  8869.  Parameters
  8870.  
  8871.    hps  Identifies the presentation space.
  8872.  
  8873.    lAttribute  Specifies the attributes to check. It can be one of the
  8874.    following values:
  8875.  
  8876.    Value                   Meaning
  8877.    ──────────────────────────────────────────────────────────────────────────
  8878.    ATTR_CHAINED            Chained
  8879.  
  8880.    ATTR_DETECTABLE         Detectability
  8881.  
  8882.    ATTR_DYNAMIC            Dynamic
  8883.  
  8884.    ATTR_FASTCHAIN          Fast chaining
  8885.  
  8886.    ATTR_PROP_DETECTABLE    Propagate detectability
  8887.  
  8888.    ATTR_PROP_VISIBLE       Propagate visibility
  8889.  
  8890.    ATTR_VISIBLE            Visibility
  8891.    ──────────────────────────────────────────────────────────────────────────
  8892.  
  8893.  Return Value
  8894.  
  8895.    The return value is ATTR_ON or ATTR_OFF if the function is successful, or
  8896.    ATTR_ERROR if an error occurred.
  8897.  
  8898.  Errors
  8899.  
  8900.    Use the WinGetLastError function to retrieve the error value, which may be
  8901.    the following:
  8902.  
  8903.          PMERR_INV_MICROPS_FUNCTION
  8904.  
  8905.  See Also
  8906.  
  8907.    GpiSetInitialSegmentAttrs
  8908.  
  8909.  
  8910.  ────────────────────────────────────────────────────────────────────────────
  8911.  GpiQueryKerningPairs
  8912.  ────────────────────────────────────────────────────────────────────────────
  8913.    BOOL GpiQueryKerningPairs (hps, ckrnpr, akrnpr)
  8914.    HPS hps;                /*presentation-space handle                     */
  8915.    LONG ckrnpr;            /*number of kerning pairs                       */
  8916.    PKERNINGPAIRS akrnpr;   /*pointer to array of kerning-pair structures   */
  8917.  
  8918.    The GpiQueryKerningPairs function retrieves kerning-pair information for
  8919.    the current font for the presentation space. The kerning-pair information
  8920.    specifies the characters to be kerned and the amount of space in world
  8921.    coordinates to kern. The number of kerned pairs for a given font is
  8922.    specified in the font metrics for that font.
  8923.  
  8924.  Parameters
  8925.  
  8926.    hps  Identifies the presentation space.
  8927.  
  8928.    ckrnpr  Specifies the number of kerning pairs to retrieve.
  8929.  
  8930.    akrnpr  Points to the array of KERNINGPAIRS structures that receives the
  8931.    kerning-pair information. The array must have the number of elements
  8932.    specified by the ckrnpr parameter. The KERNINGPAIRS structure has the
  8933.    following form:
  8934.  
  8935.    typedef struct _KERNINGPAIRS {
  8936.        SHORT sFirstChar;
  8937.        SHORT sSecondChar;
  8938.        SHORT sKerningAmount;
  8939.    } KERNINGPAIRS;
  8940.  
  8941.    For a full description, see Chapter 4, "Types, Macros, Structures."
  8942.  
  8943.  Return Value
  8944.  
  8945.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  8946.    an error occurred.
  8947.  
  8948.  Example
  8949.  
  8950.    This example uses the GpiQueryKerningPairs function to retrieve the
  8951.    kerning information for the current font.
  8952.  
  8953.    FONTMETRICS fm;
  8954.    SEL sel;
  8955.    PKERNINGPAIRS akrnpr;
  8956.  
  8957.    GpiQueryFontMetrics(hps, (LONG) sizeof(FONTMETRICS), &fm);
  8958.    DosAllocSeg(fm.sKerningPairs * sizeof(KERNINGPAIRS), &sel,
  8959.        SEG_NONSHARED);
  8960.    akrnpr = MAKEP(sel, 0);
  8961.    GpiQueryKerningPairs(hps, (LONG) fm.sKerningPairs, akrnpr);
  8962.  
  8963.  See Also
  8964.  
  8965.    GpiQueryFontMetrics
  8966.  
  8967.  
  8968.  ────────────────────────────────────────────────────────────────────────────
  8969.  GpiQueryLineEnd
  8970.  ────────────────────────────────────────────────────────────────────────────
  8971.    LONG GpiQueryLineEnd (hps)
  8972.    HPS hps;                /*presentation-space handle                     */
  8973.  
  8974.    The GpiQueryLineEnd function returns the current line-end attribute. The
  8975.    function cannot be used in an open segment when the drawing mode is
  8976.    DM_RETAIN.
  8977.  
  8978.  Parameters
  8979.  
  8980.    hps  Identifies the presentation space.
  8981.  
  8982.  Return Value
  8983.  
  8984.    The return value is the current line-end attribute if the function is
  8985.    successful, or LINEEND_ERROR if an error occurred.
  8986.  
  8987.  See Also
  8988.  
  8989.    GpiQueryAttrs, GpiSetDrawingMode, GpiSetLineEnd
  8990.  
  8991.  
  8992.  ────────────────────────────────────────────────────────────────────────────
  8993.  GpiQueryLineJoin
  8994.  ────────────────────────────────────────────────────────────────────────────
  8995.    LONG GpiQueryLineJoin (hps)
  8996.    HPS hps;                /*presentation-space handle                     */
  8997.  
  8998.    The GpiQueryLineJoin function returns the current line-join attribute. The
  8999.    function cannot be used in an open segment when the drawing mode is
  9000.    DM_RETAIN.
  9001.  
  9002.  Parameters
  9003.  
  9004.    hps  Identifies the presentation space.
  9005.  
  9006.  Return Value
  9007.  
  9008.    The return value is the current line-join attribute if the function is
  9009.    successful, or LINEJOIN_ERROR if an error occurred.
  9010.  
  9011.  See Also
  9012.  
  9013.    GpiQueryAttrs, GpiSetDrawingMode, GpiSetLineJoin
  9014.  
  9015.  
  9016.  ────────────────────────────────────────────────────────────────────────────
  9017.  GpiQueryLineType
  9018.  ────────────────────────────────────────────────────────────────────────────
  9019.    LONG GpiQueryLineType (hps)
  9020.    HPS hps;                /*presentation-space handle                     */
  9021.  
  9022.    The GpiQueryLineType function returns the current cosmetic line-type
  9023.    attribute, as set by the GpiSetLineType function. The function cannot be
  9024.    used in an open segment when the drawing mode is DM_RETAIN.
  9025.  
  9026.  Parameters
  9027.  
  9028.    hps  Identifies the presentation space.
  9029.  
  9030.  Return Value
  9031.  
  9032.    The return value is the current cosmetic line-type attribute if the
  9033.    function is successful, or LINETYPE_ERROR if an error occurred.
  9034.  
  9035.  See Also
  9036.  
  9037.    GpiQueryAttrs, GpiSetDrawingMode, GpiSetLineType
  9038.  
  9039.  
  9040.  ────────────────────────────────────────────────────────────────────────────
  9041.  GpiQueryLineWidth
  9042.  ────────────────────────────────────────────────────────────────────────────
  9043.    FIXED GpiQueryLineWidth (hps)
  9044.    HPS hps;                /*presentation-space handle                     */
  9045.  
  9046.    The GpiQueryLineWidth function returns the current value of the cosmetic
  9047.    line-width attribute, as set by the GpiSetLineWidth function. The function
  9048.    cannot be used in an open segment when the drawing mode is DM_RETAIN.
  9049.  
  9050.  Parameters
  9051.  
  9052.    hps  Identifies the presentation space.
  9053.  
  9054.  Return Value
  9055.  
  9056.    The return value is the current value of the cosmetic line-width attribute
  9057.    if the function is successful, or LINEWIDTH_ERROR if an error occurred.
  9058.  
  9059.  See Also
  9060.  
  9061.    GpiQueryAttrs, GpiSetDrawingMode, GpiSetLineWidth
  9062.  
  9063.  
  9064.  ────────────────────────────────────────────────────────────────────────────
  9065.  GpiQueryLineWidthGeom
  9066.  ────────────────────────────────────────────────────────────────────────────
  9067.    LONG GpiQueryLineWidthGeom (hps)
  9068.    HPS hps;                /*presentation-space handle                     */
  9069.  
  9070.    The GpiQueryLineWidthGeom function returns the current geometric
  9071.    line-width attribute. The function cannot be used in an open segment when
  9072.    the drawing mode is DM_RETAIN.
  9073.  
  9074.  Parameters
  9075.  
  9076.    hps  Identifies the presentation space.
  9077.  
  9078.  Return Value
  9079.  
  9080.    The return value is the current geometric line-width attribute if the
  9081.    function is successful, or LINEWIDTHGEOM_ERROR if an error occurred.
  9082.  
  9083.  See Also
  9084.  
  9085.    GpiQueryAttrs, GpiSetDrawingMode, GpiSetLineWidthGeom
  9086.  
  9087.  
  9088.  ────────────────────────────────────────────────────────────────────────────
  9089.  GpiQueryLogColorTable
  9090.  ────────────────────────────────────────────────────────────────────────────
  9091.    LONG GpiQueryLogColorTable (hps, flOptions, iStart, clTable, alTable)
  9092.    HPS hps;                /*presentation-space handle                     */
  9093.    ULONG flOptions;        /*color type to retrieve                        */
  9094.    LONG iStart;            /*starting index                                */
  9095.    LONG clTable;           /*maximum number of values to copy              */
  9096.    PLONG alTable;          /*pointer to array for elements                 */
  9097.  
  9098.    The GpiQueryLogColorTable function retrieves the current
  9099.    logical-color-table entries. This function copies the RGB color values
  9100.    from the current logical color table to the array pointed to by alTable.
  9101.    It may also copy the color-table index values for each RGB color value,
  9102.    depending on the value of flOptions.
  9103.  
  9104.    GpiQueryLogColorTable uses iStart as the index of the first color table
  9105.    entry to copy. It continues to copy subsequent entries until it reaches
  9106.    the end of the table or it has copied the number of values specified by
  9107.    clTable. If a logical color-table entry has no corresponding RGB color
  9108.    value, the function either copies -1 to the array or skips the entry,
  9109.    depending on the value of flOptions. It skips the entry only if it is
  9110.    copying both the color-table index and the RGB value to the array.
  9111.  
  9112.  Parameters
  9113.  
  9114.    hps  Identifies the presentation space.
  9115.  
  9116.    flOptions  Specifies whether to retrieve indexes and RGB color values or
  9117.    just RGB values. If flOptions is LCOLOPT_INDEX, the function retrieves
  9118.    indexes and RGB color values. If it is 0x0000, the function retrieves RGB
  9119.    color values only.
  9120.  
  9121.    iStart  Specifies the color-table index for the first entry to copy. The
  9122.    function copies this entry and all subsequent entries up to the number of
  9123.    values specified by clTable or the end of the logical color table.
  9124.  
  9125.    clTable  Specifies the maximum number of values to copy to the array
  9126.    pointed to by alTable. If flOptions is 0x0000, this parameter specifies
  9127.    the number of RGB color values to retrieve. If flOptions is LCOLOPT_INDEX,
  9128.    this parameter specifies the combined total of index and RGB values to
  9129.    retrieve and must be an even value.
  9130.  
  9131.    alTable  Points to the array to receive the color-table entries. If
  9132.    flOptions is equal to 0x0000, each element in the array receives an RGB
  9133.    color value. If flOptions is LCOLOPT_INDEX, each pair of array elements
  9134.    receives an index and a corresponding RGB value, with the first element in
  9135.    the pair receiving the index.
  9136.  
  9137.  Return Value
  9138.  
  9139.    The return value is the number of values copied to the array if the
  9140.    function is successful. The return value is QLCT_ERROR if an error
  9141.    occurred. The function returns QLCT_RGB if flOptions is LCOLOPT_INDEX and
  9142.    the current logical color table does not use indexes.
  9143.  
  9144.  Errors
  9145.  
  9146.    Use the WinGetLastError function to retrieve the error value, which may be
  9147.    the following:
  9148.  
  9149.          PMERR_INV_COLOR_OPTIONS
  9150.  
  9151.  Example
  9152.  
  9153.    This example uses the GpiQueryLogColorTable function to retrieve all the
  9154.    entries in the current logical color table.
  9155.  
  9156.    LONG cColors;
  9157.    SEL sel;
  9158.    PLONG alColor;
  9159.  
  9160.    /* Find out how many colors are in the color table. */
  9161.  
  9162.    DevQueryCaps(GpiQueryDevice(hps), CAPS_COLORS, 1L, &cColors);
  9163.  
  9164.    /* Allocate space for the color values and indexes. */
  9165.  
  9166.    DosAllocSeg((USHORT)(cColors * 2 * sizeof (LONG)), &sel, SEG_NONSHARED);
  9167.    alColor = MAKEP(sel, 0);
  9168.  
  9169.    /* Retrieve the values. */
  9170.  
  9171.    GpiQueryLogColorTable(hps,   /* presentation space              */
  9172.        LCOLOPT_INDEX,           /* retrieve indexes and RGB values */
  9173.        0L,                      /* start with first entry          */
  9174.        cColors * 2,             /* copy 2 values for each entry    */
  9175.        alColor);                /* array to receive values         */
  9176.  
  9177.  See Also
  9178.  
  9179.    GpiCreateLogColorTable, GpiQueryColorData, GpiQueryNearestColor,
  9180.    GpiQueryRealColors, GpiQueryRGBColor
  9181.  
  9182.  
  9183.  ────────────────────────────────────────────────────────────────────────────
  9184.  GpiQueryMarker
  9185.  ────────────────────────────────────────────────────────────────────────────
  9186.    LONG GpiQueryMarker (hps)
  9187.    HPS hps;                /*presentation-space handle                     */
  9188.  
  9189.    The GpiQueryMarker function returns the current value of the marker-symbol
  9190.    attribute. The function cannot be used in an open segment when the drawing
  9191.    mode is DM_RETAIN.
  9192.  
  9193.  Parameters
  9194.  
  9195.    hps  Identifies the presentation space.
  9196.  
  9197.  Return Value
  9198.  
  9199.    The return value is the current marker symbol if the function is
  9200.    successful, or MARKSYM_ERROR if an error occurred.
  9201.  
  9202.  See Also
  9203.  
  9204.    GpiMarker, GpiPolyMarker, GpiQueryAttrs, GpiSetDrawingMode
  9205.  
  9206.  
  9207.  ────────────────────────────────────────────────────────────────────────────
  9208.  GpiQueryMarkerBox
  9209.  ────────────────────────────────────────────────────────────────────────────
  9210.    BOOL GpiQueryMarkerBox (hps, psizfxBox)
  9211.    HPS hps;                /*presentation-space handle                     */
  9212.    PSIZEF psizfxBox;       /*pointer to structure for marker-box size      */
  9213.  
  9214.    The GpiQueryMarkerBox function retrieves the current value of the
  9215.    marker-box attribute, set by the GpiSetMarkerBox function. The function
  9216.    cannot be used in an open segment when the drawing mode is DM_RETAIN.
  9217.  
  9218.  Parameters
  9219.  
  9220.    hps  Identifies the presentation space.
  9221.  
  9222.    psizfxBox  Points to the SIZEF structure that receives the size of the
  9223.    marker box. The SIZEF structure has the following form:
  9224.  
  9225.    typedef struct _SIZEF {
  9226.        FIXED cx;
  9227.        FIXED cy;
  9228.    } SIZEF;
  9229.  
  9230.    For a full description, see Chapter 4, "Types, Macros, Structures."
  9231.  
  9232.  Return Value
  9233.  
  9234.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  9235.    an error occurred.
  9236.  
  9237.  See Also
  9238.  
  9239.    GpiQueryAttrs, GpiSetDrawingMode, GpiSetMarkerBox
  9240.  
  9241.  
  9242.  ────────────────────────────────────────────────────────────────────────────
  9243.  GpiQueryMarkerSet
  9244.  ────────────────────────────────────────────────────────────────────────────
  9245.    LONG GpiQueryMarkerSet (hps)
  9246.    HPS hps;                /*presentation-space handle                     */
  9247.  
  9248.    The GpiQueryMarkerSet function returns the current value of the marker-set
  9249.    attribute, as set by the GpiSetMarkerSet function. The function cannot be
  9250.    used in an open segment when the drawing mode is DM_RETAIN.
  9251.  
  9252.  Parameters
  9253.  
  9254.    hps  Identifies the presentation space.
  9255.  
  9256.  Return Value
  9257.  
  9258.    The return value is the local identifier for the marker set if the
  9259.    function is successful, or LCID_ERROR if an error occurred.
  9260.  
  9261.  See Also
  9262.  
  9263.    GpiQueryAttrs, GpiSetDrawingMode, GpiSetMarkerSet
  9264.  
  9265.  
  9266.  ────────────────────────────────────────────────────────────────────────────
  9267.  GpiQueryMetaFileBits
  9268.  ────────────────────────────────────────────────────────────────────────────
  9269.    BOOL GpiQueryMetaFileBits (hmf, off, cbBuffer, pbBuffer)
  9270.    HMF hmf;                /*metafile handle                               */
  9271.    LONG off;               /*offset to the first metafile byte to copy     */
  9272.    LONG cbBuffer;          /*length in bytes of buffer                     */
  9273.    PBYTE pbBuffer;         /*pointer to buffer for metafile data           */
  9274.  
  9275.    The GpiQueryMetaFileBits function copies data from the metafile specified
  9276.    by hmf to the buffer pointed to by the pbBuffer parameter. The function
  9277.    copies the bytes of the metafile, up to the number of bytes specified by
  9278.    cbBuffer, starting at the byte whose offset from the beginning of the
  9279.    metafile is specified by the off parameter.
  9280.  
  9281.  Parameters
  9282.  
  9283.    hmf  Identifies the memory metafile.
  9284.  
  9285.    off  Specifies the offset in bytes from the beginning of the metafile to
  9286.    the first byte to copy.
  9287.  
  9288.    cbBuffer  Specifies the number of bytes of metafile data to copy.
  9289.  
  9290.    pbBuffer  Points to the buffer to receive the metafile data. It must have
  9291.    the number of bytes specified by the cbBuffer parameter.
  9292.  
  9293.  Return Value
  9294.  
  9295.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  9296.    an error occurred.
  9297.  
  9298.  Errors
  9299.  
  9300.    Use the WinGetLastError function to retrieve the error value, which may be
  9301.    one of the following:
  9302.  
  9303.          PMERR_INV_METAFILE_LENGTH
  9304.          PMERR_INV_METAFILE_OFFSET
  9305.  
  9306.  Example
  9307.  
  9308.    This example uses the GpiQueryMetaFileBits function to retrieve the
  9309.    graphics-order data from the specified metafile. The
  9310.    GpiQueryMetaFileLength function returns the length of the metafile.
  9311.  
  9312.    HMF hmf;
  9313.    LONG cBytes;
  9314.    SEL sel;
  9315.    LONG off;
  9316.  
  9317.    hmf = GpiLoadMetaFile(hps, "sample.met");
  9318.  
  9319.    /* Allocate the buffer for the metafile data. */
  9320.  
  9321.    DosAllocSeg(0, &sel, SEG_NONSHARED);
  9322.    pbBuffer = MAKEP(sel, 0);
  9323.  
  9324.    cBytes = GpiQueryMetaFileLength(hmf);  /* get length of metafile */
  9325.  
  9326.    /* Continue to retrieve data in 64K blocks. */
  9327.  
  9328.    for (off = 0L; off < cBytes; off += 65536L)
  9329.        GpiQueryMetaFileBits(
  9330.            hps,          /* presentation space              */
  9331.            off,          /* offset of next byte to retrieve */
  9332.            65536L,       /* retrieve as much as possible    */
  9333.            pbBuffer);    /* buffer to receive metafile data */
  9334.  
  9335.  See Also
  9336.  
  9337.    GpiQueryMetaFileLength, GpiSetMetaFileBits
  9338.  
  9339.  
  9340.  ────────────────────────────────────────────────────────────────────────────
  9341.  GpiQueryMetaFileLength
  9342.  ────────────────────────────────────────────────────────────────────────────
  9343.    LONG GpiQueryMetaFileLength (hmf)
  9344.    HMF hmf;                /*metafile handle                               */
  9345.  
  9346.    The GpiQueryMetaFileLength function returns the total length, in bytes, of
  9347.    the metafile specified by hmf. The function is typically used to determine
  9348.    the number of bytes of data to retrieve using the GpiQueryMetaFileBits
  9349.    function.
  9350.  
  9351.  Parameters
  9352.  
  9353.    hmf  Identifies the metafile.
  9354.  
  9355.  Return Value
  9356.  
  9357.    The return value is the metafile length if the function is successful, or
  9358.    GPI_ALTERROR if an error occurred.
  9359.  
  9360.  See Also
  9361.  
  9362.    GpiQueryMetaFileBits, GpiSetMetaFileBits
  9363.  
  9364.  
  9365.  ────────────────────────────────────────────────────────────────────────────
  9366.  GpiQueryMix
  9367.  ────────────────────────────────────────────────────────────────────────────
  9368.    LONG GpiQueryMix (hps)
  9369.    HPS hps;                /*presentation-space handle                     */
  9370.  
  9371.    The GpiQueryMix function returns the current value of the (line)
  9372.    foreground color-mixing mode, as set by the GpiSetMix function. The
  9373.    function cannot be used in an open segment when the drawing mode is
  9374.    DM_RETAIN.
  9375.  
  9376.  Parameters
  9377.  
  9378.    hps  Identifies the presentation space.
  9379.  
  9380.  Return Value
  9381.  
  9382.    The return value is the current foreground mix mode if the function is
  9383.    successful, or FM_ERROR if an error occurred.
  9384.  
  9385.  See Also
  9386.  
  9387.    GpiQueryAttrs, GpiQueryBackMix, GpiSetDrawingMode, GpiSetMix
  9388.  
  9389.  
  9390.  ────────────────────────────────────────────────────────────────────────────
  9391.  GpiQueryModelTransformMatrix
  9392.  ────────────────────────────────────────────────────────────────────────────
  9393.    BOOL GpiQueryModelTransformMatrix (hps, cElements, pmatlf)
  9394.    HPS hps;                /*presentation-space handle                     */
  9395.    LONG cElements;         /*number of elements                            */
  9396.    PMATRIXLF pmatlf;       /*pointer to structure for transformation       */
  9397.                            /*matrix                                        */
  9398.  
  9399.    The GpiQueryModelTransformMatrix function retrieves the matrix for the
  9400.    current model transformation. The function cannot be used in an open
  9401.    segment when the drawing mode is DM_RETAIN.
  9402.  
  9403.  Parameters
  9404.  
  9405.    hps  Identifies the presentation space.
  9406.  
  9407.    cElements  Specifies the number of elements of the matrix to retrieve. It
  9408.    must be an integer in the range 0 through 9.
  9409.  
  9410.    pmatlf  Points to the MATRIXLF structure the receives the model
  9411.    transformation matrix. The MATRIXLF structure has the following form:
  9412.  
  9413.    typedef struct _MATRIXLF {
  9414.        FIXED fxM11;
  9415.        FIXED fxM12;
  9416.        LONG  lM13;
  9417.        FIXED fxM21;
  9418.        FIXED fxM22;
  9419.        LONG  lM23;
  9420.        LONG  lM31;
  9421.        LONG  lM32;
  9422.        LONG  lM33;
  9423.    } MATRIXLF;
  9424.  
  9425.    For a full description, see Chapter 4, "Types, Macros, Structures."
  9426.  
  9427.  Return Value
  9428.  
  9429.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  9430.    an error occurred.
  9431.  
  9432.  See Also
  9433.  
  9434.    GpiSetDrawingMode, GpiSetModelTransformMatrix
  9435.  
  9436.  
  9437.  ────────────────────────────────────────────────────────────────────────────
  9438.  GpiQueryNearestColor
  9439.  ────────────────────────────────────────────────────────────────────────────
  9440.    LONG GpiQueryNearestColor (hps, flOptions, lRgbColorIn)
  9441.    HPS hps;                /*presentation-space handle                     */
  9442.    ULONG flClrType;        /*color type                                    */
  9443.    LONG lRgbColorIn;       /*RGB color value                               */
  9444.  
  9445.    The GpiQueryColorIndex function returns the RGB color value from the
  9446.    physical palette that most closely matches the RGB color value specified
  9447.    by the lRgbColorIn parameter. The function uses the physical palette of
  9448.    the device associated with the given presentation space.
  9449.  
  9450.    If the current logical color table is realizable but has not been
  9451.    realized, the LCOLOPT_REALIZED option maps the RGB color value as if the
  9452.    logical color table has been realized. Since realizing a logical color
  9453.    table affects the contents of the physical palette, the RGB color value
  9454.    returned with this option may be different than the value returned without
  9455.    the option.
  9456.  
  9457.  Parameters
  9458.  
  9459.    hps  Identifies the presentation space.
  9460.  
  9461.    flClrType  Specifies whether the RGB color value is based on realized
  9462.    colors. If it is LCOLOPT_REALIZED, the function returns a RGB color based
  9463.    on the colors in the physical palette after the current logical color
  9464.    table is realized. If the parameter is zero, the function returns a RGB
  9465.    color based on the colors in the current physical palette.
  9466.  
  9467.    lRgbColorIn  Specifies a RGB color value.
  9468.  
  9469.  Return Value
  9470.  
  9471.    The return value is the nearest available color if the function is
  9472.    successful or GPI_ALTERROR if an error occurred.
  9473.  
  9474.  Errors
  9475.  
  9476.    Use the WinGetLastError function to retrieve the error value, which may be
  9477.    one of the following:
  9478.  
  9479.          PMERR_INV_COLOR_OPTIONS
  9480.          PMERR_INV_RGBCOLOR
  9481.  
  9482.  See Also
  9483.  
  9484.    GpiCreateLogColorTable, GpiQueryColorData, GpiQueryRealColors,
  9485.    GpiQueryRGBColor
  9486.  
  9487.  
  9488.  ────────────────────────────────────────────────────────────────────────────
  9489.  GpiQueryNumberSetIds
  9490.  ────────────────────────────────────────────────────────────────────────────
  9491.    LONG GpiQueryNumberSetIds (hps)
  9492.    HPS hps;                /*presentation-space handle                     */
  9493.  
  9494.    The GpiQueryNumberSetIds function returns the number of local identifiers
  9495.    currently in use that refer to fonts or bitmaps. The function is typically
  9496.    used before calling the GpiQuerySetIds function.
  9497.  
  9498.  Parameters
  9499.  
  9500.    hps  Identifies the presentation space.
  9501.  
  9502.  Return Value
  9503.  
  9504.    The return value is the number of local identifiers in use if the function
  9505.    is successful or GPI_ALTERROR if an error occurred.
  9506.  
  9507.  See Also
  9508.  
  9509.    GpiQuerySetIds, GpiSetBitmapId, GpiSetCharSet
  9510.  
  9511.  
  9512.  ────────────────────────────────────────────────────────────────────────────
  9513.  GpiQueryPageViewport
  9514.  ────────────────────────────────────────────────────────────────────────────
  9515.    BOOL GpiQueryPageViewport (hps, prclViewport)
  9516.    HPS hps;                /*presentation-space handle                     */
  9517.    PRECTL prclViewport;    /*pointer to structure for viewport             */
  9518.  
  9519.    The GpiQueryPageViewport function retrieves the page viewport. The
  9520.    function cannot be used if no device context is associated with the
  9521.    presentation space.
  9522.  
  9523.  Parameters
  9524.  
  9525.    hps  Identifies the presentation space.
  9526.  
  9527.    prclViewport  Points to the RECTL structure that receives the page
  9528.    viewport. The RECTL structure has the following form:
  9529.  
  9530.    typedef struct _RECTL {
  9531.        LONG  xLeft;
  9532.        LONG  yBottom;
  9533.        LONG  xRight;
  9534.        LONG  yTop;
  9535.    } RECTL;
  9536.  
  9537.    For a full description, see Chapter 4, "Types, Macros, Structures."
  9538.  
  9539.  Return Value
  9540.  
  9541.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  9542.    an error occurred.
  9543.  
  9544.  See Also
  9545.  
  9546.    GpiCreatePS, GpiSetPageViewport
  9547.  
  9548.  
  9549.  ────────────────────────────────────────────────────────────────────────────
  9550.  GpiQueryPattern
  9551.  ────────────────────────────────────────────────────────────────────────────
  9552.    LONG GpiQueryPattern (hps)
  9553.    HPS hps;                /*presentation-space handle                     */
  9554.  
  9555.    The GpiQueryPattern function returns the current value of the
  9556.    shading-pattern symbol, as set by the GpiSetPattern function. The function
  9557.    cannot be used in an open segment when the drawing mode is DM_RETAIN.
  9558.  
  9559.  Parameters
  9560.  
  9561.    hps  Identifies the presentation space.
  9562.  
  9563.  Return Value
  9564.  
  9565.    The return value is the current shading-pattern symbol if the function is
  9566.    successful or PATSYM_ERROR if an error occurred.
  9567.  
  9568.  See Also
  9569.  
  9570.    GpiQueryPatternRefPoint, GpiQueryPatternSet, GpiSetDrawingMode,
  9571.    GpiSetPattern
  9572.  
  9573.  
  9574.  ────────────────────────────────────────────────────────────────────────────
  9575.  GpiQueryPatternRefPoint
  9576.  ────────────────────────────────────────────────────────────────────────────
  9577.    BOOL GpiQueryPatternRefPoint (hps, pptlRefPoint)
  9578.    HPS hps;                /*presentation-space handle                     */
  9579.    PPOINTL pptlRefPoint;   /*pointer to structure for                      */
  9580.                            /*pattern-reference point                       */
  9581.  
  9582.    The GpiQueryPatternRefPoint function retrieves the current
  9583.    pattern-reference point. The function cannot be used in an open segment
  9584.    when the drawing mode is DM_RETAIN.
  9585.  
  9586.  Parameters
  9587.  
  9588.    hps  Identifies the presentation space.
  9589.  
  9590.    pptlRefPoint  Points to the POINTL structure that receives the
  9591.    pattern-reference point. The POINTL structure has the following form:
  9592.  
  9593.    typedef struct _POINTL  {
  9594.        LONG  x;
  9595.        LONG  y;
  9596.    } POINTL;
  9597.  
  9598.    For a full description, see Chapter 4, "Types, Macros, Structures."
  9599.  
  9600.  Return Value
  9601.  
  9602.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  9603.    an error occurred.
  9604.  
  9605.  See Also
  9606.  
  9607.    GpiQueryPattern, GpiQueryPatternSet, GpiSetDrawingMode
  9608.  
  9609.  
  9610.  ────────────────────────────────────────────────────────────────────────────
  9611.  GpiQueryPatternSet
  9612.  ────────────────────────────────────────────────────────────────────────────
  9613.    LONG GpiQueryPatternSet (hps)
  9614.    HPS hps;                /*presentation-space handle                     */
  9615.  
  9616.    The GpiQueryPatternSet function returns the current value of the
  9617.    pattern-set identifier, as set by the GpiSetPatternSet function. The
  9618.    function cannot be used in an open segment when the drawing mode is
  9619.    DM_RETAIN.
  9620.  
  9621.  Parameters
  9622.  
  9623.    hps  Identifies the presentation space.
  9624.  
  9625.  Return Value
  9626.  
  9627.    The return value is the current pattern-set identifier if the function is
  9628.    successful or LCID_ERROR if an error occurred.
  9629.  
  9630.  See Also
  9631.  
  9632.    GpiQueryPattern, GpiQueryPatternRefPoint, GpiSetDrawingMode,
  9633.    GpiSetPatternSet
  9634.  
  9635.  
  9636.  ────────────────────────────────────────────────────────────────────────────
  9637.  GpiQueryPel
  9638.  ────────────────────────────────────────────────────────────────────────────
  9639.    LONG GpiQueryPel (hps, pptl)
  9640.    HPS hps;                /*presentation-space handle                     */
  9641.    PPOINTL pptl;           /*pointer to structure with point to query      */
  9642.  
  9643.    The GpiQueryPel function returns the color of a pel at the specified
  9644.    point. The point, given in world coordinates, must be in any of the
  9645.    current clipping objects: clip path, viewing limits, graphics field, clip
  9646.    region, or visible region.
  9647.  
  9648.  Parameters
  9649.  
  9650.    hps  Identifies the presentation space.
  9651.  
  9652.    pptl  Points to the POINTL structure that contains the world coordinates
  9653.    of the point. The POINTL structure has the following form:
  9654.  
  9655.    typedef struct _POINTL  {
  9656.        LONG  x;
  9657.        LONG  y;
  9658.    } POINTL;
  9659.  
  9660.    For a full description, see Chapter 4, "Types, Macros, Structures."
  9661.  
  9662.  Return Value
  9663.  
  9664.    The return value is the color index of the pel if the function is
  9665.    successful or GPI_ALTERROR if an error occurred.
  9666.  
  9667.  See Also
  9668.  
  9669.    GpiPtVisible, GpiSetPel
  9670.  
  9671.  
  9672.  ────────────────────────────────────────────────────────────────────────────
  9673.  GpiQueryPickAperturePosition
  9674.  ────────────────────────────────────────────────────────────────────────────
  9675.    BOOL GpiQueryPickAperturePosition (hps, pptl)
  9676.    HPS hps;                /*presentation-space handle                     */
  9677.    PPOINTL pptl;           /*pointer to structure for center point         */
  9678.  
  9679.    The GpiQueryPickAperturePosition function retrieves the position of the
  9680.    center of the pick aperture.
  9681.  
  9682.  Parameters
  9683.  
  9684.    hps  Identifies the presentation space.
  9685.  
  9686.    pptl  Points to the POINTL structure that receives the coordinates, in
  9687.    presentation page units, of the center. The POINTL structure has the
  9688.    following form:
  9689.  
  9690.    typedef struct _POINTL  {
  9691.        LONG  x;
  9692.        LONG  y;
  9693.    } POINTL;
  9694.  
  9695.    For a full description, see Chapter 4, "Types, Macros, Structures."
  9696.  
  9697.  Return Value
  9698.  
  9699.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  9700.    an error occurred.
  9701.  
  9702.  See Also
  9703.  
  9704.    GpiQueryPickApertureSize, GpiSetPickAperturePosition
  9705.  
  9706.  
  9707.  ────────────────────────────────────────────────────────────────────────────
  9708.  GpiQueryPickApertureSize
  9709.  ────────────────────────────────────────────────────────────────────────────
  9710.    BOOL GpiQueryPickApertureSize (hps, psizl)
  9711.    HPS hps;                /*presentation-space handle                     */
  9712.    PSIZEL psizl;           /*pointer to structure for pick-aperture size   */
  9713.  
  9714.    The GpiQueryPickApertureSize function retrieves the width and height of
  9715.    the the pick aperture. The pick aperture is set using the
  9716.    GpiSetPickApertureSize function.
  9717.  
  9718.  Parameters
  9719.  
  9720.    hps  Identifies the presentation space.
  9721.  
  9722.    psizl  Points to a SIZEL structure that receives the pick-aperture size.
  9723.    The SIZEL structure has the following form:
  9724.  
  9725.    typedef struct _SIZEL {
  9726.        LONG cx;
  9727.        LONG cy;
  9728.    } SIZEL;
  9729.  
  9730.    For a full description, see Chapter 4, "Types, Macros, Structures."
  9731.  
  9732.  Return Value
  9733.  
  9734.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  9735.    an error occurred.
  9736.  
  9737.  See Also
  9738.  
  9739.    GpiQueryPickAperturePosition, GpiSetPickApertureSize
  9740.  
  9741.  
  9742.  ────────────────────────────────────────────────────────────────────────────
  9743.  GpiQueryPS
  9744.  ────────────────────────────────────────────────────────────────────────────
  9745.    ULONG GpiQueryPS (hps, psizlPage)
  9746.    HPS hps;                /*presentation-space handle                     */
  9747.    PSIZEL psizlPage;       /*pointer to structure for page size            */
  9748.  
  9749.    The GpiQueryPS function retrieves the page parameters and returns the
  9750.    presentation-space options for the presentation space. The page parameters
  9751.    specify the dimensions of the presentation page. The presentation-space
  9752.    options specify the page unit, storage format, and presentation type for
  9753.    the presentation space. These are the values set for the presentation
  9754.    space when it is created using the GpiCreatePS function.
  9755.  
  9756.  Parameters
  9757.  
  9758.    hps  Identifies the presentation space.
  9759.  
  9760.    psizlPage  Points to a SIZEL structure that receives the presentation-page
  9761.    size. The SIZEL structure has the following form:
  9762.  
  9763.    typedef struct _SIZEL {
  9764.        LONG cx;
  9765.        LONG cy;
  9766.    } SIZEL;
  9767.  
  9768.    For a full description, see Chapter 4, "Types, Macros, Structures."
  9769.  
  9770.  Return Value
  9771.  
  9772.    The return value is the presentation-space options if the function is
  9773.    successful or GPI_ERROR if an error occurred.
  9774.  
  9775.  Comment
  9776.  
  9777.    The individual presentation-space options can be extracted from the return
  9778.    value by using the bitwise AND operator and the constants defined for the
  9779.    flOptions parameter of the GpiCreatePS function.
  9780.  
  9781.  See Also
  9782.  
  9783.    GpiCreatePS, GpiQueryPageViewport
  9784.  
  9785.  
  9786.  ────────────────────────────────────────────────────────────────────────────
  9787.  GpiQueryRealColors
  9788.  ────────────────────────────────────────────────────────────────────────────
  9789.    LONG GpiQueryRealColors (hps, flClrType, lStart, cclr, aclr)
  9790.    HPS hps;                /*presentation-space handle                     */
  9791.    ULONG flClrType;        /*color options                                 */
  9792.    LONG lStart;            /*ordinal number of first color                 */
  9793.    LONG cclr;              /*number of colors                              */
  9794.    PLONG aclr;             /*pointer to array of colors                    */
  9795.  
  9796.    The GpiQueryRealColors function retrieves the RGB values in the physical
  9797.    palette of the device associated with the presentation space. These colors
  9798.    represent the only device colors currently available to the application.
  9799.    The function copies the RGB color values, up to the number specified by
  9800.    the cclr parameter, to the array pointed to by the aclr parameter. The
  9801.    function uses the lStart parameter to determine which physical palette
  9802.    color to start copying. If this parameter is zero, the function copies
  9803.    from the start of the physical palette. The function returns the number of
  9804.    colors actually retrieved.
  9805.  
  9806.    An application can change the contents of the physical palette by
  9807.    realizing a color table, for devices that permit realizable color tables.
  9808.    If the current logical color table is realizable but has not been
  9809.    realized, the LCOLOPT_REALIZED option retrieves the RGB color values as if
  9810.    the logical color table has been realized. Since realizing a logical color
  9811.    table affects the contents of the physical palette, the RGB color values
  9812.    retrieved with this option may be different from the values retrieved
  9813.    without the option.
  9814.  
  9815.    The GpiQueryRealColors function can also map the colors from the physical
  9816.    palette to the color-index values in the current logical color table. If
  9817.    the LCOLOPT_INDEX option is specified, the function copies a color-index
  9818.    and RGB-color pair to the array pointed to by aclr. Each value in the pair
  9819.    fills one element in the array, with the color index appearing first.
  9820.  
  9821.  Parameters
  9822.  
  9823.    hps  Identifies the presentation space.
  9824.  
  9825.    flClrType  Specifies whether the RGB color values are realized colors and
  9826.    whether color-index values are retrieved. It can be one of the following:
  9827.  
  9828.    Value               Meaning
  9829.    ──────────────────────────────────────────────────────────────────────────
  9830.    0x0000              Retrieves RGB colors based on the colors in the
  9831.                        current physical palette.
  9832.  
  9833.    LCOLOPT_REALIZED    Retrieves the RGB colors corresponding to the realized
  9834.                        logical color table. This option does not realize the
  9835.                        table, but does return values as if the table had been
  9836.                        realized.
  9837.  
  9838.    LCOLOPT_INDEX       Retrieves indexes and RGB color values.
  9839.    ──────────────────────────────────────────────────────────────────────────
  9840.  
  9841.    The LCOLOPT_REALIZED and LCOLOPT_INDEX options can be combined.
  9842.  
  9843.    lStart  Specifies the ordinal number of the first color to copy.
  9844.  
  9845.    cclr  Specifies the number of RGB color values to retrieve. If the
  9846.    LCOLOPT_INDEX option is specified, this parameter must specify the total
  9847.    number of color indexes and RGB colors to retrieve; this value must be a
  9848.    multiple of 2.
  9849.  
  9850.    aclr  Points to the array that receives the RGB color values. It must have
  9851.    the number of elements specified by the cclr parameter. If the
  9852.    LCOLOPT_INDEX option is given, the first element in each pair of elements
  9853.    is the color index.
  9854.  
  9855.  Return Value
  9856.  
  9857.    The return value is the number of elements returned if the function is
  9858.    successful or GPI_ALTERROR if an error occurred.
  9859.  
  9860.  Errors
  9861.  
  9862.    Use the WinGetLastError function to retrieve the error value, which may be
  9863.    the following:
  9864.  
  9865.          PMERR_INV_COLOR_OPTIONS
  9866.  
  9867.  See Also
  9868.  
  9869.    GpiCreateLogColorTable, GpiQueryColorData, GpiQueryNearestColor,
  9870.    GpiQueryRGBColor
  9871.  
  9872.  
  9873.  ────────────────────────────────────────────────────────────────────────────
  9874.  GpiQueryRegionBox
  9875.  ────────────────────────────────────────────────────────────────────────────
  9876.    LONG GpiQueryRegionBox (hps, hrgn, prcl)
  9877.    HPS hps;                /*presentation-space handle                     */
  9878.    HRGN hrgn;              /*region handle                                 */
  9879.    PRECTL prcl;            /*pointer to structure for enclosing rectangle  */
  9880.  
  9881.    The GpiQueryRegionBox function retrieves the dimensions of the smallest
  9882.    rectangle that encloses the region identified by hrgn. If the region is
  9883.    empty, the function sets the left and right coordinates and top and bottom
  9884.    coordinates to equal values. The function cannot be used if no device
  9885.    context is associated with the presentation space.
  9886.  
  9887.  Parameters
  9888.  
  9889.    hps  Identifies the presentation space.
  9890.  
  9891.    hrgn  Identifies the region.
  9892.  
  9893.    prcl  Points to the RECTL structure that receives the coordinates of the
  9894.    enclosing rectangle. The RECTL structure has the following form:
  9895.  
  9896.    typedef struct _RECTL {
  9897.        LONG  xLeft;
  9898.        LONG  yBottom;
  9899.        LONG  xRight;
  9900.        LONG  yTop;
  9901.    } RECTL;
  9902.  
  9903.    For a full description, see Chapter 4, "Types, Macros, Structures."
  9904.  
  9905.  Return Value
  9906.  
  9907.    The return value is RGN_NULL, RGN_RECT, or RGN_COMPLEX if the function is
  9908.    successful, or RGN_ERROR if an error occurred.
  9909.  
  9910.  See Also
  9911.  
  9912.    GpiQueryClipBox
  9913.  
  9914.  
  9915.  ────────────────────────────────────────────────────────────────────────────
  9916.  GpiQueryRegionRects
  9917.  ────────────────────────────────────────────────────────────────────────────
  9918.    BOOL GpiQueryRegionRects (hps, hrgn, prclBound, prgnrc, arcl)
  9919.    HPS hps;                /*presentation-space handle                     */
  9920.    HRGN hrgn;              /*region handle                                 */
  9921.    PRECTL prclBound;       /*pointer to structure for enclosing rectangle  */
  9922.    PRGNRECT prgnrc;        /*pointer to structure controlling processing   */
  9923.    PRECTL arcl;            /*pointer to array of rectangle structures      */
  9924.  
  9925.    The GpiQueryRegionRects function retrieves the rectangles that define the
  9926.    region identified by the hrgn parameter. The rectangles can be used to
  9927.    recreate the region, by using the GpiCreateRegion function. The function
  9928.    copies the coordinates of one or more of the defining rectangles to the
  9929.    array of structures pointed to by the arcl parameter. It uses the
  9930.    rectangle pointed to by the prclBound parameter to determine which
  9931.    rectangles to retrieve. Only rectangles within this rectangle are
  9932.    retrieved. If the prclBound parameter is NULL, the function retrieves all
  9933.    rectangles in the region.
  9934.  
  9935.    The GpiQueryRegionRects function uses the fields of the RGNRECT structure
  9936.    pointed to by the prgnrc parameter to control how the defining rectangles
  9937.    are retrieved. Since a region may comprise several rectangles, the RGNRECT
  9938.    structure lets an application retrieve a few rectangles at a time. The
  9939.    structure specifies which rectangle to start with and how many to
  9940.    retrieve. The function copies the actual number of rectangles retrieved to
  9941.    the structure. Also, a field in this structure specifies the direction
  9942.    through the region the function is to take as it retrieves rectangles.
  9943.  
  9944.    The GpiQueryRegionRects function cannot be used if no device context is
  9945.    associated with the presentation space.
  9946.  
  9947.  Parameters
  9948.  
  9949.    hps  Identifies the presentation space.
  9950.  
  9951.    hrgn  Identifies the region.
  9952.  
  9953.    prclBound  Points to the RECTL structure that contains the enclosing
  9954.    rectangle. Only rectangles within this rectangle are retrieved. The RECTL
  9955.    structure has the following form:
  9956.  
  9957.    typedef struct _RECTL {
  9958.        LONG  xLeft;
  9959.        LONG  yBottom;
  9960.        LONG  xRight;
  9961.        LONG  yTop;
  9962.    } RECTL;
  9963.  
  9964.    For a full description, see Chapter 4, "Types, Macros, Structures."
  9965.  
  9966.    prgnrc  Points to the RGNRECT structure that specifies how to retrieve the
  9967.    rectangles. The RGNRECT structure has the following form:
  9968.  
  9969.    typedef struct _RGNRECT {
  9970.        USHORT ircStart;
  9971.        USHORT crc;
  9972.        USHORT crcReturned;
  9973.        USHORT usDirection;
  9974.    } RGNRECT;
  9975.  
  9976.    For a full description, see Chapter 4, "Types, Macros, Structures."
  9977.  
  9978.    arcl  Points to the array of RECTL structures that receives the defining
  9979.    rectangles.
  9980.  
  9981.  Return Value
  9982.  
  9983.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  9984.    an error occurred.
  9985.  
  9986.  Errors
  9987.  
  9988.    Use the WinGetLastError function to retrieve the error value, which may be
  9989.    the following:
  9990.  
  9991.          PMERR_INV_REGION_CONTROL
  9992.  
  9993.  See Also
  9994.  
  9995.    GpiCombineRegion, GpiCreateRegion
  9996.  
  9997.  
  9998.  ────────────────────────────────────────────────────────────────────────────
  9999.  GpiQueryRGBColor
  10000.  ────────────────────────────────────────────────────────────────────────────
  10001.    LONG GpiQueryRGBColor (hps, flClrType, lColorIndex)
  10002.    HPS hps;                /*presentation-space handle                     */
  10003.    ULONG flClrType;        /*color type                                    */
  10004.    LONG lColorIndex;       /*color-index value                             */
  10005.  
  10006.    The GpiQueryRGBColor function returns the RGB color value in the physical
  10007.    palette that corresponds to the color-index value specified by the
  10008.    lColorIndex parameter.
  10009.  
  10010.    If the current logical color table is realizable but has not been
  10011.    realized, the LCOLOPT_REALIZED option maps the color-index value as if the
  10012.    logical color table has been realized. Since realizing a logical color
  10013.    table affects the contents of the physical palette, the RGB color value
  10014.    returned with this option may be different from the value returned without
  10015.    the option.
  10016.  
  10017.    If the current logical color table was created using the LCOLF_RGB option,
  10018.    the lColorIndex parameter is interpreted as an RGB color value. In this
  10019.    case, the function is identical to the GpiQueryNearestColor function.
  10020.  
  10021.  Parameters
  10022.  
  10023.    hps  Identifies the presentation space.
  10024.  
  10025.    flClrType  Specifies whether the RGB color value is based on realized
  10026.    colors. If it is LCOLOPT_REALIZED, the function returns an RGB color based
  10027.    on the colors in the physical palette after the current logical color
  10028.    table is realized. If the parameter is zero, the function returns an RGB
  10029.    color based on the colors in the current physical palette.
  10030.  
  10031.    lColorIndex  Specifies the color index. This may be any valid color-index
  10032.    value except CLR_DEFAULT.
  10033.  
  10034.  Return Value
  10035.  
  10036.    The return value is the RGB color that is the closest match if the
  10037.    function is successful or GPI_ALTERROR if an error occurred.
  10038.  
  10039.  Errors
  10040.  
  10041.    Use the WinGetLastError function to retrieve the error value, which may be
  10042.    one of the following:
  10043.  
  10044.          PMERR_INV_COLOR_INDEX
  10045.          PMERR_INV_COLOR_OPTIONS
  10046.  
  10047.  See Also
  10048.  
  10049.    GpiCreateLogColorTable, GpiQueryColorData, GpiQueryNearestColor,
  10050.    GpiQueryRealColors, GpiQueryRGBColor, GpiSetColor
  10051.  
  10052.  
  10053.  ────────────────────────────────────────────────────────────────────────────
  10054.  GpiQuerySegmentAttrs
  10055.  ────────────────────────────────────────────────────────────────────────────
  10056.    LONG GpiQuerySegmentAttrs (hps, idSegment, lAttribute)
  10057.    HPS hps;                /*presentation-space handle                     */
  10058.    LONG idSegment;         /*segment identifier                            */
  10059.    LONG lAttribute;        /*attribute                                     */
  10060.  
  10061.    The GpiQuerySegmentAttrs function checks a segment for the specified
  10062.    attribute. The function returns ATTR_ON or ATTR_OFF to specify whether the
  10063.    segment has or does not have the given attribute. The function can be used
  10064.    to check the attributes of any segment, including the currently open
  10065.    segment (if any).
  10066.  
  10067.  Parameters
  10068.  
  10069.    hps  Identifies the presentation space.
  10070.  
  10071.    idSegment  Specifies the segment identifier. It must be greater than zero.
  10072.  
  10073.    lAttribute  Specifies the attribute to check. It must be one of the
  10074.    following values:
  10075.  
  10076.    Value                   Meaning
  10077.    ──────────────────────────────────────────────────────────────────────────
  10078.    ATTR_CHAINED            Chained
  10079.  
  10080.    ATTR_DETECTABLE         Detectability
  10081.  
  10082.    ATTR_DYNAMIC            Dynamic
  10083.  
  10084.    ATTR_FASTCHAIN          Fast chaining
  10085.  
  10086.    ATTR_PROP_DETECTABLE    Propagate detectability
  10087.  
  10088.    ATTR_PROP_VISIBLE       Propagate visibility
  10089.  
  10090.    ATTR_VISIBLE            Visibility
  10091.    ──────────────────────────────────────────────────────────────────────────
  10092.  
  10093.  Return Value
  10094.  
  10095.    The return is ATTR_ON or ATTR_OFF if the function is successful, or
  10096.    ATTR_ERROR if an error occurred.
  10097.  
  10098.  Errors
  10099.  
  10100.    Use the WinGetLastError function to retrieve the error value, which may be
  10101.    one of the following:
  10102.  
  10103.          PMERR_INV_MICROPS_FUNCTION
  10104.          PMERR_INV_SEG_NAME
  10105.  
  10106.  See Also
  10107.  
  10108.    GpiSetSegmentAttrs
  10109.  
  10110.  
  10111.  ────────────────────────────────────────────────────────────────────────────
  10112.  GpiQuerySegmentNames
  10113.  ────────────────────────────────────────────────────────────────────────────
  10114.    LONG GpiQuerySegmentNames (hps, idFirstSegment, idLastSegment, cidMax,
  10115.    aidSegments)
  10116.    HPS hps;                /*presentation-space handle                     */
  10117.    LONG idFirstSegment;    /*first segment                                 */
  10118.    LONG idLastSegment;     /*last segment                                  */
  10119.    LONG cidMax;            /*maximum number of segments                    */
  10120.    PLONG aidSegments;      /*pointer to array for segments                 */
  10121.  
  10122.    The GpiQuerySegmentNames function retrieves the identifiers of all
  10123.    existing segments whose identifiers are in the range specified by the
  10124.    idFirstSegment and idLastSegment parameters.
  10125.  
  10126.    If the idFirstSegment parameter is equal to or greater than the
  10127.    idLastSegment parameter, the function only checks for the segment having
  10128.    the identifier specified by idFirstSegment.
  10129.  
  10130.  Parameters
  10131.  
  10132.    hps  Identifies the presentation space.
  10133.  
  10134.    idFirstSegment  Specifies the first segment in the range; it must be
  10135.    greater than zero.
  10136.  
  10137.    idLastSegment  Specifies the last segment; it must be greater than zero.
  10138.  
  10139.    cidMax  Specifies the maximum number of segment identifiers to retrieve.
  10140.  
  10141.    aidSegments  Points to the array to receive the segment identifiers. It
  10142.    must have the number of elements specified by the cidMax parameter.
  10143.  
  10144.  Return Value
  10145.  
  10146.    The return value is the number of segment identifiers returned if the
  10147.    function is successful or GPI_ALTERROR if an error occurred.
  10148.  
  10149.  Errors
  10150.  
  10151.    Use the WinGetLastError function to retrieve the error value, which may be
  10152.    one of the following:
  10153.  
  10154.          PMERR_INV_MICROPS_FUNCTION
  10155.          PMERR_INV_SEG_NAME
  10156.  
  10157.  See Also
  10158.  
  10159.    GpiOpenSegment
  10160.  
  10161.  
  10162.  ────────────────────────────────────────────────────────────────────────────
  10163.  GpiQuerySegmentPriority
  10164.  ────────────────────────────────────────────────────────────────────────────
  10165.    LONG GpiQuerySegmentPriority (hps, idRefSegment, cmdOrder)
  10166.    HPS hps;                /*presentation-space handle                     */
  10167.    LONG idRefSegment;      /*reference-segment identifier                  */
  10168.    LONG cmdOrder;          /*segment order                                 */
  10169.  
  10170.    The GpiQuerySegmentPriority function returns the identifier of the segment
  10171.    having the next-highest or next-lowest priority, relative to the segment
  10172.    specified by idRefSegment. The priority of a segment affects how segments
  10173.    in the picture chain are drawn.
  10174.  
  10175.    The function uses the cmdOrder parameter to determine whether to look for
  10176.    the segment with next-highest or next-lowest priority. The function
  10177.    returns zero if there is no segment with next-highest or next-lowest
  10178.    priority.
  10179.  
  10180.  Parameters
  10181.  
  10182.    hps  Identifies the presentation space.
  10183.  
  10184.    idRefSegment  Specifies the identifier of the segment whose priority is
  10185.    compared, or is zero to specify the segment with lowest or highest
  10186.    priority.
  10187.  
  10188.    cmdOrder  Specifies whether to check for a segment with higher or lower
  10189.    priority. It can be one of the following values:
  10190.  
  10191.    Value             Meaning
  10192.    ──────────────────────────────────────────────────────────────────────────
  10193.    LOWER_PRI         Return the identifier for the segment with next-lowest
  10194.                      priority. If idRefSegment is zero, the function returns
  10195.                      the identifier of the segment with the lowest priority.
  10196.  
  10197.    HIGHER_PRI        Return the identifier of the segment with next-highest
  10198.                      priority. If idRefSegment is zero, the function returns
  10199.                      the identifier of the segment with the highest priority.
  10200.    ──────────────────────────────────────────────────────────────────────────
  10201.  
  10202.  Return Value
  10203.  
  10204.    The return value is the identifier of the segment with the next-highest or
  10205.    next-lowest priority if the function is successful. The return value is
  10206.    GPI_ALTERROR if an error occurred.
  10207.  
  10208.  Errors
  10209.  
  10210.    Use the WinGetLastError function to retrieve the error value, which may be
  10211.    one of the following:
  10212.  
  10213.          PMERR_INV_MICROPS_FUNCTION
  10214.          PMERR_INV_SEG_NAME
  10215.  
  10216.  See Also
  10217.  
  10218.    GpiDrawChain, GpiDrawFrom, GpiSetSegmentPriority
  10219.  
  10220.  
  10221.  ────────────────────────────────────────────────────────────────────────────
  10222.  GpiQuerySegmentTransformMatrix
  10223.  ────────────────────────────────────────────────────────────────────────────
  10224.    BOOL GpiQuerySegmentTransformMatrix (hps, idSegment, cElements, pmatlf)
  10225.    HPS hps;                /*presentation-space handle                     */
  10226.    LONG idSegment;         /*segment identifier                            */
  10227.    LONG cElements;         /*number of elements                            */
  10228.    PMATRIXLF pmatlf;       /*pointer to structure for matrix elements      */
  10229.  
  10230.    The GpiQuerySegmentTransformMatrix function retrieves one or more elements
  10231.    of the segment-transformation matrix for the segment specified by
  10232.    idSegment.
  10233.  
  10234.  Parameters
  10235.  
  10236.    hps  Identifies the presentation space.
  10237.  
  10238.    idSegment  Specifies the segment identifier.
  10239.  
  10240.    cElements  Specifies the number of elements to retrieve. It must be an
  10241.    integer value in the range 0 through 9.
  10242.  
  10243.    pmatlf  Points to the MATRIXLF structure that receives the transformation
  10244.    matrix. The MATRIXLF structure has the following form:
  10245.  
  10246.    typedef struct _MATRIXLF {
  10247.        FIXED fxM11;
  10248.        FIXED fxM12;
  10249.        LONG  lM13;
  10250.        FIXED fxM21;
  10251.        FIXED fxM22;
  10252.        LONG  lM23;
  10253.        LONG  lM31;
  10254.        LONG  lM32;
  10255.        LONG  lM33;
  10256.    } MATRIXLF;
  10257.  
  10258.    For a full description, see Chapter 4, "Types, Macros, Structures."
  10259.  
  10260.  Return Value
  10261.  
  10262.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  10263.    an error occurred.
  10264.  
  10265.  Errors
  10266.  
  10267.    Use the WinGetLastError function to retrieve the error value, which may be
  10268.    one of the following:
  10269.  
  10270.          PMERR_INV_MICROPS_FUNCTION
  10271.          PMERR_INV_SEG_NAME
  10272.  
  10273.  See Also
  10274.  
  10275.    GpiSetSegmentTransformMatrix
  10276.  
  10277.  
  10278.  ────────────────────────────────────────────────────────────────────────────
  10279.  GpiQuerySetIds
  10280.  ────────────────────────────────────────────────────────────────────────────
  10281.    BOOL GpiQuerySetIds (hps, cSets, alTypes, pstr8, alcid)
  10282.    HPS hps;                /*presentation-space handle                     */
  10283.    LONG cSets;             /*number of objects to query                    */
  10284.    PLONG alTypes;          /*pointer to array of types                     */
  10285.    PSTR8 pstr8;            /*pointer to array for names                    */
  10286.    PLONG alcid;            /*pointer to array for local identifiers        */
  10287.  
  10288.    The GpiQuerySetIds function retrieves a list of types, names, and local
  10289.    identifiers for all current logical fonts and tagged bitmaps. The function
  10290.    copies the information to the arrays pointed to by the alTypes, pstr8, and
  10291.    alcid parameters. The type specifies whether the object is a logical font
  10292.    or tagged bitmap. The name is an 8-character string that uniquely
  10293.    identifies the object. Not all objects have names.
  10294.  
  10295.    The GpiQuerySetIds function retrieves information for only the number of
  10296.    objects specified by the cSets parameter, starting with the object having
  10297.    local identifier 1. If information for all objects is needed, the
  10298.    GpiQueryNumberSetIds function returns a count of all local identifiers in
  10299.    use.
  10300.  
  10301.  Parameters
  10302.  
  10303.    hps  Identifies the presentation space.
  10304.  
  10305.    cSets  Specifies the number of objects to retrieve. It must not be greater
  10306.    than the number of local identifiers currently in use.
  10307.  
  10308.    alTypes  Points to the array to receive the type for each object. The
  10309.    function sets each element in this array to either LCIDT_FONT or
  10310.    LCIDT_BITMAP. The array must have the number of elements specified by
  10311.    cSets.
  10312.  
  10313.    pstr8  Points to the array to receive the name for each object. Each
  10314.    element, itself an array, receives an object name of up to eight
  10315.    characters. If an object has no name, the element is set to zero. The
  10316.    array must have the number of elements specified by cSet.
  10317.  
  10318.    alcid  Points to the array that receives the local identifiers. The array
  10319.    must have the number of elements specified by cSets.
  10320.  
  10321.  Return Value
  10322.  
  10323.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  10324.    an error occurred.
  10325.  
  10326.  Example
  10327.  
  10328.    This example uses the GpiQuerySetIds function to retrieve the local
  10329.    identifier for all logical fonts. It then uses the identifiers to delete
  10330.    the logical fonts.
  10331.  
  10332.    LONG cIds;
  10333.    SEL sel;
  10334.    PLONG plType;
  10335.    PSTR8 pstr8;
  10336.    PLONG plcid;
  10337.  
  10338.    cIds = GpiQueryNumberSetIds(hps); /* get number of local identifiers */
  10339.  
  10340.    /* Allocate space for type, name, and local-identifier arrays. */
  10341.  
  10342.    DosAllocSeg((USHORT) cIds * sizeof(LONG), &sel, SEG_NONSHARED);
  10343.    plType = MAKEP(sel, 0);
  10344.    DosAllocSeg((USHORT) cIds * sizeof(STR8), &sel, SEG_NONSHARED);
  10345.    pstr8 = MAKEP(sel, 0);
  10346.    DosAllocSeg((USHORT) cIds * sizeof(LONG), &sel, SEG_NONSHARED);
  10347.    plcid = MAKEP(sel, 0);
  10348.  
  10349.    /* Get the types, names, and local identifiers. */
  10350.  
  10351.    GpiQuerySetIds(hps, cIds, plType, pstr8, plcid);
  10352.  
  10353.    /* Delete each local identifier that has LCIDT_FONT type. */
  10354.  
  10355.    for (i = 1; i < cIds; i++)
  10356.        if (plTypes[i] == LCIDT_FONT)
  10357.            GpiDeleteSetId(hps, plcid[i]);
  10358.  
  10359.  See Also
  10360.  
  10361.    GpiCreateLogFont, GpiQueryNumberSetIds, GpiSetBitmapId
  10362.  
  10363.  
  10364.  ────────────────────────────────────────────────────────────────────────────
  10365.  GpiQueryStopDraw
  10366.  ────────────────────────────────────────────────────────────────────────────
  10367.    LONG GpiQueryStopDraw (hps)
  10368.    HPS hps;                /*presentation-space handle                     */
  10369.  
  10370.    The GpiQueryStopDraw function returns the state of the stop-draw
  10371.    condition.
  10372.  
  10373.  Parameters
  10374.  
  10375.    hps  Identifies the presentation space.
  10376.  
  10377.  Return Value
  10378.  
  10379.    The return value is TRUE if the stop-draw condition is on or FALSE if it
  10380.    is not. The return value is GPI_ALTERROR if an error occurred.
  10381.  
  10382.  Errors
  10383.  
  10384.    Use the WinGetLastError function to retrieve the error value, which may be
  10385.    the following:
  10386.  
  10387.          PMERR_INV_MICROPS_FUNCTION
  10388.  
  10389.  See Also
  10390.  
  10391.    GpiSetStopDraw
  10392.  
  10393.  
  10394.  ────────────────────────────────────────────────────────────────────────────
  10395.  GpiQueryTag
  10396.  ────────────────────────────────────────────────────────────────────────────
  10397.    BOOL GpiQueryTag (hps, plTag)
  10398.    HPS hps;                /*presentation-space handle                     */
  10399.    PLONG plTag;            /*tag identifier                                */
  10400.  
  10401.    The GpiQueryTag function retrieves the current value of the tag
  10402.    identifier, as set by the GpiSetTag function. The function cannot be used
  10403.    in an open segment when the drawing mode is DM_RETAIN.
  10404.  
  10405.  Parameters
  10406.  
  10407.    hps  Identifies the presentation space.
  10408.  
  10409.    plTag  Points to the variable to receive the tag.
  10410.  
  10411.  Return Value
  10412.  
  10413.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  10414.    an error occurred.
  10415.  
  10416.  Errors
  10417.  
  10418.    Use the WinGetLastError function to retrieve the error value, which may be
  10419.    the following:
  10420.  
  10421.          PMERR_INV_MICROPS_FUNCTION
  10422.  
  10423.  See Also
  10424.  
  10425.    GpiSetDrawingMode, GpiSetTag
  10426.  
  10427.  
  10428.  ────────────────────────────────────────────────────────────────────────────
  10429.  GpiQueryTextBox
  10430.  ────────────────────────────────────────────────────────────────────────────
  10431.    BOOL GpiQueryTextBox (hps, cchString, pchString, cptl, aptl)
  10432.    HPS hps;                /*presentation-space handle                     */
  10433.    LONG cchString;         /*number of characters                          */
  10434.    PCH pchString;          /*pointer to string                             */
  10435.    LONG cptl;              /*number of points                              */
  10436.    PPOINTL aptl;           /*pointer to array of point structures          */
  10437.  
  10438.    The GpiQueryTextBox function retrieves the text box and concatenation
  10439.    point for the string pointed to by the pchString parameter. The text box
  10440.    is four points specifying the parallelogram that, if drawn, encloses the
  10441.    given string when the string is displayed on the device. The concatenation
  10442.    point is the point the current position advances to after the string is
  10443.    drawn. All coordinates are relative to the start point of the string──that
  10444.    is, the text box and concatenation point are given as if the string were
  10445.    drawn at the world-space origin.
  10446.  
  10447.    The GpiQueryTextBox function computes the text box and concatenation point
  10448.    using the current character attributes. It then copies the computed points
  10449.    to the array pointed to by the aptl parameter. In most cases, the function
  10450.    copies the upper-left, lower-left, upper-right, and lower-right corners of
  10451.    the text box first, followed by the concatenation point, but not all
  10452.    points need to be copied at all times. The function uses the cptl
  10453.    parameter to determine how many of these points to retrieve and copies
  10454.    only that number.
  10455.  
  10456.    Depending on the character attributes, the "upper-left" corner of the text
  10457.    box may not seem so when the text box is actually drawn. For this reason,
  10458.    the function copies the coordinates of the text box to the array prior to
  10459.    applying character attributes, such as base-line angle, that affect the
  10460.    orientation of the points.
  10461.  
  10462.    The function cannot be used in an open segment when the drawing mode is
  10463.    DM_RETAIN.
  10464.  
  10465.  Parameters
  10466.  
  10467.    hps  Identifies the presentation space.
  10468.  
  10469.    cchString  Specifies the number of characters in the string pointed to by
  10470.    pchString.
  10471.  
  10472.    pchString  Points to the character string.
  10473.  
  10474.    cptl  Specifies the number of points to retrieve. If it is TXTBOX_COUNT,
  10475.    the function retrieves the maximum number of points for the text box.
  10476.  
  10477.    aptl  Points to the array of POINTL structures that receives a list of
  10478.    points. The list of points contains the relative coordinates of the
  10479.    character box. The elements of the array are defined as follows:
  10480.  
  10481.    Value                 Meaning
  10482.    ──────────────────────────────────────────────────────────────────────────
  10483.    TXTBOX_TOPLEFT        Upper-left corner
  10484.  
  10485.    TXTBOX_BOTTOMLEFT     Lower-left corner
  10486.  
  10487.    TXTBOX_TOPRIGHT       Upper-right corner
  10488.  
  10489.    TXTBOX_BOTTOMRIGHT    Lower-right corner
  10490.  
  10491.    TXTBOX_CONCAT         Concatenation point
  10492.    ──────────────────────────────────────────────────────────────────────────
  10493.  
  10494.    The POINTL structure has the following form:
  10495.  
  10496.    typedef struct _POINTL  {
  10497.        LONG  x;
  10498.        LONG  y;
  10499.    } POINTL;
  10500.  
  10501.    For a full description, see Chapter 4, "Types, Macros, Structures."
  10502.  
  10503.  Return Value
  10504.  
  10505.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  10506.    an error occurred.
  10507.  
  10508.  Example
  10509.  
  10510.    This example uses the GpiQueryTextBox function to draw a line under the
  10511.    string. The GpiCharString function draws the string at the point
  10512.    (100,100). Since the points retrieved by GpiQueryTextBox are relative to
  10513.    the start of the string, the starting point needs to be added to the
  10514.    points that are used to draw the underline.
  10515.  
  10516.    POINTL aptl[TXTBOX_COUNT];
  10517.    POINTL ptl = { 100, 100 };
  10518.  
  10519.    GpiQueryTextBox(hps, 11L, "This string", TXTBOX_COUNT, aptl);
  10520.    aptl[1].x += ptl.x;
  10521.    aptl[1].y += ptl.y;
  10522.    GpiMove(hps, &aptl[1]);
  10523.    aptl[3].x += ptl.x;
  10524.    aptl[3].y += ptl.y;
  10525.    GpiLine(hps, &aptl[3]);
  10526.    GpiMove(hps, &ptl);
  10527.    GpiCharString(hps, 11L, "This string");
  10528.  
  10529.  See Also
  10530.  
  10531.    GpiCharStringAt, GpiSetDrawingMode
  10532.  
  10533.  
  10534.  ────────────────────────────────────────────────────────────────────────────
  10535.  GpiQueryViewingLimits
  10536.  ────────────────────────────────────────────────────────────────────────────
  10537.    BOOL GpiQueryViewingLimits (hps, prclLimits)
  10538.    HPS hps;                /*presentation-space handle                     */
  10539.    PRECTL prclLimits;      /*pointer to structure for viewing limits       */
  10540.  
  10541.    The GpiQueryViewingLimits function retrieves the current value of the
  10542.    viewing limits, as set by the GpiSetViewingLimits function. The function
  10543.    cannot be used in an open segment when the drawing mode is DM_RETAIN.
  10544.  
  10545.  Parameters
  10546.  
  10547.    hps  Identifies the presentation space.
  10548.  
  10549.    prclLimits  Points to the RECTL structure that receives the viewing
  10550.    limits. The RECTL structure has the following form:
  10551.  
  10552.    typedef struct _RECTL {
  10553.        LONG  xLeft;
  10554.        LONG  yBottom;
  10555.        LONG  xRight;
  10556.        LONG  yTop;
  10557.    } RECTL;
  10558.  
  10559.    For a full description, see Chapter 4, "Types, Macros, Structures."
  10560.  
  10561.  Return Value
  10562.  
  10563.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  10564.    an error occurred.
  10565.  
  10566.  See Also
  10567.  
  10568.    GpiQueryClipBox, GpiQueryClipRegion, GpiQueryGraphicsField,
  10569.    GpiQueryViewingLimits, GpiSetDrawingMode, GpiSetViewingLimits
  10570.  
  10571.  
  10572.  ────────────────────────────────────────────────────────────────────────────
  10573.  GpiQueryViewingTransformMatrix
  10574.  ────────────────────────────────────────────────────────────────────────────
  10575.    BOOL GpiQueryViewingTransformMatrix (hps, cElements, pmatlf)
  10576.    HPS hps;                /*presentation-space handle                     */
  10577.    LONG cElements;         /*number of elements                            */
  10578.    PMATRIXLF pmatlf;       /*pointer to structure for transformation       */
  10579.                            /*matrix                                        */
  10580.  
  10581.    The GpiQueryViewingTransformMatrix function retrieves the current
  10582.    viewing-transformation matrix.
  10583.  
  10584.  Parameters
  10585.  
  10586.    hps  Identifies the presentation space.
  10587.  
  10588.    cElements  Specifies the number of elements to retrieve. It must be an
  10589.    integer in the range 0 through 9.
  10590.  
  10591.    pmatlf  Points to the MATRIXLF structure that receives the elements of the
  10592.    viewing-transformation matrix. The MATRIXLF structure has the following
  10593.    form:
  10594.  
  10595.    typedef struct _MATRIXLF {
  10596.        FIXED fxM11;
  10597.        FIXED fxM12;
  10598.        LONG  lM13;
  10599.        FIXED fxM21;
  10600.        FIXED fxM22;
  10601.        LONG  lM23;
  10602.        LONG  lM31;
  10603.        LONG  lM32;
  10604.        LONG  lM33;
  10605.    } MATRIXLF;
  10606.  
  10607.    For a full description, see Chapter 4, "Types, Macros, Structures."
  10608.  
  10609.  Return Value
  10610.  
  10611.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  10612.    an error occurred.
  10613.  
  10614.  Errors
  10615.  
  10616.    Use the WinGetLastError function to retrieve the error value, which may be
  10617.    the following:
  10618.  
  10619.          PMERR_INV_MICROPS_FUNCTION
  10620.  
  10621.  See Also
  10622.  
  10623.    GpiSetViewingTransformMatrix
  10624.  
  10625.  
  10626.  ────────────────────────────────────────────────────────────────────────────
  10627.  GpiQueryWidthTable
  10628.  ────────────────────────────────────────────────────────────────────────────
  10629.    BOOL GpiQueryWidthTable (hps, lFirstChar, clWidths, alWidths)
  10630.    HPS hps;                /*presentation-space handle                     */
  10631.    LONG lFirstChar;        /*code point of first character                 */
  10632.    LONG clWidths;          /*number of elements                            */
  10633.    PLONG alWidths;         /*pointer to array for width table              */
  10634.  
  10635.    The GpiQueryWidthTable function retrieves the widths of one or more
  10636.    characters in the current font. A character width is the distance (in
  10637.    world coordinates) the system advances along the baseline after drawing
  10638.    the character. The function copies the widths, starting with the width for
  10639.    the character specified by the lFirstChar parameter, to the array pointed
  10640.    to by the alWidths parameter. The function uses the clWidths parameter to
  10641.    determine how many widths to retrieve.
  10642.  
  10643.    If the widths for all characters in the font are desired, the
  10644.    GpiQueryFontMetrics function can be used to retrieve the number of
  10645.    characters in the font.
  10646.  
  10647.  Parameters
  10648.  
  10649.    hps  Identifies the presentation space.
  10650.  
  10651.    lFirstChar  Specifies the code point of the first character for which a
  10652.    width is retrieved.
  10653.  
  10654.    clWidths  Specifies the number of widths to retrieve.
  10655.  
  10656.    alWidths  Points to the array that receives the character widths. The
  10657.    array must have the number of elements specified by clWidths.
  10658.  
  10659.  Return Value
  10660.  
  10661.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  10662.    an error occurred.
  10663.  
  10664.  Errors
  10665.  
  10666.    Use the WinGetLastError function to retrieve the error value, which may be
  10667.    the following:
  10668.  
  10669.          PMERR_INV_FIRST_CHAR
  10670.  
  10671.  See Also
  10672.  
  10673.    GpiQueryFontMetrics
  10674.  
  10675.  
  10676.  ────────────────────────────────────────────────────────────────────────────
  10677.  GpiRealizeColorTable
  10678.  ────────────────────────────────────────────────────────────────────────────
  10679.    BOOL GpiRealizeColorTable (hps)
  10680.    HPS hps;                /*presentation-space handle                     */
  10681.  
  10682.    The GpiRealizeColorTable function realizes the logical color table. The
  10683.    function realizes the color table by replacing the colors in the physical
  10684.    palette. It replaces the physical palette colors with the device colors
  10685.    that most closely match the RGB color values given in the logical color
  10686.    table.
  10687.  
  10688.    To realize a logical color table, the application must create the table
  10689.    using the LCOL_REALIZABLE option of the GpiCreateLogColorTable function
  10690.    and the device must be capable of realizing logical color tables. The
  10691.    DevQueryCaps function and CAPS_COLOR option can be used to determine if
  10692.    logical color tables can be realized.
  10693.  
  10694.    If the presentation space is currently associated with a screen window
  10695.    device, this function should be used only when the associated window is
  10696.    maximized. Changing the physical palette colors for the screen affects
  10697.    output for all visible windows.
  10698.  
  10699.  Parameters
  10700.  
  10701.    hps  Identifies the presentation space.
  10702.  
  10703.  Return Value
  10704.  
  10705.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  10706.    an error occurred.
  10707.  
  10708.  Example
  10709.  
  10710.    This example uses the GpiRealizeColorTable function to realize the logical
  10711.    color table. The GpiUnrealizeColorTable function is used to restore the
  10712.    physical palette after the drawing is complete.
  10713.  
  10714.    RGB argb[16];      /* RGB color values for new logical color table */
  10715.  
  10716.    /* Create a realizable logical color table. */
  10717.  
  10718.    GpiCreateLogColorTable(hps, LCOL_REALIZABLE, LCOLF_CONSECRGB,
  10719.        0L, 16L, argb);
  10720.  
  10721.    GpiRealizeColorTable(hps);     /* realizes the logical color table */
  10722.        .
  10723.        .
  10724.        .
  10725.    GpiUnrealizeColorTable(hps);   /* restores the physical palette    */
  10726.  
  10727.  See Also
  10728.  
  10729.    DevQueryCaps, GpiUnrealizeColorTable
  10730.  
  10731.  
  10732.  ────────────────────────────────────────────────────────────────────────────
  10733.  GpiRectInRegion
  10734.  ────────────────────────────────────────────────────────────────────────────
  10735.    LONG GpiRectInRegion (hps, hrgn, prcl)
  10736.    HPS hps;                /*presentation-space handle                     */
  10737.    HRGN hrgn;              /*region handle                                 */
  10738.    PRECTL prcl;            /*pointer to rectangle structure                */
  10739.  
  10740.    The GpiRectInRegion function checks whether any part of a rectangle lies
  10741.    within the specified region. The function cannot be used if no device
  10742.    context is associated with the presentation space.
  10743.  
  10744.  Parameters
  10745.  
  10746.    hps  Identifies the presentation space.
  10747.  
  10748.    hrgn  Identifies the region.
  10749.  
  10750.    prcl  Points to the RECTL structure that contains the rectangle to check.
  10751.    The RECTL structure has the following form:
  10752.  
  10753.    typedef struct _RECTL {
  10754.        LONG  xLeft;
  10755.        LONG  yBottom;
  10756.        LONG  xRight;
  10757.        LONG  yTop;
  10758.    } RECTL;
  10759.  
  10760.    For a full description, see Chapter 4, "Types, Macros, Structures."
  10761.  
  10762.  Return Value
  10763.  
  10764.    The return value is RRGN_OUTSIDE, RRGN_PARTIAL, or RRGN_INSIDE if the
  10765.    function is successful, or RRGN_ERROR if an error occurred.
  10766.  
  10767.  See Also
  10768.  
  10769.    GpiPtInRegion
  10770.  
  10771.  
  10772.  ────────────────────────────────────────────────────────────────────────────
  10773.  GpiRectVisible
  10774.  ────────────────────────────────────────────────────────────────────────────
  10775.    LONG GpiRectVisible (hps, prcl)
  10776.    HPS hps;                /*presentation-space handle                     */
  10777.    PRECTL prcl;            /*pointer to rectangle structure                */
  10778.  
  10779.    The GpiRectVisible function checks whether any part of a rectangle is
  10780.    visible on the device associated with the specified presentation space. A
  10781.    point in the rectangle is visible if it lies within the intersection of
  10782.    the current graphics field, viewing limit, clip path, clip region, and
  10783.    visible region (if any).
  10784.  
  10785.  Parameters
  10786.  
  10787.    hps  Identifies the presentation space.
  10788.  
  10789.    prcl  Points to a RECTL structure that contains the rectangle in world
  10790.    coordinates. The RECTL structure has the following form:
  10791.  
  10792.    typedef struct _RECTL {
  10793.        LONG  xLeft;
  10794.        LONG  yBottom;
  10795.        LONG  xRight;
  10796.        LONG  yTop;
  10797.    } RECTL;
  10798.  
  10799.    For a full description, see Chapter 4, "Types, Macros, Structures."
  10800.  
  10801.  Return Value
  10802.  
  10803.    The return value is RVIS_INVISIBLE, RVIS_PARTIAL, or RVIS_VISIBLE if the
  10804.    function is successful, or RVIS_ERROR if an error occurred.
  10805.  
  10806.  See Also
  10807.  
  10808.    GpiPtVisible
  10809.  
  10810.  
  10811.  ────────────────────────────────────────────────────────────────────────────
  10812.  GpiRemoveDynamics
  10813.  ────────────────────────────────────────────────────────────────────────────
  10814.    BOOL GpiRemoveDynamics (hps, idFirstSegment, idLastSegment)
  10815.    HPS hps;                /*presentation-space handle                     */
  10816.    LONG idFirstSegment;    /*first segment identifier                      */
  10817.    LONG idLastSegment;     /*last segment identifier                       */
  10818.  
  10819.    The GpiRemoveDynamics function removes from the display any images drawn
  10820.    using dynamic segments. The function removes the image for any dynamic
  10821.    segment that is in the current picture chain and whose segment identifier
  10822.    is in the range specified by the idFirstSegment and idLastSegment
  10823.    parameters. The function removes only the image drawn using the dynamic
  10824.    segment and by the dynamic segment's segment calls.
  10825.  
  10826.    The GpiRemoveDynamics function checks for the segments specified by
  10827.    idFirstSegment and idLastSegment. If they do not exist, or are not in the
  10828.    chain, or idLastSegment is less than idFirstSegment, the function returns
  10829.    without removing segments and without an error value.
  10830.  
  10831.  Parameters
  10832.  
  10833.    hps  Identifies the presentation space.
  10834.  
  10835.    idFirstSegment  Specifies the name of the first segment in the section. It
  10836.    must be greater than zero.
  10837.  
  10838.    idLastSegment  Specifies the last segment in the section. It must be
  10839.    greater than zero.
  10840.  
  10841.  Return Value
  10842.  
  10843.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  10844.    an error occurred.
  10845.  
  10846.  Errors
  10847.  
  10848.    Use the WinGetLastError function to retrieve the error value, which may be
  10849.    one of the following:
  10850.  
  10851.          PMERR_AREA_INCOMPLETE
  10852.          PMERR_INV_MICROPS_FUNCTION
  10853.          PMERR_INV_SEG_NAME
  10854.          PMERR_PATH_INCOMPLETE
  10855.  
  10856.  Comments
  10857.  
  10858.    An application should remove dynamic segments before associating a new
  10859.    device context with the presentation space.
  10860.  
  10861.  Example
  10862.  
  10863.    This example uses the GpiRemoveDynamics function to remove the image drawn
  10864.    by the dynamic segment whose segment identifier is 4. It then edits the
  10865.    segment and redraws it, using the GpiDrawDynamics function.
  10866.  
  10867.    POINTL ptl = {30, 40};
  10868.  
  10869.    /* Remove the image for dynamic segment #4. */
  10870.  
  10871.    GpiRemoveDynamics(hps, 4L, 4L);
  10872.  
  10873.    /* Edit the segment. */
  10874.  
  10875.    GpiSetDrawingMode(DM_RETAIN);
  10876.    GpiOpenSegment(hps, 4L);
  10877.    GpiSetElementPointer(hps, 1L);
  10878.    GpiMove(hps, &ptl);
  10879.    GpiCloseSegment(hps);
  10880.  
  10881.    GpiDrawDynamics(hps);    /* redraws the edited segment */
  10882.  
  10883.  See Also
  10884.  
  10885.    GpiCloseSegment, GpiDrawDynamics
  10886.  
  10887.  
  10888.  ────────────────────────────────────────────────────────────────────────────
  10889.  GpiResetBoundaryData
  10890.  ────────────────────────────────────────────────────────────────────────────
  10891.    BOOL GpiResetBoundaryData (hps)
  10892.    HPS hps;                /*presentation-space handle                     */
  10893.  
  10894.    The GpiResetBoundaryData function resets the boundary data, copying the
  10895.    maximum boundary value to the lower corner and the minimum boundary value
  10896.    to the upper corner of the boundary-data rectangle.
  10897.  
  10898.    The function is only necessary when accumulating boundary date in DM_DRAW
  10899.    drawing mode. For other drawing modes, drawing functions automatically
  10900.    reset the boundary data. (However, the GpiOpenSegment function does not
  10901.    reset the boundary data.)
  10902.  
  10903.  Parameters
  10904.  
  10905.    hps  Identifies the presentation space.
  10906.  
  10907.  Return Value
  10908.  
  10909.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  10910.    an error occurred.
  10911.  
  10912.  Errors
  10913.  
  10914.    Use the WinGetLastError function to retrieve the error value, which may be
  10915.    the following:
  10916.  
  10917.          PMERR_INV_MICROPS_FUNCTION
  10918.  
  10919.  See Also
  10920.  
  10921.    GpiSetDrawControl
  10922.  
  10923.  
  10924.  ────────────────────────────────────────────────────────────────────────────
  10925.  GpiResetPS
  10926.  ────────────────────────────────────────────────────────────────────────────
  10927.    BOOL GpiResetPS (hps, flOption)
  10928.    HPS hps;                /*presentation-space handle                     */
  10929.    ULONG flOption;         /*reset option                                  */
  10930.  
  10931.    The GpiResetPS function resets the presentation space. In general,
  10932.    resetting the presentation space restores attributes to their default
  10933.    values──that is, the values given to the attributes when the presentation
  10934.    space was created. The function can reset the presentation space in three
  10935.    ways: as if a segment were closed; as if the presentation space had just
  10936.    been created, but without deleting any resources; and as if the
  10937.    presentation space had just been created. It uses the flOption parameter
  10938.    to determine how to reset the presentation space.
  10939.  
  10940.    The GpiResetPS function does not draw or erase the device. It is up to the
  10941.    application to erase the screen, if this is required. Also, the function
  10942.    does not affect the association between the specified presentation space
  10943.    and a device context.
  10944.  
  10945.  Parameters
  10946.  
  10947.    hps  Identifies the presentation space.
  10948.  
  10949.    flOption  Specifies the reset option. It can be one of the following:
  10950.  
  10951.    Value             Meaning
  10952.    ──────────────────────────────────────────────────────────────────────────
  10953.    GRES_ATTRS        Sets all current attributes to their default values, the
  10954.                      current model transform to unity, and the current
  10955.                      position to (0,0). The option also ends any open path,
  10956.                      area, or element brackets and closes any open segment.
  10957.                      Finally, it sets the current clip path and viewing
  10958.                      limits to their widest possible values.
  10959.  
  10960.    GRES_SEGMENTS     Resets as described for GRES_ATTRS, plus it deletes all
  10961.                      retained segments, clears any boundary data, releases
  10962.                      the clip region (if any), enables kerning (if the device
  10963.                      supports it), and sets the default values for initial
  10964.                      segment attributes, default viewing transform, graphics
  10965.                      field, drawing mode, draw controls, edit mode, and
  10966.                      attribute mode.
  10967.  
  10968.    GRES_ALL          Resets as described for GRES_ATTRS and GRES_SEGMENTS,
  10969.                      plus it deletes any logical fonts and local identifiers
  10970.                      for bitmaps and sets the logical color table to its
  10971.                      default value.
  10972.    ──────────────────────────────────────────────────────────────────────────
  10973.  
  10974.  Return Value
  10975.  
  10976.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  10977.    an error occurred.
  10978.  
  10979.  Errors
  10980.  
  10981.    Use the WinGetLastError function to retrieve the error value, which may be
  10982.    the following:
  10983.  
  10984.          PMERR_INV_RESET_OPTIONS
  10985.  
  10986.  See Also
  10987.  
  10988.    GpiAssociate, GpiCreatePS
  10989.  
  10990.  
  10991.  ────────────────────────────────────────────────────────────────────────────
  10992.  GpiRestorePS
  10993.  ────────────────────────────────────────────────────────────────────────────
  10994.    BOOL GpiRestorePS (hps, idPS)
  10995.    HPS hps;                /*presentation-space handle                     */
  10996.    LONG idPS;              /*identifier for the presentation space         */
  10997.  
  10998.    The GpiRestorePS function restores the state of the presentation space by
  10999.    popping the state from the presentation space (PS) stack. The function
  11000.    sets the attributes and resources of the presentation space to the values
  11001.    that were saved previously by using the GpiSavePS function.
  11002.  
  11003.    The PS stack, maintained internally by the system, can contain one or more
  11004.    saved presentation spaces. Each saved presentation space has a unique
  11005.    identifier. The GpiRestorePS function restores a specific presentation
  11006.    space if the idPS parameter contains the corresponding identifier. The
  11007.    function also accepts negative identifiers. In this case, the function
  11008.    uses the absolute value of the identifier to determine how many
  11009.    presentation spaces to pop from the PS stack. For example, if it is -2,
  11010.    the function pops two presentation spaces from the stack. In either case,
  11011.    identifier or negative number, the function discards any presentation
  11012.    spaces that are skipped over on the PS stack.
  11013.  
  11014.  Parameters
  11015.  
  11016.    hps  Identifies the presentation space.
  11017.  
  11018.    idPS  Specifies the identifier of the saved presentation space to restore,
  11019.    or a negative number indicating the number of saved presentation spaces to
  11020.    pop. If it is an identifier, it must have been returned previously by the
  11021.    GpiSavePS function. It must not be zero.
  11022.  
  11023.  Return Value
  11024.  
  11025.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  11026.    an error occurred.
  11027.  
  11028.  Errors
  11029.  
  11030.    Use the WinGetLastError function to retrieve the error value, which may be
  11031.    the following:
  11032.  
  11033.          PMERR_INV_ID
  11034.  
  11035.  Comments
  11036.  
  11037.    The function can be used in an open segment only if the drawing mode is
  11038.    DM_DRAW. The function can also be used in an element, area, or path
  11039.    bracket. If it is in an area or path bracket, the corresponding GpiSavePS
  11040.    function must have been called in the same bracket.
  11041.  
  11042.    If an error occurs, the function leaves the PS stack and the current
  11043.    presentation space unchanged.
  11044.  
  11045.  See Also
  11046.  
  11047.    GpiPop, GpiSavePS, GpiSetDrawingMode
  11048.  
  11049.  ────────────────────────────────────────────────────────────────────────────
  11050.  GpiSaveMetaFile
  11051.  ────────────────────────────────────────────────────────────────────────────
  11052.    BOOL GpiSaveMetaFile (hmf, pszFilename)
  11053.    HMF hmf;                /*metafile handle                               */
  11054.    PSZ pszFilename;        /*pointer to filename                           */
  11055.  
  11056.    The GpiSaveMetaFile function saves a metafile to disk. The function
  11057.    deletes the metafile from memory and invalidates the metafile handle. The
  11058.    application can load the metafile by using the GpiLoadMetaFile function.
  11059.  
  11060.  Parameters
  11061.  
  11062.    hmf  Identifies the metafile.
  11063.  
  11064.    pszFilename  Points to a null-terminated string. This string must be a
  11065.    valid MS OS/2 filename that specifies the path and filename of the file to
  11066.    receive the metafile.
  11067.  
  11068.  Return Value
  11069.  
  11070.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  11071.    an error occurred.
  11072.  
  11073.  See Also
  11074.  
  11075.    GpiLoadMetaFile, GpiPlayMetaFile
  11076.  
  11077.  
  11078.  ────────────────────────────────────────────────────────────────────────────
  11079.  GpiSavePS
  11080.  ────────────────────────────────────────────────────────────────────────────
  11081.    LONG GpiSavePS (hps)
  11082.    HPS hps;                /*presentation-space handle                     */
  11083.  
  11084.    The GpiSavePS function saves the state of the presentation space on the
  11085.    presentation-space (PS) stack. The PS stack is a last-in, first-out stack,
  11086.    maintained by the system, on which an application can save one or more
  11087.    presentation-space states. The function saves the state and returns a
  11088.    unique identifier. The identifier can be used with the GpiRestorePS
  11089.    function to restore the given state.
  11090.  
  11091.    The GpiSavePS function saves the current position of the presentation
  11092.    space, the viewing limits, all attributes, and transformation matrices. It
  11093.    also saves the clip path, clip region, logical color table, and references
  11094.    to any loaded logical fonts and the regions created on the associated
  11095.    device context. It does not save the visible region. The function does not
  11096.    actually copy resources such as logical fonts and regions to the PS stack.
  11097.    Instead, it copies a reference to the resource. The application must
  11098.    ensure that the resources are available when these references are
  11099.    restored.
  11100.  
  11101.  Parameters
  11102.  
  11103.    hps  Identifies the presentation space. If it identifies a micro
  11104.    presentation space, the drawing mode must be DM_DRAW.
  11105.  
  11106.  Return Value
  11107.  
  11108.    The return value is an identifier of the saved presentation space if the
  11109.    function is successful or GPI_ERROR if an error occurred. The identifier
  11110.    is equal to the depth of the saved presentation space on the save/restore
  11111.    stack, with 1 as the base level.
  11112.  
  11113.  Comments
  11114.  
  11115.    The function can be used in an open segment, but only if the drawing mode
  11116.    is DM_DRAW. It can also be used in an element bracket. When it occurs
  11117.    within an open area or path bracket, then the corresponding call to the
  11118.    GpiRestorePS function should take place before the bracket is closed.
  11119.    Although the function can be used when creating a metafile, the drawing
  11120.    mode must be DM_DRAW when replaying the metafile.
  11121.  
  11122.    The PS stack is not the same as the attribute stack (that is, the stack
  11123.    used to save attributes when the attribute mode is AM_PRESERVE).
  11124.  
  11125.  See Also
  11126.  
  11127.    GpiPop, GpiRestorePS, GpiSetDrawingMode
  11128.  
  11129.  
  11130.  ────────────────────────────────────────────────────────────────────────────
  11131.  GpiSetArcParams
  11132.  ────────────────────────────────────────────────────────────────────────────
  11133.    BOOL GpiSetArcParams (hps, parcp)
  11134.    HPS hps;                /*presentation-space handle                     */
  11135.    PARCPARAMS parcp;       /*pointer to structure for arc parameters       */
  11136.  
  11137.    The GpiSetArcParams function sets the current arc parameters. The arc
  11138.    parameters define the shape and orientation of the ellipse used by the
  11139.    GpiPointArc, GpiFullArc, and GpiPartialArc functions to construct arcs.
  11140.  
  11141.    The arc parameters define a four-element transformation that maps the unit
  11142.    circle to the ellipse. The transformation has the form:
  11143.  
  11144.                x' = lP x x + lR x y
  11145.                y' = lS x x + lQ x y
  11146.  
  11147.    In the transformation, lP, lR, lS, and lQ are the fields of the structure
  11148.    pointed to by the parcp parameter. The lP and lQ fields determine the
  11149.    width and height of ellipse, and the lS and lR fields determine the shear
  11150.    of the ellipse.
  11151.  
  11152.    The fields also determine the direction of drawing for arcs drawn using
  11153.    the GpiFullArc and GpiPartialArc functions. If lP x lQ is greater than lR
  11154.    x lS, the direction is counterclockwise. If lP x lQ is less than lR x lS,
  11155.    the direction is clockwise. If lP x lQ is equal to lR x lS, a straight
  11156.    line is drawn.
  11157.  
  11158.    If the attribute mode is AM_PRESERVE, the function saves the previous arc
  11159.    parameters on the attribute stack when it sets the new parameters. The
  11160.    previous arc parameters can be retrieved by using the GpiPop function.
  11161.  
  11162.  Parameters
  11163.  
  11164.    hps  Identifies the presentation space.
  11165.  
  11166.    parcp  Points to an ARCPARAMS structure that contains the arc parameters.
  11167.    The ARCPARAMS structure has the following form:
  11168.  
  11169.    typedef struct _ARCPARAMS {
  11170.        LONG lP;
  11171.        LONG lQ;
  11172.        LONG lR;
  11173.        LONG lS;
  11174.    } ARCPARAMS;
  11175.  
  11176.    For a full description, see Chapter 4, "Types, Macros, Structures."
  11177.  
  11178.  Return Value
  11179.  
  11180.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  11181.    an error occurred.
  11182.  
  11183.  Comments
  11184.  
  11185.    Although the arc parameters define the shape and orientation of arcs drawn
  11186.    by the GpiPointArc, GpiFullArc, and GpiPartialArc functions, the functions
  11187.    define the center point and the size of each arc. The GpiFullArc and
  11188.    GpiPartialArc functions use an explicit center point and a multiplier to
  11189.    scale the ellipse to a desired size. The GpiPointArc function computes the
  11190.    center point and size of the final ellipse so that it fits the given
  11191.    points.
  11192.  
  11193.    Orthogonal transformation provides the most accurate arcs. A
  11194.    transformation is orthogonal if lP x lR plus lS x lQ equals zero. By
  11195.    default, the arc parameters are as follows:
  11196.  
  11197.                lP = 1     lR = 0
  11198.                lS = 0     lQ = 1
  11199.  
  11200.    These values produce a unit circle.
  11201.  
  11202.    Arc-parameter transformation takes place in world coordinates. Any other
  11203.    transformations in force will change the shape of the figure accordingly.
  11204.  
  11205.  See Also
  11206.  
  11207.    GpiFullArc, GpiPartialArc, GpiPointArc, fbGpiQueryArcParams
  11208.  
  11209.  
  11210.  ────────────────────────────────────────────────────────────────────────────
  11211.  GpiSetAttrMode
  11212.  ────────────────────────────────────────────────────────────────────────────
  11213.    BOOL GpiSetAttrMode (hps, cmdMode)
  11214.    HPS hps;                /*presentation-space handle                     */
  11215.    LONG cmdMode;           /*attribute mode                                */
  11216.  
  11217.    The GpiSetAttrMode function sets the current attribute mode. If the
  11218.    attribute mode is AM_PRESERVE, the system saves the old value of a
  11219.    primitive attribute whenever the attribute is changed to a new value. The
  11220.    saved value of an attribute can be restored by using the GpiPop function.
  11221.    Any attributes that have been saved in a called segment are automatically
  11222.    restored on return to the caller.
  11223.  
  11224.  Parameters
  11225.  
  11226.    hps  Identifies the presentation space.
  11227.  
  11228.    cmdMode  Specifies the attribute mode. It can be one of the following
  11229.    values:
  11230.  
  11231.    Value             Meaning
  11232.    ──────────────────────────────────────────────────────────────────────────
  11233.    AM_PRESERVE       Preserve attributes.
  11234.  
  11235.    AM_NOPRESERVE     Do not preserve attributes.
  11236.    ──────────────────────────────────────────────────────────────────────────
  11237.  
  11238.  Return Value
  11239.  
  11240.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  11241.    an error occurred.
  11242.  
  11243.  Errors
  11244.  
  11245.    Use the WinGetLastError function to retrieve the error value, which may be
  11246.    one of the following:
  11247.  
  11248.          PMERR_INV_ATTR_MODE
  11249.          PMERR_INV_MICROPS_FUNCTION
  11250.  
  11251.  Comments
  11252.  
  11253.    The attribute mode is an API mode, meaning it does not affect
  11254.    attribute-setting functions that have been stored in a segment. The mode
  11255.    used for functions stored in a segment is the mode in effect when the
  11256.    function was stored. This is also true for any attribute-setting functions
  11257.    that are part of the graphics-order data in a GpiPutData, GpiElement, or
  11258.    GpiPlayMetaFile function.
  11259.  
  11260.  See Also
  11261.  
  11262.    GpiElement, GpiPlayMetaFile, GpiPop, GpiPutData, GpiSetAttrs,
  11263.    GpiSetColor
  11264.  
  11265.  
  11266.  ────────────────────────────────────────────────────────────────────────────
  11267.  GpiSetAttrs
  11268.  ────────────────────────────────────────────────────────────────────────────
  11269.    BOOL GpiSetAttrs (hps, flPrimType, flAttrsMask, flDefsMask, pbunAttrs)
  11270.    HPS hps;                /*presentation-space handle                     */
  11271.    LONG flPrimType;        /*primitive type                                */
  11272.    ULONG flAttrsMask;      /*attribute mask                                */
  11273.    ULONG flDefsMask;       /*defaults mask                                 */
  11274.    PBUNDLE pbunAttrs;      /*pointer to structure for attributes           */
  11275.  
  11276.    The GpiSetAttrs function sets attributes for the specified primitive type.
  11277.    The function uses the flPrimType parameter to determine the type of
  11278.    primitive attribute to set, then uses the flAttrsMask parameter to
  11279.    determine which attributes to set for that primitive. If the flDefsMask
  11280.    parameter specifies an attribute that is also specified by flAttrsMask,
  11281.    the function sets the attribute to its default value. Otherwise, the
  11282.    function uses the value found in the appropriate field of the buffer
  11283.    pointed to by pbunAttrs.
  11284.  
  11285.    The GpiSetAttrs function does not accept default values in the buffer
  11286.    fields. To set an attribute to its default value, both the flAttrsMask and
  11287.    flDefsMask parameters must specify the attribute. Any attribute not
  11288.    specified by flAttrsMask remains unchanged, regardless of the flDefsMask
  11289.    setting. If the attribute mode is AM_PRESERVE (as set by the
  11290.    GpiSetAttrMode function), the system saves the previous value of each
  11291.    attribute that is changed.
  11292.  
  11293.  Parameters
  11294.  
  11295.    hps  Identifies the presentation space.
  11296.  
  11297.    flPrimType  Specifies which primitive type to set attributes for. It can
  11298.    be one of the following values:
  11299.  
  11300.    Value             Meaning
  11301.    ──────────────────────────────────────────────────────────────────────────
  11302.    PRIM_AREA         Area primitives
  11303.  
  11304.    PRIM_CHAR         Character primitives
  11305.  
  11306.    PRIM_IMAGE        Image primitives
  11307.  
  11308.    PRIM_LINE         Line and arc primitives
  11309.  
  11310.    PRIM_MARKER       Marker primitives
  11311.    ──────────────────────────────────────────────────────────────────────────
  11312.  
  11313.    flAttrsMask  Specifies which attributes to set. The values for this
  11314.    parameter depend on the primitive type specified by flPrimType. It can be
  11315.    any combination of the following values for a specific type:
  11316.  
  11317.    Type                Values
  11318.    ──────────────────────────────────────────────────────────────────────────
  11319.    PRIM_AREA           ABB_COLOR, ABB_BACK_COLOR, ABB_MIX_MODE,
  11320.                        ABB_BACK_MIX_MODE, ABB_SET, ABB_SYMBOL, ABB_REF_POINT
  11321.  
  11322.    PRIM_CHAR           CBB_COLOR, CBB_BACK_COLOR, CBB_MIX_MODE,
  11323.                        CBB_BACK_MIX_MODE, CBB_SET, CBB_MODE, CBB_BOX,
  11324.                        CBB_ANGLE, CBB_SHEAR, CBB_DIRECTION
  11325.  
  11326.    PRIM_IMAGE          IBB_COLOR, IBB_BACK_COLOR, IBB_MIX_MODE,
  11327.                        IBB_BACK_MIX_MODE
  11328.  
  11329.    PRIM_LINE           LBB_COLOR, LBB_MIX_MODE, LBB_WIDTH, LBB_GEOM_WIDTH,
  11330.                        LBB_TYPE, LBB_END, LBB_JOIN
  11331.  
  11332.    PRIM_MARKER         MBB_COLOR, MBB_BACK_COLOR, MBB_MIX_MODE,
  11333.                        MBB_BACK_MIX_MODE, MBB_SET, MBB_SYMBOL, MBB_BOX
  11334.    ──────────────────────────────────────────────────────────────────────────
  11335.  
  11336.    If this parameter is zero, no attributes are set, regardless of the value
  11337.    of the flDefsMask and pbunAttrs parameters.
  11338.  
  11339.    flDefsMask  Specifies which attributes to set to default values. The
  11340.    values for this parameter depend on the primitive type specified by
  11341.    flPrimType. Although it can be any combination of the values specified for
  11342.    the flAttrsMask parameter, only the attributes that are also specified by
  11343.    flAttrsMask are set.
  11344.  
  11345.    pbunAttrs  Points to a buffer that contains attribute values for each
  11346.    attribute specified by flAttrsMask and not also specified by flDefsMask.
  11347.    The buffer format depends on the primitive type specified by flPrimType.
  11348.    The following structures can be used for the specified primitive types:
  11349.  
  11350.    Type                Structure
  11351.    ──────────────────────────────────────────────────────────────────────────
  11352.    PRIM_AREA           AREABUNDLE
  11353.  
  11354.    PRIM_CHAR           CHARBUNDLE
  11355.  
  11356.    PRIM_IMAGE          IMAGEBUNDLE
  11357.  
  11358.    PRIM_LINE           LINEBUNDLE
  11359.  
  11360.    PRIM_MARKER         MARKERBUNDLE
  11361.    ──────────────────────────────────────────────────────────────────────────
  11362.  
  11363.  Return Value
  11364.  
  11365.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  11366.    an error occurred.
  11367.  
  11368.  Errors
  11369.  
  11370.    Use the WinGetLastError function to retrieve the error value, which may be
  11371.    one of the following:
  11372.  
  11373.          PMERR_INV_BACKGROUND_MIX_ATTR
  11374.          PMERR_INV_CHAR_ANGLE_ATTR
  11375.          PMERR_INV_CHAR_DIRECTION_ATTR
  11376.          PMERR_INV_CHAR_MODE_ATTR
  11377.          PMERR_INV_CHAR_SET_ATTR
  11378.          PMERR_INV_CHAR_SHEAR_ATTR
  11379.          PMERR_INV_COLOR_ATTR
  11380.          PMERR_INV_GEOM_LINE_WIDTH_ATTR
  11381.          PMERR_INV_LINE_END_ATTR
  11382.          PMERR_INV_LINE_JOIN_ATTR
  11383.          PMERR_INV_LINE_TYPE_ATTR
  11384.          PMERR_INV_LINE_WIDTH_ATTR
  11385.          PMERR_INV_MARKER_BOX_ATTR
  11386.          PMERR_INV_MARKER_SET_ATTR
  11387.          PMERR_INV_MIX_ATTR
  11388.          PMERR_INV_PATTERN_ATTR
  11389.          PMERR_INV_PATTERN_SET_ATTR
  11390.          PMERR_INV_PRIMITIVE_TYPE
  11391.  
  11392.  See Also
  11393.  
  11394.    GpiQueryAttrs, GpiSetBackMix, GpiSetCharAngle, GpiSetCharBox,
  11395.    GpiSetColor, GpiSetCp, GpiSetLineType, GpiSetLineWidth,
  11396.    GpiSetMarkerBox, GpiSetMarkerSet, GpiSetMix, GpiSetPattern,
  11397.    GpiSetPatternRefPoint, GpiSetPatternSet
  11398.  
  11399.  
  11400.  ────────────────────────────────────────────────────────────────────────────
  11401.  GpiSetBackColor
  11402.  ────────────────────────────────────────────────────────────────────────────
  11403.    BOOL GpiSetBackColor (hps, clr)
  11404.    HPS hps;                /*presentation-space handle                     */
  11405.    LONG clr;               /*background color                              */
  11406.  
  11407.    The GpiSetBackColor function sets the current background color for all
  11408.    primitive types. The background color specifies the color used to fill the
  11409.    background of the primitive, such as the gaps between dashes in a styled
  11410.    line. The function sets the background color to the color specified by
  11411.    clr. The clr parameter is either an RGB color value or a color-index
  11412.    value, depending on the current logical color table. The actual color the
  11413.    clr parameter represents also depends on the current logical color table.
  11414.  
  11415.    If the attribute mode is AM_PRESERVE, the function saves the previous
  11416.    background color on the attribute stack when it sets the new color. The
  11417.    previous background color can be retrieved by using the GpiPop function.
  11418.  
  11419.  Parameters
  11420.  
  11421.    hps  Identifies the presentation space.
  11422.  
  11423.    clr  Specifies the color. The values depend on the current logical color
  11424.    table. If the logical color table has been created using the LCOLF_RGB
  11425.    constant, the values must be RGB color values. Otherwise, the values must
  11426.    be color-index values. If the default logical color table is used, the
  11427.    parameter can be any one of the following standard color-index values:
  11428.  
  11429. ╓┌─┌─────────────────┌───────────────────────────────────────────────────────╖
  11430.    Value             Meaning
  11431.    ──────────────────────────────────────────────────────────────────────────
  11432.    CLR_FALSE         All color planes are zero.
  11433.  
  11434.    CLR_TRUE          All color planes are 1.
  11435.  
  11436.    CLR_DEFAULT       Set to default value; same as zero.
  11437.  
  11438.    CLR_WHITE         White.
  11439.  
  11440.    CLR_BLACK         Black.
  11441.  
  11442.    CLR_BACKGROUND    Reset color (used by the GpiErase function).
  11443.  
  11444.    CLR_BLUE          Blue.
  11445.  
  11446.    CLR_RED           Red.
  11447.    Value             Meaning
  11448.    ──────────────────────────────────────────────────────────────────────────
  11449.   CLR_RED           Red.
  11450.  
  11451.    CLR_PINK          Pink.
  11452.  
  11453.    CLR_GREEN         Green.
  11454.  
  11455.    CLR_CYAN          Cyan.
  11456.  
  11457.    CLR_YELLOW        Yellow.
  11458.  
  11459.    CLR_NEUTRAL       Neutral.
  11460.    ──────────────────────────────────────────────────────────────────────────
  11461.  
  11462.  
  11463.  Return Value
  11464.  
  11465.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  11466.    an error occurred.
  11467.  
  11468.  Errors
  11469.  
  11470.    Use the WinGetLastError function to retrieve the error value, which may be
  11471.    the following:
  11472.  
  11473.          PMERR_INV_BACKGROUND_COL_ATTR
  11474.  
  11475.  Comments
  11476.  
  11477.    The functions that draw primitives use the background-mix mode to combine
  11478.    the background color with colors already on the display surface. If the
  11479.    background-mix mode is BM_LEAVEALONE, the background color is ignored and
  11480.    existing colors remain unchanged.
  11481.  
  11482.  See Also
  11483.  
  11484.    GpiCreateLogColorTable, GpiErase, GpiPop, GpiSetBackMix
  11485.  
  11486.  
  11487.  ────────────────────────────────────────────────────────────────────────────
  11488.  GpiSetBackMix
  11489.  ────────────────────────────────────────────────────────────────────────────
  11490.    BOOL GpiSetBackMix (hps, lMixMode)
  11491.    HPS hps;                /*presentation-space handle                     */
  11492.    LONG lMixMode;          /*background-mix mode                           */
  11493.  
  11494.    The GpiSetBackMix function sets the current background-mix mode for all
  11495.    primitive types. The background-mix mode specifies how the background
  11496.    color is combined with colors in underlying primitives. The available
  11497.    background-mix modes depend on the device associated with the presentation
  11498.    space, but all devices support the BM_LEAVEALONE and BM_OVERPAINT mix
  11499.    modes. If the mix mode specified by lMixMode is not supported, the
  11500.    function uses FM_LEAVEALONE instead. The DevQueryCaps function can be used
  11501.    to determine which mix modes are supported.
  11502.  
  11503.    If the attribute mode is AM_PRESERVE, the function saves the previous
  11504.    background-mix mode on the attribute stack when it sets the new mode. The
  11505.    previous background-mix mode can be retrieved by using the GpiPop
  11506.    function.
  11507.  
  11508.  Parameters
  11509.  
  11510.    hps  Identifies the presentation space.
  11511.  
  11512.    lMixMode  Specifies the background-mix mode. It can be one of the
  11513.    following values:
  11514.  
  11515.    Value             Meaning
  11516.    ──────────────────────────────────────────────────────────────────────────
  11517.    BM_DEFAULT        The default value (BM_LEAVEALONE).
  11518.  
  11519.    BM_LEAVEALONE     The background color is ignored. The existing color
  11520.                      remains unchanged.
  11521.  
  11522.    BM_OR             The individual pel colors are combined using the OR
  11523.                      operator.
  11524.  
  11525.    BM_OVERPAINT      The background color replaces the existing color.
  11526.  
  11527.    BM_XOR            The individual pel colors are combined using the XOR
  11528.                      operator.
  11529.    ──────────────────────────────────────────────────────────────────────────
  11530.  
  11531.  Return Value
  11532.  
  11533.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  11534.    an error occurred.
  11535.  
  11536.  Errors
  11537.  
  11538.    Use the WinGetLastError function to retrieve the error value, which may be
  11539.    the following:
  11540.  
  11541.          PMERR_INV_BACKGROUND_MIX_ATTR
  11542.  
  11543.  Comments
  11544.  
  11545.    The background-mix mode is used when drawing areas, images, markers, and
  11546.    characters. For areas and images, the mix mode applies to pels that are
  11547.    not set by the shading pattern. For markers, the mix mode applies to pels
  11548.    not set by the marker pattern. For characters, the mix mode applies to
  11549.    pels not set by the character pattern.
  11550.  
  11551.  See Also
  11552.  
  11553.    DevQueryCaps, GpiPop, GpiSetBackColor
  11554.  
  11555.  
  11556.  ────────────────────────────────────────────────────────────────────────────
  11557.  GpiSetBitmap
  11558.  ────────────────────────────────────────────────────────────────────────────
  11559.    HBITMAP GpiSetBitmap (hps, hbm)
  11560.    HPS hps;                /*presentation-space handle                     */
  11561.    HBITMAP hbm;            /*bitmap handle                                 */
  11562.  
  11563.    The GpiSetBitmap function sets a bitmap as the current bitmap in a memory
  11564.    device context. The function sets the bitmap specified by hbm. This bitmap
  11565.    must not be set for any other device context and must not be set for area
  11566.    shading. If another bitmap is already set in the device context, the
  11567.    function releases the old bitmap and returns its handle.
  11568.  
  11569.    The specified presentation space must be currently associated with a
  11570.    memory device context. If the bitmap format is not the same as the device
  11571.    context, the bitmap format must be convertible to one supported by the
  11572.    device. This is guaranteed if the bitmap has one of the standard formats.
  11573.  
  11574.  Parameters
  11575.  
  11576.    hps  Identifies the presentation space.
  11577.  
  11578.    hbm  Identifies the bitmap to set. If it is NULL, the function releases
  11579.    the bitmap currently set in the associated device.
  11580.  
  11581.  Return Value
  11582.  
  11583.    The return value is the old bitmap handle, NULL for a null handle, or
  11584.    HBM_ERROR if an error occurred.
  11585.  
  11586.  See Also
  11587.  
  11588.    DevOpenDC, GpiCreateBitmap, GpiLoadBitmap, GpiSetBitmapId
  11589.  
  11590.  
  11591.  ────────────────────────────────────────────────────────────────────────────
  11592.  GpiSetBitmapBits
  11593.  ────────────────────────────────────────────────────────────────────────────
  11594.    LONG GpiSetBitmapBits (hps, iScanStart, cScans, pbBuffer, pbmi)
  11595.    HPS hps;                /*presentation-space handle                     */
  11596.    LONG iScanStart;        /*index of first scan line                      */
  11597.    LONG cScans;            /*number of scan lines                          */
  11598.    PBYTE pbBuffer;         /*pointer to buffer with bitmap data            */
  11599.    PBITMAPINFO pbmi;       /*pointer to structure with bitmap header table */
  11600.  
  11601.    The GpiSetBitmapBits function copies image data to a bitmap from the
  11602.    buffer pointed to by pbBuffer. The function copies the image data to the
  11603.    bitmap currently set for the presentation space. The presentation space
  11604.    must be associated with a memory device context.
  11605.  
  11606.    To copy the image data, the function needs the width and height of the
  11607.    bitmap, the count of planes and adjacent color bits, and the array of RGB
  11608.    color values for the bitmap pels. These values must be specified in the
  11609.    fields of the structure pointed to by pbmi. An application must make sure
  11610.    there is sufficient space in the structure to hold all elements of the
  11611.    array of RGB color values. The number of elements in the array depends on
  11612.    the format of the bitmap.
  11613.  
  11614.    The buffer holding the image data must have sufficient image data to set
  11615.    all pels in the bitmap. The number of bytes for the buffer is equal to the
  11616.    number of scan lines to be copied, multiplied by the width of the bitmap
  11617.    in bytes (multiplied by the number of adjacent color bits and rounded up
  11618.    to the next multiple of 4), multiplied by the number of color planes. If
  11619.    the bitmap width (in bytes) is not an exact multiple of 4, the function
  11620.    discards any extra bits. If the format of the bitmap does not match the
  11621.    device format, the function converts the bitmap. The function can convert
  11622.    standard formats only.
  11623.  
  11624.  Parameters
  11625.  
  11626.    hps  Identifies the presentation space.
  11627.  
  11628.    iScanStart  Specifies the number of the first scan line to copy to the
  11629.    buffer. If it is zero, the function copies the first scan line in the
  11630.    bitmap.
  11631.  
  11632.    cScans  Specifies the number of scan lines to copy.
  11633.  
  11634.    pbBuffer  Points to the buffer that contains the image data for the
  11635.    bitmap.
  11636.  
  11637.    pbmi  Points to the BITMAPINFO structure that contains the bitmap
  11638.    information table. The BITMAPINFO structure has the following form:
  11639.  
  11640.    typedef struct _BITMAPINFO {
  11641.        ULONG  cbFix;
  11642.        USHORT cx;
  11643.        USHORT cy;
  11644.        USHORT cPlanes;
  11645.        USHORT cBitCount;
  11646.        RGB    argbColor[1];
  11647.    } BITMAPINFO;
  11648.  
  11649.    For a full description, see Chapter 4, "Types, Macros, Structures."
  11650.  
  11651.  Return Value
  11652.  
  11653.    The return value is the number of scan lines set, or GPI_ALTERROR if an
  11654.    error occurred.
  11655.  
  11656.  Errors
  11657.  
  11658.    Use the WinGetLastError function to retrieve the error value, which may be
  11659.    one of the following:
  11660.  
  11661.          PMERR_INV_DC_TYPE
  11662.          PMERR_INV_INFO_TABLE
  11663.  
  11664.  See Also
  11665.  
  11666.    GpiAssociate, GpiCreateBitmap, GpiLoadBitmap
  11667.  
  11668.  
  11669.  ────────────────────────────────────────────────────────────────────────────
  11670.  GpiSetBitmapDimension
  11671.  ────────────────────────────────────────────────────────────────────────────
  11672.    BOOL GpiSetBitmapDimension (hbm, psizlBitmap)
  11673.    HBITMAP hbm;            /*bitmap handle                                 */
  11674.    PSIZEL psizlBitmap;     /*pointer to structure with size of bitmap      */
  11675.  
  11676.    The GpiSetBitmapDimension function sets the width and height of a bitmap
  11677.    (in 0.1 millimeter units). Although the system does not use the values set
  11678.    by this function, an application can retrieve the values by using the
  11679.    GpiQueryBitmapDimension function.
  11680.  
  11681.  Parameters
  11682.  
  11683.    hbm  Identifies the bitmap to be set.
  11684.  
  11685.    psizlBitmap  Points to the SIZEL structure that contains the width and
  11686.    height of the bitmap, in 0.1 millimeter units. The SIZEL structure has the
  11687.    following form:
  11688.  
  11689.    typedef struct _SIZEL {
  11690.        LONG cx;
  11691.        LONG cy;
  11692.    } SIZEL;
  11693.  
  11694.    For a full description, see Chapter 4, "Types, Macros, Structures."
  11695.  
  11696.  Return Value
  11697.  
  11698.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  11699.    an error occurred.
  11700.  
  11701.  See Also
  11702.  
  11703.    GpiCreateBitmap, GpiQueryBitmapDimension, GpiQueryBitmapParameters
  11704.  
  11705.  
  11706.  ────────────────────────────────────────────────────────────────────────────
  11707.  GpiSetBitmapId
  11708.  ────────────────────────────────────────────────────────────────────────────
  11709.    BOOL GpiSetBitmapId (hps, hbm, lcid)
  11710.    HPS hps;                /*presentation-space handle                     */
  11711.    HBITMAP hbm;            /*bitmap handle                                 */
  11712.    LONG lcid;              /*local identifier                              */
  11713.  
  11714.    The GpiSetBitmapId function tags the bitmap with the local identifier
  11715.    specified by lcid. The tagged bitmap can subsequently be used for area
  11716.    shading by specifying the local identifier in a call to the
  11717.    GpiSetPatternSet function. The bitmap must have a format supported by the
  11718.    device associated with the presentation space, and it must not be set in
  11719.    any other device.
  11720.  
  11721.    The GpiDeleteSetId function can subsequently be used to release the
  11722.    identifier.
  11723.  
  11724.  Parameters
  11725.  
  11726.    hps  Identifies the presentation space.
  11727.  
  11728.    hbm  Identifies the bitmap to tag.
  11729.  
  11730.    lcid  Specifies the local identifier for the bitmap. It can be any integer
  11731.    in the range 1 through 254 that has not already been used as a bitmap tag
  11732.    or local identifier for a logical font.
  11733.  
  11734.  Return Value
  11735.  
  11736.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  11737.    an error occurred.
  11738.  
  11739.  See Also
  11740.  
  11741.    GpiBitBlt, GpiDeleteSetId, GpiSetBitmap, GpiSetPatternSet
  11742.  
  11743.  
  11744.  ────────────────────────────────────────────────────────────────────────────
  11745.  GpiSetCharAngle
  11746.  ────────────────────────────────────────────────────────────────────────────
  11747.    BOOL GpiSetCharAngle (hps, pgradlAngle)
  11748.    HPS hps;                /*presentation-space handle                     */
  11749.    PGRADIENTL pgradlAngle; /*pointer to structure with baseline angle      */
  11750.  
  11751.    The GpiSetCharAngle function sets the character angle. The character angle
  11752.    specifies the angle at which characters are drawn, relative to the x-axis.
  11753.    The function uses the point specified by the pgradlAngle parameter to
  11754.    compute the character angle. Any characters drawn are set on a baseline
  11755.    that is parallel to a line drawn through the specified point and the
  11756.    origin.
  11757.  
  11758.    If the attribute mode is AM_PRESERVE, the function saves the previous
  11759.    character angle on the attribute stack when it sets the new angle. The
  11760.    previous character angle can be retrieved by using the GpiPop function.
  11761.  
  11762.  Parameters
  11763.  
  11764.    hps  Identifies the presentation space.
  11765.  
  11766.    pgradlAngle  Points to the GRADIENTL structure that contains a point that
  11767.    defines the character angle. If both fields in the structure are zero, the
  11768.    function sets the character angle to the default value. The GRADIENTL
  11769.    structure has the following form:
  11770.  
  11771.    typedef struct _GRADIENTL {
  11772.        LONG x;
  11773.        LONG y;
  11774.    } GRADIENTL;
  11775.  
  11776.    For a full description, see Chapter 4, "Types, Macros, Structures."
  11777.  
  11778.  Return Value
  11779.  
  11780.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  11781.    an error occurred.
  11782.  
  11783.  Errors
  11784.  
  11785.    Use the WinGetLastError function to retrieve the error value, which may be
  11786.    the following:
  11787.  
  11788.          PMERR_INV_CHAR_ANGLE_ATTR
  11789.  
  11790.  Comments
  11791.  
  11792.    The character angle is used only when the character mode is CM_MODE2 or
  11793.    CM_MODE3, as set by the GpiSetCharMode function. In CM_MODE2, the system
  11794.    uses the character angle to compute the position of each character along
  11795.    the baseline. However, when the system draws a character, it places only
  11796.    the lower-left corner of the character box at the computed position. The
  11797.    orientation of the character box remains relative to the x-axis instead of
  11798.    the baseline. In CH_MODE3, the character boxes are rotated to be
  11799.    perpendicular to the character baseline. If the world-coordinate system is
  11800.    such that one x-axis unit is not physically equal to one y-axis unit, a
  11801.    rotated character string appears to be sheared.
  11802.  
  11803.  See Also
  11804.  
  11805.    GpiQueryCharAngle, GpiSetAttrMode, GpiSetAttrs, GpiSetCharMode
  11806.  
  11807.  
  11808.  ────────────────────────────────────────────────────────────────────────────
  11809.  GpiSetCharBox
  11810.  ────────────────────────────────────────────────────────────────────────────
  11811.    BOOL GpiSetCharBox (hps, psizfxBox)
  11812.    HPS hps;                /*presentation-space handle                     */
  11813.    PSIZEF psizfxBox;       /*pointer to structure with character-box size  */
  11814.  
  11815.    The GpiSetCharBox function sets the current character-box attribute to the
  11816.    specified value. The character-box attribute specifies the width and
  11817.    height of the character box. The character box determines the spacing of
  11818.    consecutive characters along the baseline and the orientation of
  11819.    characters relative to the baseline.
  11820.  
  11821.    Both width and height can be positive, negative, or zero. When either
  11822.    value is negative, the spacing occurs in the opposite direction to normal
  11823.    and each character is drawn reflected in character-mode 3. For example, a
  11824.    negative height in the standard direction in mode 3 means that the
  11825.    characters are drawn upside down and the string is drawn below the
  11826.    baseline (assuming no other transformations cause inversion). A zero
  11827.    character width or height is also valid; in this case, the string of
  11828.    characters collapses into a line. If both values are zero, the string is
  11829.    drawn as a single point.
  11830.  
  11831.    If the attribute mode is AM_PRESERVE, the function saves the previous
  11832.    character-box attribute on the attribute stack when it sets the new
  11833.    character box. The previous character-box attribute can be retrieved by
  11834.    using the GpiPop function.
  11835.  
  11836.  Parameters
  11837.  
  11838.    hps  Identifies the presentation space.
  11839.  
  11840.    psizfxBox  Points to a SIZEF structure that contains the width and height
  11841.    of the character box in world coordinates. The SIZEF structure has the
  11842.    following form:
  11843.  
  11844.    typedef struct _SIZEF {
  11845.        FIXED cx;
  11846.        FIXED cy;
  11847.    } SIZEF;
  11848.  
  11849.    For a full description, see Chapter 4, "Types, Macros, Structures."
  11850.  
  11851.  Return Value
  11852.  
  11853.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  11854.    an error occurred.
  11855.  
  11856.  See Also
  11857.  
  11858.    GpiQueryCharBox, GpiSetAttrMode, GpiSetAttrs
  11859.  
  11860.  
  11861.  ────────────────────────────────────────────────────────────────────────────
  11862.  GpiSetCharDirection
  11863.  ────────────────────────────────────────────────────────────────────────────
  11864.    BOOL GpiSetCharDirection (hps, flDirection)
  11865.    HPS hps;                /*presentation-space handle                     */
  11866.    LONG flDirection;       /*character direction                           */
  11867.  
  11868.    The GpiSetCharDirection function sets the character direction for drawing
  11869.    characters. The character direction specifies the direction to advance
  11870.    after drawing a character, relative to the baseline.
  11871.  
  11872.    If the attribute mode is AM_PRESERVE, the function saves the previous
  11873.    character direction on the attribute stack when it sets the new direction.
  11874.    The previous character direction can be retrieved by using the GpiPop
  11875.    function.
  11876.  
  11877.  Parameters
  11878.  
  11879.    hps  Identifies the presentation space.
  11880.  
  11881.    flDirection  Specifies the character direction. If it is CHDIRN_LEFTRIGHT,
  11882.    the character direction is from left to right. If it is CHDIRN_DEFAULT,
  11883.    the function sets the default character direction. The default is from
  11884.    left to right.
  11885.  
  11886.  Return Value
  11887.  
  11888.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  11889.    an error occurred.
  11890.  
  11891.  Errors
  11892.  
  11893.    Use the WinGetLastError function to retrieve the error value, which may be
  11894.    the following:
  11895.  
  11896.          PMERR_INV_CHAR_DIRECTION_ATTR
  11897.  
  11898.  See Also
  11899.  
  11900.    GpiQueryCharDirection, GpiSetAttrMode, GpiSetAttrs
  11901.  
  11902.  
  11903.  ────────────────────────────────────────────────────────────────────────────
  11904.  GpiSetCharMode
  11905.  ────────────────────────────────────────────────────────────────────────────
  11906.    BOOL GpiSetCharMode (hps, flMode)
  11907.    HPS hps;                /*presentation-space handle                     */
  11908.    LONG flMode;            /*character mode                                */
  11909.  
  11910.    The GpiSetCharMode function sets the character mode. The character mode
  11911.    specifies which character attributes to use when drawing characters.
  11912.  
  11913.    If the attribute mode is AM_PRESERVE, the function saves the previous
  11914.    character mode on the attribute stack when it sets the new mode. The
  11915.    previous character mode can be retrieved by using the GpiPop function.
  11916.  
  11917.  Parameters
  11918.  
  11919.    hps  Identifies the presentation space.
  11920.  
  11921.    flMode  Specifies the character mode. It can be one of the following
  11922.    values:
  11923.  
  11924.    Value       Meaning
  11925.    ──────────────────────────────────────────────────────────────────────────
  11926.    CM_DEFAULT  Use the default.
  11927.  
  11928.    CM_MODE1    Use an image font, as determined by the character-set
  11929.                attribute. The positioning of characters is influenced only by
  11930.                the character-direction attribute; other character attributes
  11931.                are ignored.
  11932.  
  11933.    CM_MODE2    Use an image font, as determined by the character-set
  11934.                attribute. The character box, character angle, character
  11935.                direction, character shear, character spacing, character
  11936.                extra, and character break extra values are taken into
  11937.                consideration for positioning successive characters.
  11938.                Individual character definitions are not scaled or rotated.
  11939.  
  11940.    CM_MODE3    Use a vector font, as determined by the character-set
  11941.                attribute. All character attributes are followed exactly for
  11942.                positioning individual characters, scaling, rotating, and
  11943.                shearing.
  11944.    ──────────────────────────────────────────────────────────────────────────
  11945.  
  11946.    If the specified mode is not valid, the default is used.
  11947.  
  11948.  Return Value
  11949.  
  11950.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  11951.    an error occurred.
  11952.  
  11953.  Errors
  11954.  
  11955.    Use the WinGetLastError function to retrieve the error value, which may be
  11956.    the following:
  11957.  
  11958.          PMERR_INV_CHAR_MODE_ATTR
  11959.  
  11960.  See Also
  11961.  
  11962.    GpiQueryAttrMode, GpiSetAttrMode
  11963.  
  11964.  
  11965.  ────────────────────────────────────────────────────────────────────────────
  11966.  GpiSetCharSet
  11967.  ────────────────────────────────────────────────────────────────────────────
  11968.    BOOL GpiSetCharSet (hps, lcid)
  11969.    HPS hps;                /*presentation-space handle                     */
  11970.    LONG lcid;              /*local identifier                              */
  11971.  
  11972.    The GpiSetCharSet function sets the current value of the character-set
  11973.    attribute. The character-set attribute specifies the logical font to use
  11974.    for drawing character strings. The logical font, specified by the lcid
  11975.    parameter, must have been previously created using the GpiCreateLogFont
  11976.    function.
  11977.  
  11978.    If the attribute mode is AM_PRESERVE, the function saves the previous
  11979.    character set on the attribute stack when it sets the new character set.
  11980.    The previous character set can be retrieved by using the GpiPop function.
  11981.  
  11982.  Parameters
  11983.  
  11984.    hps  Identifies the presentation space.
  11985.  
  11986.    lcid  Specifies the local identifier for a logical font. It can be any
  11987.    value in the range 1 through 254 that has been previously set as a local
  11988.    identifier for a logical font. If it is zero, the function sets the
  11989.    character-set attribute to the default character set.
  11990.  
  11991.  Return Value
  11992.  
  11993.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  11994.    an error occurred.
  11995.  
  11996.  Errors
  11997.  
  11998.    Use the WinGetLastError function to retrieve the error value, which may be
  11999.    the following:
  12000.  
  12001.          PMERR_INV_CHAR_SET_ATTR
  12002.  
  12003.  See Also
  12004.  
  12005.    GpiQueryCharSet, GpiSetAttrMode, GpiSetAttrs
  12006.  
  12007.  
  12008.  ────────────────────────────────────────────────────────────────────────────
  12009.  GpiSetCharShear
  12010.  ────────────────────────────────────────────────────────────────────────────
  12011.    BOOL GpiSetCharShear (hps, pptlShear)
  12012.    HPS hps;                /*presentation-space handle                     */
  12013.    PPOINTL pptlShear;      /*pointer to structure with shear angle         */
  12014.  
  12015.    The GpiSetCharShear function sets the character-shear attribute. The
  12016.    character shear specifies how much to shear (tilt) characters from their
  12017.    normal vertical orientation. The function uses the coordinates of the
  12018.    point specified by pptlShear as the end point of a line originating at
  12019.    (0,0). The vertical strokes in subsequent character strings are drawn
  12020.    parallel to the line. The top of the character box remains parallel to the
  12021.    character baseline.
  12022.  
  12023.    The system draws upright characters if pptlShear specifies the point
  12024.    (0,1). This is the default character-shear attribute. If coordinates in
  12025.    the point are both positive or both negative, the characters slope from
  12026.    bottom-left to top-right. If the coordinates have opposite signs (one is
  12027.    positive and one is negative), the characters slope from top-left to
  12028.    bottom-right. Zero should not be used for the y-coordinate since it
  12029.    implies an infinite shear. However, if both coordinates are zero, the
  12030.    attribute is set to the default value.
  12031.  
  12032.    If the attribute mode is AM_PRESERVE, the function saves the previous
  12033.    character-shear attribute on the attribute stack when it sets the new
  12034.    character shear. The previous character-shear attribute can be retrieved
  12035.    by using the GpiPop function.
  12036.  
  12037.  Parameters
  12038.  
  12039.    hps  Identifies the presentation space.
  12040.  
  12041.    pptlShear  Points to a POINTL structure that contains a point that defines
  12042.    the character shear. The POINTL structure has the following form:
  12043.  
  12044.    typedef struct _POINTL  {
  12045.        LONG  x;
  12046.        LONG  y;
  12047.    } POINTL;
  12048.  
  12049.    For a full description, see Chapter 4, "Types, Macros, Structures."
  12050.  
  12051.  Return Value
  12052.  
  12053.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  12054.    an error occurred.
  12055.  
  12056.  Errors
  12057.  
  12058.    Use the WinGetLastError function to retrieve the error value, which may be
  12059.    the following:
  12060.  
  12061.          PMERR_INV_CHAR_SHEAR_ATTR
  12062.  
  12063.  See Also
  12064.  
  12065.    GpiQueryCharShear, GpiSetAttrMode, GpiSetAttrs
  12066.  
  12067.  
  12068.  ────────────────────────────────────────────────────────────────────────────
  12069.  GpiSetClipPath
  12070.  ────────────────────────────────────────────────────────────────────────────
  12071.    BOOL GpiSetClipPath (hps, idPath, cmdOptions)
  12072.    HPS hps;                /*presentation-space handle                     */
  12073.    LONG idPath;            /*clip path identifier                          */
  12074.    LONG cmdOptions;        /*options                                       */
  12075.  
  12076.    The GpiSetClipPath function sets the clip path. The clip path specifies a
  12077.    path in device space that the system uses to clip output. The clip path
  12078.    includes all points inside and on the boundary of the path specified by
  12079.    idPath. Since the path coordinates are assumed to be device coordinates,
  12080.    no conversion is applied.
  12081.  
  12082.    The function creates the clip path by closing any open figures. It then
  12083.    releases any existing clip path (deleting the previous path, if any), and
  12084.    sets the specified path as the clip path. After a path is set as the clip
  12085.    path, it cannot be used again. However, its identifier is free to use for
  12086.    another path.
  12087.  
  12088.  Parameters
  12089.  
  12090.    hps  Identifies the presentation space.
  12091.  
  12092.    idPath  Specifies the identifier of the path to set to the clip path. It
  12093.    can be 1 to specify a path or zero to specify no clip path.
  12094.  
  12095.    cmdOptions  Specifies the filling and combining modes. It can be one or
  12096.    two of the following values:
  12097.  
  12098.    Value         Meaning
  12099.    ──────────────────────────────────────────────────────────────────────────
  12100.    SCP_ALTERNATE Computes the interior of the clip path, using alternate
  12101.                  mode. This is the default if neither SCP_ALTERNATE nor
  12102.                  SCP_WINDING is given.
  12103.  
  12104.    SCP_AND       Intersects the specified path with the current clip path.
  12105.                  This value must be specified if the idPath parameter is 1.
  12106.  
  12107.    SCP_RESET     Resets the clip path, releasing the current clip path if
  12108.                  any. This value must be specified if the idPath parameter is
  12109.                  0. This is the default if neither SCP_AND nor SCP_RESET is
  12110.                  given.
  12111.  
  12112.    SCP_WINDING   Computes the interior of the clip path, using winding mode.
  12113.    ──────────────────────────────────────────────────────────────────────────
  12114.  
  12115.  Return Value
  12116.  
  12117.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  12118.    an error occurred.
  12119.  
  12120.  Errors
  12121.  
  12122.    Use the WinGetLastError function to retrieve the error value, which may be
  12123.    one of the following:
  12124.  
  12125.          PMERR_INV_PATH_ID
  12126.          PMERR_PATH_UNKNOWN
  12127.  
  12128.  Comments
  12129.  
  12130.    Unless the segments in the picture chain have the fast-chaining attribute,
  12131.    the system releases the clip path when it draws each segment. Also, the
  12132.    GpiResetPS function releases the current clip path.
  12133.  
  12134.  See Also
  12135.  
  12136.    GpiBeginArea, GpiQueryClipBox, GpiResetPS
  12137.  
  12138.  
  12139.  ────────────────────────────────────────────────────────────────────────────
  12140.  GpiSetClipRegion
  12141.  ────────────────────────────────────────────────────────────────────────────
  12142.    LONG GpiSetClipRegion (hps, hrgn, phrgn)
  12143.    HPS hps;                /*presentation-space handle                     */
  12144.    HRGN hrgn;              /*region handle                                 */
  12145.    PHRGN phrgn;            /*pointer to variable for previous region       */
  12146.                            /*handle                                        */
  12147.  
  12148.    The GpiSetClipRegion function sets the clip region. The clip region
  12149.    specifies a region in device space that the system uses to clip output.
  12150.    The clip region includes all points inside and on the boundary of the
  12151.    region specified by hrgn. Since the region coordinates are assumed to be
  12152.    device coordinates, no conversion is applied.
  12153.  
  12154.    The function creates the clip region by releasing the previous clip
  12155.    region, copying the handle of this region to the variable pointed to by
  12156.    phrgn, and setting the specified region as the clip region. Once a region
  12157.    is set as the clip region, it cannot be used in subsequent region
  12158.    operations. Once released from the clipping region, a region can be used
  12159.    again to restore the previous clip region.
  12160.  
  12161.  Parameters
  12162.  
  12163.    hps  Identifies the presentation space. The presentation space must be
  12164.    currently associated with the device context for which the specified
  12165.    regions were created.
  12166.  
  12167.    hrgn  Identifies the region. If the hrgn parameter is NULL, the function
  12168.    releases any previous clip region and sets no clip region.
  12169.  
  12170.    phrgn  Points to the variable that receives the handle of the previous
  12171.    region. If no previous clip region exists, the function copies NULL to the
  12172.    variable.
  12173.  
  12174.  Return Value
  12175.  
  12176.    The return value is RGN_NULL, RGN_RECT, or RGN_COMPLEX if the function is
  12177.    successful, or RGN_ERROR if an error occurred.
  12178.  
  12179.  See Also
  12180.  
  12181.    GpiCreateRegion, GpiOffsetClipRegion
  12182.  
  12183.  
  12184.  ────────────────────────────────────────────────────────────────────────────
  12185.  GpiSetColor
  12186.  ────────────────────────────────────────────────────────────────────────────
  12187.    BOOL GpiSetColor (hps, clr)
  12188.    HPS hps;                /*presentation-space handle                     */
  12189.    LONG clr;               /*color value                                   */
  12190.  
  12191.    The GpiSetColor function sets the current foreground color for all
  12192.    primitive types. The foreground color specifies the color used to draw the
  12193.    foreground of the primitive, such as the dashes in a styled line or the
  12194.    diagonal bars in a diagonal shading pattern. The function sets the
  12195.    foreground color to the color specified by clr. The clr parameter is
  12196.    either an RGB color value or a color index value, depending on the current
  12197.    logical color table. The actual color the clr parameter represents also
  12198.    depends on the current logical color table.
  12199.  
  12200.    If the attribute mode is AM_PRESERVE, the function saves the previous
  12201.    foreground color on the attribute stack when it sets the new color. The
  12202.    previous foreground color can be retrieved by using the GpiPop function.
  12203.  
  12204.  Parameters
  12205.  
  12206.    hps  Identifies the presentation space.
  12207.  
  12208.    clr  Specifies the color. The values depend on the current logical color
  12209.    table. If the logical color table has been created using the LCOLF_RGB,
  12210.    the values must be RGB color values. Otherwise, the values must be
  12211.    color-index values. If the default logical color table is used, the
  12212.    parameter can be any one of the following standard color-index values:
  12213.  
  12214. ╓┌─┌─────────────────────┌───────────────────────────────────────────────────╖
  12215.    Value                 Meaning
  12216.    ──────────────────────────────────────────────────────────────────────────
  12217.    CLR_FALSE             All color planes are zeros.
  12218.  
  12219.    CLR_TRUE              All color planes are ones.
  12220.  
  12221.    CLR_DEFAULT           Default value; same as CLR_NEUTRAL.
  12222.  
  12223.    CLR_WHITE             White.
  12224.    Value                 Meaning
  12225.    ──────────────────────────────────────────────────────────────────────────
  12226.   CLR_WHITE             White.
  12227.  
  12228.    CLR_BLACK             Black.
  12229.  
  12230.    CLR_BACKGROUND        Reset color (used by the GpiErase function).
  12231.  
  12232.    CLR_BLUE              Blue.
  12233.  
  12234.    CLR_RED               Red.
  12235.  
  12236.    CLR_PINK              Pink.
  12237.  
  12238.    CLR_GREEN             Green.
  12239.  
  12240.    CLR_CYAN              Cyan.
  12241.  
  12242.    CLR_YELLOW            Yellow.
  12243.  
  12244.    CLR_NEUTRAL           Neutral.
  12245.    Value                 Meaning
  12246.    ──────────────────────────────────────────────────────────────────────────
  12247.   CLR_NEUTRAL           Neutral.
  12248.  
  12249.    CLR_DARKGRAY          Dark gray.
  12250.  
  12251.    CLR_DARKBLUE          Dark blue.
  12252.  
  12253.    CLR_DARKRED           Dark red.
  12254.  
  12255.    CLR_DARKPINK          Dark pink.
  12256.  
  12257.    CLR_DARKGREEN         Dark green.
  12258.  
  12259.    CLR_DARKCYAN          Dark cyan.
  12260.  
  12261.    CLR_BROWN             Brown.
  12262.  
  12263.    CLR_PALEGRAY          Light gray.
  12264.    ──────────────────────────────────────────────────────────────────────────
  12265.  
  12266.    Value                 Meaning
  12267.    ──────────────────────────────────────────────────────────────────────────
  12268. 
  12269.  
  12270.  Return Value
  12271.  
  12272.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  12273.    an error occurred.
  12274.  
  12275.  Errors
  12276.  
  12277.    Use the WinGetLastError function to retrieve the error value, which may be
  12278.    the following:
  12279.  
  12280.          PMERR_INV_COLOR_ATTR
  12281.  
  12282.  Comments
  12283.  
  12284.    The CLR_BACKGROUND color for the default logical color table is the
  12285.    natural background color for the device (for example, the paper color for
  12286.    a printer). For the display, the CLR_BACKGROUND color is the default
  12287.    window color as set by the WinSetSysColors function. The CLR_NEUTRAL color
  12288.    for the default logical color table is a device-dependent color that
  12289.    provides a contrasting color to CLR_BACKGROUND (for example, it is the ink
  12290.    color for a one-color printer). For the display, it is the default
  12291.    window-text color.
  12292.  
  12293.  See Also
  12294.  
  12295.    GpiErase, GpiPop, GpiQueryAttrs, GpiQueryColor, GpiSetAttrMode,
  12296.    GpiSetAttrs, GpiSetMix WinSetSysColors
  12297.  
  12298.  
  12299.  ────────────────────────────────────────────────────────────────────────────
  12300.  GpiSetCp
  12301.  ────────────────────────────────────────────────────────────────────────────
  12302.    BOOL GpiSetCp (hps, idcp)
  12303.    HPS hps;                /*presentation-space handle                     */
  12304.    USHORT idcp;            /*code-page identifier                          */
  12305.  
  12306.    The GpiSetCp function selects the code-page identifier to be used for
  12307.    graphics characters for the default character set.
  12308.  
  12309.    When a presentation space is first created, the code page used is the one
  12310.    defined by the process code page, as set by the DosSetProcCp function.
  12311.  
  12312.  Parameters
  12313.  
  12314.    hps  Identifies the presentation space.
  12315.  
  12316.    idcp  Specifies the code-page identifier. The WinQueryCpList function can
  12317.    be used to find which code pages are available.
  12318.  
  12319.  Return Value
  12320.  
  12321.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  12322.    an error occurred.
  12323.  
  12324.  Errors
  12325.  
  12326.    Use the WinGetLastError function to retrieve the error value, which may be
  12327.    the following:
  12328.  
  12329.          PMERR_INV_CODEPAGE
  12330.  
  12331.  See Also
  12332.  
  12333.    DosSetProcCp, GpiQueryCp, WinQueryCpList
  12334.  
  12335.  
  12336.  ────────────────────────────────────────────────────────────────────────────
  12337.  GpiSetCurrentPosition
  12338.  ────────────────────────────────────────────────────────────────────────────
  12339.    BOOL GpiSetCurrentPosition (hps, pptl)
  12340.    HPS hps;                /*presentation-space handle                     */
  12341.    PPOINTL pptl;           /*pointer to structure with new position        */
  12342.  
  12343.    The GpiSetCurrentPosition function sets the current position to the
  12344.    specified point. When used in an area bracket, the function closes the
  12345.    current open figure (if any) and marks the start of a new figure.
  12346.  
  12347.    This function is equivalent to the GpiMove function, except that, if the
  12348.    current attribute mode is AM_PRESERVE (see the GpiSetAttrMode function),
  12349.    the function saves the current position before setting it to the new
  12350.    value. It can be restored by using the GpiPop function.
  12351.  
  12352.  Parameters
  12353.  
  12354.    hps  Identifies the presentation space.
  12355.  
  12356.    pptl  Points to the POINTL structure that contains the new value of the
  12357.    current position. The POINTL structure has the following form:
  12358.  
  12359.    typedef struct _POINTL  {
  12360.        LONG  x;
  12361.        LONG  y;
  12362.    } POINTL;
  12363.  
  12364.    For a full description, see Chapter 4, "Types, Macros, Structures."
  12365.  
  12366.  Return Value
  12367.  
  12368.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  12369.    an error occurred.
  12370.  
  12371.  See Also
  12372.  
  12373.    GpiMove, GpiPop, GpiQueryCurrentPosition, GpiSetAttrMode
  12374.  
  12375.  
  12376.  ────────────────────────────────────────────────────────────────────────────
  12377.  GpiSetDefaultViewMatrix
  12378.  ────────────────────────────────────────────────────────────────────────────
  12379.    BOOL GpiSetDefaultViewMatrix (hps, cElements, pmatlf, flType)
  12380.    HPS hps;                /*presentation-space handle                     */
  12381.    LONG cElements;         /*number of elements                            */
  12382.    PMATRIXLF pmatlf;       /*pointer to structure with transform matrix    */
  12383.    LONG flType;            /*transformation type                           */
  12384.  
  12385.    The GpiSetDefaultViewMatrix function sets the default viewing
  12386.    transformation. The function sets the transformation by adding or
  12387.    replacing the existing transformation matrix with the matrix pointed to by
  12388.    the pmatlf parameter. The function adds, preempts, or replaces the
  12389.    existing transformation matrix as specified by the flType parameter.
  12390.  
  12391.    The GpiSetDefaultViewMatrix function requires a nine-element matrix to set
  12392.    the default viewing transformation. If the specified matrix does not
  12393.    contain nine elements, the function uses the corresponding elements of the
  12394.    identity matrix for each unspecified element. The cElements parameter
  12395.    specifies the number of elements in the matrix. If this parameter equals
  12396.    zero, the identity matrix is used.
  12397.  
  12398.  Parameters
  12399.  
  12400.    hps  Identifies the presentation space.
  12401.  
  12402.    cElements  Specifies the number of elements in the matrix to set. It can
  12403.    be any integer in the range 0 to 9.
  12404.  
  12405.    pmatlf  Points to a MATRIXLF structure that contains the transformation
  12406.    matrix. The MATRIXLF structure has the following form:
  12407.  
  12408.    typedef struct _MATRIXLF {
  12409.        FIXED fxM11;
  12410.        FIXED fxM12;
  12411.        LONG  lM13;
  12412.        FIXED fxM21;
  12413.        FIXED fxM22;
  12414.        LONG  lM23;
  12415.        LONG  lM31;
  12416.        LONG  lM32;
  12417.        LONG  lM33;
  12418.    } MATRIXLF;
  12419.  
  12420.    For a full description, see Chapter 4, "Types, Macros, Structures."
  12421.  
  12422.    flType  Specifies how a specified transformation matrix should be used to
  12423.    modify the default viewing transformation. It can be one of the following
  12424.    values:
  12425.  
  12426.    Value                 Meaning
  12427.    ──────────────────────────────────────────────────────────────────────────
  12428.    TRANSFORM_ADD         Additive. The specified transformation matrix is
  12429.                          combined with the existing default viewing
  12430.                          transformation, in the order of the existing
  12431.                          transformation first, the new transformation second.
  12432.                          This option is useful for incremental updates to
  12433.                          transformations.
  12434.  
  12435.    TRANSFORM_PREEMPT     Preemptive. The specified transformation matrix is
  12436.                          combined with the existing default viewing
  12437.                          transformation, in the order of the new
  12438.                          transformation first, the existing transformation
  12439.                          second.
  12440.  
  12441.    TRANSFORM_REPLACE     New/replace. The previous default viewing
  12442.                          transformation is discarded and replaced by the
  12443.                          specified transformation matrix.
  12444.    ──────────────────────────────────────────────────────────────────────────
  12445.  
  12446.  Return Value
  12447.  
  12448.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  12449.    an error occurred.
  12450.  
  12451.  Errors
  12452.  
  12453.    Use the WinGetLastError function to retrieve the error value, which may be
  12454.    the following:
  12455.  
  12456.          PMERR_INV_TRANSFORM_TYPE
  12457.  
  12458.  See Also
  12459.  
  12460.    GpiQueryDefaultViewMatrix
  12461.  
  12462.  
  12463.  ────────────────────────────────────────────────────────────────────────────
  12464.  GpiSetDrawControl
  12465.  ────────────────────────────────────────────────────────────────────────────
  12466.    BOOL GpiSetDrawControl (hps, lControl, flDraw)
  12467.    HPS hps;                /*presentation-space handle                     */
  12468.    LONG lControl;          /*draw control to change                        */
  12469.    LONG flDraw;            /*drawing flag                                  */
  12470.  
  12471.    The GpiSetDrawControl function sets the current draw controls. The draw
  12472.    controls specify whether the system carries out certain actions, such as
  12473.    accumulating boundary data, when the application draws. The function sets
  12474.    the draw control specified by the lControl parameter by turning it on or
  12475.    off as specified by the flDraw parameter. By default, all draw controls
  12476.    except DCTL_DISPLAY are off.
  12477.  
  12478.    The function cannot be used in an open segment or in an area, path, or
  12479.    element bracket.
  12480.  
  12481.  Parameters
  12482.  
  12483.    hps  Identifies the presentation space.
  12484.  
  12485.    lControl  Specifies the draw control to set. It can be one of the
  12486.    following values:
  12487.  
  12488. ╓┌─┌─────────────────────┌───────────────────────────────────────────────────╖
  12489.    Value                 Meaning
  12490.    ──────────────────────────────────────────────────────────────────────────
  12491.    DCTL_BOUNDARY         Accumulate boundary data. During any output
  12492.                          operations except GpiErase, accumulate the bounding
  12493.                          rectangle of the drawing. This control can be used
  12494.                          with a micro presentation space.
  12495.  
  12496.    DCTL_CORRELATE        Correlate the GpiPutData, GpiElement, and primitive
  12497.    Value                 Meaning
  12498.    ──────────────────────────────────────────────────────────────────────────
  12499.   DCTL_CORRELATE        Correlate the GpiPutData, GpiElement, and primitive
  12500.                          functions. This control causes these functions to
  12501.                          return GPI_HITS if the drawing intersects with the
  12502.                          pick aperture. This control applies only to
  12503.                          drawing functions used when the drawing mode is
  12504.                          DM_DRAW or DM_DRAWANDRETAIN. Also, it does not
  12505.                          effect execution of functions stored in a segment.
  12506.                          This control can be used with a micro presentation
  12507.                          space.
  12508.  
  12509.    DCTL_DISPLAY          Allow drawing to occur on the device. If this
  12510.                          control is off, no output, other than output for
  12511.                          GpiErase, appears on the device associated with the
  12512.                          presentation space. This control can be used with a
  12513.                          micro presentation space.
  12514.  
  12515.    DCTL_DYNAMIC          Draw dynamic segments. This control causes the
  12516.                          GpiDrawChain, GpiDrawFrom, and GpiDrawSegment
  12517.                          functions to call the GpiRemoveDynamics function
  12518.    Value                 Meaning
  12519.    ──────────────────────────────────────────────────────────────────────────
  12520.                         functions to call the GpiRemoveDynamics function
  12521.                          before drawing and the GpiDrawDynamics function
  12522.                          after drawing. The effect is to update the dynamic
  12523.                          segments each time the picture chain or a segment is
  12524.                          drawn.
  12525.  
  12526.    DCTL_ERASE            Erasing before drawing. This control causes the
  12527.                          GpiDrawChain, GpiDrawFrom, and GpiDrawSegment
  12528.                          functions to call the GpiErase function before
  12529.                          drawing.
  12530.    ──────────────────────────────────────────────────────────────────────────
  12531.  
  12532.  
  12533.    flDraw  Specifies whether to turn a draw control on or off. It can be one
  12534.    of the following values:
  12535.  
  12536.    Value         Meaning
  12537.    ──────────────────────────────────────────────────────────────────────────
  12538.    DCTL_OFF      Set control off.
  12539.  
  12540.    DCTL_ON       Set control on.
  12541.    ──────────────────────────────────────────────────────────────────────────
  12542.  
  12543.  Return Value
  12544.  
  12545.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  12546.    an error occurred.
  12547.  
  12548.  Errors
  12549.  
  12550.    Use the WinGetLastError function to retrieve the error value, which may be
  12551.    one of the following:
  12552.  
  12553.          PMERR_INV_DRAW_CONTROL
  12554.          PMERR_INV_DRAW_VALUE
  12555.          PMERR_INV_MICROPS_FUNCTION
  12556.  
  12557.  See Also
  12558.  
  12559.    GpiDrawChain, GpiDrawDynamics, GpiDrawFrom, GpiDrawSegment,
  12560.    GpiElement, GpiErase, GpiPutData, GpiQueryDrawControl,
  12561.    GpiRemoveDynamics
  12562.  
  12563.  
  12564.  ────────────────────────────────────────────────────────────────────────────
  12565.  GpiSetDrawingMode
  12566.  ────────────────────────────────────────────────────────────────────────────
  12567.    BOOL GpiSetDrawingMode (hps, flMode)
  12568.    HPS hps;                /*presentation-space handle                     */
  12569.    LONG flMode;            /*drawing mode                                  */
  12570.  
  12571.    The GpiSetDrawingMode function sets the drawing mode. The drawing mode
  12572.    affects all subsequent drawing and attribute functions, including the
  12573.    GpiPutData function, that occur in open chained segments. The drawing mode
  12574.    specifies whether the functions are drawn, retained, or drawn and
  12575.    retained.
  12576.  
  12577.    The drawing mode does not affect the functions in unchained segments or
  12578.    outside of segments. For chained segments, the system stores the functions
  12579.    if the DM_RETAIN or DM_DRAWANDRETAIN mode is set. If the DM_DRAWANDRETAIN
  12580.    mode is set, the system draws as well as stores the functions. If the mode
  12581.    is DM_DRAW, the functions draw only. For unchained segments, drawing and
  12582.    attribute functions are always retained regardless of the drawing mode.
  12583.    Outside of segments, the functions draw only.
  12584.  
  12585.    The function cannot be used in an open segment or in an area, path, or
  12586.    element bracket.
  12587.  
  12588.  Parameters
  12589.  
  12590.    hps  Identifies the presentation space.
  12591.  
  12592.    flMode  Specifies the mode used for subsequent drawing and attribute
  12593.    functions. It can be one of the following values:
  12594.  
  12595.    Value                Meaning
  12596.    ──────────────────────────────────────────────────────────────────────────
  12597.    DM_DRAW              Draw only.
  12598.  
  12599.    DM_RETAIN            Retain only.
  12600.  
  12601.    DM_DRAWANDRETAIN     Draw and retain.
  12602.    ──────────────────────────────────────────────────────────────────────────
  12603.  
  12604.  Return Value
  12605.  
  12606.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  12607.    an error occurred.
  12608.  
  12609.  Errors
  12610.  
  12611.    Use the WinGetLastError function to retrieve the error value, which may be
  12612.    one of the following:
  12613.  
  12614.          PMERR_INV_DRAWING_MODE
  12615.          PMERR_INV_MICROPS_FUNCTION
  12616.  
  12617.  See Also
  12618.  
  12619.    GpiCloseSegment, GpiOpenSegment, GpiPutData, GpiQueryDrawingMode
  12620.  
  12621.  
  12622.  ────────────────────────────────────────────────────────────────────────────
  12623.  GpiSetEditMode
  12624.  ────────────────────────────────────────────────────────────────────────────
  12625.    BOOL GpiSetEditMode (hps, flEditMode)
  12626.    HPS hps;                /*presentation-space handle                     */
  12627.    LONG flEditMode;        /*editing mode                                  */
  12628.  
  12629.    The GpiSetEditMode function sets the current editing mode. The editing
  12630.    mode specifies whether new elements added to a retained segment are
  12631.    inserted into the segment or whether they replace existing elements. The
  12632.    default editing mode (set by the GpiCreatePS or GpiResetPS function) is
  12633.    insert.
  12634.  
  12635.    Although the editing mode applies to retained segments only, the
  12636.    GpiSetEditMode function can be used to change the editing mode at any
  12637.    time, regardless of the drawing mode. However, the function cannot be used
  12638.    in an element bracket.
  12639.  
  12640.  Parameters
  12641.  
  12642.    hps  Identifies the presentation space.
  12643.  
  12644.    flEditMode  Specifies the editing mode. It can be one of the following
  12645.    values:
  12646.  
  12647.    Value             Meaning
  12648.    ──────────────────────────────────────────────────────────────────────────
  12649.    SEGEM_INSERT      Insert. The system inserts a new element after the
  12650.                      element pointed to by the element pointer. The element
  12651.                      pointer is updated to point to the new element.
  12652.  
  12653.    SEGEM_REPLACE     Replace. The system replaces the element pointed by the
  12654.                      element pointer. The element pointer does not change.
  12655.    ──────────────────────────────────────────────────────────────────────────
  12656.  
  12657.  Return Value
  12658.  
  12659.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  12660.    an error occurred.
  12661.  
  12662.  Errors
  12663.  
  12664.    Use the WinGetLastError function to retrieve the error value, which may be
  12665.    one of the following:
  12666.  
  12667.          PMERR_INV_EDIT_MODE
  12668.          PMERR_INV_MICROPS_FUNCTION
  12669.  
  12670.  See Also
  12671.  
  12672.    GpiCreatePS, GpiQueryEditMode, GpiResetPS,
  12673.    GpiSetElementPointerAtLabel
  12674.  
  12675.  
  12676.  ────────────────────────────────────────────────────────────────────────────
  12677.  GpiSetElementPointer
  12678.  ────────────────────────────────────────────────────────────────────────────
  12679.    BOOL GpiSetElementPointer (hps, idElement)
  12680.    HPS hps;                /*presentation-space handle                     */
  12681.    LONG idElement;         /*element number                                */
  12682.  
  12683.    The GpiSetElementPointer function moves the element pointer to the element
  12684.    specified by idElement. The function uses idElement as the number of
  12685.    elements to move from the beginning of the segment to reach the new
  12686.    element.
  12687.  
  12688.    The function can be used only in an open segment and only with DM_RETAIN
  12689.    as the drawing mode. The function cannot be used in an element bracket.
  12690.  
  12691.  Parameters
  12692.  
  12693.    hps  Identifies the presentation space.
  12694.  
  12695.    idElement  Specifies the element number. If the element number is
  12696.    negative, the element pointer is set to zero. If the value is greater than
  12697.    the number of elements in the segment, the element pointer is set to the
  12698.    last element.
  12699.  
  12700.  Return Value
  12701.  
  12702.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  12703.    an error occurred.
  12704.  
  12705.  Errors
  12706.  
  12707.    Use the WinGetLastError function to retrieve the error value, which may be
  12708.    one of the following:
  12709.  
  12710.          PMERR_INV_MICROPS_FUNCTION
  12711.          PMERR_NOT_IN_RETAIN_MODE
  12712.  
  12713.  See Also
  12714.  
  12715.    GpiQueryElementPointer
  12716.  
  12717.  
  12718.  ────────────────────────────────────────────────────────────────────────────
  12719.  GpiSetElementPointerAtLabel
  12720.  ────────────────────────────────────────────────────────────────────────────
  12721.    BOOL GpiSetElementPointerAtLabel (hps, idLabel)
  12722.    HPS hps;                /*presentation-space handle                     */
  12723.    LONG idLabel;           /*label identifier                              */
  12724.  
  12725.    The GpiSetElementPointerAtLabel function moves the element pointer to the
  12726.    element containing the specified label. The function starts the search at
  12727.    the next element after the current element-pointer position. If the
  12728.    function does not find the label before reaching the end of the segment,
  12729.    the function leaves the element pointer unchanged and returns an error.
  12730.  
  12731.    The function can be used only in an open segment and only with DM_RETAIN
  12732.    drawing mode. The function cannot be used in an element bracket.
  12733.  
  12734.  Parameters
  12735.  
  12736.    hps  Identifies the presentation space.
  12737.  
  12738.    idLabel  Specifies the label.
  12739.  
  12740.  Return Value
  12741.  
  12742.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  12743.    an error occurred.
  12744.  
  12745.  Errors
  12746.  
  12747.    Use the WinGetLastError function to retrieve the error value, which may be
  12748.    one of the following:
  12749.  
  12750.          PMERR_INV_MICROPS_FUNCTION
  12751.          PMERR_LABEL_NOT_FOUND
  12752.          PMERR_NOT_IN_RETAIN_MODE
  12753.  
  12754.  See Also
  12755.  
  12756.    GpiLabel, GpiQueryElementPointer
  12757.  
  12758.  
  12759.  ────────────────────────────────────────────────────────────────────────────
  12760.  GpiSetGraphicsField
  12761.  ────────────────────────────────────────────────────────────────────────────
  12762.    BOOL GpiSetGraphicsField (hps, prclField)
  12763.    HPS hps;                /*presentation-space handle                     */
  12764.    PRECTL prclField;       /*pointer to structure with field               */
  12765.  
  12766.    The GpiSetGraphicsField function sets the size and position of the
  12767.    graphics field in presentation-page units. The graphics field defines the
  12768.    rectangle in the presentation page to clip. Any output outside the
  12769.    graphics field is not drawn on the device.
  12770.  
  12771.    The graphics field includes all points in the rectangle interior and all
  12772.    points on the lower and left edges, but not the points on the upper and
  12773.    right edges. Initially, the graphics field has the same size as the page
  12774.    space. The units for the graphics field are not affected by any
  12775.    transformation except the final device transformation.
  12776.  
  12777.  Parameters
  12778.  
  12779.    hps  Identifies the presentation space.
  12780.  
  12781.    prclField  Points to a RECTL structure containing the graphics field. It
  12782.    is an error if the top coordinate is less than the bottom, or the right
  12783.    coordinate less than the left. All values must be presentation-page units.
  12784.    The RECTL structure has the following form:
  12785.  
  12786.    typedef struct _RECTL {
  12787.        LONG  xLeft;
  12788.        LONG  yBottom;
  12789.        LONG  xRight;
  12790.        LONG  yTop;
  12791.    } RECTL;
  12792.  
  12793.    For a full description, see Chapter 4, "Types, Macros, Structures."
  12794.  
  12795.  Return Value
  12796.  
  12797.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  12798.    an error occurred.
  12799.  
  12800.  See Also
  12801.  
  12802.    GpiQueryGraphicsField
  12803.  
  12804.  
  12805.  ────────────────────────────────────────────────────────────────────────────
  12806.  GpiSetInitialSegmentAttrs
  12807.  ────────────────────────────────────────────────────────────────────────────
  12808.    BOOL GpiSetInitialSegmentAttrs (hps, flAttribute, flAttrFlag)
  12809.    HPS hps;                /*presentation-space handle                     */
  12810.    LONG flAttribute;       /*attribute type                                */
  12811.    LONG flAttrFlag;        /*attribute on/off flag                         */
  12812.  
  12813.    The GpiSetInitialSegmentAttrs function sets the initial segment
  12814.    attributes. The system applies these attributes to each new segment as it
  12815.    is created. The function can change these attributes, one at a time, by
  12816.    turning them on or off.
  12817.  
  12818.    When the presentation space is first created, the initial segment
  12819.    attributes create visible, chained, dynamic, and fast-chaining segments
  12820.    that propagate visibility and detectability, even though they are not
  12821.    detectable. These attribute have no effect on primitives outside of
  12822.    segments.
  12823.  
  12824.  Parameters
  12825.  
  12826.    hps  Identifies the presentation space.
  12827.  
  12828.    flAttribute  Specifies the segment attribute to change. It can be one of
  12829.    the following values:
  12830.  
  12831. ╓┌─┌─────────────────────┌───────────────────────────────────────────────────╖
  12832.    Value                 Meaning
  12833.    Value                 Meaning
  12834.    ──────────────────────────────────────────────────────────────────────────
  12835.    ATTR_CHAINED          Adds the segment to the picture chain. If this
  12836.                          attribute is off, a new segment is an unchained
  12837.                          segment. Although unchained segments can be drawn
  12838.                          individually, they cannot be added to the picture
  12839.                          chain. (However, they can be called from a segment
  12840.                          in the picture chain.)
  12841.  
  12842.    ATTR_DETECTABLE       Enables correlation for the segment. If this
  12843.                          attribute is on, the GpiCorrelateChain,
  12844.                          GpiCorrelateFrom, and GpiCorrelateSegment functions
  12845.                          can be used to correlate each new segment.
  12846.  
  12847.    ATTR_DYNAMIC          Creates a dynamic segment. Dynamic segments are
  12848.                          designed to be rapidly updated without affecting
  12849.                          other segments in the picture chain. The system
  12850.                          draws dynamic segments using the exclusive-OR
  12851.                          operator. This lets the segments be erased. Only
  12852.                          retained segments can be dynamic.
  12853.  
  12854.    Value                 Meaning
  12855.    ──────────────────────────────────────────────────────────────────────────
  12856. 
  12857.    ATTR_FASTCHAIN        Relaxes the automatic reset of primitive attributes
  12858.                          for the segment. If this attribute is off, the
  12859.                          system resets all primitive attributes just before a
  12860.                          segment in the picture chain is drawn.
  12861.  
  12862.    ATTR_PROP_DETECTABLE  Forces all segments beneath the segment to inherit
  12863.                          the detectable attribute. If this attribute is on,
  12864.                          all segments called by the segment can be
  12865.                          correlated.
  12866.  
  12867.    ATTR_PROP_VISIBLE     Forces all segments beneath the segment to be
  12868.                          visible. The visibility lasts only as long as the
  12869.                          segment is called by the segment with this attribute
  12870.                          on.
  12871.  
  12872.    ATTR_VISIBLE          Makes the segment visible. The attribute lets the
  12873.                          system draw the segment on the output device.
  12874.    ──────────────────────────────────────────────────────────────────────────
  12875.    Value                 Meaning
  12876.    ──────────────────────────────────────────────────────────────────────────
  12877.   ──────────────────────────────────────────────────────────────────────────
  12878.  
  12879.  
  12880.    flAttrFlag  Specifies whether to turn the attribute on or off. If it is
  12881.    ATTR_ON, the function turns the attribute on. If it is ATTR_OFF, the
  12882.    function turns the attribute off.
  12883.  
  12884.  Return Value
  12885.  
  12886.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  12887.    an error occurred.
  12888.  
  12889.  Errors
  12890.  
  12891.    Use the WinGetLastError function to retrieve the error value, which may be
  12892.    one of the following:
  12893.  
  12894.          PMERR_INV_MICROPS_FUNCTION
  12895.          PMERR_INV_SEG_ATTR
  12896.  
  12897.  See Also
  12898.  
  12899.    GpiCorrelateChain, GpiCorrelateFrom, GpiCorrelateSegment,
  12900.    GpiOpenSegment, GpiSetDrawControl, GpiSetDrawingMode
  12901.  
  12902.  
  12903.  ────────────────────────────────────────────────────────────────────────────
  12904.  GpiSetLineEnd
  12905.  ────────────────────────────────────────────────────────────────────────────
  12906.    BOOL GpiSetLineEnd (hps, lLineEnd)
  12907.    HPS hps;                /*presentation-space handle                     */
  12908.    LONG lLineEnd;          /*line end                                      */
  12909.  
  12910.    The GpiSetLineEnd function sets the current line-end attribute. The
  12911.    line-end attribute specifies the shape of the ends of lines drawn by the
  12912.    GpiStrokePath function or by the GpiModifyPath and GpiFillPath function
  12913.    pair.
  12914.  
  12915.    If the attribute mode is AM_PRESERVE, the function saves the previous
  12916.    line-end attribute on the attribute stack when it sets the new line end.
  12917.    The previous line-end attribute can be retrieved by using the GpiPop
  12918.    function.
  12919.  
  12920.  Parameters
  12921.  
  12922.    hps  Identifies a presentation space.
  12923.  
  12924.    lLineEnd  Specifies the line end. It may be one of the following values:
  12925.  
  12926.    Value             Meaning
  12927.    ──────────────────────────────────────────────────────────────────────────
  12928.    LINEEND_DEFAULT   Use default.
  12929.  
  12930.    LINEEND_FLAT      Flat. The line is ended at the end point of the original
  12931.                      path.
  12932.  
  12933.    LINEEND_ROUND     Round. The line is ended as if a circle having a
  12934.                      diameter equal to the line width is drawn centered on
  12935.                      the end point of the original path.
  12936.  
  12937.    LINEEND_SQUARE    Square. The line is ended as if a square having the same
  12938.                      width as the line is drawn centered on the end point of
  12939.                      the original path.
  12940.    ──────────────────────────────────────────────────────────────────────────
  12941.  
  12942.  Return Value
  12943.  
  12944.    The return value is TRUE if the function is successful. Otherwise, it is
  12945.    FALSE, indicating that an error occurred.
  12946.  
  12947.    Use the WinGetLastError function to retrieve the error value, which may be
  12948.    the following:
  12949.  
  12950.          PMERR_INV_LINE_END_ATTR
  12951.  
  12952.  See Also
  12953.  
  12954.    GpiFillPath, GpiModifyPath, GpiPop, GpiQueryAttrs, GpiQueryLineEnd,
  12955.    GpiSetAttrMode
  12956.  
  12957.  
  12958.  ────────────────────────────────────────────────────────────────────────────
  12959.  GpiSetLineJoin
  12960.  ────────────────────────────────────────────────────────────────────────────
  12961.    BOOL GpiSetLineJoin (hps, flLineJoin)
  12962.    HPS hps;                /*presentation-space handle                     */
  12963.    LONG flLineJoin;        /*line-join flags                               */
  12964.  
  12965.    The GpiSetLineJoin function sets the current line-join attribute to the
  12966.    specified value. The line-join attribute specifies how the intersection of
  12967.    lines (at the end points) are drawn by the GpiStrokePath function or by
  12968.    the GpiModifyPath and GpiFillPath function pair.
  12969.  
  12970.    If the attribute mode is AM_PRESERVE, the function saves the previous
  12971.    line-join attribute on the attribute stack when it sets the new line join.
  12972.    The previous line-join attribute can be retrieved by using the GpiPop
  12973.    function.
  12974.  
  12975.  Parameters
  12976.  
  12977.    hps  Identifies the presentation space.
  12978.  
  12979.    flLineJoin  Specifies line-join flags. It can be one of the following
  12980.    values:
  12981.  
  12982.    Value             Meaning
  12983.    ──────────────────────────────────────────────────────────────────────────
  12984.    LINEJOIN_BEVEL    Bevel
  12985.  
  12986.    LINEJOIN_DEFAULT  Default
  12987.  
  12988.    LINEJOIN_MITRE    Mitre
  12989.  
  12990.    LINEJOIN_ROUND    Round
  12991.    ──────────────────────────────────────────────────────────────────────────
  12992.  
  12993.  Return Value
  12994.  
  12995.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  12996.    an error occurred.
  12997.  
  12998.  Errors
  12999.  
  13000.    Use the WinGetLastError function to retrieve the error value, which may be
  13001.    the following:
  13002.  
  13003.          PMERR_INV_LINE_JOIN_ATTR
  13004.  
  13005.  See Also
  13006.  
  13007.    GpiFillPath, GpiModifyPath, GpiPop, GpiQueryAttrs, GpiQueryLineJoin,
  13008.    GpiSetAttrMode, GpiSetAttrs, GpiStrokePath
  13009.  
  13010.  
  13011.  ────────────────────────────────────────────────────────────────────────────
  13012.  GpiSetLineType
  13013.  ────────────────────────────────────────────────────────────────────────────
  13014.    BOOL GpiSetLineType (hps, flLineType)
  13015.    HPS hps;                /*presentation-space handle                     */
  13016.    LONG flLineType;        /*line type                                     */
  13017.  
  13018.    The GpiSetLineType function sets the current cosmetic line-type attribute
  13019.    to the specified value.
  13020.  
  13021.  Parameters
  13022.  
  13023.    hps  Identifies the presentation space.
  13024.  
  13025.    flLineType  Specifies the line type. If the specified line type is not
  13026.    valid, the default is used. A valid line type is one of the following:
  13027.  
  13028.          LINETYPE_DOT
  13029.          LINETYPE_SHORTDASH
  13030.          LINETYPE_DASHDOT
  13031.          LINETYPE_DOUBLEDOT
  13032.          LINETYPE_LONGDASH
  13033.          LINETYPE_DASHDOUBLEDOT
  13034.          LINETYPE_SOLID
  13035.          LINETYPE_INVISIBLE
  13036.          LINETYPE_ALTERNATE
  13037.  
  13038.  Return Value
  13039.  
  13040.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  13041.    an error occurred.
  13042.  
  13043.  Errors
  13044.  
  13045.    Use the WinGetLastError function to retrieve the error value, which may be
  13046.    the following:
  13047.  
  13048.          PMERR_INV_LINE_TYPE_ATTR
  13049.  
  13050.  Comments
  13051.  
  13052.    A non-solid line type consists of a sequence of on-and-off runs that gives
  13053.    the appearance of a dotted line.
  13054.  
  13055.    This attribute specifies the cosmetic line type, which is used for all
  13056.    line and curve drawing. It does not depend on transforms. For example,
  13057.    dashes do not become longer if a "zoom in" occurs.
  13058.  
  13059.    The eight standard line types are implemented on each device to give a
  13060.    good appearance based on the "pel" resolution. Their definitions cannot be
  13061.    changed by applications, nor can applications define additional cosmetic
  13062.    line types.
  13063.  
  13064.    The system maintains position within the line-type definition. For
  13065.    example, a curve may be implemented as a polyline. However, the following
  13066.    functions cause the position to be reset:
  13067.  
  13068.          GpiCallSegmentMatrix
  13069.          GpiMove
  13070.          GpiPop
  13071.          GpiSetCurrentPosition
  13072.          GpiSetModelTransformMatrix
  13073.          GpiSetPageViewport
  13074.          GpiSetSegmentTransformMatrix
  13075.  
  13076.    The attribute mode (see GpiSetAttrMode) determines whether the current
  13077.    value of the line type attribute is preserved.
  13078.  
  13079.  See Also
  13080.  
  13081.    GpiQueryAttrs, GpiQueryLineType, GpiSetAttrMode, GpiSetAttrs
  13082.  
  13083.  
  13084.  ────────────────────────────────────────────────────────────────────────────
  13085.  GpiSetLineWidth
  13086.  ────────────────────────────────────────────────────────────────────────────
  13087.    BOOL GpiSetLineWidth (hps, fxLineWidth)
  13088.    HPS hps;                /*presentation-space handle                     */
  13089.    FIXED fxLineWidth;      /*line width                                    */
  13090.  
  13091.    The GpiSetLineWidth function sets the current cosmetic line-width
  13092.    attribute to the specified value. The line width specifies the width of
  13093.    cosmetic lines, that is, lines drawn by functions such as GpiLine. The
  13094.    function treats the line width as a multiplier for the normal line
  13095.    thickness for the device.
  13096.  
  13097.    If the attribute mode is AM_PRESERVE, the function saves the previous line
  13098.    width on the attribute stack when it sets the new width. The previous line
  13099.    width can be retrieved by using the GpiPop function.
  13100.  
  13101.  Parameters
  13102.  
  13103.    hps  Identifies the presentation space.
  13104.  
  13105.    fxLineWidth  Specifies the line-width multiplier. It must be a fixed-point
  13106.    number or one of the following values:
  13107.  
  13108.    Value               Meaning
  13109.    ──────────────────────────────────────────────────────────────────────────
  13110.    LINEWIDTH_DEFAULT   Default
  13111.  
  13112.    LINEWIDTH_NORMAL    Normal width (1.0)
  13113.    ──────────────────────────────────────────────────────────────────────────
  13114.  
  13115.    Any other positive value is a multiplier on the normal line width. Only
  13116.    normal line widths are currently supported. Any value greater than
  13117.    LINEWIDTH_NORMAL will result in a warning.
  13118.  
  13119.  Return Value
  13120.  
  13121.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  13122.    an error occurred.
  13123.  
  13124.  Errors
  13125.  
  13126.    Use the WinGetLastError function to retrieve the error value, which may be
  13127.    the following:
  13128.  
  13129.          PMERR_INV_LINE_WIDTH_ATTR
  13130.  
  13131.  Comments
  13132.  
  13133.    The thickness of cosmetic lines is not affected by transformations.
  13134.  
  13135.  See Also
  13136.  
  13137.    GpiLine, GpiPop, GpiQueryAttrs, GpiQueryLineWidth, GpiSetAttrMode,
  13138.    GpiSetAttrs
  13139.  
  13140.  
  13141.  ────────────────────────────────────────────────────────────────────────────
  13142.  GpiSetLineWidthGeom
  13143.  ────────────────────────────────────────────────────────────────────────────
  13144.    BOOL GpiSetLineWidthGeom (hps, lLineWidth)
  13145.    HPS hps;                /*presentation-space handle                     */
  13146.    LONG lLineWidth;        /*line width                                    */
  13147.  
  13148.    The GpiSetLineWidthGeom function sets the current geometric-line-width
  13149.    attribute to the specified value. The geometric line width specifies the
  13150.    width of lines drawn by using the GpiStrokePath function or the
  13151.    GpiModifyPath and GpiFillPath pair.
  13152.  
  13153.    If the attribute mode is AM_PRESERVE, the function saves the previous
  13154.    geometric-line width on the attribute stack when it sets the new width.
  13155.    The previous geometric-line width can be retrieved using the GpiPop
  13156.    function.
  13157.  
  13158.  Parameters
  13159.  
  13160.    hps  Identifies the presentation space.
  13161.  
  13162.    lLineWidth  Specifies the geometric-line width in world coordinates. This
  13163.    value cannot be negative. If it is zero, the resulting line has zero
  13164.    width.
  13165.  
  13166.  Return Value
  13167.  
  13168.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  13169.    an error occurred.
  13170.  
  13171.  Errors
  13172.  
  13173.    Use the WinGetLastError function to retrieve the error value, which may be
  13174.    the following:
  13175.  
  13176.          PMERR_INV_GEOM_LINE_WIDTH_ATTR
  13177.  
  13178.  See Also
  13179.  
  13180.    GpiFillPath, GpiModifyPath, GpiPop, GpiQueryAttrs,
  13181.    GpiQueryLineWidthGeom, GpiSetAttrMode, GpiSetAttrs, GpiStrokePath
  13182.  
  13183.  
  13184.  ────────────────────────────────────────────────────────────────────────────
  13185.  GpiSetMarker
  13186.  ────────────────────────────────────────────────────────────────────────────
  13187.    BOOL GpiSetMarker (hps, lSymbol)
  13188.    HPS hps;                /*presentation-space handle                     */
  13189.    LONG lSymbol;           /*marker symbol                                 */
  13190.  
  13191.    The GpiSetMarker function sets the value of the marker attribute. The
  13192.    marker attribute specifies the marker drawn by the GpiMarker function.
  13193.  
  13194.    If the attribute mode is AM_PRESERVE, the function saves the previous
  13195.    marker attribute on the attribute stack when it sets the new marker. The
  13196.    previous marker attribute can be retrieved by using the GpiPop function.
  13197.  
  13198.  Parameters
  13199.  
  13200.    hps  Identifies the presentation space.
  13201.  
  13202.    lSymbol  Specifies the identity of the required marker symbol. Zero
  13203.    selects the default marker symbol; a value in the range 1 through 255
  13204.    identifies a symbol in the current marker set. If the default maker set is
  13205.    used, the parameter can be one of the following values:
  13206.  
  13207. ╓┌─┌───────────────────────┌─────────────────────────────────────────────────╖
  13208.    Value                   Meaning
  13209.    ──────────────────────────────────────────────────────────────────────────
  13210.    MARKSYM_CROSS           Cross
  13211.    Value                   Meaning
  13212.    ──────────────────────────────────────────────────────────────────────────
  13213.    MARKSYM_CROSS           Cross
  13214.  
  13215.    MARKSYM_PLUS            Plus sign
  13216.  
  13217.    MARKSYM_DIAMOND         Diamond
  13218.  
  13219.    MARKSYM_SQUARE          Square
  13220.  
  13221.    MARKSYM_SIXPOINTSTAR    Six-pointed star
  13222.  
  13223.    MARKSYM_EIGHTPOINTSTAR  Eight-pointed star
  13224.  
  13225.    MARKSYM_SOLIDDIAMOND    Solid diamond
  13226.  
  13227.    MARKSYM_SOLIDSQUARE     Solid square
  13228.  
  13229.    MARKSYM_DOT             Dot
  13230.  
  13231.    MARKSYM_SMALLCIRCLE     Small circle
  13232.    Value                   Meaning
  13233.    ──────────────────────────────────────────────────────────────────────────
  13234.   MARKSYM_SMALLCIRCLE     Small circle
  13235.  
  13236.    MARKSYM_BLANK           Blank (nothing drawn)
  13237.    ──────────────────────────────────────────────────────────────────────────
  13238.  
  13239.  
  13240.  Return Value
  13241.  
  13242.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  13243.    an error occurred.
  13244.  
  13245.  See Also
  13246.  
  13247.    GpiMarker, GpiPop, GpiQueryMarker
  13248.  
  13249.  
  13250.  ────────────────────────────────────────────────────────────────────────────
  13251.  GpiSetMarkerBox
  13252.  ────────────────────────────────────────────────────────────────────────────
  13253.    BOOL GpiSetMarkerBox (hps, psizfxBox)
  13254.    HPS hps;                /*presentation-space handle                     */
  13255.    PSIZEF psizfxBox;       /*pointer to structure with marker box size     */
  13256.  
  13257.    The GpiSetMarkerBox function sets the current marker-box attribute. The
  13258.    marker box specifies the width and height of markers drawn by the
  13259.    GpiMarker function.
  13260.  
  13261.    If the attribute mode is AM_PRESERVE, the function saves the previous
  13262.    marker-box attribute on the attribute stack when it sets the new marker
  13263.    box. The previous marker-box attribute can be retrieved by using the
  13264.    GpiPop function.
  13265.  
  13266.  Parameters
  13267.  
  13268.    hps  Identifies the presentation space.
  13269.  
  13270.    psizfxBox  Points to a SIZEF structure containing the size of the marker
  13271.    box, in world coordinates. The SIZEF structure has the following form:
  13272.  
  13273.    typedef struct _SIZEF {
  13274.        FIXED cx;
  13275.        FIXED cy;
  13276.    } SIZEF;
  13277.  
  13278.    For a full description, see Chapter 4, "Types, Macros, Structures."
  13279.  
  13280.  Return Value
  13281.  
  13282.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  13283.    an error occurred.
  13284.  
  13285.  Errors
  13286.  
  13287.    Use the WinGetLastError function to retrieve the error value, which may be
  13288.    the following:
  13289.  
  13290.          PMERR_INV_MARKER_BOX_ATTR
  13291.  
  13292.  See Also
  13293.  
  13294.    GpiQueryAttrs, GpiQueryMarkerBox, GpiSetAttrs
  13295.  
  13296.  
  13297.  ────────────────────────────────────────────────────────────────────────────
  13298.  GpiSetMarkerSet
  13299.  ────────────────────────────────────────────────────────────────────────────
  13300.    BOOL GpiSetMarkerSet (hps, lcid)
  13301.    HPS hps;                /*presentation-space handle                     */
  13302.    LONG lcid;              /*local identifier                              */
  13303.  
  13304.    The GpiSetMarkerSet function sets the current marker-set attribute. The
  13305.    marker-set attribute specifies the marker or character set from which
  13306.    markers can be chosen. The marker set can be the default marker set or any
  13307.    logical font created by using the GpiCreateLogFont function.
  13308.  
  13309.    If the attribute mode is AM_PRESERVE, the function saves the previous
  13310.    marker-set attribute on the attribute stack when it sets the new marker
  13311.    set. The previous marker-set attribute can be retrieved by using the
  13312.    GpiPop function.
  13313.  
  13314.  Parameters
  13315.  
  13316.    hps  Identifies the presentation space.
  13317.  
  13318.    lcid  Specifies the logical identifier for the marker set. It can be any
  13319.    integer in the range 1 to 254 for which a logical font has be created, or
  13320.    it can be LCID_DEFAULT to specify the default marker set.
  13321.  
  13322.  Return Value
  13323.  
  13324.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  13325.    an error occurred.
  13326.  
  13327.  Errors
  13328.  
  13329.    Use the WinGetLastError function to retrieve the error value, which may be
  13330.    the following:
  13331.  
  13332.          PMERR_INV_MARKER_SET_ATTR
  13333.  
  13334.  See Also
  13335.  
  13336.    GpiCreateLogFont, GpiPop, GpiQueryAttrs, GpiQueryMarkerSet,
  13337.    GpiSetAttrs
  13338.  
  13339.  
  13340.  ────────────────────────────────────────────────────────────────────────────
  13341.  GpiSetMetaFileBits
  13342.  ────────────────────────────────────────────────────────────────────────────
  13343.    BOOL GpiSetMetaFileBits (hmf, off, cbBuffer, pbBuffer)
  13344.    HMF hmf;                /*message-queue handle                          */
  13345.    LONG off;               /*offset into the metafile                      */
  13346.    LONG cbBuffer;          /*length of the metafile data                   */
  13347.    PBYTE pbBuffer;         /*pointer to the metafile data                  */
  13348.  
  13349.    The GpiSetMetaFileBits function copies data to the metafile specified by
  13350.    hmf from the buffer pointed to by the pbBuffer parameter. The function
  13351.    inserts the bytes into the metafile, up to the number of bytes specified
  13352.    by cbBuffer, at the byte in the metafile where the offset from the
  13353.    beginning of the metafile is specified by the off parameter.
  13354.  
  13355.    The application must ensure that the metafile data has the correct format.
  13356.    The data should not be changed after it is created by the
  13357.    GpiQueryMetaFileBits function.
  13358.  
  13359.  Parameters
  13360.  
  13361.    hmf  Identifies the metafile memory.
  13362.  
  13363.    off  Specifies the offset in bytes from the beginning of the metafile to
  13364.    the first byte that receives copied data.
  13365.  
  13366.    cbBuffer  Specifies the number of bytes of metafile data to copy.
  13367.  
  13368.    pbBuffer  Points to the buffer to receive the metafile data. It must have
  13369.    the number of bytes specified by the cbBuffer parameter.
  13370.  
  13371.  Return Value
  13372.  
  13373.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  13374.    an error occurred.
  13375.  
  13376.  Errors
  13377.  
  13378.    Use the WinGetLastError function to retrieve the error value, which may be
  13379.    one of the following:
  13380.  
  13381.          PMERR_INV_METAFILE_LENGTH
  13382.          PMERR_INV_METAFILE_OFFSET
  13383.  
  13384.  See Also
  13385.  
  13386.    GpiQueryMetaFileBits
  13387.  
  13388.  
  13389.  ────────────────────────────────────────────────────────────────────────────
  13390.  GpiSetMix
  13391.  ────────────────────────────────────────────────────────────────────────────
  13392.    BOOL GpiSetMix (hps, flMixMode)
  13393.    HPS hps;                /*presentation-space handle                     */
  13394.    LONG flMixMode;         /*color-mixing mode                             */
  13395.  
  13396.    The GpiSetMix function sets the current foreground-mix mode. The
  13397.    foreground-mix mode specifies how the foreground color is combined with
  13398.    the colors in underlying primitives. The available mixing modes depend on
  13399.    the device that is associated with the presentation space, but all devices
  13400.    support the mix- ing modes FM_LEAVEALONE, FM_XOR, and FM_OVERPAINT. If the
  13401.    mixing mode specified by flMixMode is not supported, the function uses
  13402.    FM_OVERPAINT instead. The DevQueryCaps function can be used to determine
  13403.    which mixing modes are supported.
  13404.  
  13405.    If the attribute mode is AM_PRESERVE, the function saves the previous
  13406.    foreground-mix mode on the attribute stack when it sets the new mode. Thep
  13407.    previous foreground-mix mode can be retrieved using the GpiPop function.
  13408.  
  13409.  Parameters
  13410.  
  13411.    hps  Identifies the presentation space.
  13412.  
  13413.    flMixMode  Specifies the color-mixing mode. It can be one of the following
  13414.    values:
  13415.  
  13416. ╓┌─┌─────────────────┌───────────────────────────────────────────────────────╖
  13417.    Value             Meaning
  13418.    ──────────────────────────────────────────────────────────────────────────
  13419.    FM_AND            The individual pel colors are combined using the AND
  13420.                      operator.
  13421.    Value             Meaning
  13422.    ──────────────────────────────────────────────────────────────────────────
  13423.                     operator.
  13424.  
  13425.    FM_DEFAULT        Default. This is the same as FM_OVERPAINT.
  13426.  
  13427.    FM_INVERT         All existing pel colors are inverted. The foreground
  13428.                      color is ignored.
  13429.  
  13430.    FM_LEAVEALONE     The foreground color is ignored. The existing color
  13431.                      remains unchanged.
  13432.  
  13433.    FM_MASKSRCNOT     The individual pel colors are combined using the AND
  13434.                      operator after inverting the existing pel colors.
  13435.  
  13436.    FM_MERGENOTSRC    The individual pel colors are combined using the OR
  13437.                      operator after inverting the foreground color.
  13438.  
  13439.    FM_MERGESRCNOT    The individual pel colors are combined using the OR
  13440.                      operator after inverting the existing pel colors.
  13441.  
  13442.    Value             Meaning
  13443.    ──────────────────────────────────────────────────────────────────────────
  13444. 
  13445.    FM_NOTCOPYSRC     The inverse of the foreground color replaces the
  13446.                      existing color.
  13447.  
  13448.    FM_NOTMASKSRC     The individual pel colors are inverted after being
  13449.                      combined using the AND operator.
  13450.  
  13451.    FM_NOTMERGESRC    The individual pel colors are inverted after being
  13452.                      combined using the OR operator.
  13453.  
  13454.    FM_NOTXORSRC      The individual pel colors are inverted after being
  13455.                      combined using the XOR operator.
  13456.  
  13457.    FM_ONE            All pels are set to one.
  13458.  
  13459.    FM_OR             The individual pel colors are combined using the OR
  13460.                      operator.
  13461.  
  13462.    FM_OVERPAINT      The foreground color replaces the existing color.
  13463.    Value             Meaning
  13464.    ──────────────────────────────────────────────────────────────────────────
  13465.   FM_OVERPAINT      The foreground color replaces the existing color.
  13466.  
  13467.    FM_SUBTRACT       The individual pel colors are combined using the AND
  13468.                      operator after inverting the foreground color.
  13469.  
  13470.    FM_XOR            The individual pel colors are combined using the XOR
  13471.                      operator.
  13472.  
  13473.    FM_ZERO           All pels are set to zero.
  13474.    ──────────────────────────────────────────────────────────────────────────
  13475.  
  13476.  
  13477.  Return Value
  13478.  
  13479.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  13480.    an error occurred.
  13481.  
  13482.  See Also
  13483.  
  13484.    DevQueryCaps, GpiQueryMix, GpiSetBackMix
  13485.  
  13486.  
  13487.  ────────────────────────────────────────────────────────────────────────────
  13488.  GpiSetModelTransformMatrix
  13489.  ────────────────────────────────────────────────────────────────────────────
  13490.    BOOL GpiSetModelTransformMatrix (hps, cElements, pmatlf, flType)
  13491.    HPS hps;                /*presentation-space handle                     */
  13492.    LONG cElements;         /*number of elements                            */
  13493.    PMATRIXLF pmatlf;       /*pointer to structure with transformation      */
  13494.                            /*matrix                                        */
  13495.    LONG flType;            /*transformation types                          */
  13496.  
  13497.    The GpiSetModelTransformMatrix function sets the model transformation. The
  13498.    model transformation applies to all primitives used inside and outside of
  13499.    segments. The function sets the transformation by adding or replacing the
  13500.    existing transformation matrix with the matrix pointed to by the pmatlf
  13501.    parameter. The function adds, preempts, or replaces the existing
  13502.    transformation matrix as specified by the flType parameter.
  13503.  
  13504.    The GpiSetModelTransformMatrix function requires a nine-element matrix to
  13505.    set the model transformation. If the specified matrix does not contain
  13506.    nine elements, the function uses the corresponding elements of the
  13507.    identity matrix for each unspecified element. The cElements parameter
  13508.    specifies the number of elements in the matrix. If this parameter equals
  13509.    zero, the identity matrix is used. If scaling values greater than one are
  13510.    given, care must be taken that the combined effect of this and any other
  13511.    relevant transformations do not exceed the limit for fixed-point numbers.
  13512.  
  13513.    If the attribute mode is AM_PRESERVE, the function saves the previous
  13514.    model transformation on the attribute stack when it sets the new
  13515.    transformation. The previous model transformation can be retrieved using
  13516.    the GpiPop function.
  13517.  
  13518.  Parameters
  13519.  
  13520.    hps  Identifies the presentation space.
  13521.  
  13522.    cElements  Specifies the number of elements in the matrix to set. It can
  13523.    be any integer in the range 0 through 9.
  13524.  
  13525.    pmatlf  Points to a MATRIXLF structure that contains the transformation
  13526.    matrix. The MATRIXLF structure has the following form:
  13527.  
  13528.    typedef struct _MATRIXLF {
  13529.        FIXED fxM11;
  13530.        FIXED fxM12;
  13531.        LONG  lM13;
  13532.        FIXED fxM21;
  13533.        FIXED fxM22;
  13534.        LONG  lM23;
  13535.        LONG  lM31;
  13536.        LONG  lM32;
  13537.        LONG  lM33;
  13538.    } MATRIXLF;
  13539.  
  13540.    For a full description, see the "Structures" section.
  13541.  
  13542.    flType  Specifies how a specified matrix should be used to modify the
  13543.    segment transformation. It can be one of the following values:
  13544.  
  13545.    Value               Meaning
  13546.    ──────────────────────────────────────────────────────────────────────────
  13547.    TRANSFORM_ADD       Additive. The specified transformation matrix is
  13548.                        combined with the existing model transformation, in
  13549.                        the order of the existing transformation first, the
  13550.                        new transformation second. This option is useful for
  13551.                        incremental updates to transformations.
  13552.  
  13553.    TRANSFORM_PREEMPT   Preemptive. The specified transformation matrix is
  13554.                        combined with the existing model transformation, in
  13555.                        the order of the new transformation first, the
  13556.                        existing transformation second.
  13557.  
  13558.    TRANSFORM_REPLACE   New/replace. The previous model transformation is
  13559.                        discarded and replaced by the specified transformation
  13560.                        matrix.
  13561.    ──────────────────────────────────────────────────────────────────────────
  13562.  
  13563.  Return Value
  13564.  
  13565.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  13566.    an error occurred.
  13567.  
  13568.  Errors
  13569.  
  13570.    Use the WinGetLastError function to retrieve the error value, which may be
  13571.    the following:
  13572.  
  13573.          PMERR_INV_TRANSFORM_TYPE
  13574.  
  13575.  See Also
  13576.  
  13577.    GpiQueryModelTransformMatrix, GpiSetAttrMode
  13578.  
  13579.  
  13580.  ────────────────────────────────────────────────────────────────────────────
  13581.  GpiSetPageViewport
  13582.  ────────────────────────────────────────────────────────────────────────────
  13583.    BOOL GpiSetPageViewport (hps, prclViewport)
  13584.    HPS hps;                /*presentation-space handle                     */
  13585.    PRECTL prclViewport;    /*pointer to structure with page viewport       */
  13586.  
  13587.    The GpiSetPageViewport function sets the page viewport within device
  13588.    space. The page viewport and the presentation page size (specified by the
  13589.    GpiCreatePS function) specify the device transformation.
  13590.  
  13591.    The function can only be used if the presentation space has an associated
  13592.    device context.
  13593.  
  13594.  Parameters
  13595.  
  13596.    hps  Identifies the presentation space.
  13597.  
  13598.    prclViewport  Points to a RECTL structure defining the page viewport in
  13599.    device units. The RECTL structure has the following form:
  13600.  
  13601.    typedef struct _RECTL {
  13602.        LONG  xLeft;
  13603.        LONG  yBottom;
  13604.        LONG  xRight;
  13605.        LONG  yTop;
  13606.    } RECTL;
  13607.  
  13608.    For a full description, see Chapter 4, "Types, Macros, Structures."
  13609.  
  13610.  Return Value
  13611.  
  13612.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  13613.    an error occurred.
  13614.  
  13615.  Comments
  13616.  
  13617.    When a presentation space is associated with a device context, the system
  13618.    sets a default page viewport. The default page viewport depends on the
  13619.    page units selected for the presentation space.
  13620.  
  13621.  See Also
  13622.  
  13623.    GpiCreatePS, GpiQueryPageViewport
  13624.  
  13625.  
  13626.  ────────────────────────────────────────────────────────────────────────────
  13627.  GpiSetPattern
  13628.  ────────────────────────────────────────────────────────────────────────────
  13629.    BOOL GpiSetPattern (hps, lSymbol)
  13630.    HPS hps;                /*presentation-space handle                     */
  13631.    LONG lSymbol;           /*shading pattern                               */
  13632.  
  13633.    The GpiSetPattern function sets the current value of the pattern
  13634.    attribute. The pattern attribute specifies the shading pattern used to
  13635.    fill areas. The pattern can be any pattern from the default pattern set or
  13636.    any character from a raster font. If the specified pattern is not valid
  13637.    for the device associated with the presentation space, the function sets
  13638.    the default pattern.
  13639.  
  13640.    If the attribute mode is AM_PRESERVE, the function saves the previous
  13641.    pattern attribute on the attribute stack when it sets the new pattern. The
  13642.    previous pattern attribute can be retrieved using the GpiPop function.
  13643.  
  13644.  Parameters
  13645.  
  13646.    hps  Identifies the presentation space.
  13647.  
  13648.    lSymbol  Specifies the shading pattern to set. The values depend on the
  13649.    particular pattern set selected by the pattern-set attribute. It can be
  13650.    zero to specify the default pattern, or a number in the range 1 through
  13651.    255 to specify a particular pattern from the current pattern set. If the
  13652.    default pattern set is used, it can be one of the following values:
  13653.  
  13654. ╓┌─┌───────────────────┌─────────────────────────────────────────────────────╖
  13655.    Value               Meaning
  13656.    ──────────────────────────────────────────────────────────────────────────
  13657.    PATSYM_BLANK        Blank pattern (background only)
  13658.  
  13659.    PATSYM_DEFAULT      Default pattern (device-dependent)
  13660.  
  13661.    PATSYM_DENSE1       Density-1 pattern (mostly foreground)
  13662.  
  13663.    PATSYM_DENSE2       Density-2 pattern
  13664.  
  13665.    PATSYM_DENSE3       Density-3 pattern
  13666.  
  13667.    PATSYM_DENSE4       Density-4 pattern
  13668.  
  13669.    PATSYM_DENSE5       Density-5 pattern
  13670.  
  13671.    PATSYM_DENSE6       Density-6 pattern
  13672.  
  13673.    Value               Meaning
  13674.    ──────────────────────────────────────────────────────────────────────────
  13675. 
  13676.    PATSYM_DENSE7       Density-7 pattern
  13677.  
  13678.    PATSYM_DENSE8       Density-8 pattern (mostly background)
  13679.  
  13680.    PATSYM_DIAG1        Upward-diagonal pattern (steep)
  13681.  
  13682.    PATSYM_DIAG2        Upward-diagonal pattern (gradual)
  13683.  
  13684.    PATSYM_DIAG3        Downward-diagonal pattern (steep)
  13685.  
  13686.    PATSYM_DIAG4        Downward-diagonal pattern (gradual)
  13687.  
  13688.    PATSYM_HALFTONE     Alternating foreground and background pattern
  13689.  
  13690.    PATSYM_HORIZ        Horizontal pattern
  13691.  
  13692.    PATSYM_NOSHADE      Blank pattern (background only)
  13693.  
  13694.    Value               Meaning
  13695.    ──────────────────────────────────────────────────────────────────────────
  13696. 
  13697.    PATSYM_SOLID        Solid pattern (foreground only)
  13698.  
  13699.    PATSYM_VERT         Vertical pattern
  13700.    ──────────────────────────────────────────────────────────────────────────
  13701.  
  13702.  
  13703.  Return Value
  13704.  
  13705.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  13706.    an error occurred.
  13707.  
  13708.  Errors
  13709.  
  13710.    Use the WinGetLastError function to retrieve the error value, which may be
  13711.    the following:
  13712.  
  13713.          PMERR_INV_PATTERN_SET_ATTR
  13714.  
  13715.  Comments
  13716.  
  13717.    If the current pattern set specifies a bitmap (see the GpiSetBitmapId or
  13718.    GpiSetPatternSet function), the pattern attribute is ignored.
  13719.  
  13720.  See Also
  13721.  
  13722.    GpiQueryPattern, GpiSetBitmapId, GpiSetPatternRefPoint,
  13723.    GpiSetPatternSet
  13724.  
  13725.  
  13726.  ────────────────────────────────────────────────────────────────────────────
  13727.  GpiSetPatternRefPoint
  13728.  ────────────────────────────────────────────────────────────────────────────
  13729.    BOOL GpiSetPatternRefPoint (hps, pptlRef)
  13730.    HPS hps;                /*presentation-space handle                     */
  13731.    PPOINTL pptlRef;        /*pointer to structure with reference point     */
  13732.  
  13733.    The GpiSetPatternRefPoint function sets the current pattern reference
  13734.    point to the specified value. The pattern reference point is the point to
  13735.    which the origin of the fill pattern maps. The pattern reference point
  13736.    does need not be inside the actual area to be filled. The default pattern
  13737.    reference point is (0,0).
  13738.  
  13739.    If the attribute mode is AM_PRESERVE, the function saves the previous
  13740.    pattern reference point on the attribute stack when it sets the new
  13741.    reference point. The previous pattern reference point can be retrieved
  13742.    using the GpiPop function.
  13743.  
  13744.  Parameters
  13745.  
  13746.    hps  Identifies the presentation space.
  13747.  
  13748.    pptlRef  Points to the POINTL structure that contains the pattern
  13749.    reference point in world coordinates. The POINTL structure has the
  13750.    following form:
  13751.  
  13752.    typedef struct _POINTL  {
  13753.        LONG  x;
  13754.        LONG  y;
  13755.    } POINTL;
  13756.  
  13757.    For a full description, see Chapter 4, "Types, Macros, Structures."
  13758.  
  13759.  Return Value
  13760.  
  13761.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  13762.    an error occurred.
  13763.  
  13764.  Comments
  13765.  
  13766.    The pattern reference point is subject to all transformations. This means
  13767.    that moving an area by using a transformation also moves the fill pattern
  13768.    so that the pattern keeps its position relative to the area boundaries.
  13769.    This allows part of a picture to be moved using the GpiBitBlt function,
  13770.    and the remainder is drawn without discontinuity by changing the
  13771.    appropriate transformation.
  13772.  
  13773.  See Also
  13774.  
  13775.    GpiBitBlt, GpiQueryPatternRefPoint, GpiSetAttrMode, GpiSetPattern,
  13776.    GpiSetPatternSet
  13777.  
  13778.  
  13779.  ────────────────────────────────────────────────────────────────────────────
  13780.  GpiSetPatternSet
  13781.  ────────────────────────────────────────────────────────────────────────────
  13782.    BOOL GpiSetPatternSet (hps, lcid)
  13783.    HPS hps;                /*presentation-space handle                     */
  13784.    LONG lcid;              /*local identifier                              */
  13785.  
  13786.    The GpiSetPatternSet function sets the current pattern-set attribute to
  13787.    the specified value. The pattern set specifies the pattern or character
  13788.    set from which patterns can be chosen. The pattern set can be the default
  13789.    pattern set, any logical font created using the GpiCreateLogFont function,
  13790.    or any tagged bitmap.
  13791.  
  13792.    If a logical font is set as the pattern set, the GpiSetPattern function
  13793.    can be used to choose which character in the font as the pattern.
  13794.    Depending on the device associated with the presentation space, not all of
  13795.    the character may be used as the pattern. For example, some devices use
  13796.    only 8-by-8 patterns, and therefore use only the lower-left corner of a
  13797.    character.
  13798.  
  13799.    If a tagged bitmap is set as the pattern set, the bitmap is used as the
  13800.    pattern. As with characters, not all of the bitmap may be used as the
  13801.    pattern. Also, if the bitmap is color and the device is monochrome, the
  13802.    system converts the bitmap to monochrome.
  13803.  
  13804.    If the attribute mode is AM_PRESERVE, the function saves the previous
  13805.    pattern-set attribute on the attribute stack when it sets the new pattern
  13806.    set. The previous pattern-set attribute can be retrieved using the GpiPop
  13807.    function.
  13808.  
  13809.  Parameters
  13810.  
  13811.    hps  Identifies the presentation space.
  13812.  
  13813.    lcid  Specifies the local identifier for the pattern set. It can be any
  13814.    integer in the range 1 through 254 for which a logical font or tagged
  13815.    bitmap has been created. It can be LCID_DEFAULT to specify the default
  13816.    pattern set.
  13817.  
  13818.  Return Value
  13819.  
  13820.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  13821.    an error occurred.
  13822.  
  13823.  Errors
  13824.  
  13825.    Use the WinGetLastError function to retrieve the error value, which may be
  13826.    the following:
  13827.  
  13828.          PMERR_INV_PATTERN_ATTR
  13829.  
  13830.  Comments
  13831.  
  13832.    Certain fonts cannot be used for patterns. The function returns an error
  13833.    if an application attempts to set such a font as the pattern set. Fonts
  13834.    that cannot be used as patterns include device fonts which cannot be used
  13835.    for shading, and any kind of raster font used for a plotter device.
  13836.  
  13837.  See Also
  13838.  
  13839.    GpiQueryPatternSet, GpiSetPattern, GpiSetPatternRefPoint
  13840.  
  13841.  
  13842.  ────────────────────────────────────────────────────────────────────────────
  13843.  GpiSetPel
  13844.  ────────────────────────────────────────────────────────────────────────────
  13845.    LONG GpiSetPel (hps, pptl)
  13846.    HPS hps;                /*presentation-space handle                     */
  13847.    PPOINTL pptl;           /*pointer to structure with point position      */
  13848.  
  13849.    The GpiSetPel function sets the pel at the specified position to the
  13850.    current foreground color. The pel's position is expressed in world
  13851.    coordinates. If the pel is not visible (that is, the point lies outside
  13852.    the clip area), the color remains unchanged.
  13853.  
  13854.  Parameters
  13855.  
  13856.    hps  Identifies the presentation space.
  13857.  
  13858.    pptl  Points to a POINTL structure containing the position in world
  13859.    coordinates. The POINTL structure has the following form:
  13860.  
  13861.    typedef struct _POINTL  {
  13862.        LONG  x;
  13863.        LONG  y;
  13864.    } POINTL;
  13865.  
  13866.    For a full description, see Chapter 4, "Types, Macros, Structures."
  13867.  
  13868.  Return Value
  13869.  
  13870.    The return value is GPI_OK or GPI_HITS if the function is successful (it
  13871.    is GPI_HITS if the detectable attribute is set for the presentation space
  13872.    and a correlation hit occurs). The return value is GPI_ERROR if an error
  13873.    occurs.
  13874.  
  13875.  See Also
  13876.  
  13877.    GpiQueryPel, GpiSetAttrs, GpiSetColor, GpiSetMix
  13878.  
  13879.  
  13880.  ────────────────────────────────────────────────────────────────────────────
  13881.  GpiSetPickAperturePosition
  13882.  ────────────────────────────────────────────────────────────────────────────
  13883.    BOOL GpiSetPickAperturePosition (hps, pptlPick)
  13884.    HPS hps;                /*presentation-space handle                     */
  13885.    PPOINTL pptlPick;       /*pointer to structure with center of           */
  13886.                            /*pick aperture                                 */
  13887.  
  13888.    The GpiSetPickAperturePosition function sets the center of the pick
  13889.    aperture, in presentation-page space, for subsequent non-retained
  13890.    correlation operations.
  13891.  
  13892.  Parameters
  13893.  
  13894.    hps  Identifies the presentation space.
  13895.  
  13896.    pptlPick  Points to the POINTL structure that contains the center of the
  13897.    pick aperture. The POINTL structure has the following form:
  13898.  
  13899.    typedef struct _POINTL  {
  13900.        LONG  x;
  13901.        LONG  y;
  13902.    } POINTL;
  13903.  
  13904.    For a full description, see Chapter 4, "Types, Macros, Structures."
  13905.  
  13906.  Return Value
  13907.  
  13908.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  13909.    an error occurred.
  13910.  
  13911.  See Also
  13912.  
  13913.    GpiQueryPickAperturePosition, GpiSetPickApertureSize
  13914.  
  13915.  
  13916.  ────────────────────────────────────────────────────────────────────────────
  13917.  GpiSetPickApertureSize
  13918.  ────────────────────────────────────────────────────────────────────────────
  13919.    BOOL GpiSetPickApertureSize (hps, flOption, psizlPick)
  13920.    HPS hps;                /*presentation-space handle                     */
  13921.    LONG flOption;          /*options                                       */
  13922.    PSIZEL psizlPick;       /*pointer to structure with pick-aperture size  */
  13923.  
  13924.    The GpiSetPickApertureSize function sets the pick-aperture size. The
  13925.    function sets the pick aperture to either the default value or to the size
  13926.    specified by psizlPick. The default size is a rectangle in
  13927.    presentation-page space that produces a square in device space that has a
  13928.    width and height equal to the default-character cell height.
  13929.  
  13930.  Parameters
  13931.  
  13932.    hps  Identifies the presentation space.
  13933.  
  13934.    flOption  Specifies the pick-aperture type. It can be one of the following
  13935.    values:
  13936.  
  13937.    Value             Meaning
  13938.    ──────────────────────────────────────────────────────────────────────────
  13939.    PICKAP_DEFAULT    Use default pick aperture. The psizlPick parameter is
  13940.                      ignored.
  13941.  
  13942.    PICKAP_REC        Use psizlPick value.
  13943.    ──────────────────────────────────────────────────────────────────────────
  13944.  
  13945.    psizlPick  Points to the SIZEL structure that contains the pick-aperture
  13946.    size. The SIZEL structure has the following form:
  13947.  
  13948.    typedef struct _SIZEL {
  13949.        LONG cx;
  13950.        LONG cy;
  13951.    } SIZEL;
  13952.  
  13953.    For a full description, see Chapter 4, "Types, Macros, Structures."
  13954.  
  13955.  Return Value
  13956.  
  13957.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  13958.    an error occurred.
  13959.  
  13960.  Errors
  13961.  
  13962.    Use the WinGetLastError function to retrieve the error value, which may be
  13963.    the following:
  13964.  
  13965.          PMERR_INV_PICK_APERTURE_OPTION
  13966.  
  13967.  See Also
  13968.  
  13969.    GpiQueryPickApertureSize, GpiSetPickAperturePosition
  13970.  
  13971.  
  13972.  ────────────────────────────────────────────────────────────────────────────
  13973.  GpiSetPS
  13974.  ────────────────────────────────────────────────────────────────────────────
  13975.    BOOL GpiSetPS (hps, psizl, flOptions)
  13976.    HPS hps;                /*presentation-space handle                     */
  13977.    PSIZEL psizl;           /*pointer to structure for presentation-space   */
  13978.                            /*size                                          */
  13979.    ULONG flOptions;        /*options                                       */
  13980.  
  13981.    The GpiSetPS function sets the page size and units for the presentation
  13982.    space. The function is often used to change the device transformation for
  13983.    the presentation space.
  13984.  
  13985.    The function does not affect the device context associated with the
  13986.    presentation space. This means the device context that was already
  13987.    associated remains associated. Also, the function does not change the
  13988.    presentation space type, such as micro-presentation space or a normal
  13989.    presentation space.
  13990.  
  13991.    When this function is called, it resets the presentation space to a state
  13992.    that is equivalent to setting the value GRES_ALL in the GpiResetPS
  13993.    function.
  13994.  
  13995.  Parameters
  13996.  
  13997.    hps  Identifies the presentation space.
  13998.  
  13999.    psizl  Points to the SIZEL structure that contains the size of the
  14000.    presentation page. The SIZEL structure has the following form:
  14001.  
  14002.    typedef struct _SIZEL {
  14003.        LONG cx;
  14004.        LONG cy;
  14005.    } SIZEL;
  14006.  
  14007.    For a full description, see Chapter 4, "Types, Macros, Structures."
  14008.  
  14009.    flOptions  Specifies the presentation-space options. The options define
  14010.    the page unit for the presentation space. Although the flOptions parameter
  14011.    can include many other options (as specified by the GpiCreatePS function),
  14012.    the function ignores all but the page units. The page units can be one of
  14013.    the following values:
  14014.  
  14015.    Page unit         Meaning
  14016.    ──────────────────────────────────────────────────────────────────────────
  14017.    PU_ARBITRARY      Sets units initially to pels but permits the units to be
  14018.                      modified later using the GpiSetPageViewport function.
  14019.  
  14020.    PU_HIENGLISH      Sets units to 0.001 inch.
  14021.  
  14022.    PU_HIMETRIC       Sets units to 0.01 millimeter.
  14023.  
  14024.    PU_LOENGLISH      Sets units to 0.01 inch.
  14025.  
  14026.    PU_LOMETRIC       Sets units to 0.1 millimeter.
  14027.  
  14028.    PU_PELS           Sets units to pels.
  14029.  
  14030.    PU_TWIPS          Sets units to 1/1440 inch (1/20 point).
  14031.    ──────────────────────────────────────────────────────────────────────────
  14032.  
  14033.  Return Value
  14034.  
  14035.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  14036.    an error occurred.
  14037.  
  14038.  See Also
  14039.  
  14040.    GpiCreatePS, GpiResetPS
  14041.  
  14042.  
  14043.  ────────────────────────────────────────────────────────────────────────────
  14044.  GpiSetRegion
  14045.  ────────────────────────────────────────────────────────────────────────────
  14046.    BOOL GpiSetRegion (hps, hrgn, crcl, arcl)
  14047.    HPS hps;                /*presentation-space handle                     */
  14048.    HRGN hrgn;              /*region handle                                 */
  14049.    LONG crcl;              /*number of rectangles                          */
  14050.    PRECTL arcl;            /*pointer to array of rectangle structures      */
  14051.  
  14052.    The GpiSetRegion function redefines the region specified by the hrgn
  14053.    parameter. The function replaces the old region by creating a region that
  14054.    consists of the union of the rectangles pointed to by the arcl parameter.
  14055.    This function is similar to the GpiCreateRegion function.
  14056.  
  14057.    The function can be used only if a device context is associated with the
  14058.    presentation space.
  14059.  
  14060.  Parameters
  14061.  
  14062.    hps  Identifies the presentation space.
  14063.  
  14064.    hrgn  Identifies the region handle.
  14065.  
  14066.    crcl  Specifies the number of rectangles to use to create the new region.
  14067.    If it is zero, the function creates an empty region and the arcl parameter
  14068.    is ignored.
  14069.  
  14070.    arcl  Points to the array of RECTL structures that contains the rectangles
  14071.    for the replacement region. The array must have the number of elements
  14072.    specified by crcl. The RECTL structures have the form:
  14073.  
  14074.    typedef struct _RECTL {
  14075.        LONG  xLeft;
  14076.        LONG  yBottom;
  14077.        LONG  xRight;
  14078.        LONG  yTop;
  14079.    } RECTL;
  14080.  
  14081.    For a full description, see Chapter 4, "Types, Macros, Structures."
  14082.  
  14083.  Return Value
  14084.  
  14085.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  14086.    an error occurred.
  14087.  
  14088.  See Also
  14089.  
  14090.    GpiCombineRegion, GpiCreateRegion
  14091.  
  14092.  ────────────────────────────────────────────────────────────────────────────
  14093.  GpiSetSegmentAttrs
  14094.  ────────────────────────────────────────────────────────────────────────────
  14095.    BOOL GpiSetSegmentAttrs (hps, idSegment, flAttribute, flAttrFlag)
  14096.    HPS hps;                /*presentation-space handle                     */
  14097.    LONG idSegment;         /*segment identifier                            */
  14098.    LONG flAttribute;       /*attributes                                    */
  14099.    LONG flAttrFlag;        /*attribute on/off flag                         */
  14100.  
  14101.    The GpiSetSegmentAttrs function sets a segment attribute for a retained
  14102.    segment. The segment attributes specify whether a segment is chained,
  14103.    visible, detectable, dynamic, and so on. The function can turn these
  14104.    attributes on or off, one attribute at a time.
  14105.  
  14106.  Parameters
  14107.  
  14108.    hps  Identifies the presentation space.
  14109.  
  14110.    idSegment  Specifies the segment to change. It must be greater than zero.
  14111.  
  14112.    flAttribute  Specifies the segment attribute to set or clear. It can be
  14113.    one of the the following values:
  14114.  
  14115.    Value                   Meaning
  14116.    ──────────────────────────────────────────────────────────────────────────
  14117.    ATTR_CHAINED            Chained
  14118.  
  14119.    ATTR_DETECTABLE         Detectability
  14120.  
  14121.    ATTR_DYNAMIC            Dynamic
  14122.  
  14123.    ATTR_FASTCHAIN          Fast chaining
  14124.  
  14125.    ATTR_PROP_DETECTABLE    Propagate detectability
  14126.  
  14127.    ATTR_PROP_VISIBLE       Propagate visibility
  14128.  
  14129.    ATTR_VISIBLE            Visibility
  14130.    ──────────────────────────────────────────────────────────────────────────
  14131.  
  14132.    flAttrFlag  Specifies whether to turn the attribute on or off. If it is
  14133.    ATTR_ON, the function turns on the attribute; if ATTR_OFF, the function
  14134.    turns off the attribute.
  14135.  
  14136.  Return Value
  14137.  
  14138.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  14139.    an error occurred.
  14140.  
  14141.  Errors
  14142.  
  14143.    Use the WinGetLastError function to retrieve the error value, which may be
  14144.    one of the following:
  14145.  
  14146.          PMERR_INV_MICROPS_FUNCTION
  14147.          PMERR_INV_SEG_ATTR
  14148.          PMERR_INV_SEG_NAME
  14149.  
  14150.  Comments
  14151.  
  14152.    When a segment is modified from non-chained to chained, it is added to the
  14153.    end of the drawing chain.
  14154.  
  14155.  See Also
  14156.  
  14157.    GpiQuerySegmentAttrs
  14158.  
  14159.  
  14160.  ────────────────────────────────────────────────────────────────────────────
  14161.  GpiSetSegmentPriority
  14162.  ────────────────────────────────────────────────────────────────────────────
  14163.    BOOL GpiSetSegmentPriority (hps, idSegment, idRefSegment, cmdOrder)
  14164.    HPS hps;                /*presentation-space handle                     */
  14165.    LONG idSegment;         /*segment identifier                            */
  14166.    LONG idRefSegment;      /*reference-segment identifier                  */
  14167.    LONG cmdOrder;          /*command options                               */
  14168.  
  14169.    The GpiSetSegmentPriority function sets the priority for the segment
  14170.    specified by idSegment. Segment priority applies only to chained segments.
  14171.    The segment priority of a segment specifies the position of that segment
  14172.    in the picture chain. The priority affects how the segment appears when
  14173.    drawn, since segments with higher priorities (later positions in the
  14174.    chain) may draw over the segment.
  14175.  
  14176.    The function changes a segment's priority by moving its position in the
  14177.    picture chain relative to a given segment. The function places the segment
  14178.    either before or after the segment specified by the idRefSegment
  14179.    parameter. The cmdOrder parameter specifies the priority that the segment
  14180.    should have relative to the idRefSegment segment, and therefore determines
  14181.    whether it goes before or after. The function places the segment at either
  14182.    the beginning or end of the picture chain if the idRefSegment parameter is
  14183.    zero.
  14184.  
  14185.  Parameters
  14186.  
  14187.    hps  Identifies the presentation space.
  14188.  
  14189.    idSegment  Specifies the identifier of the segment whose priority is to
  14190.    change; it must be greater than zero.
  14191.  
  14192.    idRefSegment  Specifies the reference-segment identifier. It must be the
  14193.    identifier of a segment in the picture chain, or it must be zero. If it is
  14194.    zero, the function uses the beginning or end of the picture chain.
  14195.  
  14196.    cmdOrder  Specifies whether to give the segment higher or lower priority
  14197.    than the segment specified by idRefSegment. It can be one of the following
  14198.    values:
  14199.  
  14200.    Value             Meaning
  14201.    ──────────────────────────────────────────────────────────────────────────
  14202.    LOWER_PRI         Gives the segment lower priority. The function places
  14203.                      the segment before the reference-segment in the chain.
  14204.                      If the idRefSegment is zero, the function makes the
  14205.                      segment the highest-priority segment.
  14206.  
  14207.    HIGHER_PRI        Gives the segment higher priority. The function places
  14208.                      the segment after the reference-segment in the chain. If
  14209.                      the idRefSegment is zero, the function makes the segment
  14210.                      the lowest-priority segment.
  14211.    ──────────────────────────────────────────────────────────────────────────
  14212.  
  14213.  Return Value
  14214.  
  14215.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  14216.    an error occurred.
  14217.  
  14218.  Errors
  14219.  
  14220.    Use the WinGetLastError function to retrieve the error value, which may be
  14221.    one of the following:
  14222.  
  14223.          PMERR_INV_MICROPS_FUNCTION
  14224.          PMERR_INV_SEG_NAME
  14225.          PMERR_SEG_AND_REFSEG_ARE_SAME
  14226.  
  14227.  See Also
  14228.  
  14229.    GpiDrawChain, GpiDrawFrom, GpiQuerySegmentPriority
  14230.  
  14231.  
  14232.  ────────────────────────────────────────────────────────────────────────────
  14233.  GpiSetSegmentTransformMatrix
  14234.  ────────────────────────────────────────────────────────────────────────────
  14235.    BOOL GpiSetSegmentTransformMatrix (hps, idSegment, cElements, pmatlf,
  14236.    flType)
  14237.    HPS hps;                /*presentation-space handle                     */
  14238.    LONG idSegment;         /*segment identifier                            */
  14239.    LONG cElements;         /*number of elements                            */
  14240.    PMATRIXLF pmatlf;       /*pointer to structure with transformation      */
  14241.                            /*matrix                                        */
  14242.    LONG flType;            /*type of transformation                        */
  14243.  
  14244.    The GpiSetSegmentTransformMatrix function sets the segment transformation
  14245.    for the specified segment. The segment transformation applies to all
  14246.    primitives in the segment. The function sets the transformation by adding
  14247.    or replacing the existing transformation matrix with the matrix pointed to
  14248.    by the pmatlf parameter. The function adds, preempts, or replaces the
  14249.    existing transformation matrix as specified by the flType parameter.
  14250.  
  14251.    The GpiSetSegmentTransformMatrix function requires a nine-element matrix
  14252.    to set the segment transformation. If the specified matrix does not
  14253.    contain nine elements, the function uses the corresponding elements of the
  14254.    identity matrix for each unspecified element. The cElements parameter
  14255.    specifies the number of elements in the matrix. If this parameter equals
  14256.    zero, the identity matrix is used. If scaling values greater than one are
  14257.    given, care must be taken that the combined effect of this and any other
  14258.    relevant transformations do not exceed the limit for fixed-point numbers.
  14259.  
  14260.  Parameters
  14261.  
  14262.    hps  Identifies the presentation space.
  14263.  
  14264.    idSegment  Specifies the segment identifier; it must be greater than zero.
  14265.    The segment transformation does not affect primitives outside the
  14266.    specified segment.
  14267.  
  14268.    cElements  Specifies the number of elements in the matrix to set. It can
  14269.    be any integer in the range 0 through 9.
  14270.  
  14271.    pmatlf  Points to a MATRIXLF structure that contains the transformation
  14272.    matrix. The MATRIXLF structure has the following form:
  14273.  
  14274.    typedef struct _MATRIXLF {
  14275.        FIXED fxM11;
  14276.        FIXED fxM12;
  14277.        LONG  lM13;
  14278.        FIXED fxM21;
  14279.        FIXED fxM22;
  14280.        LONG  lM23;
  14281.        LONG  lM31;
  14282.        LONG  lM32;
  14283.        LONG  lM33;
  14284.    } MATRIXLF;
  14285.  
  14286.    For a full description, see Chapter 4, "Types, Macros, Structures."
  14287.  
  14288.    flType  Specifies how a specified matrix should be used to modify the
  14289.    segment transformation. It can be one of the following values:
  14290.  
  14291.    Value                 Meaning
  14292.    ──────────────────────────────────────────────────────────────────────────
  14293.    TRANSFORM_ADD         Additive. The specified transformation matrix is
  14294.                          combined with the existing segment transformation,
  14295.                          in the order of the existing transformation first,
  14296.                          the new transformation second. This option is useful
  14297.                          for incremental updates to transformations.
  14298.  
  14299.    TRANSFORM_PREEMPT     Preemptive. The specified transformation matrix is
  14300.                          combined with the existing segment transformation,
  14301.                          in the order of the new transformation first, the
  14302.                          existing transformation second.
  14303.  
  14304.    TRANSFORM_REPLACE     New/replace. The previous segment transformation is
  14305.                          discarded and replaced by the specified
  14306.                          transformation matrix.
  14307.    ──────────────────────────────────────────────────────────────────────────
  14308.  
  14309.  Return Value
  14310.  
  14311.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  14312.    an error occurred.
  14313.  
  14314.  Errors
  14315.  
  14316.    Use the WinGetLastError function to retrieve the error value, which may be
  14317.    one of the following:
  14318.  
  14319.          PMERR_INV_MICROPS_FUNCTION
  14320.          PMERR_INV_SEG_NAME
  14321.          PMERR_INV_TRANSFORM_TYPE
  14322.  
  14323.  Comments
  14324.  
  14325.    The system applies a segment transformation to the primitives in the given
  14326.    segment after applying the model transformation and any instance and
  14327.    segment transformations from calling segments.
  14328.  
  14329.  Example
  14330.  
  14331.    This example uses the GpiSetSegmentTransformMatrix function to replace the
  14332.    existing segment transformation. The new transformation doubles the width
  14333.    and height of drawing.
  14334.  
  14335.    MATRIXLF matlf = { MAKEFIXED(2,0), 0, 0, 0, MAKEFIXED(2,0), 0, 100 };
  14336.  
  14337.    GpiSetSegmentTransformMatrix(hps, 7L, &matlf, TRANSFORM_REPLACE);
  14338.  
  14339.  See Also
  14340.  
  14341.    GpiQueryDefaultViewMatrix, GpiQuerySegmentTransformMatrix
  14342.  
  14343.  
  14344.  ────────────────────────────────────────────────────────────────────────────
  14345.  GpiSetStopDraw
  14346.  ────────────────────────────────────────────────────────────────────────────
  14347.    BOOL GpiSetStopDraw (hps, fStopDraw)
  14348.    HPS hps;                /*presentation-space handle                     */
  14349.    LONG fStopDraw;         /*stop-draw condition flag                      */
  14350.  
  14351.    The GpiSetStopDraw function sets or clears the stop-draw condition. The
  14352.    stop-draw condition terminates specific functions that may be executing in
  14353.    another thread of the process. If the stop-draw condition is set, the
  14354.    system stops the following functions and forces each to return an error:
  14355.  
  14356.          GpiDrawChain
  14357.          GpiDrawDynamics
  14358.          GpiDrawFrom
  14359.          GpiDrawSegment
  14360.          GpiPlayMetaFile
  14361.          GpiPutData
  14362.  
  14363.  Parameters
  14364.  
  14365.    hps  Identifies the presentation space.
  14366.  
  14367.    fStopDraw  Specifies the stop-draw condition. If it is FALSE, the function
  14368.    clears the stop-draw condition. If it is TRUE, the function sets the
  14369.    condition.
  14370.  
  14371.  Return Value
  14372.  
  14373.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  14374.    an error occurred.
  14375.  
  14376.  Errors
  14377.  
  14378.    Use the WinGetLastError function to retrieve the error value, which may be
  14379.    one of the following:
  14380.  
  14381.          PMERR_INV_MICROPS_FUNCTION
  14382.          PMERR_INV_STOP_DRAW_VALUE
  14383.  
  14384.  Comments
  14385.  
  14386.    The GpiSetStopDraw function lets an application set up and control an
  14387.    asynchronous thread that carries out long drawing operations. If the
  14388.    controlling thread needs to stop drawing, it sets the condition. If it
  14389.    wants to allow drawing, it clears the condition. The stop-draw condition
  14390.    only affects the listed functions.
  14391.  
  14392.    Using the stop-draw condition to stop drawing to a metafile creates an
  14393.    unusable metafile.
  14394.  
  14395.  See Also
  14396.  
  14397.    GpiDrawChain, GpiDrawDynamics, GpiDrawFrom, GpiDrawSegment,
  14398.    GpiPlayMetaFile, GpiPutData
  14399.  
  14400.  
  14401.  ────────────────────────────────────────────────────────────────────────────
  14402.  GpiSetTag
  14403.  ────────────────────────────────────────────────────────────────────────────
  14404.    BOOL GpiSetTag (hps, lTag)
  14405.    HPS hps;                /*presentation-space handle                     */
  14406.    LONG lTag;              /*tag                                           */
  14407.  
  14408.    The GpiSetTag function sets the current primitive tag. A primitive tag is
  14409.    a way of identifying a primitive stored in a segment. The function sets
  14410.    the primitive tag and the system applies this tag to all subsequent
  14411.    primitives. The default tag is zero.
  14412.  
  14413.    Primitive tags are typically used when correlating segments. The
  14414.    GpiCorrelateChain, GpiCorrelateFrom, and GpiCorrelateSegment functions
  14415.    return the segment identifier and the primitive tag of objects that lie in
  14416.    the pick aperture.
  14417.  
  14418.    The GpiSetTag function cannot be used in an area bracket, but can be used
  14419.    before an area bracket to give all primitives in the area the same tag. If
  14420.    the attribute mode is AM_PRESERVE, the function saves the previous tag on
  14421.    the attribute stack when it sets the new tag. The previous tag can be
  14422.    retrieved using the GpiPop function.
  14423.  
  14424.  Parameters
  14425.  
  14426.    hps  Identifies the presentation space.
  14427.  
  14428.    lTag  Specifies a tag. It must be an integer value.
  14429.  
  14430.  Return Value
  14431.  
  14432.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  14433.    an error occurred.
  14434.  
  14435.  Errors
  14436.  
  14437.    Use the WinGetLastError function to retrieve the error value, which may be
  14438.    the following:
  14439.  
  14440.          PMERR_INV_MICROPS_FUNCTION
  14441.  
  14442.  Comment
  14443.  
  14444.    Although primitives in an unnamed segment can be tagged, the correlation
  14445.    functions cannot pick or correlate unnamed segments or any tags applied to
  14446.    them are ignored.
  14447.  
  14448.  See Also
  14449.  
  14450.    GpiBeginArea, GpiCorrelateChain, GpiCorrelateFrom,
  14451.    GpiCorrelateSegment, GpiEndArea, GpiSetAttrMode
  14452.  
  14453.  
  14454.  ────────────────────────────────────────────────────────────────────────────
  14455.  GpiSetViewingLimits
  14456.  ────────────────────────────────────────────────────────────────────────────
  14457.    BOOL GpiSetViewingLimits (hps, pgrcLimits)
  14458.    HPS hps;                /*presentation-space handle                     */
  14459.    PRECTL prclLimits;      /*pointer to structure with viewing limits      */
  14460.  
  14461.    The GpiSetViewingLimits function sets the viewing limits. The viewing
  14462.    limits specify a rectangle in model space that the system uses to clip
  14463.    output. The viewing limits include all points inside the rectangle and all
  14464.    points on the left and bottom edges. It does not include points on the
  14465.    right and top edges. Points on these edges are clipped.
  14466.  
  14467.    The GpiSetViewingLimits function can be used in a segment to set the
  14468.    viewing limits for subsequent primitives in the segment. The viewing
  14469.    limits also apply to any called segments, unless the called segment itself
  14470.    sets the viewing limits.
  14471.  
  14472.  Parameters
  14473.  
  14474.    hps  Identifies the presentation space.
  14475.  
  14476.    prclLimits  Points to the RECTL structure that contains the coordinates of
  14477.    the viewing limits. The RECTL structure has the following form:
  14478.  
  14479.    typedef struct _RECTL {
  14480.        LONG  xLeft;
  14481.        LONG  yBottom;
  14482.        LONG  xRight;
  14483.        LONG  yTop;
  14484.    } RECTL;
  14485.  
  14486.    For a full description, see Chapter 4, "Types, Macros, Structures."
  14487.  
  14488.  Return Value
  14489.  
  14490.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  14491.    an error occurred.
  14492.  
  14493.  Comments
  14494.  
  14495.    Unless the segments in the picture chain have the fast-chaining attribute,
  14496.    the system resets the default viewing limits when each segment in the
  14497.    chain is drawn. The default viewing limits include all model space,
  14498.    meaning nothing is clipped.
  14499.  
  14500.    The segment and model transformations do not affect the viewing limits,
  14501.    but the current viewing and default viewing transformations do.
  14502.  
  14503.  See Also
  14504.  
  14505.    GpiQueryViewingLimits, GpiSetAttrMode
  14506.  
  14507.  
  14508.  ────────────────────────────────────────────────────────────────────────────
  14509.  GpiSetViewingTransformMatrix
  14510.  ────────────────────────────────────────────────────────────────────────────
  14511.    BOOL GpiSetViewingTransformMatrix (hps, cElements, pmatlf, flType)
  14512.    HPS hps;                /*presentation-space handle                     */
  14513.    LONG cElements;         /*number of elements                            */
  14514.    PMATRIXLF pmatlf;       /*pointer to structure with transformation      */
  14515.                            /*matrix                                        */
  14516.    LONG flType;            /*transformation type                           */
  14517.  
  14518.    The GpiSetViewingTransformMatrix function sets the viewing transformation.
  14519.    The viewing transformation applies to all primitives inside subsequently
  14520.    opened (new) segments (it has no effect on primitives outside segments).
  14521.    All graphics primitives in a segment have the same viewing transformation,
  14522.    since the function cannot be used in an open segment. Also, once set for a
  14523.    segment, the viewing transformation cannot be altered.
  14524.  
  14525.    The GpiSetViewingTransformMatrix function sets the transformation by
  14526.    replacing the existing transformation matrix with the matrix pointed to by
  14527.    the pmatlf parameter. The function replaces the existing transformation
  14528.    matrix as specified by the flType parameter. The function requires a
  14529.    nine-element matrix to set the viewing transformation. If the specified
  14530.    matrix does not contain nine elements, the function uses the corresponding
  14531.    elements of the identity matrix for each unspecified element. The
  14532.    cElements parameter specifies the number of elements in the matrix. If
  14533.    this parameter equals zero, the identity matrix is used. If scaling values
  14534.    greater than one are given, care must be taken that the combined effect of
  14535.    this and any other relevant transformations do not exceed the limit for
  14536.    fixed-point numbers.
  14537.  
  14538.  Parameters
  14539.  
  14540.    hps  Identifies the presentation space.
  14541.  
  14542.    cElements  Specifies the number of elements in the matrix to set. It can
  14543.    be any integer in the range 0 through 9.
  14544.  
  14545.    pmatlf  Points to the MATRIXLF structure that contains the transformation
  14546.    matrix. The MATRIXLF structure has the following form:
  14547.  
  14548.    typedef struct _MATRIXLF {
  14549.        FIXED fxM11;
  14550.        FIXED fxM12;
  14551.        LONG  lM13;
  14552.        FIXED fxM21;
  14553.        FIXED fxM22;
  14554.        LONG  lM23;
  14555.        LONG  lM31;
  14556.        LONG  lM32;
  14557.        LONG  lM33;
  14558.    } MATRIXLF;
  14559.  
  14560.    For a full description, see Chapter 4, "Types, Macros, Structures."
  14561.  
  14562.    flType  Specifies the transform type. It can be TRANSFORM_REPLACE. The
  14563.    previous viewing transformation is discarded and replaced by a specified
  14564.    transformation.
  14565.  
  14566.  Return Value
  14567.  
  14568.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  14569.    an error occurred.
  14570.  
  14571.  Errors
  14572.  
  14573.    Use the WinGetLastError function to retrieve the error value, which may be
  14574.    one of the following:
  14575.  
  14576.          PMERR_INV_MICROPS_FUNCTION
  14577.          PMERR_INV_TRANSFORM_TYPE
  14578.  
  14579.  Example
  14580.  
  14581.    This example uses the GpiSetViewingTransformMatrix function to replace the
  14582.    existing viewing transformation. The new transformation doubles the width
  14583.    and height of drawing.
  14584.  
  14585.    MATRIXLF matlf = { MAKEFIXED(2,0), 0, 0, 0, MAKEFIXED(2,0), 0, 100 };
  14586.  
  14587.    GpiSetViewingTransformMatrix(hps, 7L, &matlf, TRANSFORM_REPLACE);
  14588.  
  14589.  See Also
  14590.  
  14591.    GpiQueryDefaultViewMatrix, GpiQueryViewingTransformMatrix
  14592.  
  14593.  
  14594.  ────────────────────────────────────────────────────────────────────────────
  14595.  GpiStrokePath
  14596.  ────────────────────────────────────────────────────────────────────────────
  14597.    LONG GpiStrokePath (hps, lPath, flOptions)
  14598.    HPS hps;                /*presentation-space handle                     */
  14599.    LONG lPath;             /*stroke path                                   */
  14600.    ULONG flOptions;        /*reserved                                      */
  14601.  
  14602.    The GpiStrokePath function strokes a path and then draws it using the area
  14603.    attributes. This function first converts the path to one describing the
  14604.    envelope of a wide line stroked using the current geometric wide-line
  14605.    attribute (see the GpiSetLineWidthGeom function).
  14606.  
  14607.  Parameters
  14608.  
  14609.    hps  Identifies a presentation space.
  14610.  
  14611.    lPath  Specifies the path to stroke.
  14612.  
  14613.    flOptions  Specifies a reserved value; it must be zero.
  14614.  
  14615.  Return Value
  14616.  
  14617.    The return value is GPI_OK or GPI_HITS if the function is successful (it
  14618.    is GPI_HITS if the detectable attribute is set for the presentation space
  14619.    and a correlation hit occurs). The return value is GPI_ERROR if an error
  14620.    occurs.
  14621.  
  14622.  Example
  14623.  
  14624.    This example uses the GpiStrokePath to draw a wide line.
  14625.  
  14626.    POINTL ptlStart = { 0, 0 };
  14627.    POINTL ptlTriangle[] = { 100, 100, 200, 0, 0, 0 };
  14628.  
  14629.    /* create the path */
  14630.  
  14631.    GpiBeginPath(hps, 1L);
  14632.    GpiMove(hps, &ptlStart);
  14633.    GpiPolyLine(hps, 3, ptlTriangle);
  14634.    GpiEndPath(hps);
  14635.  
  14636.    GpiSetLineWidthGeom(hps, 20L); /* set the line width           */
  14637.    GpiStrokePath(hps, 1L, 0L);    /* draw the wide line           */
  14638.  
  14639.  See Also
  14640.  
  14641.    GpiBeginPath, GpiEndPath, GpiModifyPath, GpiSetLineWidthGeom
  14642.  
  14643.  
  14644.  ────────────────────────────────────────────────────────────────────────────
  14645.  GpiUnloadFonts
  14646.  ────────────────────────────────────────────────────────────────────────────
  14647.    BOOL GpiUnloadFonts (hab, pszModName)
  14648.    HAB hab;                /*anchor-block handle                           */
  14649.    PSZ pszModName;         /*pointer to the module name                    */
  14650.  
  14651.    The GpiUnloadFonts function unloads font definitions that were previously
  14652.    loaded from the resource file specified by the pszModName parameter.
  14653.    Before unloading fonts, the application should delete any local
  14654.    identifiers previously assigned to the fonts. The function unloads the
  14655.    fonts for the application only. If any other applications have loaded the
  14656.    fonts, they remain available for those applications.
  14657.  
  14658.  Parameters
  14659.  
  14660.    hab  Identifies the anchor block.
  14661.  
  14662.    pszModName  Points to a null-terminated string. This string must be a
  14663.    valid MS OS/2 filename. If it does not specify a path and the filename
  14664.    extension, the function appends the default extension (.dll) and searches
  14665.    for the font resource file in the directories specified by the libpath
  14666.    command in the config.sys file.
  14667.  
  14668.  Return Value
  14669.  
  14670.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  14671.    an error occurred.
  14672.  
  14673.  Errors
  14674.  
  14675.    Use the WinGetLastError function to retrieve the error value, which may be
  14676.    the following:
  14677.  
  14678.          PMERR_FONT_NOT_LOADED
  14679.  
  14680.  See Also
  14681.  
  14682.    GpiCreateLogFont, GpiDeleteSetId, GpiLoadFonts, GpiSetCharSet
  14683.  
  14684.  
  14685.  ────────────────────────────────────────────────────────────────────────────
  14686.  GpiUnrealizeColorTable
  14687.  ────────────────────────────────────────────────────────────────────────────
  14688.    BOOL GpiUnrealizeColorTable (hps)
  14689.    HPS hps;                /*presentation-space handle                     */
  14690.  
  14691.    The GpiUnrealizeColorTable function "unrealizes" the logical color table.
  14692.    The function has the opposite effect of the GpiRealizeColorTable function.
  14693.    It restores the default device colors for the physical palette for the
  14694.    device associated with the given presentation space.
  14695.  
  14696.    The function does not change the logical color table.
  14697.  
  14698.  Parameters
  14699.  
  14700.    hps  Identifies the presentation space.
  14701.  
  14702.  Return Value
  14703.  
  14704.    The return value is GPI_OK if the function is successful or GPI_ERROR if
  14705.    an error occurred.
  14706.  
  14707.  See Also
  14708.  
  14709.    GpiRealizeColorTable
  14710.  
  14711.  
  14712.  ────────────────────────────────────────────────────────────────────────────
  14713.  GpiWCBitBlt
  14714.  ────────────────────────────────────────────────────────────────────────────
  14715.    LONG GpiWCBitBlt (hps, hbm, cPoints, aptl, lRop, flOptions)
  14716.    HPS hps;                /*presentation-space handle                     */
  14717.    HBITMAP hbm;            /*bitmap handle                                 */
  14718.    LONG cPoints;           /*number of points                              */
  14719.    PPOINTL aptl;           /*pointer to structure with points              */
  14720.    LONG lRop;              /*mixing function                               */
  14721.    ULONG flOptions;        /*options                                       */
  14722.  
  14723.    The GpiWCBitBlt function copies a bitmap to a presentation space. It can
  14724.    also modify the bitmap within a rectangle in a presentation space. The
  14725.    exact operation carried out by GpiWCBitBlt depends on the raster operation
  14726.    specified by the lRop parameter.
  14727.  
  14728.    If lRop directs GpiWCBitBlt to copy a bitmap, the function copies the
  14729.    bitmap specified by hbm to the presentation space. The presentation space
  14730.    must be associated with a device context for the display, for memory, or
  14731.    for some other suitable raster device. The aptl parameter points to an
  14732.    array of points that specify the corners of a rectangle in the bitmap as
  14733.    well as the corners of the rectangle in the presentation space to receive
  14734.    the bitmap. The bitmap rectangle is specified in device coordinates; the
  14735.    presentation-space rectangle in world coordinates. If the bitmap and
  14736.    presentation-space rectangles are not the same (after converting the
  14737.    presentation space to device coordinates), GpiWCBitBlt stretches or
  14738.    compresses the bitmap to fit the presentation-space rectangle.
  14739.  
  14740.    If lRop directs GpiWCBitBlt to modify a bitmap, the function uses the
  14741.    raster operation to determine how to alter the bits in a rectangle in the
  14742.    presentation space. Raster operations include changes such as inverting
  14743.    existing bits, replacing bits with pattern bits, and mixing existing and
  14744.    pattern bits to create new colors. For some raster operations, the
  14745.    function mixes the bits of the bitmap with the presentation space and/or
  14746.    pattern bits.
  14747.  
  14748.  Parameters
  14749.  
  14750.    hps  Identifies the presentation space.
  14751.  
  14752.    hbm  Identifies the bitmap.
  14753.  
  14754.    cPoints  Specifies the number of points pointed to by the aptl parameter.
  14755.    It must be 4.
  14756.  
  14757.    aptl  Points to an array of POINTL structures that contains the number of
  14758.    points specified in the cPoints parameter. The points must be given in the
  14759.    following order:
  14760.  
  14761.    Element      Coordinate
  14762.    index
  14763.    ──────────────────────────────────────────────────────────────────────────
  14764.    0            Specifies the lower-left corner of the target rectangle in
  14765.                 world coordinates.
  14766.  
  14767.    1            Specifies the upper-right corner of the target rectangle in
  14768.                 world coordinates.
  14769.  
  14770.    3            Specifies the lower-left corner of the source rectangle in
  14771.                 device coordinates.
  14772.  
  14773.    4            Specifies the upper-right corner of the source rectangle in
  14774.                 device coordinates.
  14775.    ──────────────────────────────────────────────────────────────────────────
  14776.  
  14777.    The POINTL structure has the following form:
  14778.  
  14779.    typedef struct _POINTL  {
  14780.        LONG  x;
  14781.        LONG  y;
  14782.    } POINTL;
  14783.  
  14784.    For a full description, see Chapter 4, "Types, Macros, Structures."
  14785.  
  14786.    lRop  Specifies the raster operation for the function. It can be any value
  14787.    in the range 0 through 255 or one of the following values, which represent
  14788.    common raster operations:
  14789.  
  14790. ╓┌─┌───────────────────┌─────────────────────────────────────────────────────╖
  14791.    Value               Meaning
  14792.    ──────────────────────────────────────────────────────────────────────────
  14793.    ROP_DSTINVERT       Inverts the target.
  14794.  
  14795.    ROP_MERGECOPY       Combines the source and the pattern using the bitwise
  14796.                        AND operator.
  14797.  
  14798.    ROP_MERGEPAINT      Combines the inverse of the source and the target
  14799.                        using the bitwise OR operator.
  14800.  
  14801.    ROP_NOTSRCCOPY      Copies the inverse of the source to the target.
  14802.  
  14803.    ROP_NOTSRCERASE     Combines the inverse of the source and the inverse of
  14804.                        the target bitmaps using the bitwise AND operator.
  14805.  
  14806.    ROP_ONE             Sets all target pels to 1.
  14807.    Value               Meaning
  14808.    ──────────────────────────────────────────────────────────────────────────
  14809.   ROP_ONE             Sets all target pels to 1.
  14810.  
  14811.    ROP_PATCOPY         Copies the pattern to the target.
  14812.  
  14813.    ROP_PATINVERT       Combines the target and the pattern using the bitwise
  14814.                        exclusive XOR operator.
  14815.  
  14816.    ROP_PATPAINT        Combines the inverse of the source, the pattern, and
  14817.                        target using the bitwise OR operator.
  14818.  
  14819.    ROP_SRCAND          Combines the source and target bitmaps using the
  14820.                        bitwise AND operator.
  14821.  
  14822.    ROP_SRCCOPY         Copies the source bitmap to the target.
  14823.  
  14824.    ROP_SRCERASE        Combines the source and the inverse of the target
  14825.                        bitmaps using the bitwise AND operator.
  14826.  
  14827.    ROP_SRCINVERT       Combines the source and target bitmaps using the
  14828.    Value               Meaning
  14829.    ──────────────────────────────────────────────────────────────────────────
  14830.   ROP_SRCINVERT       Combines the source and target bitmaps using the
  14831.                        bitwise exclusive OR operator.
  14832.  
  14833.    ROP_SRCPAINT        Combines the source and target bitmaps using the
  14834.                        bitwise OR operator.
  14835.  
  14836.    ROP_ZERO            Sets all target pels to 0.
  14837.    ──────────────────────────────────────────────────────────────────────────
  14838.  
  14839.  
  14840.    flOptions  Specifies how to compress a bitmap if the target rectangle is
  14841.    smaller than the source. It can be one of the following values:
  14842.  
  14843.    Value               Meaning
  14844.    ──────────────────────────────────────────────────────────────────────────
  14845.    BBO_AND             Compresses two rows or columns into one by combining
  14846.                        them with the bitwise AND operator. This value is
  14847.                        useful for compressing bitmaps that have black images
  14848.                        on a white background.
  14849.  
  14850.    BBO_OR              Compresses two rows or columns into one by combining
  14851.                        them with the bitwise OR operator. This value is the
  14852.                        default and is useful for compressing bitmaps that
  14853.                        have white images on a black background.
  14854.  
  14855.    BBO_IGNORE          Compresses two rows or columns by throwing one out.
  14856.                        This value is useful for compressing color bitmaps.
  14857.    ──────────────────────────────────────────────────────────────────────────
  14858.  
  14859.    All values in the range 0x0100 to 0xFF00 are reserved for privately
  14860.    supported modes for particular devices.
  14861.  
  14862.  Return Value
  14863.  
  14864.    The return value is GPI_OK or GPI_HITS if the function is successful (it
  14865.    is GPI_HITS if the detectable attribute is set for the presentation space
  14866.    and a correlation hit occurs). The return value is GPI_ERROR if an error
  14867.    occurs.
  14868.  
  14869.  Errors
  14870.  
  14871.    Use the WinGetLastError function to retrieve the error value, which may be
  14872.    one of the following:
  14873.  
  14874.          PMERR_BASE_ERROR
  14875.          PMERR_BITMAP_NOT_SELECTED
  14876.          PMERR_INCOMPATIBLE_BITMAP
  14877.          PMERR_INV_BITBLT_MIX
  14878.          PMERR_INV_BITBLT_STYLE
  14879.          PMERR_INV_COORDINATE
  14880.          PMERR_INV_DC_TYPE
  14881.          PMERR_INV_HBITMAP
  14882.          PMERR_INV_HDC
  14883.          PMERR_INV_IN_AREA
  14884.          PMERR_INV_IN_PATH
  14885.          PMERR_INV_LENGTH_OR_COUNT
  14886.  
  14887.  Comments
  14888.  
  14889.    The GpiWCBitBlt function can be used in an open segment. If the drawing
  14890.    mode is DM_DRAWANDRETAIN or DM_RETAIN, the function builds a graphics
  14891.    order in the current open segment. The order identifies the bitmap handle
  14892.    and uses uses long or short coordinates, as determined by the
  14893.    presentation-space format.
  14894.  
  14895.    GpiWCBitBlt does not affect the pels in the upper and right boundaries of
  14896.    the presentation-space rectangle. This means the function draws up to but
  14897.    does not include those pels. Also, the function ignores any rotation
  14898.    transformations.
  14899.  
  14900.    If the lRop parameter includes a pattern, GpiWCBitBlt uses the current
  14901.    area color, area background color, pattern set, and pattern symbol of the
  14902.    presentation space. Although the function may stretch or compress the
  14903.    bitmap, it never stretches or compresses the pattern.
  14904.  
  14905.    If the presentation-space and the bitmap have different color formats,
  14906.    GpiWCBitBlt converts the bitmap color format as it copies the bitmap. This
  14907.    applies to bitmaps copied to a device context having a monochrome format.
  14908.    To convert a monochrome bitmap to a color bitmap, GpiWCBitBlt converts 1
  14909.    pels to the presentation foreground color, and 0 pels to the current-area
  14910.    background color.
  14911.  
  14912.  Example
  14913.  
  14914.    This example uses GpiWCBitBlt to copy and compress a bitmap in a
  14915.    presentation space. The function copies the bitmap that is 100 pels wide
  14916.    and 100 pels high into a 50-by-50-pel rectangle at the location (300,400).
  14917.    Since the raster operation is ROP_SRCCOPY, GpiWCBitBlt replaces the image
  14918.    previously in the presentation-space rectangle. The function compresses
  14919.    the bitmap to fit the new rectangle by discarding extra rows and columns
  14920.    as specified by the BBO_IGNORE option.
  14921.  
  14922.    HPS hps;
  14923.    HBITMAP hbm;
  14924.    POINTL aptl[4] = {
  14925.        300, 400,      /* lower-left corner of target             */
  14926.        350, 450,      /* upper-right corner of target            */
  14927.        0, 0,          /* lower-left corner of source             */
  14928.        100, 100 };    /* upper-right corner of source            */
  14929.  
  14930.    GpiWCBitBlt(hps,   /* presentation space                      */
  14931.        hbm,           /* bitmap handle                           */
  14932.        4L,            /* four points needed to compress          */
  14933.        aptl,          /* points for source and target rectangles */
  14934.        ROP_SRCCOPY,   /* copy source replacing target            */
  14935.        BBO_IGNORE);   /* discard extra rows and columns          */
  14936.  
  14937.  See Also
  14938.  
  14939.    DevOpenDC, GpiBitBlt, GpiCreateBitmap, GpiLoadBitmap, GpiSetBitmap,
  14940.    GpiSetBitmapDimension, GpiSetBitmapId
  14941.  
  14942.  ────────────────────────────────────────────────────────────────────────────
  14943.  WinAddAtom
  14944.  ────────────────────────────────────────────────────────────────────────────
  14945.    ATOM WinAddAtom (hAtomTbl, pszAtomName)
  14946.    HATOMTBL hAtomTbl;      /*handle to the atom table                      */
  14947.    PSZ pszAtomName;        /*address of the buffer for the atom name       */
  14948.  
  14949.    The WinAddAtom function adds an atom to an atom table and sets its use
  14950.    count to 1. If the atom name already exists in the table, this function
  14951.    adds 1 to its use count.
  14952.  
  14953.  Parameters
  14954.  
  14955.    hAtomTbl  Identifies the atom table. This handle must have been created by
  14956.    a previous call to the WinCreateAtomTable or WinQuerySystemAtomTable
  14957.    function.
  14958.  
  14959.    pszAtomName  Points to the null-terminated character string that contains
  14960.    an atom name to be added to the table. If the string begins with a "#"
  14961.    character, the ASCII digits that follow are converted into a 16-bit
  14962.    integer. If this integer is a valid integer atom, this function returns
  14963.    that atom without actually modifying the atom table. If the string begins
  14964.    with an "!" character, the next two bytes are interpreted as an atom.
  14965.  
  14966.    If the high word of pszAtomName is 0xFFFF, the low word is treated as an
  14967.    atom. If it is an integer atom, that atom is returned. Otherwise the
  14968.    reference count associated with that atom is increased by one and the atom
  14969.    is returned.
  14970.  
  14971.  Return Value
  14972.  
  14973.    The return value is the atom associated with the passed string or NULL.
  14974.    The return value is zero if an invalid atom table or atom name was
  14975.    specified.
  14976.  
  14977.  See Also
  14978.  
  14979.    WinCreateAtomTable, WinDeleteAtom, WinFindAtom, WinQueryAtomLength,
  14980.    WinQueryAtomName, WinQueryAtomUsage
  14981.  
  14982.  
  14983.  ────────────────────────────────────────────────────────────────────────────
  14984.  WinAddProgram
  14985.  ────────────────────────────────────────────────────────────────────────────
  14986.    HPROGRAM WinAddProgram (hab, ppib, hGroupHandle)
  14987.    HAB hab;                /*handle to the anchor block                    */
  14988.    PPIBSTRUCT ppib;        /*address of structure with program information */
  14989.    HPROGRAM hGroupHandle;  /*handle of the program group                   */
  14990.  
  14991.    The WinAddProgram function adds a program title to the program list of a
  14992.    group. Program titles need not be unique, although duplicate titles within
  14993.    the same group are not allowed.
  14994.  
  14995.  Parameters
  14996.  
  14997.    hab  Identifies the anchor block.
  14998.  
  14999.    ppib  Points to a PIBSTRUCT structure that contains program information
  15000.    for the program being added to the program list.
  15001.  
  15002.    The PIBSTRUCT structure has the following form:
  15003.  
  15004.    typedef struct _PIBSTRUCT {
  15005.        PROGTYPE  progt;
  15006.        CHAR      szTitle[MAXNAMEL+1];
  15007.        CHAR      szIconFileName[MAXPATHL+1];
  15008.        CHAR      szExecutable[MAXPATHL+1];
  15009.        CHAR      szStartupDir[MAXPATHL+1];
  15010.        XYWINSIZE xywinInitial;
  15011.        USHORT    res1;
  15012.        LHANDLE   res2;
  15013.        USHORT    cchEnvironmentVars;
  15014.        PCH       pchEnvironmentVars;
  15015.        USHORT    cchProgramParameter;
  15016.        PCH       pchProgramParameter;
  15017.    } PIBSTRUCT;
  15018.  
  15019.    For a full description, see Chapter 4, "Types, Macros, Structures."
  15020.  
  15021.    hGroupHandle  Identifies the program group to which the program is added.
  15022.    The special value SGH_ROOT may be used, indicating the root group.
  15023.  
  15024.  Return Value
  15025.  
  15026.    The return value is the program handle for the program added to the
  15027.    program list.
  15028.  
  15029.  See Also
  15030.  
  15031.    WinCreateGroup, WinQueryDefinition, WinQueryProgramTitles
  15032.  
  15033.  
  15034.  ────────────────────────────────────────────────────────────────────────────
  15035.  WinAddSwitchEntry
  15036.  ────────────────────────────────────────────────────────────────────────────
  15037.    HSWITCH WinAddSwitchEntry (pswctl)
  15038.    PSWCNTRL pswctl;        /*address of structure with new entry           */
  15039.                            /*information                                   */
  15040.  
  15041.    The WinAddSwitchEntry function adds an entry to the switch list (the list
  15042.    of running programs that is displayed by the Task Manager).
  15043.  
  15044.  Parameters
  15045.  
  15046.    pswctl  Points to the SWCNTRL structure that contains information about
  15047.    the new switch-list entry. If the szSwtitle field in the SWCNTRL structure
  15048.    is NULL, the system uses the name under which the application was started.
  15049.    This applies only for the first call to this function for that program
  15050.    (since the program was started). Otherwise, a NULL entry name is invalid.
  15051.  
  15052.    The SWCNTRL structure has the following form:
  15053.  
  15054.    typedef struct _SWCNTRL {
  15055.        HWND     hwnd;
  15056.        HWND     hwndIcon;
  15057.        HPROGRAM hprog;
  15058.        USHORT   idProcess;
  15059.        USHORT   idSession;
  15060.        UCHAR    uchVisibility;
  15061.        UCHAR    fbJump;
  15062.        CHAR     szSwtitle[MAXNAMEL+1];
  15063.        BYTE     fReserved;
  15064.    } SWCNTRL;
  15065.  
  15066.    For a full description, see Chapter 4, "Types, Macros, Structures."
  15067.  
  15068.  Return Value
  15069.  
  15070.    The return value is a handle to the new switch-list entry, or NULL if an
  15071.    error occurs.
  15072.  
  15073.  Example
  15074.  
  15075.    This example calls WinQueryWindowProcess to get the current processor
  15076.    identifier (needed for the SWCNTRL structure). It then sets up the swctl
  15077.    structure and calls WinAddSwitchEntry to add the program's name to the
  15078.    task list. The returned handle can be used in subsequent calls to
  15079.    WinChangeSwitchEntry if the title needs to be changed. The variables
  15080.    swctl, hswitch, and pid should be global if your application will be
  15081.    calling the WinChangeSwitchEntry function to avoid having to set up the
  15082.    structure again.
  15083.  
  15084.    SWCNTRL swctl;
  15085.    HSWITCH hswitch;
  15086.    PID pid;
  15087.  
  15088.    WinQueryWindowProcess(hwndFrame, &pid, NULL);
  15089.  
  15090.    swctl.hwnd = hwndFrame;                 /* window handle      */
  15091.    swctl.hwndIcon = NULL;                  /* icon handle        */
  15092.    swctl.hprog = NULL;                     /* program handle     */
  15093.    swctl.idProcess = pid;                  /* process identifier */
  15094.    swctl.idSession = NULL;                 /* session identifier */
  15095.    swctl.uchVisibility = SWL_VISIBLE;      /* visibility         */
  15096.    swctl.fbJump = SWL_JUMPABLE;            /* jump indicator     */
  15097.    swctl.szSwtitle[0] = NULL;              /* program name       */
  15098.  
  15099.    hswitch = WinAddSwitchEntry(&swctl);
  15100.  
  15101.  Comment
  15102.  
  15103.    Leading and trailing blanks are removed from the title. The title is
  15104.    truncated to 60 characters. There is a system limit to the number of
  15105.    switch-list entries (several hundred) but it is unlikely to be reached
  15106.    because other system limits, such as memory size, will impinge first.
  15107.  
  15108.  See Also
  15109.  
  15110.    WinChangeSwitchEntry, WinQueryWindowProcess, WinRemoveSwitchEntry
  15111.  
  15112.  
  15113.  ────────────────────────────────────────────────────────────────────────────
  15114.  WinAlarm
  15115.  ────────────────────────────────────────────────────────────────────────────
  15116.    BOOL WinAlarm (hwndDesktop, fsType)
  15117.    HWND hwndDesktop;       /*handle of the desktop                         */
  15118.    USHORT fsType;          /*alarm style                                   */
  15119.  
  15120.    The WinAlarm function generates an audible alarm that can be used to alert
  15121.    the user about special conditions.
  15122.  
  15123.  Parameters
  15124.  
  15125.    hwndDesktop  Identifies the desktop window. This parameter can be
  15126.    HWND_DESKTOP or the desktop window handle.
  15127.  
  15128.    fsType  Specifies the alarm style. It can be one of the following values:
  15129.  
  15130.          WA_WARNING
  15131.          WA_NOTE
  15132.          WA_ERROR
  15133.  
  15134.  Return Value
  15135.  
  15136.    The return value is TRUE if the function is successful or FALSE if an
  15137.    error occurs.
  15138.  
  15139.  Comments
  15140.  
  15141.    The duration and frequency of the alarm can be changed by the
  15142.    WinSetSysValue function. The alarm is not generated if the system value
  15143.    SV_ALARM is set to FALSE.
  15144.  
  15145.    The following system values control the alarm:
  15146.  
  15147.    Value                Meaning
  15148.    ──────────────────────────────────────────────────────────────────────────
  15149.    SV_ALARM             Specifies whether calls to WinAlarm generate a sound.
  15150.                         A value of TRUE means sound is generated.
  15151.  
  15152.    SV_ERRORDURATION     Specifies the duration in milliseconds of a WA_ERROR
  15153.                         sound.
  15154.  
  15155.    SV_ERRORFREQ         Specifies the frequency in cycles per second of a
  15156.                         WA_ERROR sound.
  15157.  
  15158.    SV_NOTEDURATION      Specifies the duration in milliseconds of a WA_NOTE
  15159.                         sound.
  15160.  
  15161.    SV_NOTEFREQ          Specifies the frequency in cycles per second of a
  15162.                         WA_NOTE sound.
  15163.  
  15164.    SV_WARNINGDURATION   Specifies the duration in milliseconds of a
  15165.                         WA_WARNING sound.
  15166.  
  15167.    SV_WARNINGFREQ       Specifies the frequency in cycles per second of a
  15168.                         WA_WARNING sound.
  15169.    ──────────────────────────────────────────────────────────────────────────
  15170.  
  15171.  Example
  15172.  
  15173.    This example calls an application-defined initialization function, and if
  15174.    the function fails it calls WinAlarm to generate an audible alarm
  15175.    notifying the user the initialization failed.
  15176.  
  15177.    if (!GenericInit()) {                      /* general initialization */
  15178.        WinAlarm(HWND_DESKTOP, WA_ERROR);
  15179.  
  15180.  See Also
  15181.  
  15182.    WinFlashWindow, WinSetSysValue
  15183.  
  15184.  
  15185.  ────────────────────────────────────────────────────────────────────────────
  15186.  WinAllocMem
  15187.  ────────────────────────────────────────────────────────────────────────────
  15188.    NPBYTE WinAllocMem (hHeap, cb)
  15189.    HHEAP hHeap;            /*handle of the heap                            */
  15190.    USHORT cb;              /*number of bytes to allocate                   */
  15191.  
  15192.    The WinAllocMem function allocates memory from a heap and returns the
  15193.    16-bit offset from the start of the segment that contains the heap.
  15194.  
  15195.  Parameters
  15196.  
  15197.    hHeap  Identifies the heap from which to allocate memory. This handle is
  15198.    returned by a previous call to the WinCreateHeap function.
  15199.  
  15200.    cb  Specifies the number of bytes to allocate.
  15201.  
  15202.  Return Value
  15203.  
  15204.    The return value points to the allocated memory block if the function is
  15205.    successful or is NULL if an error occurs.
  15206.  
  15207.  Comments
  15208.  
  15209.    The low two bits of the returned pointer are always zero. This function
  15210.    returns NULL when it cannot allocate the memory object, either because an
  15211.    invalid heap handle is specified or because there is not enough room in
  15212.    the heap for an object of the specified size and it is unable to grow the
  15213.    segment containing the heap by an amount large enough to satisfy the
  15214.    request.
  15215.  
  15216.    If the specified heap is created with the HM_MOVEABLE option, the value of
  15217.    the cb parameter is remembered in the second reserved word of the
  15218.    allocated block.
  15219.  
  15220.    If no free block is found, WinAllocMem seeks space by calling the
  15221.    WinAvailMem function. If this does not generate a free block large enough,
  15222.    WinAllocMem attempts to grow the segment by the maximum of the size of the
  15223.    request and the minimum growth parameter specified on the call to the
  15224.    WinCreateHeap function. If that fails, this function returns NULL.
  15225.  
  15226.    No synchronization is done for this call. Multi-threaded applications
  15227.    should use semaphores if more than one thread will be making this call to
  15228.    prevent two or more threads from calling this function at the same time.
  15229.  
  15230.    If the heap was created in the default data segment, the returned value
  15231.    may be used directly as a near pointer. Otherwise, it must be combined
  15232.    with the selector of the heap segment to create a far pointer. The MAKEP
  15233.    macro can be used for this purpose as in the following code fragment:
  15234.  
  15235.    NPBYTE npb;
  15236.    PBYTE pb;
  15237.  
  15238.    npb = WinAllocMem(...);
  15239.    pb = MAKEP(sel,          /* heap segment selector           */
  15240.        (USHORT) npb);       /* value returned from WinAllocMem */
  15241.  
  15242.  See Also
  15243.  
  15244.    WinAvailMem, WinCreateHeap, WinFreeMem, WinReallocMem
  15245.  
  15246.  
  15247.  ────────────────────────────────────────────────────────────────────────────
  15248.  WinAvailMem
  15249.  ────────────────────────────────────────────────────────────────────────────
  15250.    USHORT WinAvailMem (hHeap, fCompact, cbMinFree)
  15251.    HHEAP hHeap;            /*handle of the heap                            */
  15252.    BOOL fCompact;          /*memory-compaction flag                        */
  15253.    USHORT cbMinFree;       /*amount of storage requested                   */
  15254.  
  15255.    The WinAvailMem function returns the size of the largest free block on the
  15256.    heap.
  15257.  
  15258.  Parameters
  15259.  
  15260.    hHeap  Identifies the heap. This handle must have been created by a
  15261.    previous call to the WinCreateHeap function.
  15262.  
  15263.    fCompact  Specifies the memory-compaction flag. If TRUE, the heap is
  15264.    reorganized. If FALSE, the heap is not reorganized.
  15265.  
  15266.    cbMinFree  This parameter is currently not used, but should be set to the
  15267.    amount of storage the caller is requesting. A future release may use this
  15268.    value to limit the scope of the compaction.
  15269.  
  15270.  Return Value
  15271.  
  15272.    The return value is the largest memory block available if the function is
  15273.    successful, or 0xFFFF if an error occurs.
  15274.  
  15275.  Comments
  15276.  
  15277.    If the passed heap was created with the HM_MOVEABLE option, the
  15278.    reorganization entails moving all movable blocks toward the beginning of
  15279.    the heap. The presence of fixed objects may inhibit the amount of movement
  15280.    that can occur. While the compaction is occurring, the dedicated and
  15281.    nondedicated free lists are reconstructed from any free blocks that cannot
  15282.    be filled by the compactor.
  15283.  
  15284.    If the passed heap was not created with the HM_MOVEABLE option, the
  15285.    reorganization entails sorting all free lists into a single list in
  15286.    address order, scanning the list for adjacent blocks to coalesce, and then
  15287.    reconstructing the dedicated and nondedicated free lists.
  15288.  
  15289.    No synchronization is done for this call. Multi-threaded applications
  15290.    should use semaphores if more then one thread will be making this call to
  15291.    prevent two or more threads from calling this function at the same time.
  15292.  
  15293.  See Also
  15294.  
  15295.    WinAllocMem, WinCreateHeap, WinFreeMem, WinReallocMem
  15296.  
  15297.  
  15298.  ────────────────────────────────────────────────────────────────────────────
  15299.  WinBeginEnumWindows
  15300.  ────────────────────────────────────────────────────────────────────────────
  15301.    HENUM WinBeginEnumWindows (hwnd)
  15302.    HWND hwnd;              /*handle of the parent window                   */
  15303.  
  15304.    The WinBeginEnumWindows function begins the enumeration process for all
  15305.    immediate child windows of a specified window. This function takes a
  15306.    snapshot of the window hierarchy at the time the function is called and
  15307.    enumerates the windows in the order they were at the time the snapshot is
  15308.    taken. The topmost child window is enumerated first, guaranteeing that all
  15309.    child windows are enumerated.
  15310.  
  15311.  Parameters
  15312.  
  15313.    hwnd  Identifies the parent window whose child windows are enumerated. If
  15314.    this parameter is HWND_DESKTOP, all main windows are enumerated.
  15315.  
  15316.  Return Value
  15317.  
  15318.    The return value is the handle to an enumeration list and is used in
  15319.    subsequent calls to WinGetNextWindow to retrieve the window handles in
  15320.    succession. When the application has finished the enumeration, this handle
  15321.    must be destroyed by the WinEndEnumWindows function.
  15322.  
  15323.  Comments
  15324.  
  15325.    The enumerated windows are not locked and can be destroyed between the
  15326.    time this function is called and the time that the WinGetNextWindow
  15327.    function is used to obtain the window handle. However, enumerated window
  15328.    handles referenced by the enumeration handle will be removed from the
  15329.    enumeration list if they are destroyed. Thus they will not be returned by
  15330.    WinGetNextWindow.
  15331.  
  15332.  See Also
  15333.  
  15334.    WinEndEnumWindows, WinGetNextWindow
  15335.  
  15336.  
  15337.  ────────────────────────────────────────────────────────────────────────────
  15338.  WinBeginPaint
  15339.  ────────────────────────────────────────────────────────────────────────────
  15340.    HPS WinBeginPaint (hwnd, hps, prclPaint)
  15341.    HWND hwnd;              /*handle of the window handle                   */
  15342.    HPS hps;                /*handle of the presentation space              */
  15343.    PRECTL prclPaint;       /*address of structure for bounding rectangle   */
  15344.  
  15345.    The WinBeginPaint function obtains a presentation space whose visible
  15346.    region is the window's update region. This sets up the presentation space
  15347.    so that any drawing will only occur within the update region. The
  15348.    presentation space can be an existing one supplied to this function, in
  15349.    which case its visible region will be set to the update region of hwnd.
  15350.    Otherwise, a cached presentation space is obtained specifically for the
  15351.    window.
  15352.  
  15353.    The WinEndPaint function must be called when drawing is complete.
  15354.  
  15355.  Parameters
  15356.  
  15357.    hwnd  Identifies the window where drawing will occur.
  15358.  
  15359.    hps  Identifies the presentation space to use. If this parameter is NULL,
  15360.    a cache presentation space is created.
  15361.  
  15362.    prclPaint  Points to a RECTL structure that will be set to the smallest
  15363.    rectangle bounding the update region. The RECTL structure has the
  15364.    following form:
  15365.  
  15366.    typedef struct _RECTL {
  15367.        LONG  xLeft;
  15368.        LONG  yBottom;
  15369.        LONG  xRight;
  15370.        LONG  yTop;
  15371.    } RECTL;
  15372.  
  15373.    For a full description, see Chapter 4, "Types, Macros, Structures."
  15374.  
  15375.  Return Value
  15376.  
  15377.    The return value is a handle to a presentation space, or NULL if an error
  15378.    occurred.
  15379.  
  15380.  Comments
  15381.  
  15382.    This function hides the cursor, if it is in the window, until the
  15383.    WinEndPaint function is called.
  15384.  
  15385.  Example
  15386.  
  15387.    This example calls WinBeginPaint when it receives a WM_PAINT message to
  15388.    get a presentation-space handle to the update region, and to get the
  15389.    coordinates of the update rectangle. It then fills the update rectangle
  15390.    and calls WinEndPaint to release the presentation space.
  15391.  
  15392.    case WM_PAINT:
  15393.        hps = WinBeginPaint(hwnd,   /* handle of the window      */
  15394.            NULL,                   /* get a cache ps            */
  15395.            &rcl);                  /* receives update rectangle */
  15396.        WinFillRect(hps, &rcl, CLR_WHITE);
  15397.        WinEndPaint(hps);
  15398.  
  15399.  See Also
  15400.  
  15401.    WinEndPaint
  15402.  
  15403.  
  15404.  ────────────────────────────────────────────────────────────────────────────
  15405.  WinBroadcastMsg
  15406.  ────────────────────────────────────────────────────────────────────────────
  15407.    BOOL WinBroadcastMsg (hwnd, msg, mp1, mp2, fs)
  15408.    HWND hwnd;              /*handle of the parent window                   */
  15409.    USHORT msg;             /*message                                       */
  15410.    MPARAM mp1;             /*message parameter                             */
  15411.    MPARAM mp2;             /*message parameter                             */
  15412.    USHORT fs;              /*windows to send message to                    */
  15413.  
  15414.    The WinBroadcastMsg function broadcasts a message to multiple windows.
  15415.    This function sends or posts a message to all immediate child windows of
  15416.    the specified window.
  15417.  
  15418.  Parameters
  15419.  
  15420.    hwnd  Identifies the window whose immediate child windows will receive the
  15421.    message. If this parameter is NULL, the function sends the message to all
  15422.    main windows on the screen.
  15423.  
  15424.    msg  Specifies the message.
  15425.  
  15426.    mp1  Specifies the first message parameter.
  15427.  
  15428.    mp2  Specifies the second message parameter.
  15429.  
  15430.    fs  Specifies which windows to send the message to, and whether the
  15431.    message should be sent or posted. The value consists of a flag from each
  15432.    of the following lists combined using the OR operator.
  15433.  
  15434.    The following list contains the values specifying which windows to
  15435.    broadcast the message to:
  15436.  
  15437.    Destination       Meaning
  15438.    ──────────────────────────────────────────────────────────────────────────
  15439.    BMSG_DESCENDANTS  Post or send the message to hwnd and all of its
  15440.                      descendants.
  15441.  
  15442.    BMSG_FRAMEONLY    Post or send the message to frame windows only.
  15443.    ──────────────────────────────────────────────────────────────────────────
  15444.  
  15445.    The following list contains the values specifying how to broadcast the
  15446.    message (send or post):
  15447.  
  15448.    Value             Meaning
  15449.    ──────────────────────────────────────────────────────────────────────────
  15450.    BMSG_POST         Post a message to all child windows of the window
  15451.                      specified by the hwnd parameter.
  15452.  
  15453.    BMSG_POSTQUEUE    Post a message to all threads that have a message queue.
  15454.                      The message's hwnd parameter will be NULL.
  15455.  
  15456.    BMSG_SEND         Send a message to all children of the window specified
  15457.                      by the hwnd parameter.
  15458.    ──────────────────────────────────────────────────────────────────────────
  15459.  
  15460.  Return Value
  15461.  
  15462.    The return value is TRUE if the function is successful or FALSE if an
  15463.    error occurs.
  15464.  
  15465.  See Also
  15466.  
  15467.    WinPostMsg, WinSendMsg
  15468.  
  15469.  
  15470.  ────────────────────────────────────────────────────────────────────────────
  15471.  WinCalcFrameRect
  15472.  ────────────────────────────────────────────────────────────────────────────
  15473.    BOOL WinCalcFrameRect (hwndFrame, prcl, fClient)
  15474.    HWND hwndFrame;         /*handle of the frame window                    */
  15475.    PRECTL prcl;            /*address of structure with window rectangle    */
  15476.    BOOL fClient;           /*client-indicator flag                         */
  15477.  
  15478.    The WinCalcFrameRect function calculates a client rectangle from a frame
  15479.    rectangle or calculates a frame rectangle from a client rectangle. This
  15480.    function provides the size and position of the client area within the
  15481.    specified frame window, or conversely, the size and position of the frame
  15482.    window that would contain a client window of the specified size and
  15483.    position.
  15484.  
  15485.  Parameters
  15486.  
  15487.    hwndFrame  Identifies the frame window.
  15488.  
  15489.    prcl  Points to the RECTL structure that contains the coordinates of the
  15490.    window. If the fClient parameter is TRUE, this structure contains the
  15491.    coordinates of the frame window, and on return, it will contain the
  15492.    coordinates of a client window. If the fClient parameter is FALSE, this
  15493.    structure contains the coordinates of the client window, and on return, it
  15494.    will contain the coordinates of a frame window. The RECTL structure has
  15495.    the following form:
  15496.  
  15497.    typedef struct _RECTL {
  15498.        LONG  xLeft;
  15499.        LONG  yBottom;
  15500.        LONG  xRight;
  15501.        LONG  yTop;
  15502.    } RECTL;
  15503.  
  15504.    For a full description, see Chapter 4, "Types, Macros, Structures."
  15505.  
  15506.    fClient  Specifies whether the window to calculate is a client window or a
  15507.    frame window. If TRUE, a client window is calculated. If FALSE, a frame
  15508.    window is calculated.
  15509.  
  15510.  Return Value
  15511.  
  15512.    The return value is TRUE if the function is successful or FALSE if an
  15513.    error occurs.
  15514.  
  15515.  
  15516.  ────────────────────────────────────────────────────────────────────────────
  15517.  WinCallMsgFilter
  15518.  ────────────────────────────────────────────────────────────────────────────
  15519.    BOOL WinCallMsgFilter (hab, pqmsg, msgf)
  15520.    HAB hab;                /*handle of the anchor block                    */
  15521.    PQMSG pqmsg;            /*address of structure with message             */
  15522.    USHORT msgf;            /*message-filter code                           */
  15523.  
  15524.    The WinCallMsgFilter function calls a message-filter hook. This function
  15525.    allows an application to pass a message to the message-filter hook
  15526.    procedure(s).
  15527.  
  15528.  Parameters
  15529.  
  15530.    hab  Identifies the anchor block.
  15531.  
  15532.    pqmsg  Points to the QMSG structure that contains the message to be passed
  15533.    to the message-filter hook procedure. The QMSG structure has the following
  15534.    form:
  15535.  
  15536.    typedef struct _QMSG {
  15537.        HWND   hwnd;
  15538.        USHORT msg;
  15539.        MPARAM mp1;
  15540.        MPARAM mp2;
  15541.        ULONG  time;
  15542.        POINTL ptl;
  15543.    } QMSG;
  15544.  
  15545.    For a full description, see Chapter 4, "Types, Macros, Structures."
  15546.  
  15547.    msgf  Specifies the message-filter code passed to the message-filter hook.
  15548.    This can be one of the following values:
  15549.  
  15550.    Message           Meaning
  15551.    ──────────────────────────────────────────────────────────────────────────
  15552.    MSGF_DIALOGBOX    Message originated while processing a modal dialog.
  15553.  
  15554.    MSGF_MESSAGEBOX   Message originated while processing a message box.
  15555.  
  15556.    MSGF_TRACK        Message originated while tracking a control, such as a
  15557.                      scroll bar.
  15558.    ──────────────────────────────────────────────────────────────────────────
  15559.  
  15560.  Return Value
  15561.  
  15562.    The return value is TRUE if a message-filter hook returned TRUE.
  15563.    Otherwise, it is FALSE, indicating that all message-filter hooks returned
  15564.    FALSE or that no message-filter hooks are defined.
  15565.  
  15566.  See Also
  15567.  
  15568.    WinDispatchMsg, WinGetMsg
  15569.  
  15570.  
  15571.  ────────────────────────────────────────────────────────────────────────────
  15572.  WinCancelShutdown
  15573.  ────────────────────────────────────────────────────────────────────────────
  15574.    BOOL WinCancelShutdown (hmq, fCancelAlways)
  15575.    HMQ hmq;                /*handle of the message queue                   */
  15576.    BOOL fCancelAlways;     /*status of WM_QUIT message                     */
  15577.  
  15578.    The WinCancelShutdown function allows a thread to function after receiving
  15579.    a WM_QUIT message. The thread must call the WinCancelShutdown function,
  15580.    passing its message-queue handle for identification. If the thread owns
  15581.    the active window, that window is pushed to the bottom and deactivated.
  15582.    WinCancelShutdown maintains a list of queues associated with the threads
  15583.    that called it to avoid sending another WM_QUIT message to the same thread
  15584.    later.
  15585.  
  15586.  Parameters
  15587.  
  15588.    hmq  Identifies the message queue for the current thread.
  15589.  
  15590.    fCancelAlways  Specifies whether the thread receives WM_QUIT messages
  15591.    during system shutdown. If this parameter is TRUE, the thread does not
  15592.    receive WM_QUIT messages during system shutdown. Note that this does not
  15593.    prevent a WM_QUIT message from being put into the queue for this thread by
  15594.    some other mechanism. If this parameter is FALSE, the thread ignores the
  15595.    WM_QUIT message. Note that a subsequent system shutdown causes a new
  15596.    WM_QUIT message to be sent to this thread.
  15597.  
  15598.  Return Value
  15599.  
  15600.    The return value is TRUE if the function is successful or FALSE if an
  15601.    error occurs.
  15602.  
  15603.  
  15604.  ────────────────────────────────────────────────────────────────────────────
  15605.  WinCatch
  15606.  ────────────────────────────────────────────────────────────────────────────
  15607.    SHORT WinCatch (pcatchbuf)
  15608.    PCATCHBUF pcatchbuf;    /*address of structure for execution            */
  15609.                            /*environment                                   */
  15610.  
  15611.    The WinCatch function captures the current execution environment and
  15612.    copies it to a buffer. The buffer can later be used by the WinThrow
  15613.    function to restore the execution environment. The execution environment
  15614.    includes the state of all system registers and the instruction counter.
  15615.  
  15616.  Parameters
  15617.  
  15618.    pcatchbuf  Points to the CATCHBUF structure that receives the execution
  15619.    environment. The CATCHBUF structure has the following form:
  15620.  
  15621.    typedef struct _CATCHBUF {
  15622.        ULONG reserved[4];
  15623.    } CATCHBUF;
  15624.  
  15625.    For a full description, see Chapter 4, "Types, Macros, Structures."
  15626.  
  15627.  Return Value
  15628.  
  15629.    The WinCatch function returns immediately with a return value of zero. It
  15630.    returns again when the WinThrow function is called, this time with the
  15631.    return value specified in the sErrorReturn parameter of the WinThrow
  15632.    function.
  15633.  
  15634.  Comments
  15635.  
  15636.    The routine that calls WinCatch is responsible for freeing any resources
  15637.    allocated between the time WinCatch was called and the time WinThrow was
  15638.    called.
  15639.  
  15640.  Example
  15641.  
  15642.    This example calls WinCatch to save the current execution environment
  15643.    before calling a recursive sort function. The first return from WinCatch
  15644.    is zero. If the doSort function calls WinThrow, execution will again
  15645.    return to the WinCatch function. This time, WinCatch will return the
  15646.    STACKOVERFLOW error passed by the doSort function. The doSort function is
  15647.    recursive, that is, it calls itself. It maintains a variable,
  15648.    usStackCheck, that is used to check to see how much stack space has been
  15649.    used. If more then 3K of the stack has been used, it calls WinThrow to
  15650.    drop out of all the nested function calls back into the function that
  15651.    called WinCatch.
  15652.  
  15653.    USHORT usStackCheck
  15654.    CATCHBUF ctchbf;
  15655.  
  15656.    main() {
  15657.        SHORT sErrorReturn;
  15658.  
  15659.        sErrorReturn = WinCatch(&ctchbf); /* save execution environment */
  15660.        if (sErrorReturn) {
  15661.            .
  15662.            . /* error processing */
  15663.            .
  15664.        }
  15665.        usStackCheck = 0;              /* initialize stack usage count  */
  15666.        doSort(1, 1000);               /* call sort function            */
  15667.    }
  15668.  
  15669.    VOID doSort(sLeft, sRight)
  15670.    SHORT sLeft, sRight;
  15671.    {
  15672.        SHORT i, sLast;
  15673.  
  15674.        /*
  15675.         * check to see if more than 3K of the stack has been used, and if
  15676.         * so, call WinThrow to drop back into the original calling program
  15677.         */
  15678.  
  15679.        usStackCheck += 10;
  15680.        if (usStackCheck > (3 * 1024))
  15681.            WinThrow(&ctchbf, STACKOVERFLOW);
  15682.        .
  15683.        . /* sorting algorithm */
  15684.        .
  15685.        doSort(sLeft, sLast - 1);         /* note recursive call         */
  15686.        usStackCheck -= 10;               /* update stack check variable */
  15687.    }
  15688.  
  15689.  See Also
  15690.  
  15691.    WinThrow
  15692.  
  15693.  
  15694.  ────────────────────────────────────────────────────────────────────────────
  15695.  WinChangeSwitchEntry
  15696.  ────────────────────────────────────────────────────────────────────────────
  15697.    USHORT WinChangeSwitchEntry (hSwitch, pswctl)
  15698.    HSWITCH hSwitch;        /*handle to task-switch list                    */
  15699.    PSWCNTRL pswctl;        /*address of structure with change information  */
  15700.  
  15701.    The WinChangeSwitchEntry function changes information in the switch list
  15702.    (the list of running programs displayed by the Task Manager).
  15703.  
  15704.  Parameters
  15705.  
  15706.    hSwitch  Identifies the switch-list entry to change. This handle is
  15707.    returned by the WinAddSwitchEntry function.
  15708.  
  15709.    pswctl  Points to the SWCNTRL structure that contains information about
  15710.    the changed switch-list entry. The SWCNTRL structure has the following
  15711.    form:
  15712.  
  15713.    typedef struct _SWCNTRL {
  15714.        HWND     hwnd;
  15715.        HWND     hwndIcon;
  15716.        HPROGRAM hprog;
  15717.        USHORT   idProcess;
  15718.        USHORT   idSession;
  15719.        UCHAR    uchVisibility;
  15720.        UCHAR    fbJump;
  15721.        CHAR     szSwtitle[MAXNAMEL+1];
  15722.        BYTE     fReserved;
  15723.    } SWCNTRL;
  15724.  
  15725.    For a full description, see Chapter 4, "Types, Macros, Structures."
  15726.  
  15727.  Return Value
  15728.  
  15729.    The return value is zero if the function is successful or nonzero if an
  15730.    error occurs.
  15731.  
  15732.  Example
  15733.  
  15734.    This example changes a swctl structure (SWCNTRL) and then calls
  15735.    WinChangeSwitchEntry to change the title of the application in the task
  15736.    list. For this example to work, the swctl structure must have been a
  15737.    global that was initialized prior to this call. See the example for the
  15738.    WinAddSwitchEntry function to see how to set up a SWCNTRL structure.
  15739.  
  15740.    strcpy(swctl.szSwtitle, "Generic: ");     /* application name */
  15741.    strcat(swctl.szSwtitle, pszFileName);     /* current filename */
  15742.    WinChangeSwitchEntry(hswitch, &swctl);    /* make the change  */
  15743.  
  15744.  See Also
  15745.  
  15746.    WinAddSwitchEntry, WinRemoveSwitchEntry
  15747.  
  15748.  
  15749.  ────────────────────────────────────────────────────────────────────────────
  15750.  WinCloseClipbrd
  15751.  ────────────────────────────────────────────────────────────────────────────
  15752.    BOOL WinCloseClipbrd (hab)
  15753.    HAB hab;                /*handle of the anchor block                    */
  15754.  
  15755.    The WinCloseClipbrd function closes the clipboard, allowing other
  15756.    applications to open it. This function sends a WM_DRAWCLIPBOARD message,
  15757.    causing the clipboard contents to be drawn in the clipboard-viewer window.
  15758.    The clipboard must be open prior to this function being called.
  15759.  
  15760.  Parameters
  15761.  
  15762.    hab  Identifies the anchor block.
  15763.  
  15764.  Return Value
  15765.  
  15766.    The return value is TRUE if the function is successful or FALSE if an
  15767.    error occurs.
  15768.  
  15769.  See Also
  15770.  
  15771.    WinEmptyClipbrd, WinOpenClipbrd
  15772.  
  15773.  
  15774.  ────────────────────────────────────────────────────────────────────────────
  15775.  WinCompareStrings
  15776.  ────────────────────────────────────────────────────────────────────────────
  15777.    USHORT WinCompareStrings (hab, idcp, idcc, psz1, psz2, reserved)
  15778.    HAB hab;                /*handle of the anchor block                    */
  15779.    USHORT idcp;            /*code-page identifier                          */
  15780.    USHORT idcc;            /*country-code identifier                       */
  15781.    PSZ psz1;               /*address of first string                       */
  15782.    PSZ psz2;               /*address of second string                      */
  15783.    USHORT reserved;        /*must be zero                                  */
  15784.  
  15785.    The WinCompareStrings function compares two strings.
  15786.  
  15787.  Parameters
  15788.  
  15789.    hab  Identifies the anchor block.
  15790.  
  15791.    idcp  Identifies the code page.
  15792.  
  15793.    idcc  Identifies the country code.
  15794.  
  15795.    psz1  Points to the first string.
  15796.  
  15797.    psz2  Points to the second string.
  15798.  
  15799.    reserved  Specifies a reserved value; must be zero.
  15800.  
  15801.  Return Value
  15802.  
  15803.    The return value is the comparison result. It can be one of the following
  15804.    values:
  15805.  
  15806.    Value     Meaning
  15807.    ──────────────────────────────────────────────────────────────────────────
  15808.    WCS_EQ    Strings are equal.
  15809.  
  15810.    WCS_LT    String 1 is less than string 2.
  15811.  
  15812.    WCS_GT    String 1 is greater than string 2.
  15813.  
  15814.    WCS_ERROR Invalid country-code or code-page identifier.
  15815.    ──────────────────────────────────────────────────────────────────────────
  15816.  
  15817.  
  15818.  ────────────────────────────────────────────────────────────────────────────
  15819.  WinCopyAccelTable
  15820.  ────────────────────────────────────────────────────────────────────────────
  15821.    USHORT WinCopyAccelTable (haccel, pacct, cbCopyMax)
  15822.    HACCEL haccel;          /*handle of the accelerator table               */
  15823.    PACCELTABLE pacct;      /*address of structure receiving information    */
  15824.    USHORT cbCopyMax;       /*maximum size of data area                     */
  15825.  
  15826.    The WinCopyAccelTable function copies an accelerator table. This function
  15827.    is used to obtain the accelerator-table data that corresponds to an
  15828.    accelerator-table handle or to determine the size of the accelerator-table
  15829.    data.
  15830.  
  15831.  Parameters
  15832.  
  15833.    haccel  Identifies the accelerator table.
  15834.  
  15835.    pacct  Points to the area of memory where the accelerator-table
  15836.    information will be copied (in the form of an ACCELTABLE structure). If
  15837.    this parameter is NULL, the function will return with the number of bytes
  15838.    needed to copy the table. The ACCELTABLE structure has the following form:
  15839.  
  15840.    typedef struct _ACCELTABLE {
  15841.        USHORT cAccel;
  15842.        USHORT codepage;
  15843.        ACCEL aaccel[1];
  15844.    } ACCELTABLE;
  15845.  
  15846.    For a full description, see Chapter 4, "Types, Macros, Structures."
  15847.  
  15848.    cbCopyMax  Specifies the maximum size of the data area pointed to by the
  15849.    pacct parameter. This parameter is ignored if pacct is NULL.
  15850.  
  15851.  Return Value
  15852.  
  15853.    The return value is the amount of data copied or the length required for
  15854.    the complete accelerator table if the function was successful, or it is
  15855.    zero if an error occurs.
  15856.  
  15857.  
  15858.  ────────────────────────────────────────────────────────────────────────────
  15859.  WinCopyRect
  15860.  ────────────────────────────────────────────────────────────────────────────
  15861.    BOOL WinCopyRect (hab, prclDst, prclSrc)
  15862.    HAB hab;                /*handle of the anchor block                    */
  15863.    PRECTL prclDst;         /*address of structure with destination         */
  15864.                            /*rectangle                                     */
  15865.    PRECTL prclSrc;         /*address of structure with source rectangle    */
  15866.  
  15867.    The WinCopyRect function copies the coordinates of one rectangle to
  15868.    another.
  15869.  
  15870.  Parameters
  15871.  
  15872.    hab  Identifies the anchor block.
  15873.  
  15874.    prclDst  Points to the RECTL structure that receives a copy of the
  15875.    rectangle specified by the prclSrc parameter. The RECTL structure has the
  15876.    following form:
  15877.  
  15878.    typedef struct _RECTL {
  15879.        LONG  xLeft;
  15880.        LONG  yBottom;
  15881.        LONG  xRight;
  15882.        LONG  yTop;
  15883.    } RECTL;
  15884.  
  15885.    For a full description, see Chapter 4, "Types, Macros, Structures."
  15886.  
  15887.    prclSrc  Points to the RECTL structure that specifies the source
  15888.    rectangle.
  15889.  
  15890.  Return Value
  15891.  
  15892.    The return value is TRUE if the function is successful or FALSE if an
  15893.    error occurs.
  15894.  
  15895.  See Also
  15896.  
  15897.    WinSetRectEmpty
  15898.  
  15899.  
  15900.  ────────────────────────────────────────────────────────────────────────────
  15901.  WinCpTranslateChar
  15902.  ────────────────────────────────────────────────────────────────────────────
  15903.    UCHAR WinCpTranslateChar (hab, cpSrc, chSrc, cpDst)
  15904.    HAB hab;                /*handle of the anchor block                    */
  15905.    USHORT cpSrc;           /*code page of source string                    */
  15906.    UCHAR chSrc;            /*character to be translated                    */
  15907.    USHORT cpDst;           /*code page of resultant string                 */
  15908.  
  15909.    The WinCpTranslateChar function translates a character from one code page
  15910.    to another.
  15911.  
  15912.  Parameters
  15913.  
  15914.    hab  Identifies the anchor block.
  15915.  
  15916.    cpSrc  Specifies the code page of the source string.
  15917.  
  15918.    chSrc  Specifies the character to be translated.
  15919.  
  15920.    cpDst  Specifies the code page of the resultant string.
  15921.  
  15922.  Return Value
  15923.  
  15924.    The return value is the translated character. If a match for this
  15925.    character is not found, 0xFF is returned.
  15926.  
  15927.  See Also
  15928.  
  15929.    WinCpTranslateString
  15930.  
  15931.  
  15932.  ────────────────────────────────────────────────────────────────────────────
  15933.  WinCpTranslateString
  15934.  ────────────────────────────────────────────────────────────────────────────
  15935.    BOOL WinCpTranslateString (hab, cpSrc, pszSrc, cpDst, cchDestMax, pszDest)
  15936.    HAB hab;                /*handle of the anchor block                    */
  15937.    USHORT cpSrc;           /*code page source string                       */
  15938.    PSZ pszSrc;             /*address of string to be translated            */
  15939.    USHORT cpDst;           /*code page of resultant string                 */
  15940.    USHORT cchDestMax;      /*maximum length of output string               */
  15941.    PSZ pszDest;            /*address of buffer for translated string       */
  15942.  
  15943.    The WinCpTranslateString function translates a string from one code page
  15944.    to another. Both source and destination strings are null terminated.
  15945.  
  15946.  Parameters
  15947.  
  15948.    hab  Identifies the anchor block.
  15949.  
  15950.    cpSrc  Specifies the code page of the source string.
  15951.  
  15952.    pszSrc  Points to the string to be translated.
  15953.  
  15954.    cpDst  Specifies the code page of the resultant string.
  15955.  
  15956.    cchDestMax  Specifies the maximum length of the output string.
  15957.  
  15958.    pszDest  Points to the buffer to receive the translated string.
  15959.  
  15960.  Return Value
  15961.  
  15962.    The return value is TRUE if the function is successful or FALSE if an
  15963.    error occurs. A return value of TRUE indicates that most, if not all,
  15964.    characters were translated successfully. All untranslated characters are
  15965.    converted to 0xFF.
  15966.  
  15967.  See Also
  15968.  
  15969.    WinCpTranslateChar
  15970.  
  15971.  
  15972.  ────────────────────────────────────────────────────────────────────────────
  15973.  WinCreateAccelTable
  15974.  ────────────────────────────────────────────────────────────────────────────
  15975.    HACCEL WinCreateAccelTable (hab, pacct)
  15976.    HAB hab;                /*handle of the anchor block                    */
  15977.    PACCELTABLE pacct;      /*address of structure for accelerator table    */
  15978.  
  15979.    The WinCreateAccelTable function allocates an accelerator table with its
  15980.    contents initialized to that of the specified ACCELTABLE structure.
  15981.  
  15982.  Parameters
  15983.  
  15984.    hab  Identifies the anchor block.
  15985.  
  15986.    pacct  Points to the ACCELTABLE structure that contains an accelerator
  15987.    table. The ACCELTABLE structure has the following form:
  15988.  
  15989.    typedef struct _ACCELTABLE {
  15990.        USHORT cAccel;
  15991.        USHORT codepage;
  15992.        ACCEL aaccel[1];
  15993.    } ACCELTABLE;
  15994.  
  15995.    For a full description, see Chapter 4, "Types, Macros, Structures."
  15996.  
  15997.  Return Value
  15998.  
  15999.    The return value identifies an accelerator table.
  16000.  
  16001.  Comments
  16002.  
  16003.    When an application terminates it must call WinDestroyAccelTable to
  16004.    destroy every accelerator table created by the call to the
  16005.    WinCreateAccelTable function.
  16006.  
  16007.  See Also
  16008.  
  16009.    WinCopyAccelTable, WinDestroyAccelTable, WinQueryAccelTable,
  16010.    WinSetAccelTable
  16011.  
  16012.  
  16013.  ────────────────────────────────────────────────────────────────────────────
  16014.  WinCreateAtomTable
  16015.  ────────────────────────────────────────────────────────────────────────────
  16016.    HATOMTBL WinCreateAtomTable (cbInitial, cBuckets)
  16017.    USHORT cbInitial;       /*number of bytes for atom table                */
  16018.    USHORT cBuckets;        /*size of hash table                            */
  16019.  
  16020.    The WinCreateAtomTable function creates an empty atom table. This function
  16021.    must be called before any other atom-manager function.
  16022.  
  16023.  Parameters
  16024.  
  16025.    cbInitial  Specifies the number of initial bytes reserved for the atom
  16026.    table. This is a lower bound on the amount of memory reserved. The amount
  16027.    of memory actually used by an atom table depends on the actual number of
  16028.    atoms stored in the table. If this parameter is zero, the size of the atom
  16029.    table is the minimum size needed to store the atom hash table.
  16030.  
  16031.    cBuckets  Specifies the size of the hash table used to access atoms. If
  16032.    this parameter is zero, the default value 37 is used. For best results,
  16033.    this parameter should be a prime number.
  16034.  
  16035.  Return Value
  16036.  
  16037.    The return value is a handle to an atom table, or NULL if an error occurs.
  16038.  
  16039.  See Also
  16040.  
  16041.    WinAddAtom, WinDeleteAtom, WinDestroyAtomTable,
  16042.    WinQuerySystemAtomTable
  16043.  
  16044.  
  16045.  ────────────────────────────────────────────────────────────────────────────
  16046.  WinCreateCursor
  16047.  ────────────────────────────────────────────────────────────────────────────
  16048.    BOOL WinCreateCursor (hwnd, x, y, cx, cy, fs, prclClip)
  16049.    HWND hwnd;              /*handle of the window with the cursor          */
  16050.    SHORT x;                /*horizontal position of the cursor             */
  16051.    SHORT y;                /*vertical position of the cursor               */
  16052.    SHORT cx;               /*cursor width                                  */
  16053.    SHORT cy;               /*cursor height                                 */
  16054.    USHORT fs;              /*cursor appearance                             */
  16055.    PRECTL prclClip;        /*address of structure with cursor area         */
  16056.  
  16057.    The WinCreateCursor function creates a cursor for a specified window.
  16058.  
  16059.  Parameters
  16060.  
  16061.    hwnd  Identifies the window in which the cursor is displayed. This
  16062.    parameter can be the desktop window handle or HWND_DESKTOP.
  16063.  
  16064.    x  Specifies the horizontal position of the cursor.
  16065.  
  16066.    y  Specifies the vertical position of the cursor.
  16067.  
  16068.    cx  Specifies the width of the cursor. If this parameter is zero, the
  16069.    system border width (SV_CXBORDER) is used.
  16070.  
  16071.    cy  Specifies the height size of cursor. If this parameter is zero, the
  16072.    system border height (SV_CYBORDER) is used.
  16073.  
  16074.    fs  Specifies the appearance of the cursor. This parameter can be one of
  16075.    the following values:
  16076.  
  16077.    Value                 Meaning
  16078.    ──────────────────────────────────────────────────────────────────────────
  16079.    CURSOR_FLASH          Cursor flashes.
  16080.  
  16081.    CURSOR_FRAME          Cursor is a rectangular frame.
  16082.  
  16083.    CURSOR_HALFTONE       Cursor is halftone.
  16084.  
  16085.    CURSOR_SOLID          Cursor is solid.
  16086.  
  16087.    CURSOR_SETPOS         Set a new cursor position. The cx and cy parameters
  16088.                          are ignored. Used when a cursor has already been
  16089.                          created. All other appearance flags are ignored.
  16090.    ──────────────────────────────────────────────────────────────────────────
  16091.  
  16092.    prclClip  Points to the RECTL structure that contains the coordinates of a
  16093.    rectangle within which the cursor is visible. If the cursor goes outside
  16094.    this rectangle, it becomes invisible (it is clipped). The rectangle is
  16095.    specified in window coordinates. If prclClip is NULL, the cursor is
  16096.    clipped to the window identified by the hwnd parameter. The RECTL
  16097.    structure has the following form:
  16098.  
  16099.    typedef struct _RECTL {
  16100.        LONG  xLeft;
  16101.        LONG  yBottom;
  16102.        LONG  xRight;
  16103.        LONG  yTop;
  16104.    } RECTL;
  16105.  
  16106.    For a full description, see Chapter 4, "Types, Macros, Structures."
  16107.  
  16108.  Return Value
  16109.  
  16110.    The return value is TRUE if the function is successful or FALSE if an
  16111.    error occurs.
  16112.  
  16113.  Comments
  16114.  
  16115.    The cursor is used to indicate the position of text input. It is initially
  16116.    hidden and must be made visible by using the WinShowCursor function.
  16117.  
  16118.    Only one cursor is available at a time on a given screen. If another
  16119.    cursor exists when this function is called, it is destroyed. An
  16120.    application should create and display a cursor when it has the input focus
  16121.    or is the active window. Creating a cursor at any other time may stop the
  16122.    cursor from flashing in another window. Similarly, when the application
  16123.    loses the input focus or becomes inactive, it should destroy its cursor.
  16124.  
  16125.    The cursor width is typically specified as zero (default width is used).
  16126.    This is preferable to a value of 1 because such a fine width will be
  16127.    almost invisible on a high-resolution device.
  16128.  
  16129.  See Also
  16130.  
  16131.    WinDestroyCursor, WinQueryCursorInfo, WinShowCursor
  16132.  
  16133.  
  16134.  ────────────────────────────────────────────────────────────────────────────
  16135.  WinCreateDlg
  16136.  ────────────────────────────────────────────────────────────────────────────
  16137.    HWND WinCreateDlg (hwndParent, hwndOwner, pfnDlgProc, pdlgt,
  16138.    pCreateParams)
  16139.    HWND hwndParent;        /*handle of the parent window                   */
  16140.    HWND hwndOwner;         /*handle of the owner window                    */
  16141.    PFNWP pfnDlgProc;       /*address of dialog procedure                   */
  16142.    PDLGTEMPLATE pdlgt;     /*address of structure with dialog template     */
  16143.    PVOID pCreateParams;
  16144.  
  16145.    The WinCreateDlg function creates a dialog window from a dialog template
  16146.    in memory. This function works like the WinLoadDlg function, which creates
  16147.    a dialog window from a dialog template in a resource.
  16148.  
  16149.  Parameters
  16150.  
  16151.    hwndParent  Identifies the parent window.
  16152.  
  16153.    hwndOwner  Identifies the owner window.
  16154.  
  16155.    pfnDlgProc  Points to the dialog procedure.
  16156.  
  16157.    pdlgt  Points to the DLGTEMPLATE structure that contains the dialog
  16158.    template. The DLGTEMPLATE structure has the following form:
  16159.  
  16160.    typedef struct _DLGTEMPLATE {
  16161.        USHORT      cbTemplate;
  16162.        USHORT      type;
  16163.        USHORT      codepage;
  16164.        USHORT      offadlgti;
  16165.        USHORT      fsTemplateStatus;
  16166.        USHORT      iItemFocus;
  16167.        USHORT      coffPresParams;
  16168.        DLGTITEM    adlgti[1];
  16169.    } DLGTEMPLATE;
  16170.  
  16171.    For a full description, see Chapter 4, "Types, Macros, Structures."
  16172.  
  16173.    pCreateParams  Contains application-specific data that is passed to the
  16174.    dialog procedure as part of the WM_INITDLG message.
  16175.  
  16176.  Return Value
  16177.  
  16178.    The return value is the handle of the dialog window that was created, or
  16179.    NULL if an error occurred.
  16180.  
  16181.  Example
  16182.  
  16183.    This example loads a dialog template from the application's resources and
  16184.    uses the template with the WinCreateDlg function to create a dialog
  16185.    window. This example is identical to calling the WinLoadDlg function, but
  16186.    gives the application the advantage of reviewing and modifying the dialog
  16187.    template before creating the dialog window.
  16188.  
  16189.    SEL sel;
  16190.    PDLGTEMPLATE pdlgt;
  16191.  
  16192.    DosGetResource(NULL, RT_DIALOG, ID_DIALOG, &sel);
  16193.    pdlgt = MAKEP(sel, 0);    /* convert resource to structure pointer */
  16194.  
  16195.    /* make any changes to dialog template here */
  16196.  
  16197.    WinCreateDlg(HWND_DESKTOP,
  16198.        NULL,        /* owner window                */
  16199.        MyDlgProc,   /* address of dialog procedure */
  16200.        pdlgt,       /* address of dialog structure */
  16201.        NULL);       /* application-specific data   */
  16202.    DosFreeSeg(sel); /* free the memory             */
  16203.  
  16204.  See Also
  16205.  
  16206.    DosGetResource, WinDlgBox, WinLoadDlg, WinProcessDlg
  16207.  
  16208.  
  16209.  ────────────────────────────────────────────────────────────────────────────
  16210.  WinCreateFrameControls
  16211.  ────────────────────────────────────────────────────────────────────────────
  16212.    BOOL WinCreateFrameControls (hwndFrame, pfcdata, pszTitle, hmod)
  16213.    HWND hwndFrame;         /*handle of the frame window                    */
  16214.    PFRAMECDATA pfcdata;    /*address of structure                          */
  16215.    PSZ pszTitle;           /*address of title-bar string                   */
  16216.    HMODULE hmod;           /*handle of module with the frame controls      */
  16217.  
  16218.    The WinCreateFrameControls function creates standard frame controls for a
  16219.    specified window. This function is used when the standard frame controls
  16220.    are needed for a nonstandard window; for example, with a window with a
  16221.    class other than WC_FRAME.
  16222.  
  16223.  Parameters
  16224.  
  16225.    hwndFrame  Identifies the frame window that becomes the parent and owner
  16226.    window of all the frame controls created.
  16227.  
  16228.    pfcdata  Points to the FRAMECDATA structure that contains information
  16229.    about the frame controls that are to be created. The FRAMECDATA structure
  16230.    has the following form:
  16231.  
  16232.    typedef struct _FRAMECDATA {
  16233.        USHORT       cb;
  16234.        ULONG        flCreateFlags;
  16235.        HMODULE      hmodResources;
  16236.        USHORT       idResources;
  16237.    } FRAMECDATA;
  16238.  
  16239.    For a full description, see Chapter 4, "Types, Macros, Structures."
  16240.  
  16241.    pszTitle  Points to a null-terminated string displayed in a title-bar
  16242.    control. hmod  Identifies the module that contains the frame controls.
  16243.  
  16244.  Return Value
  16245.  
  16246.    The return value is TRUE if the function is successful or FALSE if an
  16247.    error occurs.
  16248.  
  16249.  See Also
  16250.  
  16251.    WinCreateWindow
  16252.  
  16253.  
  16254.  ────────────────────────────────────────────────────────────────────────────
  16255.  WinCreateGroup
  16256.  ────────────────────────────────────────────────────────────────────────────
  16257.    HPROGRAM WinCreateGroup (hab, pszTitle, fVisible, hprogDest, pszHelp)
  16258.    HAB hab;                /*handle of the anchor block                    */
  16259.    PSZ pszTitle;           /*address of the group title                    */
  16260.    BYTE fVisible;          /*visibility flag                               */
  16261.    HPROGRAM hprogDest;     /*handle of the destination group               */
  16262.    PSZ pszHelp;            /*address of help text                          */
  16263.  
  16264.    The WinCreateGroup function creates a new program-group entry in the
  16265.    installed program list. The new group is created empty. The WinAddProgram
  16266.    function must be used to add program entries to the group. If the group
  16267.    already exists, the existing group handle is returned.
  16268.  
  16269.  Parameters
  16270.  
  16271.    hab  Identifies the anchor block.
  16272.  
  16273.    pszTitle  Points to the title of the new group. The maximum string size is
  16274.    60 characters. Strings that exceed this limit are truncated to 60
  16275.    characters. Leading and trailing blanks are removed. The string must
  16276.    contain at least one nonblank character and must not contain a backslash
  16277.    (\).
  16278.  
  16279.    fVisible  Specifies the visibility of the new group. If it is SHE_VISIBLE,
  16280.    the group is visible (can be viewed by end-user). If it is SHE_INVISIBLE,
  16281.    the group is invisible.
  16282.  
  16283.    hprogDest  Identifies the program group into which the new group is
  16284.    placed. If this parameter is NULL, the new group is placed in the root
  16285.    group.
  16286.  
  16287.    pszHelp  Points to a null-terminated text string that is used as a short
  16288.    piece of help information relating to the new program group. This
  16289.    parameter is optional and can be NULL. If used, the string must contain at
  16290.    least one nonblank character and be less than 60 characters in length.
  16291.  
  16292.  Return Value
  16293.  
  16294.    The return value is the group handle for the newly created group if the
  16295.    function is successful. Otherwise, the return value is NULL, indicating
  16296.    that an error occurred.
  16297.  
  16298.  See Also
  16299.  
  16300.    WinAddProgram
  16301.  
  16302.  
  16303.  ────────────────────────────────────────────────────────────────────────────
  16304.  WinCreateHeap
  16305.  ────────────────────────────────────────────────────────────────────────────
  16306.    HHEAP WinCreateHeap (selHeapBase, cbHeap, cbGrow, cbMinDed, cbMaxDed,
  16307.    fsOptions)
  16308.    USHORT selHeapBase;     /*selector of the heap                          */
  16309.    USHORT cbHeap;          /*initial heap size                             */
  16310.    USHORT cbGrow;          /*number of bytes heap must grow                */
  16311.    USHORT cbMinDed;        /*minimum number of dedicated free lists        */
  16312.    USHORT cbMaxDed;        /*maximum number of dedicated free lists        */
  16313.    USHORT fsOptions;       /*heap options                                  */
  16314.  
  16315.    The WinCreateHeap function creates a heap that can used for memory
  16316.    management.
  16317.  
  16318.  Parameters
  16319.  
  16320.    selHeapBase  Specifies the selector of the segment that will contain the
  16321.    local heap.
  16322.  
  16323.    cbHeap  Specifies the initial heap size (in bytes).
  16324.  
  16325.    cbGrow  Specifies the minimum number of bytes by which the heap must be
  16326.    increased if it is too small to satisfy a memory allocation request (see
  16327.    the WinAllocMem and WinReallocMem functions). If this parameter is zero,
  16328.    the default value of 512 bytes is used.
  16329.  
  16330.    cbMinDed  Specifies the minimum number of dedicated free lists.
  16331.  
  16332.    cbMaxDed  Specifies the maximum number of dedicated free lists.
  16333.  
  16334.    fsOptions  Specifies the optional characteristics for the heap. It may be
  16335.    one or more of the following values:
  16336.  
  16337.    Value         Meaning
  16338.    ──────────────────────────────────────────────────────────────────────────
  16339.    HM_MOVEABLE   Specifies that the created heap supports movable objects.
  16340.                  WinAllocMem then reserves an additional two words at the
  16341.                  beginning of each allocated object.
  16342.  
  16343.    HM_VALIDSIZE  Specifies that the heap manager should check the size
  16344.                  arguments to WinReallocMem and WinFreeMem function calls
  16345.                  against the two additional words stored at the beginning of
  16346.                  each allocated object. This option is only valid if
  16347.                  HM_MOVEABLE is also specified.
  16348.    ──────────────────────────────────────────────────────────────────────────
  16349.  
  16350.  Return Value
  16351.  
  16352.    The return value is a handle to the heap, or zero if an error occurred.
  16353.  
  16354.  Comments
  16355.  
  16356.    There are three types of segments that can contain a heap:
  16357.  
  16358.    ■  Automatic data segment of an application
  16359.  
  16360.    ■  Automatic data segment of a dynamic-link package
  16361.  
  16362.    ■  Segment allocated by the DosAllocSeg function (public or shared)
  16363.  
  16364.    To accommodate these various targets for heaps, all four possible
  16365.    combinations of the parameters are used to discriminate between the
  16366.    various options.
  16367.  
  16368.    These combinations are shown in the following list:
  16369.  
  16370. ╓┌─┌───────────┌─────────┌───────────────────────────────────────────────────╖
  16371.    selHeapBase cbHeap    Meaning
  16372.    ──────────────────────────────────────────────────────────────────────────
  16373.    Zero        Zero      Caller is an application that places the heap at the
  16374.                          end of its automatic data segment. The size of the
  16375.                          heap was specified with the HEAPSIZE keyword in the
  16376.                          application's .def file to the linker. This function
  16377.                          extracts the heap-size parameter from the local
  16378.                          information segment and uses that many bytes at the
  16379.                          end of the caller's automatic data segment. No
  16380.                          reallocation of the data segment occurs, as the
  16381.                          loader already reserved space at the end of the data
  16382.    selHeapBase cbHeap    Meaning
  16383.    ──────────────────────────────────────────────────────────────────────────
  16384.                         loader already reserved space at the end of the data
  16385.                          segment, after the static data was loaded from the
  16386.                          .exe file.
  16387.  
  16388.    Selector    Nonzero   Caller is a dynamic-link package that places a heap
  16389.                          at the end of its automatic data segment. The cbHeap
  16390.                          parameter must be less than or equal to the HEAPSIZE
  16391.                          value from the .def file that was passed to the
  16392.                          dynamic-link package's initialization entry point in
  16393.                          the cx register. Otherwise, this function may
  16394.                          produce incorrect results.
  16395.  
  16396.    Selector    Zero      Caller is either an application or a dynamic-link
  16397.                          package that has explicitly allocated a segment
  16398.                          using the DosAllocSeg function and places a heap in
  16399.                          that segment. The heap is placed at the beginning of
  16400.                          the segment and the size of the segment (determined
  16401.                          by using DosSizeSeg) is the size of the heap.
  16402.  
  16403.    selHeapBase cbHeap    Meaning
  16404.    ──────────────────────────────────────────────────────────────────────────
  16405. 
  16406.    Zero        Nonzero   Caller is either an application or a dynamic-link
  16407.                          package that places a heap of a specific size in a
  16408.                          separate segment but does not call DosAllocSeg. For
  16409.                          information about accessing the segment implicitly
  16410.                          allocated by WinCreateHeap when called with this
  16411.                          combination of parameters, see the WinLockHeap
  16412.                          function.
  16413.    ──────────────────────────────────────────────────────────────────────────
  16414.  
  16415.  
  16416.  See Also
  16417.  
  16418.    DosAllocSeg, DosSizeSeg, WinAllocMem, WinDestroyHeap, WinFreeMem,
  16419.    WinLockHeap, WinReallocMem
  16420.  
  16421.  
  16422.  ────────────────────────────────────────────────────────────────────────────
  16423.  WinCreateMenu
  16424.  ────────────────────────────────────────────────────────────────────────────
  16425.    HWND WinCreateMenu (hwndParent, pvmt)
  16426.    HWND hwndParent;        /*handle of the parent window                   */
  16427.    PVOID pvmt;             /*address of the menu template                  */
  16428.  
  16429.    The WinCreateMenu function creates a menu window from a menu template. The
  16430.    menu window is created with its parent and owner set to the hwndParent
  16431.    parameter.
  16432.  
  16433.  Parameters
  16434.  
  16435.    hwndParent  Identifies the owner and parent window which should be a frame
  16436.    window.
  16437.  
  16438.    pvmt  Points to the menu template. The format of the pvmt parameter is the
  16439.    binary menu-template-resource format.
  16440.  
  16441.  Return Value
  16442.  
  16443.    The return value is the menu-window handle, or zero if an error occurred.
  16444.  
  16445.  See Also
  16446.  
  16447.    WinCreateWindow, WinLoadMenu
  16448.  
  16449.  
  16450.  ────────────────────────────────────────────────────────────────────────────
  16451.  WinCreateMsgQueue
  16452.  ────────────────────────────────────────────────────────────────────────────
  16453.    HMQ WinCreateMsgQueue (hab, cmsg)
  16454.    HAB hab;                /*handle of the anchor block                    */
  16455.    SHORT cmsg;             /*size of the message queue                     */
  16456.  
  16457.    The WinCreateMsgQueue function creates a message queue for the current
  16458.    thread. This function must be called after the WinInitialize function but
  16459.    before any other Presentation Manager functions are called. It can be
  16460.    called only once per thread.
  16461.  
  16462.  Parameters
  16463.  
  16464.    hab  Identifies the anchor block.
  16465.  
  16466.    cmsg  Specifies the maximum queue size. This parameter can use a value of
  16467.    DEFAULT_QUEUE_SIZE to get the system default queue size.
  16468.  
  16469.  Return Value
  16470.  
  16471.    The return value identifies a message queue, or it is NULL if the queue
  16472.    cannot be created.
  16473.  
  16474.  Comments
  16475.  
  16476.    The default queue size is 10 messages which is sufficient for most
  16477.    applications. However, if an application processes a high volume of
  16478.    messages, and the processing of some of these messages is slow, the
  16479.    application should create a larger queue.
  16480.  
  16481.  Example
  16482.  
  16483.    This example shows the typical startup code for a thread that will be
  16484.    making Presentation Manager function calls; in this case the startup
  16485.    function of the application. It calls WinInitialize to initialize the
  16486.    thread for making Presentation Manager function calls, and
  16487.    WinCreateMsgQueue to create a message queue for the thread. Before the
  16488.    thread terminates, it calls WinDestroyMsgQueue to destroy the message
  16489.    queue.
  16490.  
  16491.    HAB hab;    /* handle to the anchor block  */
  16492.    HMQ hmq;    /* handle to the message queue */
  16493.  
  16494.    VOID cdecl main() {
  16495.        hab = WinInitialize(NULL);
  16496.        hmq = WinCreateMsgQueue(hab, DEFAULT_QUEUE_SIZE);
  16497.            .
  16498.            . /* initialization and message loop */
  16499.            .
  16500.        WinDestroyMsgQueue(hmq);
  16501.        WinTerminate(hab);
  16502.        DosExit(EXIT_PROCESS, 0);
  16503.    }
  16504.  
  16505.  See Also
  16506.  
  16507.    WinDestroyMsgQueue, WinInitialize
  16508.  
  16509.  
  16510.  ────────────────────────────────────────────────────────────────────────────
  16511.  WinCreatePointer
  16512.  ────────────────────────────────────────────────────────────────────────────
  16513.    HPOINTER WinCreatePointer (hwndDesktop, hbmPointer, fPointer, xHotspot,
  16514.    yHotspot)
  16515.    HWND hwndDesktop;       /*handle of the desktop                         */
  16516.    HBITMAP hbmPointer;     /*handle of the bitmap                          */
  16517.    BOOL fPointer;          /*full-size or icon-size pointer                */
  16518.    SHORT xHotspot;         /*horizontal hot spot                           */
  16519.    SHORT yHotspot;         /*vertical hot spot                             */
  16520.  
  16521.    The WinCreatePointer function creates a pointer from a bitmap.
  16522.  
  16523.  Parameters
  16524.  
  16525.    hwndDesktop  Identifies the desktop window. This parameter can be
  16526.    HWND_DESKTOP or the desktop window handle.
  16527.  
  16528.    hbmPointer  Identifies the bitmap from which the pointer image is created.
  16529.    The bitmap must be of an even vertical size, logically divided into two
  16530.    sections in the vertical direction, each half representing one of the two
  16531.    images used as the successive drawing masks for the pointer. The top half
  16532.    is the XOR image. The bottom half is the AND image. This allows a pointer
  16533.    to have four colors: black, white, background, and inverted background.
  16534.  
  16535.    fPointer  Indicates if the pointer is pointer- or icon-sized. If this
  16536.    parameter is TRUE, the bitmap will be stretched (if necessary) to the
  16537.    system-pointer dimensions. If this parameter is FALSE, the bitmap will be
  16538.    stretched (if necessary) to the system-icon dimensions.
  16539.  
  16540.    xHotspot  Specifies the horizontal offset of the pointer hot spot from the
  16541.    lower-left corner (in pels).
  16542.  
  16543.    yHotspot  Specifies the vertical offset of the pointer hot spot from the
  16544.    lower-left corner (in pels).
  16545.  
  16546.  Return Value
  16547.  
  16548.    The return value is the handle of the new pointer, or it is NULL if an
  16549.    error occurs.
  16550.  
  16551.  Comments
  16552.  
  16553.    Since the bitmap needs to include two images, one on top of the other, the
  16554.    height of the bitmap must be an even number. This function will fail if
  16555.    the height is not an even number.
  16556.  
  16557.  See Also
  16558.  
  16559.    WinDestroyPointer, WinDrawPointer, WinLoadPointer, WinQueryPointer,
  16560.    WinSetPointer
  16561.  
  16562.  
  16563.  ────────────────────────────────────────────────────────────────────────────
  16564.  WinCreateStdWindow
  16565.  ────────────────────────────────────────────────────────────────────────────
  16566.    HWND WinCreateStdWindow (hwndParent, flStyle, pflCreateFlags,
  16567.    pszClientClass, pszTitle, flClientStyle, hmod, idResources, phwndClient)
  16568.    HWND hwndParent;        /*handle of the parent window                   */
  16569.    ULONG flStyle;          /*frame-window style                            */
  16570.    PULONG pflCreateFlags;  /*creation flags                                */
  16571.    PSZ pszClientClass;     /*client-window class name                      */
  16572.    PSZ pszTitle;           /*address of title-bar text                     */
  16573.    ULONG flClientStyle;    /*client-window style                           */
  16574.    HMODULE hmod;           /*handle of the resource module                 */
  16575.    USHORT idResources;     /*frame-window identifier                       */
  16576.    PHWND phwndClient;      /*address of client-window handle               */
  16577.  
  16578.    The WinCreateStdWindow function creates a standard frame window.
  16579.  
  16580.  Parameters
  16581.  
  16582.    hwndParent  Identifies the parent window. A main window is created if this
  16583.    parameter is NULL, HWND_DESKTOP, or a window handle returned by the
  16584.    WinQueryDesktopWindow function. An object window is created if this
  16585.    parameter is HWND_DESKTOP or a window handle returned by the
  16586.    WinQueryObjectWindow function.
  16587.  
  16588.    flStyle  Specifies the frame-window style. It can be any combination of
  16589.    the WS_ styles (see the description for flClientStyle) and the following
  16590.    values:
  16591.  
  16592. ╓┌─┌─────────────────────┌───────────────────────────────────────────────────╖
  16593.    Value                 Meaning
  16594.    ──────────────────────────────────────────────────────────────────────────
  16595.    FS_ACCELTABLE         Creates an accelerator table. The table is loaded
  16596.                          from the application's resource file. It should have
  16597.                          the same identifier as the menu and the icon (if
  16598.                          any).
  16599.  
  16600.    FS_BORDER             Creates a window that has a border with an inner
  16601.                          border drawn with the active title-bar color. It is
  16602.                          most often used by dialog boxes.
  16603.  
  16604.    FS_DLGBORDER          Creates a window with a single line border around
  16605.                          it. The width of the border line is SV_CXBORDER and
  16606.                          the height is SV_CYBORDER. For a description of
  16607.                          these system values, see the comments section of
  16608.                          WinSetSysValue.
  16609.  
  16610.    FS_ICON               The created window has an icon with the same
  16611.                          identifier as the menu and accelerator table (if
  16612.                          any).
  16613.    Value                 Meaning
  16614.    ──────────────────────────────────────────────────────────────────────────
  16615.                         any).
  16616.  
  16617.    FS_MOUSEALIGN         Creates a window whose position is relative to the
  16618.                          current position of the mouse. Normally, this is
  16619.                          only used by dialog boxes.
  16620.  
  16621.    FS_NOBYTEALIGN        Creates a window whereby the frame window is not
  16622.                          byte aligned. Setting this flag will decrease the
  16623.                          performance of drawing operations to the client
  16624.                          window.
  16625.  
  16626.    FS_NOMOVEWITHOWNER    Creates a frame window that will not move if the
  16627.                          owner window moves.
  16628.  
  16629.    FS_SCREENALIGN        Creates a window that is aligned with respect to the
  16630.                          screen. Normally, this is only used by dialog boxes.
  16631.  
  16632.    FS_SHELLPOSITION      The Presentation Manager (shell) determines the
  16633.                          position of the window, typically in a cascaded
  16634.    Value                 Meaning
  16635.    ──────────────────────────────────────────────────────────────────────────
  16636.                         position of the window, typically in a cascaded
  16637.                          position from the last application that started.
  16638.  
  16639.    FS_SIZEBORDER         Creates a sizing border.
  16640.  
  16641.    FS_SYSMODAL           Creates a system modal window. For a description of
  16642.                          a system modal window, see the comments section of
  16643.                          the WinSetSysModalWindow function.
  16644.  
  16645.    FS_TASKLIST           The window title is added to the Task Manager's
  16646.                          list.
  16647.  
  16648.    FS_STANDARD           Specifies a combination of the following flags:
  16649.  
  16650.                              FS_ICON
  16651.                              FS_ACCELTABLE
  16652.                              FS_SHELLPOSITION
  16653.                              FS_TASKLIST
  16654.  
  16655.    Value                 Meaning
  16656.    ──────────────────────────────────────────────────────────────────────────
  16657. 
  16658.    ──────────────────────────────────────────────────────────────────────────
  16659.  
  16660.  
  16661.    pflCreateFlags  Specifies options that control how the frame window is
  16662.    created. If no options are specified, FCF_STANDARD is used. The flags may
  16663.    be any combination of the following values:
  16664.  
  16665. ╓┌─┌─────────────────────┌───────────────────────────────────────────────────╖
  16666.    Value                 Meaning
  16667.    ──────────────────────────────────────────────────────────────────────────
  16668.    FCF_ACCELTABLE        Creates an accelerator table. The table is loaded
  16669.                          from the application's resource file. It should have
  16670.                          the same identifier as the menu and the icon (if
  16671.                          any).
  16672.  
  16673.    FCF_BORDER            Creates a window with a single line border around
  16674.                          it. The width of the border line is SV_CXBORDER and
  16675.                          the height is SV_CYBORDER. For a description of
  16676.    Value                 Meaning
  16677.    ──────────────────────────────────────────────────────────────────────────
  16678.                         the height is SV_CYBORDER. For a description of
  16679.                          these system values, see the WinSetSysValue
  16680.                          function.
  16681.  
  16682.    FCF_DLGBORDER         Creates a window that has a border with an inner
  16683.                          border drawn with the active title-bar color. It is
  16684.                          most often used by dialog boxes.
  16685.  
  16686.    FCF_HORZSCROLL        Creates a horizontal scroll bar.
  16687.  
  16688.    FCF_ICON              The created window has an icon with the same
  16689.                          identifier as the menu and accelerator table (if
  16690.                          any).
  16691.  
  16692.    FCF_MAXBUTTON         Creates a maximize button.
  16693.  
  16694.    FCF_MENU              Creates a menu bar.
  16695.  
  16696.    FCF_MINBUTTON         Creates a minimize button.
  16697.    Value                 Meaning
  16698.    ──────────────────────────────────────────────────────────────────────────
  16699.   FCF_MINBUTTON         Creates a minimize button.
  16700.  
  16701.    FCF_MINMAX            Creates a minimize and a maximize button
  16702.                          (FCF_MINBUTTON | FCF_MAXBUTTON).
  16703.  
  16704.    FCF_MOUSEALIGN        Creates a window whose position is relative to the
  16705.                          current position of the mouse. Normally, this is
  16706.                          only used by dialog boxes.
  16707.  
  16708.    FCF_NOBYTEALIGN       Creates a window whereby the client window is not
  16709.                          byte aligned. Setting this flag will decrease the
  16710.                          performance of drawing operations to the client
  16711.                          window.
  16712.  
  16713.    FCF_NOMOVEWITHOWNER   Creates a window that will not move if the owner
  16714.                          window moves.
  16715.  
  16716.    FCF_SCREENALIGN       Creates a window that is aligned with respect to the
  16717.                          screen. Normally, this is only used by dialog boxes.
  16718.    Value                 Meaning
  16719.    ──────────────────────────────────────────────────────────────────────────
  16720.                         screen. Normally, this is only used by dialog boxes.
  16721.  
  16722.    FCF_SHELLPOSITION     The Presentation Manager (shell) determines the
  16723.                          position of the window, typically in a cascaded
  16724.                          position from the last application that started.
  16725.  
  16726.    FCF_SIZEBORDER        Creates a sizing border.
  16727.  
  16728.    FCF_SYSMENU           Creates a system menu.
  16729.  
  16730.    FCF_SYSMODAL          Creates a system modal window. For a description of
  16731.                          a system modal window, see the WinSetSysModalWindow
  16732.                          function.
  16733.  
  16734.    FCF_TASKLIST          Adds the window to the switch list of the Task
  16735.                          Manager.
  16736.  
  16737.    FCF_TITLEBAR          Creates a title bar.
  16738.  
  16739.    Value                 Meaning
  16740.    ──────────────────────────────────────────────────────────────────────────
  16741. 
  16742.    FCF_VERTSCROLL        Creates a vertical scroll bar.
  16743.  
  16744.    FCF_STANDARD          Specifies a combination of the following flags:
  16745.  
  16746.                              FCF_TITLEBAR
  16747.                              FCF_SYSMENU
  16748.                              FCF_MENU
  16749.                              FCF_SIZEBORDER
  16750.                              FCF_MINMAX
  16751.                              FCF_ICON
  16752.                              FCF_ACCELTABLE
  16753.                              FCF_SHELLPOSITION
  16754.                              FCF_TASKLIST
  16755.  
  16756.    ──────────────────────────────────────────────────────────────────────────
  16757.  
  16758.  
  16759.    pszClientClass  Points to the client-window class name. If the
  16760.    pszClientClass parameter is not a zero-length string, a client window of
  16761.    style flClientStyle and class pszClientClass is created. This parameter is
  16762.    an application-specified name (defined by the WinRegisterClass function),
  16763.    the name of a preregistered WC class, or a WC constant. If this parameter
  16764.    is NULL, no client area is created.
  16765.  
  16766.    pszTitle  Points to the title-bar text. This parameter is ignored if
  16767.    FCF_TITLEBAR is not specified in the pflCreateFlags parameter.
  16768.  
  16769.    flClientStyle  Specifies the client-window style. It can be a combination
  16770.    of one or more of the following values:
  16771.  
  16772. ╓┌─┌─────────────────────┌───────────────────────────────────────────────────╖
  16773.    Value                 Meaning
  16774.    ──────────────────────────────────────────────────────────────────────────
  16775.    WS_CLIPCHILDREN       Prevents a window from painting over its child
  16776.                          windows.
  16777.  
  16778.    WS_CLIPSIBLINGS       Prevents a window from painting over its sibling
  16779.                          windows.
  16780.  
  16781.    Value                 Meaning
  16782.    ──────────────────────────────────────────────────────────────────────────
  16783. 
  16784.    WS_DISABLED           Disables mouse and keyboard input to the window. It
  16785.                          is used to temporarily prevent the user from using
  16786.                          the window.
  16787.  
  16788.    WS_MAXIMIZED          Enlarges the window to the maximum size.
  16789.  
  16790.    WS_MINIMIZED          Reduces the window to the minimum size.
  16791.  
  16792.    WS_PARENTCLIP         Prevents a window from painting over its parent
  16793.                          window.
  16794.  
  16795.    WS_SAVEBITS           Saves the image under the window as a bitmap. When
  16796.                          the window is moved or hidden, the system restores
  16797.                          the image by copying the bits.
  16798.  
  16799.    WS_SYNCPAINT          Causes the window to immediately receive WM_PAINT
  16800.                          messages after a part of the window becomes invalid.
  16801.                          Without this style, the window receives WM_PAINT
  16802.    Value                 Meaning
  16803.    ──────────────────────────────────────────────────────────────────────────
  16804.                         Without this style, the window receives WM_PAINT
  16805.                          messages only if no other message is waiting to be
  16806.                          processed.
  16807.  
  16808.    WS_VISIBLE            Makes the window visible. This window will be drawn
  16809.                          on the screen unless overlapping windows completely
  16810.                          obscure it. Windows without this style are hidden.
  16811.    ──────────────────────────────────────────────────────────────────────────
  16812.  
  16813.  
  16814.    This parameter is ignored if the pszClientClass parameter is a zero-length
  16815.    string.
  16816.  
  16817.    hmod  Identifies the module that contains the resource definitions. This
  16818.    parameter can be either the module handle returned by the DosLoadModule
  16819.    function or NULL for the application's module. This parameter is ignored
  16820.    unless FS_ICON, FS_ACCELTABLE, or FS_MENU is specified in the flStyle
  16821.    parameter.
  16822.  
  16823.    idResources  Identifies the frame-window identifier and the identifier
  16824.    within the resource definition of the required resource. The application
  16825.    must ensure that all resources related to one frame window have the same
  16826.    identifier value.
  16827.  
  16828.    phwndClient  Points to the variable that receives the client-window
  16829.    handle. It will be NULL if the function fails.
  16830.  
  16831.  Return Value
  16832.  
  16833.    The return value is the handle of the frame window, or it is NULL if an
  16834.    error occurs.
  16835.  
  16836.  Example
  16837.  
  16838.    This example shows a typical initialization function for a window. The
  16839.    function first registers the window class, then calls WinCreateStdWindow
  16840.    to create a standard window and returns immediately if the function fails.
  16841.    Otherwise, it continues on to do other initialization processing.
  16842.  
  16843.    Note: The FCF_STANDARD constant can only be used if you have all the
  16844.    resources in defines. For example, if you use this constant, and you don't
  16845.    have an accelerator table, the function will fail.
  16846.  
  16847.    CHAR szClassName[] = "Generic";    /* window class name    */
  16848.    HWND hwndClient;                   /* handle to the client */
  16849.    HWND hwndClient;                   /* handle to the client */
  16850.  
  16851.    BOOL GenericInit()
  16852.    {
  16853.        ULONG flStyle;
  16854.  
  16855.        flStyle = FCF_STANDARD;
  16856.        if (!WinRegisterClass(hab, szClassName, GenericWndProc, 0L, 0))
  16857.            return (FALSE);
  16858.  
  16859.        hwndFrame = WinCreateStdWindow(HWND_DESKTOP,
  16860.            0L,                     /* frame-window style            */
  16861.            &flStyle,               /* window style                  */
  16862.            szClassName,            /* class name                    */
  16863.            "Generic Application",  /* window title                  */
  16864.            0L,                     /* default client style          */
  16865.            NULL,                   /* resource in executable file   */
  16866.            IDM_RESOURCE,           /* resource id                   */
  16867.            &hwndClient);           /* receives client window handle */
  16868.  
  16869.        if (! hwndFrame)
  16870.            return (FALSE);
  16871.        else {
  16872.            .
  16873.            . /* other initialization code */
  16874.            .
  16875.  
  16876.  See Also
  16877.  
  16878.    DosLoadModule, WinCreateWindow, WinQueryDesktopWindow,
  16879.    WinQueryObjectWindow, WinSetSysModalWindow, WinSetSysValue,
  16880.    WinSetWindowPos, WinSetWindowUShort
  16881.  
  16882.  
  16883.  ────────────────────────────────────────────────────────────────────────────
  16884.  WinCreateWindow
  16885.  ────────────────────────────────────────────────────────────────────────────
  16886.    HWND WinCreateWindow (hwndParent, pszClass, pszName, flStyle, x, y, cx,
  16887.    cy, hwndOwner, hwndInsertBehind, id, pCtlData, pPresParams)
  16888.    HWND hwndParent;        /*desktop-window handle                         */
  16889.    PSZ pszClass;           /*address of registered class name              */
  16890.    PSZ pszName;            /*address of window text                        */
  16891.    ULONG flStyle;          /*window style                                  */
  16892.    SHORT x;                /*horizontal position of window                 */
  16893.    SHORT y;                /*vertical position of window                   */
  16894.    SHORT cx;               /*window width                                  */
  16895.    SHORT cy;               /*window depth                                  */
  16896.    HWND hwndOwner;         /*owner-window handle                           */
  16897.    HWND hwndInsertBehind;  /*handle to sibling window                      */
  16898.    USHORT id;              /*window identifier                             */
  16899.    PVOID pCtlData;         /*address of buffer                             */
  16900.    PVOID pPresParams;      /*reserved                                      */
  16901.  
  16902.    The WinCreateWindow function creates a new window.
  16903.  
  16904.  Parameters
  16905.  
  16906.    hwndParent  Specifies the parent window for the new window. Any valid
  16907.    window handle can be used.
  16908.  
  16909.    pszClass  Points to the registered class name. This parameter is either an
  16910.    application-specified name (defined by the WinRegisterClass function), the
  16911.    name of a preregistered WC class, or a WC constant.
  16912.  
  16913.    pszName  Points to window text or other class-specific data. The actual
  16914.    structure of the data is class-specific. This data is usually a
  16915.    zero-terminated string, which is often displayed in the window.
  16916.  
  16917.    flStyle  Specifies the window style. It can be a combination of one or
  16918.    more of the following values:
  16919.  
  16920. ╓┌─┌───────────────────┌─────────────────────────────────────────────────────╖
  16921.    Value               Meaning
  16922.    ──────────────────────────────────────────────────────────────────────────
  16923.    WS_CLIPCHILDREN     Prevents a window from painting over its child
  16924.                        windows.
  16925.  
  16926.    WS_CLIPSIBLINGS     Prevents a window from painting over its sibling
  16927.                        windows.
  16928.    Value               Meaning
  16929.    ──────────────────────────────────────────────────────────────────────────
  16930.                       windows.
  16931.  
  16932.    WS_DISABLED         Disables mouse and keyboard input to the window. It is
  16933.                        used to temporarily prevent the user from using the
  16934.                        window.
  16935.  
  16936.    WS_MAXIMIZED        Enlarges the window to the maximum size.
  16937.  
  16938.    WS_MINIMIZED        Reduces the window to the minimum size.
  16939.  
  16940.    WS_PARENTCLIP       Prevents a window from painting over its parent
  16941.                        window.
  16942.  
  16943.    WS_SAVEBITS         Saves the image under the window as a bitmap. When the
  16944.                        window is moved or hidden, the system restores the
  16945.                        image by copying the bits.
  16946.  
  16947.    WS_SYNCPAINT        Causes the window to immediately receive WM_PAINT
  16948.                        messages after a part of the window becomes invalid.
  16949.    Value               Meaning
  16950.    ──────────────────────────────────────────────────────────────────────────
  16951.                       messages after a part of the window becomes invalid.
  16952.                        Without this style, the window receives WM_PAINT
  16953.                        messages only if no other message is waiting to be
  16954.                        processed.
  16955.  
  16956.    WS_VISIBLE          Makes the window visible. This window will be drawn on
  16957.                        the screen unless overlapping windows completely
  16958.                        obscure it. Windows without this style are hidden.
  16959.    ──────────────────────────────────────────────────────────────────────────
  16960.  
  16961.  
  16962.    x  Specifies the horizontal position of the window relative to the origin
  16963.    of the parent window.
  16964.  
  16965.    y  Specifies the vertical position of the window relative to the origin of
  16966.    the parent window.
  16967.  
  16968.    cx  Specifies the window width in pels.
  16969.  
  16970.    cy  Specifies the window depth in pels.
  16971.  
  16972.    hwndOwner  Identifies the owner window.
  16973.  
  16974.    hwndInsertBehind  Identifies the sibling window behind which the specified
  16975.    window is placed. If this parameter is HWND_TOP, the specified window is
  16976.    placed on top of all its sibling windows. If this parameter is
  16977.    HWND_BOTTOM, the specified window is placed behind all its sibling
  16978.    windows. If this parameter is not HWND_TOP or HWND_BOTTOM, or it is a
  16979.    child window of the desktop window identified by hwndParent, then NULL is
  16980.    returned.
  16981.  
  16982.    id  Specifies the window identifier, a value given by the application that
  16983.    allows a specific child window to be identified. For example, the controls
  16984.    of a dialog box have unique identifiers so that an owner window can
  16985.    distinguish which control has notified it. Window identifiers are also
  16986.    used for frame windows.
  16987.  
  16988.    pCtlData  Points to the buffer that contains class-specific information.
  16989.    This data is passed to the window procedure by the WM_CREATE message.
  16990.  
  16991.    pPresParams  Points to the presentation parameters. This is a reserved
  16992.    field and must be zero.
  16993.  
  16994.  Return Value
  16995.  
  16996.    The return value is the handle of the window, or NULL if an error occurs.
  16997.  
  16998.  Comments
  16999.  
  17000.    WinCreateWindow sends a WM_CREATE message to the window procedure of the
  17001.    window being created, and then sends the WM_ADJUSTWINDOWPOS message before
  17002.    the window is displayed. The values passed are those given to the
  17003.    WinCreateWindow function.
  17004.  
  17005.    The WM_SIZE message is not sent by WinCreateWindow while the window is
  17006.    being created. Any required size processing is performed during the
  17007.    processing of the WM_CREATE message.
  17008.  
  17009.  See Also
  17010.  
  17011.    WinCreateStdWindow, WinQueryObjectWindow, WinRegisterClass
  17012.  
  17013.  
  17014.  ────────────────────────────────────────────────────────────────────────────
  17015.  WinDdeInitiate
  17016.  ────────────────────────────────────────────────────────────────────────────
  17017.    BOOL WinDdeInitiate (hwndClient, pszAppName, pszTopicName)
  17018.    HWND hwndClient;        /*handle of the client window                   */
  17019.    PSZ pszAppName;         /*address of application name                   */
  17020.    PSZ pszTopicName;       /*address of topic name                         */
  17021.  
  17022.    The WinDdeInitiate function initiates a DDE conversation by sending a
  17023.    WM_DDE_INITIATE message. All server applications matching the supplied
  17024.    application name will reply with a WM_DDE_INITIATEACK message if they
  17025.    support the specified topic.
  17026.  
  17027.  Parameters
  17028.  
  17029.    hwndClient  Identifies the client window. Since the window handle serves
  17030.    as the recipient of DDE messages for its conversation, it need not be
  17031.    visible. All applications must rely only on their own window handles to
  17032.    identify conversations.
  17033.  
  17034.    pszAppName  Points to a NULL terminated string containing the server's
  17035.    application name. If the string has zero length, any server application
  17036.    may respond.
  17037.  
  17038.    pszTopicName  Points to a NULL terminated string containing the topic
  17039.    name. If the string has zero length, the server will respond once for each
  17040.    topic that it supports.
  17041.  
  17042.  Return Value
  17043.  
  17044.    The return value is TRUE if the function is successful or FALSE if an
  17045.    error occurs.
  17046.  
  17047.  Comments
  17048.  
  17049.    The WM_DDE_INITIATE is sent to all top-level frame windows in the system.
  17050.    Any prospective server must subclass a top-level frame window in order to
  17051.    retrieve this message.
  17052.  
  17053.  See Also
  17054.  
  17055.    WinDdePostMsg, WinDdeRespond
  17056.  
  17057.  
  17058.  ────────────────────────────────────────────────────────────────────────────
  17059.  WinDdePostMsg
  17060.  ────────────────────────────────────────────────────────────────────────────
  17061.    BOOL WinDdePostMsg (hwndTo, hwndFrom, wm, pddes, fRetry)
  17062.    HWND hwndTo;            /*handle of the window to post to               */
  17063.    HWND hwndFrom;          /*handle of the window that is posting          */
  17064.    USHORT wm;              /*message number                                */
  17065.    PDDESTRUCT pddes;       /*address of the structure to pass              */
  17066.    BOOL fRetry;            /*retry flag                                    */
  17067.  
  17068.    The WinDdePostMsg function posts a DDE message to the specified window's
  17069.    message queue.
  17070.  
  17071.  Parameters
  17072.  
  17073.    hwndTo  Identifies the window the message is to be posted to.
  17074.  
  17075.    hwndFrom  Identifies the window that is posting the message.
  17076.  
  17077.    wm  Specifies the message being sent. The following messages may be sent:
  17078.  
  17079.          WM_DDE_ACK
  17080.          WM_DDE_ADVISE
  17081.          WM_DDE_DATA
  17082.          WM_DDE_EXECUTE
  17083.          WM_DDE_INITIATE
  17084.          WM_DDE_INITIATEACK
  17085.          WM_DDE_POKE
  17086.          WM_DDE_REQUEST
  17087.          WM_DDE_TERMINATE
  17088.          WM_DDE_UNADVISE
  17089.  
  17090.    pddes  Points to a DDESTRUCT structure. The structure has the following
  17091.    form:
  17092.  
  17093.    typedef struct _DDESTRUCT {
  17094.        ULONG     cbData;
  17095.        USHORT    fsStatus;
  17096.        USHORT    usFormat;
  17097.        USHORT    offszItemName;
  17098.        USHORT    offabData;
  17099.    } DDESTRUCT;
  17100.  
  17101.    For more information, see Chapter 4, "Types, Macros, Structures."
  17102.  
  17103.    fRetry  Specifies whether or not to try to send the message again if it
  17104.    fails the first time because the destination queue was full. If TRUE, the
  17105.    message is sent repeatedly at one second intervals until it could be
  17106.    successfully posted.
  17107.  
  17108.  Return Value
  17109.  
  17110.    The return value is TRUE if the function is successful, or FALSE if an
  17111.    error occurred. If the fRetry parameter is TRUE, this function will still
  17112.    return FALSE if the message cannot be sent for any reason other then the
  17113.    destination queue being full.
  17114.  
  17115.  See Also
  17116.  
  17117.    WinDdeInitiate, WinDdeRespond
  17118.  
  17119.  
  17120.  ────────────────────────────────────────────────────────────────────────────
  17121.  WinDdeRespond
  17122.  ────────────────────────────────────────────────────────────────────────────
  17123.    MRESULT WinDdeRespond (hwndClient, hwndServer, pszAppName, pszTopicName)
  17124.    HWND hwndClient;        /*handle of the client window                   */
  17125.    HWND hwndServer;        /*handle of the server window                   */
  17126.    PSZ pszAppName;         /*address of name of application                */
  17127.    PSZ pszTopicName;       /*address of name of topic                      */
  17128.  
  17129.    The WinDdeRespond function sends an acknowledgement message
  17130.    (WM_DDE_INITIATEACK) back to the application that sent a WM_DDE_INITIATE
  17131.    message.
  17132.  
  17133.  Parameters
  17134.  
  17135.    hwndClient  Identifies the client window.
  17136.  
  17137.    hwndServer  Identifies the server window.
  17138.  
  17139.    pszAppName  Points to the name of the application that is acknowledging
  17140.    the WM_DDE_INITIATE message.
  17141.  
  17142.    pszTopicName  Points to the topic name that the acknowledging application
  17143.    will accept.
  17144.  
  17145.  Return Value
  17146.  
  17147.    The return value is the result of sending the WM_DDE_INITIATEACK message
  17148.    to the client window.
  17149.  
  17150.  See Also
  17151.  
  17152.    WinDdeInitiate
  17153.  
  17154.  
  17155.  ────────────────────────────────────────────────────────────────────────────
  17156.  WinDefAVioWindowProc
  17157.  ────────────────────────────────────────────────────────────────────────────
  17158.    MRESULT WinDefAVioWindowProc (hwnd, msg, mp1, mp2)
  17159.    HWND hwnd;              /*handle of the window                          */
  17160.    USHORT msg;             /*message                                       */
  17161.    MPARAM mp1;             /*message parameter                             */
  17162.    MPARAM mp2;             /*message parameter                             */
  17163.  
  17164.    The WinDefAVioWindowProc function calls the default window procedure for
  17165.    an advanced video-input-and-output (AVIO) window. An AVIO application must
  17166.    use this function instead of the WinDefWindowProc function that is used
  17167.    with Presentation Manager applications.
  17168.  
  17169.    The default window procedure provides default processing for any window
  17170.    messages that an application does not process. This function is used to
  17171.    ensure that every message is processed. It should be called with the same
  17172.    parameters as those received by the window procedure.
  17173.  
  17174.  Parameters
  17175.  
  17176.    hwnd  Identifies the window that received the message.
  17177.  
  17178.    msg  Specifies the message.
  17179.  
  17180.    mp1  Specifies message parameter 1.
  17181.  
  17182.    mp2  Specifies message parameter 2.
  17183.  
  17184.  Return Value
  17185.  
  17186.    The return value is dependent on the message that was passed to this
  17187.    function.
  17188.  
  17189.  See Also
  17190.  
  17191.    WinDefWindowProc
  17192.  
  17193.  
  17194.  ────────────────────────────────────────────────────────────────────────────
  17195.  WinDefDlgProc
  17196.  ────────────────────────────────────────────────────────────────────────────
  17197.    MRESULT WinDefDlgProc (hwndDlg, msg, mp1, mp2)
  17198.    HWND hwndDlg;           /*handle of the dialog                          */
  17199.    USHORT msg;             /*message                                       */
  17200.    MPARAM mp1;             /*message parameter                             */
  17201.    MPARAM mp2;             /*message parameter                             */
  17202.  
  17203.    The WinDefDlgProc function calls the default dialog procedure. The default
  17204.    dialog procedure provides default processing for any dialog window
  17205.    messages that an application does not process. This function is used to
  17206.    ensure that every message is processed. It should be called with the same
  17207.    parameters as those received by the dialog procedure.
  17208.  
  17209.  Parameters
  17210.  
  17211.    hwndDlg  Identifies the dialog window that received the message.
  17212.  
  17213.    msg  Specifies the message.
  17214.  
  17215.    mp1  Specifies message parameter 1.
  17216.  
  17217.    mp2  Specifies message parameter 2.
  17218.  
  17219.  Return Value
  17220.  
  17221.    The return value is dependent on the message that was passed to this
  17222.    function.
  17223.  
  17224.  Example
  17225.  
  17226.    This example shows a typical dialog box procedure. A switch statement is
  17227.    used to process individual messages. All messages not processed are passed
  17228.    on to the WinDefDlgProc function.
  17229.  
  17230.    MRESULT CALLBACK AboutDlg(hwnd, usMessage, mp1, mp2)
  17231.    HWND   hwnd;
  17232.    USHORT usMessage;
  17233.    MPARAM mp1;
  17234.    MPARAM mp2;
  17235.    {
  17236.        switch (usMessage) {
  17237.  
  17238.            /*
  17239.             * process whatever messages you want here and send the rest
  17240.             * to WinDefWindowProc
  17241.             */
  17242.  
  17243.            default:
  17244.                return (WinDefDlgProc(hwnd, usMessage, mp1, mp2));
  17245.        }
  17246.    }
  17247.  
  17248.  See Also
  17249.  
  17250.    WinDefWindowProc
  17251.  
  17252.  
  17253.  ────────────────────────────────────────────────────────────────────────────
  17254.  WinDefWindowProc
  17255.  ────────────────────────────────────────────────────────────────────────────
  17256.    MRESULT WinDefWindowProc (hwnd, msg, mp1, mp2)
  17257.    HWND hwnd;              /*handle of the window                          */
  17258.    USHORT msg;             /*message                                       */
  17259.    MPARAM mp1;             /*message parameter                             */
  17260.    MPARAM mp2;             /*message parameter                             */
  17261.  
  17262.    The WinDefWindowProc function calls the default window procedure. The
  17263.    default window procedure provides default processing for any window
  17264.    messages that an application does not process. This function is used to
  17265.    ensure that every message is processed. It should be called with the same
  17266.    parameters as those received by the window procedure.
  17267.  
  17268.  Parameters
  17269.  
  17270.    hwnd  Identifies the window that received the message.
  17271.  
  17272.    msg  Specifies the message.
  17273.  
  17274.    mp1  Specifies message parameter 1.
  17275.  
  17276.    mp2  Specifies message parameter 2.
  17277.  
  17278.  Return Value
  17279.  
  17280.    The return value is dependent on the message that was passed to this
  17281.    function.
  17282.  
  17283.  Example
  17284.  
  17285.    This example shows a typical window procedure. A switch statement is used
  17286.    to process individual messages. All messages not processed are passed on
  17287.    to the WinDefWindowProc function.
  17288.  
  17289.    MRESULT CALLBACK GenericWndProc(hwnd, usMessage, mp1, mp2)
  17290.    HWND   hwnd;
  17291.    USHORT usMessage;
  17292.    MPARAM mp1;
  17293.    MPARAM mp2;
  17294.    {
  17295.        switch (usMessage) {
  17296.  
  17297.            /*
  17298.             * process whatever messages you want here and send the rest
  17299.             * to WinDefWindowProc
  17300.             */
  17301.  
  17302.            default:
  17303.                return (WinDefWindowProc(hwnd, usMessage, mp1, mp2));
  17304.        }
  17305.    }
  17306.  
  17307.  See Also
  17308.  
  17309.    WinDefAVioWindowProc, WinDefDlgProc
  17310.  
  17311.  
  17312.  ────────────────────────────────────────────────────────────────────────────
  17313.  WinDeleteAtom
  17314.  ────────────────────────────────────────────────────────────────────────────
  17315.    ATOM WinDeleteAtom (hAtomTbl, atom)
  17316.    HATOMTBL hAtomTbl;      /*handle of the atom table                      */
  17317.    ATOM atom;              /*atom                                          */
  17318.  
  17319.    The WinDeleteAtom function deletes an atom from the atom table.
  17320.  
  17321.  Parameters
  17322.  
  17323.    hAtomTbl  Identifies the atom table. This handle must have been created by
  17324.    a previous call to the WinCreateAtomTable function.
  17325.  
  17326.    atom  Specifies the atom to be deleted.
  17327.  
  17328.  Return Value
  17329.  
  17330.    The return value is NULL if the function is successful. Otherwise, it is
  17331.    equal to the value of the atom parameter if the function failed and the
  17332.    atom has not been deleted.
  17333.  
  17334.    If the passed atom is an integer atom, NULL is returned. If it is not an
  17335.    integer atom and it is a valid atom for the given atom table (it has an
  17336.    atom name and use count associated with it), the use count is decreased by
  17337.    one and NULL is returned. If the use count has been decreased to zero, the
  17338.    atom name and use count are removed from the atom table.
  17339.  
  17340.  See Also
  17341.  
  17342.    WinAddAtom, WinCreateAtomTable
  17343.  
  17344.  
  17345.  ────────────────────────────────────────────────────────────────────────────
  17346.  WinDestroyAccelTable
  17347.  ────────────────────────────────────────────────────────────────────────────
  17348.    BOOL WinDestroyAccelTable (haccel)
  17349.    HACCEL haccel;          /*handle of the accelerator table               */
  17350.  
  17351.    The WinDestroyAccelTable function destroys an accelerator table. Before an
  17352.    application terminates, it should call this function for each accelerator
  17353.    table created with a call to the WinCreateAccelTable function.
  17354.  
  17355.  Parameters
  17356.  
  17357.    haccel  Identifies the accelerator table to be destroyed. This handle must
  17358.    have been created by a previous call to the WinCreateAccelTable function.
  17359.  
  17360.  Return Value
  17361.  
  17362.    The return value is TRUE if the function is successful or FALSE if an
  17363.    error occurs.
  17364.  
  17365.  See Also
  17366.  
  17367.    WinCreateAccelTable
  17368.  
  17369.  
  17370.  ────────────────────────────────────────────────────────────────────────────
  17371.  WinDestroyAtomTable
  17372.  ────────────────────────────────────────────────────────────────────────────
  17373.    HATOMTBL WinDestroyAtomTable (hAtomTbl)
  17374.    HATOMTBL hAtomTbl;      /*handle of the atom table                      */
  17375.  
  17376.    The WinDestroyAtomTable function destroys an atom table created by the
  17377.    WinCreateAtomTable function.
  17378.  
  17379.  Parameters
  17380.  
  17381.    hAtomTbl  Identifies the atom table to be destroyed. This handle must have
  17382.    been created by a previous call to the WinCreateAtomTable function.
  17383.  
  17384.  Return Value
  17385.  
  17386.    The return value is NULL if the function is successful. Otherwise, the
  17387.    return value is the hAtomTbl parameter.
  17388.  
  17389.    This method of returning failure allows for updating the status of an atom
  17390.    table and destroying it at the same time with a call similar to the
  17391.    following:
  17392.  
  17393.    hAtomTbl = WinDestroyAtomTable(hAtomTbl);
  17394.  
  17395.  See Also
  17396.  
  17397.    WinCreateAtomTable
  17398.  
  17399.  
  17400.  ────────────────────────────────────────────────────────────────────────────
  17401.  WinDestroyCursor
  17402.  ────────────────────────────────────────────────────────────────────────────
  17403.    BOOL WinDestroyCursor (hwnd)
  17404.    HWND hwnd;              /*handle of the window                          */
  17405.  
  17406.    The WinDestroyCursor function erases and destroys the current cursor, if
  17407.    it belongs to the specified window.
  17408.  
  17409.    This function has no effect if the current cursor does not belong to the
  17410.    specified window.
  17411.  
  17412.  Parameters
  17413.  
  17414.    hwnd  Identifies the window to which the cursor belongs.
  17415.  
  17416.  Return Value
  17417.  
  17418.    The return value is TRUE if the function is successful or FALSE if an
  17419.    error occurs.
  17420.  
  17421.  Comments
  17422.  
  17423.    It is not necessary to call the WinDestroyCursor function before calling
  17424.    the WinCreateCursor function, as the WinCreateCursor function will
  17425.    automatically destroy any existing cursor.
  17426.  
  17427.  See Also
  17428.  
  17429.    WinCreateCursor, WinQueryCursorInfo, WinShowCursor
  17430.  
  17431.  
  17432.  ────────────────────────────────────────────────────────────────────────────
  17433.  WinDestroyHeap
  17434.  ────────────────────────────────────────────────────────────────────────────
  17435.    HHEAP WinDestroyHeap (hHeap)
  17436.    HHEAP hHeap;            /*handle of the heap                            */
  17437.  
  17438.    The WinDestroyHeap function destroys a heap created by the WinCreate- Heap
  17439.    function. If the WinCreateHeap function allocated a segment, the
  17440.    WinDestroyHeap will free that segment.
  17441.  
  17442.  Parameters
  17443.  
  17444.    hHeap  Identifies the heap to be destroyed. This handle must have been
  17445.    created by a previous call to the WinCreateHeap function.
  17446.  
  17447.  Return Value
  17448.  
  17449.    The return value is zero if the function is successful. Otherwise, it is
  17450.    nonzero, indicating that an error occurred.
  17451.  
  17452.  See Also
  17453.  
  17454.    WinCreateHeap
  17455.  
  17456.  
  17457.  ────────────────────────────────────────────────────────────────────────────
  17458.  WinDestroyMsgQueue
  17459.  ────────────────────────────────────────────────────────────────────────────
  17460.    BOOL WinDestroyMsgQueue (hmq)
  17461.    HMQ hmq;                /*handle of the message queue                   */
  17462.  
  17463.    The WinDestroyMsgQueue function destroys a message queue. Any thread or
  17464.    application that creates a message queue should call WinDestroyMsgQueue to
  17465.    destroy that message queue before terminating.
  17466.  
  17467.  Parameters
  17468.  
  17469.    hmq  Identifies the message queue to be destroyed. This handle must have
  17470.    been created by a previous call to the WinCreateMsgQueue function in the
  17471.    same thread that is calling the WinDestroyMsgQueue function.
  17472.  
  17473.  Return Value
  17474.  
  17475.    The return value is TRUE if the function is successful or FALSE if an
  17476.    error occurs.
  17477.  
  17478.  Example
  17479.  
  17480.    This example calls WinInitialize to initialize the thread for making
  17481.    Presentation Manager function calls, and calls WinCreateMsgQueue to create
  17482.    a message queue for the thread. Before the thread terminates, it calls
  17483.    WinDestroyMsgQueue to destroy the message queue.
  17484.  
  17485.    hab = WinInitialize(NULL);
  17486.    hmq = WinCreateMsgQueue(hab, DEFAULT_QUEUE_SIZE);
  17487.        .
  17488.        . /* initialization and message loop */
  17489.        .
  17490.    WinDestroyMsgQueue(hmq);
  17491.  
  17492.  See Also
  17493.  
  17494.    WinCreateMsgQueue, WinInitialize
  17495.  
  17496.  
  17497.  ────────────────────────────────────────────────────────────────────────────
  17498.  WinDestroyPointer
  17499.  ────────────────────────────────────────────────────────────────────────────
  17500.    BOOL WinDestroyPointer (hptr)
  17501.    HPOINTER hptr;          /*handle of the pointer or icon                 */
  17502.  
  17503.    The WinDestroyPointer function destroys a pointer or an icon. A pointer
  17504.    can be destroyed only by the process that created it. The system pointers
  17505.    and icons cannot be destroyed.
  17506.  
  17507.  Parameters
  17508.  
  17509.    hptr  Identifies the pointer or icon to destroy.
  17510.  
  17511.  Return Value
  17512.  
  17513.    The return value is TRUE if the function is successful or FALSE if an
  17514.    error occurs.
  17515.  
  17516.  See Also
  17517.  
  17518.    WinCreatePointer
  17519.  
  17520.  
  17521.  ────────────────────────────────────────────────────────────────────────────
  17522.  WinDestroyWindow
  17523.  ────────────────────────────────────────────────────────────────────────────
  17524.    BOOL WinDestroyWindow (hwnd)
  17525.    HWND hwnd;              /*handle of the window to destory               */
  17526.  
  17527.    The WinDestroyWindow function destroys a window and any child windows of
  17528.    that window. If the window is locked, this function will not return until
  17529.    the window has been unlocked (and destroyed).
  17530.  
  17531.  Parameters
  17532.  
  17533.    hwnd  Identifies the window to be destroyed.
  17534.  
  17535.  Return Value
  17536.  
  17537.    The return value is TRUE if the function is successful or FALSE if an
  17538.    error occurs.
  17539.  
  17540.  Comments
  17541.  
  17542.    The window to be destroyed must have been created by the thread that
  17543.    issues this call. Before the window identified by the hwnd parameter is
  17544.    itself destroyed, all child windows it owns are also destroyed.
  17545.  
  17546.    Note that any presentation spaces created with the WinGetPS function must
  17547.    be released by calling the WinReleasePS function. This must be done before
  17548.    calling WinDestroyWindow.
  17549.  
  17550.    The following messages are sent by this function:
  17551.  
  17552.    Value                       Meaning
  17553.    ──────────────────────────────────────────────────────────────────────────
  17554.    WM_ACTIVATE                 Sent with the first message parameter equal to
  17555.                                FALSE if the window being destroyed is the
  17556.                                active window.
  17557.  
  17558.    WM_DESTROY                  Always sent to the window being destroyed
  17559.                                after the window has been hidden on the
  17560.                                device, but before its child windows have been
  17561.                                destroyed.
  17562.  
  17563.    WM_OTHERWINDOWDESTROYED     Sent to all main windows if the window being
  17564.                                destroyed, or any of its descendants, has been
  17565.                                registered with the WinRegisterWindowDestroy
  17566.                                function.
  17567.  
  17568.    WM_RENDERALLFMTS            Sent if the clipboard owner is being destroyed
  17569.                                and there are unrendered formats in the
  17570.                                clipboard.
  17571.    ──────────────────────────────────────────────────────────────────────────
  17572.  
  17573.    If the window being destroyed is the active window, then both the active
  17574.    window and the input-focus window are transferred to another window when
  17575.    the window is destroyed.
  17576.  
  17577.  See Also
  17578.  
  17579.    WinCreateStdWindow, WinCreateWindow, WinGetPS, WinLockWindow,
  17580.    WinRegisterWindowDestroy, WinReleasePS
  17581.  
  17582.  
  17583.  ────────────────────────────────────────────────────────────────────────────
  17584.  WinDismissDlg
  17585.  ────────────────────────────────────────────────────────────────────────────
  17586.    BOOL WinDismissDlg (hwndDlg, usResult)
  17587.    HWND hwndDlg;           /*handle of the dialog                          */
  17588.    USHORT usResult;        /*result code to return                         */
  17589.  
  17590.    The WinDismissDlg function hides the dialog window and causes the
  17591.    WinProcessDlg or WinDlgBox function to return.
  17592.  
  17593.  Parameters
  17594.  
  17595.    hwndDlg  Identifies the dialog window to be hidden.
  17596.  
  17597.    usResult  Specifies the value that is returned to the caller of
  17598.    WinProcessDlg or WinDlgBox.
  17599.  
  17600.  Return Value
  17601.  
  17602.    The return value is TRUE if the function is successful or FALSE if an
  17603.    error occurs.
  17604.  
  17605.  Comments
  17606.  
  17607.    This function is required to complete the processing of a modal dialog
  17608.    window and is called from its dialog procedure.
  17609.  
  17610.    The WinDismissDlg function is automatically called by the WinDefDlgProc
  17611.    function upon receiving a WM_COMMAND message. The WinDefDlgProc function
  17612.    will set usResult to the identifier of the control that generated the
  17613.    WM_COMMAND message.
  17614.  
  17615.    Note that this function can be called from a modeless dialog box, although
  17616.    this is not necessary since there is no internal message processing loop.
  17617.    If the function is called, the dialog box window is hidden. The
  17618.    application must destroy the dialog box window, if required.
  17619.  
  17620.  Example
  17621.  
  17622.    This example shows a typical dialog procedure that has both an OK and a
  17623.    Cancel button. If the user selects the OK button, WinDismissDlg is called
  17624.    with a result value of TRUE. If the user selects the Cancel button,
  17625.    WinDismissDlg is called with a result value of TRUE.
  17626.  
  17627.    case WM_COMMAND:
  17628.        switch (SHORT1FROMMP(mp1)) {
  17629.            case ID_ENTER: /* OK button selected  */
  17630.                WinDismissDlg(hwnd, TRUE);
  17631.                return (0L);
  17632.  
  17633.            case ID_CANCEL: /* Cancel button selected */
  17634.                WinDismissDlg(hwnd, FALSE);
  17635.                return (0L);
  17636.  
  17637.  See Also
  17638.  
  17639.    WinDlgBox, WinProcessDlg
  17640.  
  17641.  
  17642.  ────────────────────────────────────────────────────────────────────────────
  17643.  WinDispatchMsg
  17644.  ────────────────────────────────────────────────────────────────────────────
  17645.    ULONG WinDispatchMsg (hab, pqmsg)
  17646.    HAB hab;                /*handle of the anchor block                    */
  17647.    PQMSG pqmsg;            /*address of structure for message queue        */
  17648.  
  17649.    The WinDispatchMsg dispatches a message to a window. It is typically used
  17650.    to dispatch a message retrieved with the WinGetMsg function. Unlike the
  17651.    WinSendMsg function, the WinDispatchMsg function does not call any hooks
  17652.    installed with the WinSetHook function.
  17653.  
  17654.  Parameters
  17655.  
  17656.    hab  Identifies an anchor block.
  17657.  
  17658.    pqmsg  Points to a QMSG structure that contains the message. The QMSG
  17659.    structure has the following form:
  17660.  
  17661.    typedef struct _QMSG {
  17662.        HWND hwnd;
  17663.        USHORT msg;
  17664.        MPARAM mp1;
  17665.        MPARAM mp2;
  17666.        ULONG time;
  17667.        POINTL ptl;
  17668.    } QMSG;
  17669.  
  17670.    For a full description, see Chapter 4, "Types, Macros, Structures."
  17671.  
  17672.  Return Value
  17673.  
  17674.    The return value is the value returned by the window procedure that was
  17675.    called.
  17676.  
  17677.  Example
  17678.  
  17679.    This example calls WinGetMsg to retrieve a message and WinDispatchMsg to
  17680.    send the message.
  17681.  
  17682.    HAB hab;
  17683.    QMSG qmsg;
  17684.  
  17685.    while (WinGetMsg(hab,   /* handle to the anchor block             */
  17686.            &qmsg,          /* address of the message queue structure */
  17687.            NULL,           /* accept messages for any window         */
  17688.            0,              /* first message to accept                */
  17689.            0))             /* accept all messages                    */
  17690.        WinDispatchMsg(hab, &qmsg);
  17691.  
  17692.  See Also
  17693.  
  17694.    WinGetMsg, WinProcessDlg, WinSendMsg, WinSetHook
  17695.  
  17696.  
  17697.  ────────────────────────────────────────────────────────────────────────────
  17698.  WinDlgBox
  17699.  ────────────────────────────────────────────────────────────────────────────
  17700.    USHORT WinDlgBox (hwndParent, hwndOwner, pfnDlgProc, hmod, idDlg,
  17701.    pCreateParams)
  17702.    HWND hwndParent;        /*handle of the parent window                   */
  17703.    HWND hwndOwner;         /*handle of the owner window                    */
  17704.    PFNWP pfnDlgProc;       /*dialog procedure address                      */
  17705.    HMODULE hmod;           /*handle of resource module                     */
  17706.    USHORT idDlg;           /*identifies the dialog                         */
  17707.    PVOID pCreateParams;    /*address of application-specific data          */
  17708.  
  17709.    The WinDlgBox function loads and processes a modal dialog box and returns
  17710.    the usResult value passed to the WinDismissDlg function. It is equivalent
  17711.    to calling WinLoadDlg, WinProcessDlg, and WinDestroyWindow.
  17712.  
  17713.    This function does not return until the dialog procedure calls the
  17714.    WinDismissDlg function.
  17715.  
  17716.  Parameters
  17717.  
  17718.    hwndParent  Identifies the parent window.
  17719.  
  17720.    hwndOwner  Identifies the owner window.
  17721.  
  17722.    pfnDlgProc  Points to the dialog procedure.
  17723.  
  17724.    hmod  Identifies the module that contains the dialog template. This
  17725.    parameter can be either the module handle returned by the DosLoadModule
  17726.    function or NULL for the application's module.
  17727.  
  17728.    idDlg  Identifies the dialog window.
  17729.  
  17730.    pCreateParams  Points to application-specific data that is passed to the
  17731.    dialog procedure as part of the WM_INITDLG message.
  17732.  
  17733.  Return Value
  17734.  
  17735.    The return value is the value specified in the usResult parameter of the
  17736.    WinDismissDlg function, or DID_ERROR if an error occurred while trying to
  17737.    load the dialog box.
  17738.  
  17739.  Example
  17740.  
  17741.    This example processes an application-defined message (IDM_OPEN) and calls
  17742.    WinDlgBox to load a dialog box.
  17743.  
  17744.    case IDM_OPEN:
  17745.        if (WinDlgBox(HWND_DESKTOP,
  17746.                hwndFrame,    /* handle of the owner         */
  17747.                OpenDlg,      /* dialog procedure address    */
  17748.                NULL,         /* location of dialog resource */
  17749.                IDD_OPEN,     /* resource identifier         */
  17750.                NULL)) {      /* application-specific data   */
  17751.           .
  17752.           . /* code executed if dialog box returns TRUE */
  17753.           .
  17754.        }
  17755.  
  17756.  See Also
  17757.  
  17758.    DosLoadModule, WinDismissDlg, WinLoadDlg, WinProcessDlg
  17759.  
  17760.  
  17761.  ────────────────────────────────────────────────────────────────────────────
  17762.  WinDrawBitmap
  17763.  ────────────────────────────────────────────────────────────────────────────
  17764.    BOOL WinDrawBitmap (hpsDst, hbm, prclSrc, pptlDst, clrFore, clrBack, fs)
  17765.    HPS hpsDst;             /*handle of the destination presentation space  */
  17766.    HBITMAP hbm;            /*handle of the bitmap                          */
  17767.    PRECTL prclSrc;         /*address of structure with rectangle           */
  17768.                            /*coordinates                                   */
  17769.    PPOINTL pptlDst;        /*address of structure with bitmap position     */
  17770.    LONG clrFore;           /*color of the foreground                       */
  17771.    LONG clrBack;           /*color of the background                       */
  17772.    USHORT fs;              /*bitmap-drawing flags                          */
  17773.  
  17774.    The WinDrawBitmap function draws a bitmap using the current image colors
  17775.    and mixes.
  17776.  
  17777.  Parameters
  17778.  
  17779.    hpsDst  Identifies the presentation space in which the bitmap is drawn.
  17780.  
  17781.    hbm  Identifies the bitmap.
  17782.  
  17783.    prclSrc  Points to the RECTL data structure that contains the coordinates
  17784.    of the rectangle to be drawn. If this parameter is NULL, the entire bitmap
  17785.    is drawn. The RECTL structure has the following form:
  17786.  
  17787.    typedef struct _RECTL {
  17788.        LONG  xLeft;
  17789.        LONG  yBottom;
  17790.        LONG  xRight;
  17791.        LONG  yTop;
  17792.    } RECTL;
  17793.  
  17794.    For a full description, see Chapter 4, "Types, Macros, Structures."
  17795.  
  17796.    pptlDst  Points to the position of the lower left of the bitmap in the
  17797.    presentation space (in presentation space coordinates).
  17798.  
  17799.    clrFore  Specifies the color of the foreground.
  17800.  
  17801.    clrBack  Specifies the color of the background.
  17802.  
  17803.    fs  Specifies the flags that determine how the bitmap is drawn. It can be
  17804.    one of the following values:
  17805.  
  17806.    Value           Meaning
  17807.    ──────────────────────────────────────────────────────────────────────────
  17808.    DBM_HALFTONE    Use the OR operator to combine the bitmap with an
  17809.                    alternating pattern of ones and zeros before drawing it.
  17810.                    This flag can be used in conjunction with either
  17811.                    DBM_NORMAL or DBM_INVERT.
  17812.  
  17813.    DBM_IMAGEATTRS  The clrFore and clrBack parameters are ignored and the
  17814.                    image attribute colors already selected in hpsDst are used
  17815.                    instead.
  17816.  
  17817.    DBM_INVERT      Draw the bitmap inverted, using ROP_NOTSRCCOPY.
  17818.  
  17819.    DBM_NORMAL      Draw the bitmap normally, using ROP_SRCCOPY.
  17820.  
  17821.    DBM_STRETCH     The pptlDst parameter points to a RECTL data structure,
  17822.                    representing a rectangle in the destination presentation
  17823.                    space to which the bitmap should be stretched.
  17824.    ──────────────────────────────────────────────────────────────────────────
  17825.  
  17826.  Return Value
  17827.  
  17828.    The return value is TRUE if the function is successful or FALSE if an
  17829.    error occurs.
  17830.  
  17831.  See Also
  17832.  
  17833.    GpiCreateBitmap, GpiLoadBitmap, WinGetSysBitmap
  17834.  
  17835.  ────────────────────────────────────────────────────────────────────────────
  17836.  WinDrawBorder
  17837.  ────────────────────────────────────────────────────────────────────────────
  17838.    BOOL WinDrawBorder (hps, prcl, cx, cy, clrFore, clrBack, fsCmd)
  17839.    HPS hps;                /*handle of the presentation space              */
  17840.    PRECTL prcl;            /*address of structure with bounding rectangle  */
  17841.    SHORT cx;               /*width of the border                           */
  17842.    SHORT cy;               /*height of the border                          */
  17843.    LONG clrFore;           /*color of the foreground                       */
  17844.    LONG clrBack;           /*color of the background                       */
  17845.    USHORT fsCmd;           /*border-drawing flags                          */
  17846.  
  17847.    The WinDrawBorder function draws a border (a rectangular frame, normally
  17848.    used around the edge of a window).
  17849.  
  17850.  Parameters
  17851.  
  17852.    hps  Identifies the presentation space in which the border is drawn.
  17853.  
  17854.    prcl  Points to a RECTL structure that contains the bounding rectangle for
  17855.    the border. The border is drawn within this rectangle. The RECTL structure
  17856.    has the following form:
  17857.  
  17858.    typedef struct _RECTL {
  17859.        LONG  xLeft;
  17860.        LONG  yBottom;
  17861.        LONG  xRight;
  17862.        LONG  yTop;
  17863.    } RECTL;
  17864.  
  17865.    For a full description, see Chapter 4, "Types, Macros, Structures."
  17866.  
  17867.    cx  Specifies the width of the left and right sides of the border
  17868.    rectangle.
  17869.  
  17870.    cy  Specifies the height of the top and bottom sides of the border
  17871.    rectangle.
  17872.  
  17873.    clrFore  Specifies the color of the foreground.
  17874.  
  17875.    clrBack  Specifies the color of the background.
  17876.  
  17877.    fsCmd  Specifies the flags that determine how the border is drawn. It can
  17878.    be one of the following values:
  17879.  
  17880. ╓┌─┌───────────────┌─────────────────────────────────────────────────────────╖
  17881.    Value           Meaning
  17882.    ──────────────────────────────────────────────────────────────────────────
  17883.    DB_AREAMIXMODE  Draws the border with the current area attributes, using
  17884.                    the current-area foreground mix mode mapped to a GpiBitBlt
  17885.                    raster operation. Note that the background mix mode is
  17886.                    ignored by WinDrawBorder in this release because GpiBitBlt
  17887.                    ignores it.
  17888.  
  17889.    DB_DESTINVERT   Inverts the border.
  17890.  
  17891.    DB_DLGBORDER    A standard dialog border is drawn. If DB_PATCOPY is
  17892.                    specified, then an active dialog border is drawn. If
  17893.                    DB_PATINVERT is specified, then an inactive dialog border
  17894.    Value           Meaning
  17895.    ──────────────────────────────────────────────────────────────────────────
  17896.                   DB_PATINVERT is specified, then an inactive dialog border
  17897.                    is drawn. If this option is specified, the cx and cy
  17898.                    parameters are ignored.
  17899.  
  17900.    DB_INTERIOR     The interior of the border is drawn with the current
  17901.                    pattern background color. The border is drawn in the
  17902.                    current pattern foreground color.
  17903.  
  17904.    DB_PATCOPY      Draws the border with the current area attributes, forcing
  17905.                    a mix mode of ROP_SRCCOPY.
  17906.  
  17907.    DB_PATINVERT    Draws the border with the current area attributes, forcing
  17908.                    a mix mode of ROP_PATINVERT.
  17909.  
  17910.    DB_ROP          Used as a mask to isolate the raster operation related
  17911.                    flags of the fsCmd parameter.
  17912.  
  17913.    DB_STANDARD     The cx and cy parameters are multiplied by the system
  17914.                    SV_CXBORDER and SV_CYBORDER constants to produce the width
  17915.    Value           Meaning
  17916.    ──────────────────────────────────────────────────────────────────────────
  17917.                   SV_CXBORDER and SV_CYBORDER constants to produce the width
  17918.                    and height of the border sides.
  17919.    ──────────────────────────────────────────────────────────────────────────
  17920.  
  17921.  
  17922.    The current area attributes pattern is used. For instance, if the caller
  17923.    selects a diagonal-crosshatch symbol, the borders will be drawn with
  17924.    diagonal crosshatches, no matter what colors are selected. The only raster
  17925.    operation which does not use the pattern is DB_DESTINVERT.
  17926.  
  17927.  Return Value
  17928.  
  17929.    The return value is TRUE if the function is successful or FALSE if an
  17930.    error occurs.
  17931.  
  17932.  See Also
  17933.  
  17934.    GpiBitBlt
  17935.  
  17936.  
  17937.  ────────────────────────────────────────────────────────────────────────────
  17938.  WinDrawPointer
  17939.  ────────────────────────────────────────────────────────────────────────────
  17940.    BOOL WinDrawPointer (hps, x, y, hptr, fs)
  17941.    HPS hps;                /*handle of the presentation space              */
  17942.    SHORT x;                /*horizontal position                           */
  17943.    SHORT y;                /*vertical position                             */
  17944.    HPOINTER hptr;          /*handle to the mouse pointer                   */
  17945.    USHORT fs;              /*pointer-drawing flags                         */
  17946.  
  17947.    The WinDrawPointer function draws a pointer.
  17948.  
  17949.  Parameters
  17950.  
  17951.    hps  Identifies the presentation space in which the pointer is drawn.
  17952.  
  17953.    x  Specifies the x-coordinate at which to draw the pointer.
  17954.  
  17955.    y  Specifies the y-coordinate at which to draw the pointer.
  17956.  
  17957.    hptr  Identifies the pointer.
  17958.  
  17959.    fs  Specifies the flags that determine how the pointer is drawn. It can be
  17960.    one of the following values:
  17961.  
  17962.    Value           Meaning
  17963.    ──────────────────────────────────────────────────────────────────────────
  17964.    DP_HALFTONED    Draw the pointer with a halftone pattern where black
  17965.                    normally appears.
  17966.  
  17967.    DP_INVERTED     Draw the pointer inverted──black for white and white for
  17968.                    black.
  17969.  
  17970.    DP_NORMAL       Draw the pointer as it normally appears.
  17971.    ──────────────────────────────────────────────────────────────────────────
  17972.  
  17973.  Return Value
  17974.  
  17975.    The return value is TRUE if the function is successful or FALSE if an
  17976.    error occurs.
  17977.  
  17978.  See Also
  17979.  
  17980.    WinCreatePointer, WinLoadPointer
  17981.  
  17982.  
  17983.  ────────────────────────────────────────────────────────────────────────────
  17984.  WinDrawText
  17985.  ────────────────────────────────────────────────────────────────────────────
  17986.    SHORT WinDrawText (hps, cchText, pszText, pcrl, clrFore, clrBack, fsCmd)
  17987.    HPS hps;                /*handle of the presentation space              */
  17988.    SHORT cchText;          /*number of characters in the string            */
  17989.    PSZ pszText;            /*address of the text                           */
  17990.    PRECTL prcl;            /*address of structure with formatting          */
  17991.                            dimensions
  17992.    LONG clrFore;           /*color of the foreground                       */
  17993.    LONG clrBack;           /*color of the background                       */
  17994.    USHORT fsCmd;           /*text-drawing flags                            */
  17995.  
  17996.    The WinDrawText function draws a single line of formatted text into a
  17997.    specified rectangle.
  17998.  
  17999.  Parameters
  18000.  
  18001.    hps  Identifies the presentation space in which to draw the text.
  18002.  
  18003.    cchText  Specifies the number of characters in the string to draw. If this
  18004.    is set to 0xFFFF, the string is assumed to be null-terminated and its
  18005.    length is calculated by the function itself.
  18006.  
  18007.    pszText  Points to the character string to draw. A carriage-return or
  18008.    linefeed character terminates the line, even if the line is shorter than
  18009.    specified by the cchText parameter.
  18010.  
  18011.    prcl  Points to a RECTL data structure that contains the rectangle in
  18012.    which the text is formatted. If DT_QUERYEXTENT is specified in the fsCmd
  18013.    parameter, the RECTL structure is set to the string's bounding rectangle
  18014.    upon return from WinDrawText. The RECTL structure has the following form:
  18015.  
  18016.    typedef struct _RECTL {
  18017.        LONG  xLeft;
  18018.        LONG  yBottom;
  18019.        LONG  xRight;
  18020.        LONG  yTop;
  18021.    } RECTL;
  18022.  
  18023.    For a full description, see Chapter 4, "Types, Macros, Structures."
  18024.  
  18025.    clrFore  Specifies the color of the foreground. This parameter is ignored
  18026.    if DT_TEXTATTRS is set in the fsCmd parameter.
  18027.  
  18028.    clrBack  Specifies the color of the background. This parameter is ignored
  18029.    if DT_TEXTATTRS is set in the fsCmd parameter.
  18030.  
  18031.    fsCmd  Specifies an array of flags that determine how the text is drawn.
  18032.    It can be any of the following values:
  18033.  
  18034. ╓┌─┌────────────────────┌────────────────────────────────────────────────────╖
  18035.    Value                Meaning
  18036.    ──────────────────────────────────────────────────────────────────────────
  18037.    DT_LEFT              Left justify the text.
  18038.  
  18039.    DT_RIGHT             Right justify the text.
  18040.  
  18041.    Value                Meaning
  18042.    ──────────────────────────────────────────────────────────────────────────
  18043. 
  18044.    DT_TOP               Top justify the text.
  18045.  
  18046.    DT_BOTTOM            Bottom justify the text.
  18047.  
  18048.    DT_CENTER            Center the text.
  18049.  
  18050.    DT_VCENTER           Center the text vertically.
  18051.  
  18052.    DT_ERASERECT         This flag causes the RECTL structure specified in
  18053.                         prcl to be filled with the window color before
  18054.                         printing the text, but only if the DT_QUERYEXTENT
  18055.                         flag is not specified.
  18056.  
  18057.    DT_EXTERNALLEADING   This flag causes the external leading value from the
  18058.                         passed font to be added to the bottom of the bounding
  18059.                         rectangle before returning. It only has an effect
  18060.                         when both DT_TOP and DT_QUERYEXTENT are also
  18061.                         specified.
  18062.    Value                Meaning
  18063.    ──────────────────────────────────────────────────────────────────────────
  18064.                        specified.
  18065.  
  18066.    DT_HALFTONE          Make the text display halftone.
  18067.  
  18068.    DT_MNEMONIC          If a mnemonic prefix character is encountered, draw
  18069.                         the next character with mnemonic emphasis.
  18070.  
  18071.    DT_QUERYEXTENT       No drawing is performed. The prcl parameter is
  18072.                         changed to a rectangle that bounds the string if it
  18073.                         was drawn with the WinDrawText function.
  18074.  
  18075.    DT_TEXTATTRS         This flag causes the colors specified in clrFore and
  18076.                         clrBack to be ignored. The colors already selected in
  18077.                         the presentation space are used instead.
  18078.  
  18079.    DT_WORDBREAK         Only words that fit completely within the supplied
  18080.                         rectangle are drawn. A word is defined as any number
  18081.                         of leading spaces followed by one or more visible
  18082.                         characters and terminated by a space,
  18083.    Value                Meaning
  18084.    ──────────────────────────────────────────────────────────────────────────
  18085.                        characters and terminated by a space,
  18086.                         carriage-return, or linefeed character. When
  18087.                         calculating whether a particular word will fit within
  18088.                         the given rectangle, WinDrawText does not consider
  18089.                         the trailing blanks. It tests only the length of the
  18090.                         visible part of the word against the right edge of
  18091.                         the rectangle. Note that WinDrawText will always try
  18092.                         to draw at least one word, even if that word does not
  18093.                         fit in the passed rectangle. This is so that progress
  18094.                         is always made when drawing multi-line text.
  18095.    ──────────────────────────────────────────────────────────────────────────
  18096.  
  18097.  
  18098.    Some of the DT flags are mutually exclusive. Only one flag from each of
  18099.    the following groups is significant:
  18100.  
  18101.    ■  DT_LEFT, DT_CENTER, DT_RIGHT
  18102.  
  18103.    ■  DT_TOP, DT_VCENTER, DT_BOTTOM
  18104.  
  18105.  Return Value
  18106.  
  18107.    The return value is the number of characters, drawn by the function, that
  18108.    fit completely within the structure pointed to by prcl.
  18109.  
  18110.  Example
  18111.  
  18112.    This example shows how the WinDrawText function can be used to wrap text
  18113.    within a window by using the DT_WORDBREAK flag. The cchDrawn variable
  18114.    receives the number of characters actually drawn by the WinDrawText
  18115.    function. If this value is zero, no text was drawn and the for loop is
  18116.    exited. This can occur if the vertical height of the window is too short
  18117.    for the entire text. Otherwise, cchDrawn is added to the cchTotalDrawn
  18118.    variable to provide an offset into the string for the next call to
  18119.    WinDrawText.
  18120.  
  18121.    hps = WinGetPS(hwnd);          /* get a ps for the entire window */
  18122.    WinQueryWindowRect(hwnd, &rcl);         /* get window dimensions */
  18123.    WinFillRect(hps, &rcl, CLR_WHITE);      /* clear entire window   */
  18124.    cchText = strlen(pszText);              /* get length of string  */
  18125.    cyCharHeight = 15L;                     /* set character height  */
  18126.    for (cchTotalDrawn = 0;
  18127.            cchTotalDrawn != cchText;       /* until all chars drawn */
  18128.            rcl.yTop -= cyCharHeight) {
  18129.  
  18130.        /* draw the text */
  18131.  
  18132.        cchDrawn = WinDrawText(hps,     /* presentation-space handle */
  18133.            cch - cchTotalDrawn,        /* length of text to draw    */
  18134.            pszText + cchTotalDrawn,    /* address of the text       */
  18135.            &rcl,                       /* rectangle to draw in      */
  18136.            0L,                         /* foreground color          */
  18137.            0L,                         /* background color          */
  18138.            DT_WORDBREAK | DT_TOP | DT_LEFT | DT_TEXTATTRS);
  18139.        if (cchDrawn)
  18140.            cchTotalDrawn += cchDrawn;
  18141.        else
  18142.            break;                      /* text could not be drawn   */
  18143.    }
  18144.    WinReleasePS(hps);                  /* release the ps            */
  18145.  
  18146.  See Also
  18147.  
  18148.    WinSetDlgItemText
  18149.  
  18150.  
  18151.  ────────────────────────────────────────────────────────────────────────────
  18152.  WinEmptyClipbrd
  18153.  ────────────────────────────────────────────────────────────────────────────
  18154.    BOOL WinEmptyClipbrd (hab)
  18155.    HAB hab;                /*handle of the anchor block                    */
  18156.  
  18157.    The WinEmptyClipbrd function empties the clipboard, removing and freeing
  18158.    all handles to data that were on the clipboard.
  18159.  
  18160.  Parameters
  18161.  
  18162.    hab  Identifies an anchor block.
  18163.  
  18164.  Return Value
  18165.  
  18166.    The return value is TRUE if the function is successful or FALSE if an
  18167.    error occurs.
  18168.  
  18169.  Comment
  18170.  
  18171.    This function will send a WM_DESTROYCLIPBOARD message to the clipboard
  18172.    owner.
  18173.  
  18174.  See Also
  18175.  
  18176.    WinCloseClipbrd, WinOpenClipbrd
  18177.  
  18178.  
  18179.  ────────────────────────────────────────────────────────────────────────────
  18180.  WinEnablePhysInput
  18181.  ────────────────────────────────────────────────────────────────────────────
  18182.    BOOL WinEnablePhysInput (hwndDesktop, fEnable)
  18183.    HWND hwndDesktop;       /*handle of the desktop                         */
  18184.    BOOL fEnable;           /*input status                                  */
  18185.  
  18186.    The WinEnablePhysInput function enables or disables queuing of keyboard
  18187.    and mouse input.
  18188.  
  18189.  Parameters
  18190.  
  18191.    hwndDesktop  Identifies the desktop window. This parameter can be
  18192.    HWND_DESKTOP or the desktop window handle.
  18193.  
  18194.    fEnable  Specifies whether the input is queued or disabled. If TRUE,
  18195.    keyboard and mouse input are queued. If FALSE, keyboard and mouse input
  18196.    are disabled.
  18197.  
  18198.  Return Value
  18199.  
  18200.    The return value is TRUE if the function is successful or FALSE if an
  18201.    error occurs.
  18202.  
  18203.  See Also
  18204.  
  18205.    WinIsPhysInputEnabled
  18206.  
  18207.  
  18208.  ────────────────────────────────────────────────────────────────────────────
  18209.  WinEnableWindow
  18210.  ────────────────────────────────────────────────────────────────────────────
  18211.    BOOL WinEnableWindow (hwnd, fEnable)
  18212.    HWND hwnd;              /*handle of the window                          */
  18213.    BOOL fEnable;           /*enable-state flag                             */
  18214.  
  18215.    The WinEnableWindow function sets the window's enabled state.
  18216.  
  18217.  Parameters
  18218.  
  18219.    hwnd  Identifies the window whose enabled state is to be set.
  18220.  
  18221.    fEnable  Specifies the new enabled state. If TRUE, the window state is set
  18222.    to enabled. If FALSE, the window state is set to disabled.
  18223.  
  18224.  Return Value
  18225.  
  18226.    The return value is TRUE if the function is successful or FALSE if an
  18227.    error occurs.
  18228.  
  18229.  Comments
  18230.  
  18231.    If the enable state of the window is changing, a WM_ENABLE message is sent
  18232.    before this function returns.
  18233.  
  18234.    If a window is disabled, all its child windows are implicitly disabled,
  18235.    although they are not sent a WM_ENABLE message.
  18236.  
  18237.  See Also
  18238.  
  18239.    WinIsWindowEnabled
  18240.  
  18241.  
  18242.  ────────────────────────────────────────────────────────────────────────────
  18243.  WinEnableWindowUpdate
  18244.  ────────────────────────────────────────────────────────────────────────────
  18245.    BOOL WinEnableWindowUpdate (hwnd, fEnable)
  18246.    HWND hwnd;              /*handle of the window to be enabled or         */
  18247.                            /*disabled                                      */
  18248.    BOOL fEnable;           /*enabled-state flag                            */
  18249.  
  18250.    The WinEnableWindowUpdate function enables or disables the window
  18251.    visibility state for subsequent drawing to a window. This function can be
  18252.    used to prevent unnecessary redrawing when making changes to a window. The
  18253.    window can then be redrawn by calling this function with the fEnable
  18254.    parameter set to TRUE.
  18255.  
  18256.  Parameters
  18257.  
  18258.    hwnd  Identifies the window whose enable state will be changed.
  18259.  
  18260.    fEnable  Specifies whether drawing to the window is enabled. If TRUE, any
  18261.    subsequent drawing into the window will be visible. If FALSE, any
  18262.    subsequent drawing into the window will be invisible.
  18263.  
  18264.  Return Value
  18265.  
  18266.    The return value is TRUE if the function is successful or FALSE if an
  18267.    error occurs.
  18268.  
  18269.  Comments
  18270.  
  18271.    When the WinEnableWindowUpdate function is called with the fEnable
  18272.    parameter TRUE, the entire window is invalidated, however WS_SYNCPAINT
  18273.    windows are not redrawn. If you need to redraw a WS_SYNCPAINT window, you
  18274.    must call the WinShowWindow function.
  18275.  
  18276.  See Also
  18277.  
  18278.    WinShowWindow
  18279.  
  18280.  
  18281.  ────────────────────────────────────────────────────────────────────────────
  18282.  WinEndEnumWindows
  18283.  ────────────────────────────────────────────────────────────────────────────
  18284.    BOOL WinEndEnumWindows (henum)
  18285.    HENUM henum;            /*handle of the enumeration list                */
  18286.  
  18287.    The WinEndEnumWindows function ends an enumeration process. This function
  18288.    destroys the snapshot of the window hierarchy captured by the
  18289.    WinBeginEnumWindows function.
  18290.  
  18291.  Parameters
  18292.  
  18293.    henum  Identifies the enumeration list. This handle must have been created
  18294.    by a previous call to the WinBeginEnumWindows function.
  18295.  
  18296.  Return Value
  18297.  
  18298.    The return value is TRUE if the function is successful or FALSE if an
  18299.    error occurs.
  18300.  
  18301.  See Also
  18302.  
  18303.    WinBeginEnumWindows
  18304.  
  18305.  
  18306.  ────────────────────────────────────────────────────────────────────────────
  18307.  WinEndPaint
  18308.  ────────────────────────────────────────────────────────────────────────────
  18309.    BOOL WinEndPaint (hps)
  18310.    HPS hps;                /*handle of the presentation space              */
  18311.  
  18312.    The WinEndPaint function restores the presentation space to its state
  18313.    prior to the WinBeginPaint call. If a cache presentation space was created
  18314.    by the WinBeginPaint function, it is released. If the text cursor was
  18315.    hidden by the WinBeginPaint function, it is displayed.
  18316.  
  18317.  Parameters
  18318.  
  18319.    hps  Identifies the presentation space. This must be the handle of the
  18320.    presentation space returned by a previous call to the WinBeginPaint
  18321.    function.
  18322.  
  18323.  Return Value
  18324.  
  18325.    The return value is TRUE if the function is successful or FALSE if an
  18326.    error occurs.
  18327.  
  18328.  Example
  18329.  
  18330.    This example calls WinBeginPaint when it receives a WM_PAINT message to
  18331.    get a presentation-space handle to the update region and to get the
  18332.    coordinates of the update rectangle. It then fills the update rectangle
  18333.    and calls WinEndPaint to release the presentation space.
  18334.  
  18335.    case WM_PAINT:
  18336.        hps = WinBeginPaint(hwnd,   /* handle of the window      */
  18337.            NULL,                   /* get a cache ps            */
  18338.            &rcl);                  /* receives update rectangle */
  18339.        WinFillRect(hps, &rcl, CLR_WHITE);
  18340.        WinEndPaint(hps);
  18341.  
  18342.  See Also
  18343.  
  18344.    WinBeginPaint
  18345.  
  18346.  
  18347.  ────────────────────────────────────────────────────────────────────────────
  18348.  WinEnumClipbrdFmts
  18349.  ────────────────────────────────────────────────────────────────────────────
  18350.    USHORT WinEnumClipbrdFmts (hab, fmt)
  18351.    HAB hab;                /*handle of the anchor block                    */
  18352.    USHORT fmt;             /*index of last format enumerated               */
  18353.  
  18354.    The WinEnumClipbrdFmts function enumerates the list of clipboard data
  18355.    formats available in the clipboard. The clipboard must have been
  18356.    previously opened by calling the WinOpenClipbrd function.
  18357.  
  18358.  Parameters
  18359.  
  18360.    hab  Identifies the anchor block.
  18361.  
  18362.    fmt  Specifies the index of the last clipboard data format enumerated
  18363.    using this function. This should start at zero, in which case the first
  18364.    available format is obtained. Subsequently, it should be set to the last
  18365.    format index value returned by this function.
  18366.  
  18367.  Return Value
  18368.  
  18369.    The return value is the index of the next available clipboard data format
  18370.    in the clipboard. When zero is returned, enumeration is complete (there
  18371.    are no further formats available).
  18372.  
  18373.  See Also
  18374.  
  18375.    WinOpenClipbrd
  18376.  
  18377.  
  18378.  ────────────────────────────────────────────────────────────────────────────
  18379.  WinEnumDlgItem
  18380.  ────────────────────────────────────────────────────────────────────────────
  18381.    HWND WinEnumDlgItem (hwndDlg, hwnd, code, fLock)
  18382.    HWND hwndDlg;           /*handle of the dialog window                   */
  18383.    HWND hwnd;              /*handle of the child window                    */
  18384.    USHORT code;            /*returned dialog item                          */
  18385.    BOOL fLock;             /*lock/unlock flag                              */
  18386.  
  18387.    The WinEnumDlgItem function returns the handle of a dialog item within a
  18388.    dialog window.
  18389.  
  18390.  Parameters
  18391.  
  18392.    hwndDlg  Identifies the dialog window that contains the dialog item.
  18393.  
  18394.    hwnd  Identifies the child window of the dialog window. This may be an
  18395.    immediate child window or a window lower in the hierarchy, such as a child
  18396.    of a child window.
  18397.  
  18398.    code  Specifies which dialog item to return. This parameter is one of the
  18399.    following values:
  18400.  
  18401. ╓┌─┌───────────────────┌─────────────────────────────────────────────────────╖
  18402.    Value               Meaning
  18403.    ──────────────────────────────────────────────────────────────────────────
  18404.    EDI_FIRSTGROUPITEM  First item in same group.
  18405.  
  18406.    EDI_FIRSTTABITEM    First item in dialog window with style WS_TABSTOP. The
  18407.                        hwnd window is ignored.
  18408.  
  18409.    EDI_LASTGROUPITEM   Last item in same group.
  18410.  
  18411.    EDI_LASTTABITEM     Last item in dialog box with style WS_TABSTOP. The
  18412.                        hwnd window is ignored.
  18413.  
  18414.    EDI_NEXTGROUPITEM   Next item in same group. Wraps to beginning of group
  18415.                        when end of group is reached.
  18416.  
  18417.    EDI_NEXTTABITEM     Next item with style WS_TABSTOP. Wraps around to
  18418.                        beginning of dialog-item list when end is reached.
  18419.    Value               Meaning
  18420.    ──────────────────────────────────────────────────────────────────────────
  18421.                       beginning of dialog-item list when end is reached.
  18422.  
  18423.    EDI_PREVGROUPITEM   Previous item in same group. Wraps to end of group
  18424.                        when start of group is reached.
  18425.  
  18426.    EDI_PREVTABITEM     Previous item with style WS_TABSTOP. Wraps to end of
  18427.                        dialog-item list when beginning is reached.
  18428.    ──────────────────────────────────────────────────────────────────────────
  18429.  
  18430.  
  18431.    fLock  Specifies whether the dialog item is to be locked or unlocked. If
  18432.    TRUE, the item is locked. If FALSE, it is not.
  18433.  
  18434.  Return Value
  18435.  
  18436.    The return value is the item handle obtained by this function, specified
  18437.    by the code parameter. The window is always an immediate child window of
  18438.    the window identified by the hwndDlg parameter.
  18439.  
  18440.  Comments
  18441.  
  18442.    If the dialog item is locked by this function, then you must at some point
  18443.    call the WinLockWindow function to unlock the dialog item. The reason for
  18444.    locking the dialog item is so that it cannot be destroyed until you are
  18445.    done using it.
  18446.  
  18447.  
  18448.  ────────────────────────────────────────────────────────────────────────────
  18449.  WinEqualRect
  18450.  ────────────────────────────────────────────────────────────────────────────
  18451.    BOOL WinEqualRect (hab, prcl1, prcl2)
  18452.    HAB hab;                /*handle of the anchor block                    */
  18453.    PRECTL prcl1;           /*address of structure for first rectangle      */
  18454.    PRECTL prcl2;           /*address of structure for second rectangle     */
  18455.  
  18456.    The WinEqualRect function compares two rectangles for equality. Equal
  18457.    rectangles have identical coordinates (all sides are the same).
  18458.  
  18459.  Parameters
  18460.  
  18461.    hab  Identifies the anchor block.
  18462.  
  18463.    prcl1  Points to the RECTL structure that contains the first rectangle.
  18464.    The RECTL structure has the following form:
  18465.  
  18466.    typedef struct _RECTL {
  18467.        LONG  xLeft;
  18468.        LONG  yBottom;
  18469.        LONG  xRight;
  18470.        LONG  yTop;
  18471.    } RECTL;
  18472.  
  18473.    For a full description, see Chapter 4, "Types, Macros, Structures."
  18474.  
  18475.    prcl2  Points to the RECTL structure that contains the second rectangle.
  18476.  
  18477.  Return Value
  18478.  
  18479.    The return value is TRUE if the rectangles are equal, or FALSE if they are
  18480.    not.
  18481.  
  18482.  
  18483.  ────────────────────────────────────────────────────────────────────────────
  18484.  WinExcludeUpdateRegion
  18485.  ────────────────────────────────────────────────────────────────────────────
  18486.    SHORT WinExcludeUpdateRegion (hps, hwnd)
  18487.    HPS hps;                /*handle of the presentation space              */
  18488.    HWND hwnd;              /*handle of the window                          */
  18489.  
  18490.    The WinExcludeUpdateRegion function subtracts the update region of a
  18491.    window from the clipping region of a presentation space. If the
  18492.    presentation space does not have a clipping region, one is created. The
  18493.    result of this function is that drawing into the update region of a window
  18494.    will be clipped (will not be drawn). This function is typically used to
  18495.    prevent drawing into parts of a window known to be invalid.
  18496.  
  18497.  Parameters
  18498.  
  18499.    hps  Identifies the presentation space whose clipping region is updated.
  18500.  
  18501.    hwnd  Identifies the window whose update region is subtracted from the
  18502.    clipping region of the presentation space.
  18503.  
  18504.  Return Value
  18505.  
  18506.    The return value is EXRGN_NULL, EXRGN_RECT, or EXREGN_COMPLEX if the
  18507.    function is successful. The return value is EXRGN_ERROR if an error
  18508.    occurs.
  18509.  
  18510.  See Also
  18511.  
  18512.    GpiCombineRegion, WinValidateRect
  18513.  
  18514.  
  18515.  ────────────────────────────────────────────────────────────────────────────
  18516.  WinFillRect
  18517.  ────────────────────────────────────────────────────────────────────────────
  18518.    BOOL WinFillRect (hps, pcrl, clr)
  18519.    HPS hps;                /*handle of the presentation space              */
  18520.    PRECTL pcrl;            /*address of the structure with the rectangle   */
  18521.    COLOR clr;              /*color of the rectangle                        */
  18522.  
  18523.    The WinFillRect function fills a rectangular area. It does not change any
  18524.    presentation-space state.
  18525.  
  18526.  Parameters
  18527.  
  18528.    hps  Identifies the presentation space where the rectangle is drawn.
  18529.  
  18530.    pcrl  Points to the RECTL structure that contains the coordinates of the
  18531.    rectangle to fill. The RECTL structure has the following form:
  18532.  
  18533.    typedef struct _RECTL {
  18534.        LONG  xLeft;
  18535.        LONG  yBottom;
  18536.        LONG  xRight;
  18537.        LONG  yTop;
  18538.    } RECTL;
  18539.  
  18540.    For a full description, see Chapter 4, "Types, Macros, Structures."
  18541.  
  18542.    clr  Specifies the rectangle color. This parameter is either a color index
  18543.    or an RGB color value, depending on how a logical color table has been
  18544.    loaded. (For more information on color tables, see
  18545.    GpiCreateLogColorTable.)
  18546.  
  18547.    Typically, this parameter will be a color index taken from one of the
  18548.    following values:
  18549.  
  18550.        CLR_WHITE                  CLR_DARKGRAY
  18551.        CLR_BLACK                  CLR_DARKBLUE
  18552.        CLR_BACKGROUND             CLR_DARKRED
  18553.        CLR_BLUE                   CLR_DARKPINK
  18554.        CLR_RED                    CLR_DARKGREEN
  18555.        CLR_PINK                   CLR_DARKCYAN
  18556.        CLR_GREEN                  CLR_BROWN
  18557.        CLR_CYAN                   CLR_PALEGRAY
  18558.        CLR_YELLOW                 CLR_NEUTRAL
  18559.  
  18560.        SYSCLR_WINDOWSTATICTEXT    SYSCLR_WINDOWTEXT
  18561.        SYSCLR_SCROLLBAR           SYSCLR_TITLETEXT
  18562.        SYSCLR_BACKGROUND          SYSCLR_ACTIVEBORDER
  18563.        SYSCLR_ACTIVETITLE         SYSCLR_INACTIVEBORDER
  18564.        SYSCLR_INACTIVETITLE       SYSCLR_APPWORKSPACE
  18565.        SYSCLR_MENU                SYSCLR_HELPBACKGROUND
  18566.        SYSCLR_WINDOW              SYSCLR_HELPTEXT
  18567.        SYSCLR_WINDOWFRAME         SYSCLR_HELPHILITE
  18568.        SYSCLR_MENUTEXT            SYSCLR_CSYSCOLORS
  18569.  
  18570.  Return Value
  18571.  
  18572.    The return value is TRUE if the function is successful or FALSE if an
  18573.    error occurs.
  18574.  
  18575.  Example
  18576.  
  18577.    This example calls WinBeginPaint to get a presentation-space handle and
  18578.    the coordinates of the update rectangle. It then calls WinFillRect to fill
  18579.    the update rectangle.
  18580.  
  18581.    case WM_PAINT:
  18582.        hps = WinBeginPaint(hwnd, NULL, &rcl);
  18583.        WinFillRect(hps,    /* presentation-space handle    */
  18584.            &rcl,           /* coordinates of the rectangle */
  18585.            CLR_WHITE);     /* color to use                 */
  18586.        WinEndPaint(hps);
  18587.  
  18588.  See Also
  18589.  
  18590.    GpiCreateLogColorTable
  18591.  
  18592.  
  18593.  ────────────────────────────────────────────────────────────────────────────
  18594.  WinFindAtom
  18595.  ────────────────────────────────────────────────────────────────────────────
  18596.    ATOM WinFindAtom (hAtomTbl, pszAtomName)
  18597.    HATOMTBL hAtomTbl;      /*handle of the atom table                      */
  18598.    PSZ pszAtomName;        /*address of the atom name                      */
  18599.  
  18600.    The WinFindAtom function finds an atom in the atom table. This function is
  18601.    identical to the WinAddAtom function, with two exceptions: If the atom
  18602.    name is not found in the table, it is not added to the table and NULL is
  18603.    returned as the value of this function; if the atom name is found in the
  18604.    table, the use count is not increased.
  18605.  
  18606.    Because integer atoms do not have a use count and do not actually occupy
  18607.    memory in the atom table, this function is identical to WinAddAtom with
  18608.    respect to integer atoms.
  18609.  
  18610.  Parameters
  18611.  
  18612.    hAtomTbl  Identifies the atom table. This handle must have been created by
  18613.    a previous call to the WinCreateAtomTable function.
  18614.  
  18615.    pszAtomName  Points to the null-terminated character string containing the
  18616.    atom name. If the string begins with a "#" character, the ASCII digits
  18617.    that follow are converted into an integer atom. If the string begins with
  18618.    an "!" character, the next two bytes are interpreted as an atom. If the
  18619.    high word of this parameter is -1, the low word is an atom and that atom
  18620.    is returned.
  18621.  
  18622.  Return Value
  18623.  
  18624.    The return value is the atom associated with the passed string, or it is
  18625.    NULL if the string is not in the atom table.
  18626.  
  18627.  See Also
  18628.  
  18629.    WinAddAtom, WinCreateAtomTable
  18630.  
  18631.  
  18632.  ────────────────────────────────────────────────────────────────────────────
  18633.  WinFlashWindow
  18634.  ────────────────────────────────────────────────────────────────────────────
  18635.    BOOL WinFlashWindow (hwndFrame, fFlash)
  18636.    HWND hwndFrame;         /*handle of the window to flash                 */
  18637.    BOOL fFlash;            /*start/stop flashing flag                      */
  18638.  
  18639.    The WinFlashWindow function starts or stops flashing a window. Flashing is
  18640.    achieved by inverting the title bar continuously. A beep is emitted for
  18641.    the first five flashes. If the window has been minimized, the icon text
  18642.    will flash when this function is called.
  18643.  
  18644.  Parameters
  18645.  
  18646.    hwndFrame  Identifies the window to flash.
  18647.  
  18648.    fFlash  Specifies whether the window flashes. If TRUE, the window starts
  18649.    flashing. If FALSE, the window stops flashing.
  18650.  
  18651.  Return Value
  18652.  
  18653.    The return value is TRUE if the function is successful or FALSE if an
  18654.    error occurs.
  18655.  
  18656.  Comments
  18657.  
  18658.    If an application needs to display a message box, but it does not have the
  18659.    focus, then it should call the WinFlashWindow function to flash its frame
  18660.    window and emit a beep to get the user's attention. Once it receives the
  18661.    focus, it can call WinFlashWindow again to stop the flashing, and then
  18662.    display its message box. By using this method, a message box from your
  18663.    application will not be displayed while the user is working with another
  18664.    application.
  18665.  
  18666.  See Also
  18667.  
  18668.    WinAlarm
  18669.  
  18670.  
  18671.  ────────────────────────────────────────────────────────────────────────────
  18672.  WinFocusChange
  18673.  ────────────────────────────────────────────────────────────────────────────
  18674.    BOOL WinFocusChange (hwndDesktop, hwndSetFocus, fsFocusChange)
  18675.    HWND hwndDesktop;       /*handle of the desktop                         */
  18676.    HWND hwndSetFocus;      /*handle of the focus window                    */
  18677.    USHORT fsFocusChange;   /*focus-changing flags                          */
  18678.  
  18679.    The WinFocusChange function sets the focus to the specified window.
  18680.  
  18681.    A window may temporarily set the focus to itself without changing the
  18682.    active window or the selection. Examples of this are menu and scroll bar
  18683.    windows. When complete, the window sets the focus back to the previous
  18684.    focus window.
  18685.  
  18686.  Parameters
  18687.  
  18688.    hwndDesktop  Identifies the desktop window. This parameter can be
  18689.    HWND_DESKTOP or the desktop window handle.
  18690.  
  18691.    hwndSetFocus  Identifies the new focus window.
  18692.  
  18693.    fsFocusChange  Specifies the flags that control the focus-changing
  18694.    process. This parameter can be a combination of the following values:
  18695.  
  18696.    Value               Meaning
  18697.    ──────────────────────────────────────────────────────────────────────────
  18698.    FC_NOLOSEACTIVE     Do not send the WM_ACTIVATE message to the window
  18699.                        being deactivated.
  18700.  
  18701.    FC_NOLOSEFOCUS      Do not send the WM_SETFOCUS message to the window
  18702.                        losing the focus.
  18703.  
  18704.    FC_NOLOSESELECTION  Do not send the WM_SETSELECTION message to the window
  18705.                        losing the selection.
  18706.  
  18707.    FC_NOSETACTIVE      Do not send the WM_ACTIVATE message to the window
  18708.                        becoming active.
  18709.  
  18710.    FC_NOSETFOCUS       Do not send the WM_SETFOCUS message to the window
  18711.                        receiving the focus.
  18712.  
  18713.    FC_NOSETSELECTION   Do not send the WM_SETSELECTION message to the window
  18714.                        receiving the selection.
  18715.    ──────────────────────────────────────────────────────────────────────────
  18716.  
  18717.    By using various combinations of these flags, an application can control
  18718.    activation, selection, focus changes, and other default activities, such
  18719.    as bringing frame windows to the top of their sibling windows. If
  18720.    fsFocusChange is zero, the system takes the default action (this is the
  18721.    same as calling the WinSetFocus function).
  18722.  
  18723.  Return Value
  18724.  
  18725.    The return value is TRUE if the function is successful or FALSE if an
  18726.    error occurs.
  18727.  
  18728.  See Also
  18729.  
  18730.    WinQueryFocus, WinSetFocus
  18731.  
  18732.  
  18733.  ────────────────────────────────────────────────────────────────────────────
  18734.  WinFormatFrame
  18735.  ────────────────────────────────────────────────────────────────────────────
  18736.    SHORT WinFormatFrame (hwndFrame, prclFrame, pswp, cswpMax, prclClient)
  18737.    HWND hwndFrame;         /*handle of window with frame controls to be    */
  18738.                            /*formatted                                     */
  18739.    PRECTL prclFrame;       /*address of structure with rectangle           */
  18740.    PSWP pswp;              /*address of array of structures                */
  18741.    USHORT cswpMax;         /*number of SWP structures                      */
  18742.    PRECTL prclClient;      /*address of client window rectangle            */
  18743.  
  18744.    The WinFormatFrame function calculates the size and position of all
  18745.    standard frame controls within a frame window. The data is calculated and
  18746.    returned in an array with one entry for each control window. This function
  18747.    allows an application which has subclassed its frame window, to more
  18748.    easily modify the appearance of a frame window and its controls.
  18749.  
  18750.  Parameters
  18751.  
  18752.    hwndFrame  Identifies the window whose frame controls are to be formatted.
  18753.  
  18754.    prclFrame  Points to the RECTL structure that contains the rectangle where
  18755.    the frame controls are formatted. This typically is the window rectangle
  18756.    identified by the hwndFrame parameter, but where the window has a wide
  18757.    border, (for example, as specified by FS_DLGBORDER), the rectangle is
  18758.    inset by the size of the border. The RECTL structure has the following
  18759.    form:
  18760.  
  18761.    typedef struct _RECTL {
  18762.        LONG  xLeft;
  18763.        LONG  yBottom;
  18764.        LONG  xRight;
  18765.        LONG  yTop;
  18766.    } RECTL;
  18767.  
  18768.    For a full description, see Chapter 4, "Types, Macros, Structures."
  18769.  
  18770.    pswp  Points to an array of SWP structures. There must be one SWP
  18771.    structure for each frame control. Typically, the count of frame windows is
  18772.    calculated as follows:
  18773.  
  18774.          (FID_CLIENT - FID_SYSMENU + 1)
  18775.  
  18776.    This can change, however, if the frame window is subclassed. The SWP
  18777.    structure has the following form:
  18778.  
  18779.    typedef struct _SWP {
  18780.        USHORT fs;
  18781.        SHORT  cy;
  18782.        SHORT  cx;
  18783.        SHORT  y;
  18784.        SHORT  x;
  18785.        HWND   hwndInsertBehind;
  18786.        HWND   hwnd;
  18787.    } SWP;
  18788.  
  18789.    For a full description, See Chapter 4, "Types, Macros, Structures."
  18790.  
  18791.    cswpMax  Specifies the number of SWP structures.
  18792.  
  18793.    prclClient  Points to the window rectangle of the FID_CLIENT window after
  18794.    formatting. If this parameter is NULL, no client window rectangle is
  18795.    returned.
  18796.  
  18797.  Return Value
  18798.  
  18799.    The return value is the number of SWP structures returned in the array
  18800.    pointed to by pswp.
  18801.  
  18802.  Comments
  18803.  
  18804.    An SWP structure will be filled in for the following frame controls:
  18805.  
  18806.    Value           Meaning
  18807.    ──────────────────────────────────────────────────────────────────────────
  18808.    FID_CLIENT      Identifies the client window.
  18809.  
  18810.    FID_HORZSCROLL  Identifies the horizontal scroll bar.
  18811.  
  18812.    FID_MENU        Identifies the system menu.
  18813.  
  18814.    FID_MINMAX      Identifies the minimum/maximum box.
  18815.  
  18816.    FID_SYSMENU     Identifies the system menu.
  18817.  
  18818.    FID_TITLEBAR    Identifies the title bar.
  18819.  
  18820.    FID_VERTSCROLL  Identifies the vertical scroll bar.
  18821.    ──────────────────────────────────────────────────────────────────────────
  18822.  
  18823.    The returned array of SWP structures can be used in the
  18824.    WinSetMultWindowPos function to set the position and size of the frame
  18825.    windows.
  18826.  
  18827.    The WinFormatFrame function typically is used by applications that require
  18828.    a nonstandard frame-window layout. This function is called while the
  18829.    WM_UPDATEFRAME message is being processed. The application should alter
  18830.    the calculated positions and sizes as required, after returning from this
  18831.    function. Any additional windows added to the standard set can be handled
  18832.    by adding SWP structures to the array, with positions and sizes set as
  18833.    necessary.
  18834.  
  18835.  See Also
  18836.  
  18837.    WinSetMultWindowPos
  18838.  
  18839.  
  18840.  ────────────────────────────────────────────────────────────────────────────
  18841.  WinFreeErrorInfo
  18842.  ────────────────────────────────────────────────────────────────────────────
  18843.    BOOL WinFreeErrorInfo (perrinfo)
  18844.    PERRINFO perrinfo;      /*address of structure with error-info block    */
  18845.  
  18846.    The WinFreeErrorInfo function frees memory allocated for an error
  18847.    information block.
  18848.  
  18849.  Parameters
  18850.  
  18851.    perrinfo  Points to the ERRINFO structure that contains the
  18852.    error-information block whose memory is to be freed. The ERRINFO structure
  18853.    has the following form:
  18854.  
  18855.    typedef struct _ERRINFO {
  18856.        USHORT    cbFixedErrInfo;
  18857.        ERRORID   idError;
  18858.        USHORT    cDetailLevel;
  18859.        USHORT    offaoffszMsg;
  18860.        USHORT    offBinaryData;
  18861.    } ERRINFO;
  18862.  
  18863.    For a full description, see Chapter 4, "Types, Macros, Structures."
  18864.  
  18865.  Return Value
  18866.  
  18867.    The return value is TRUE if the function is successful or FALSE if an
  18868.    error occurs.
  18869.  
  18870.  See Also
  18871.  
  18872.    WinGetErrorInfo, WinGetLastError
  18873.  
  18874.  
  18875.  ────────────────────────────────────────────────────────────────────────────
  18876.  WinFreeMem
  18877.  ────────────────────────────────────────────────────────────────────────────
  18878.    NPBYTE WinFreeMem (hHeap, npMem, cbMem)
  18879.    HHEAP hHeap;            /*handle of the heap                            */
  18880.    NPBYTE npMem;           /*address of memory block to free               */
  18881.    USHORT cbMem;           /*size of the memory to free                    */
  18882.  
  18883.    The WinFreeMem function frees memory allocated by the WinAllocMem
  18884.    function.
  18885.  
  18886.  Parameters
  18887.  
  18888.    hHeap  Identifies the heap. This handle must have been created by a
  18889.    previous call to the WinCreateHeap function.
  18890.  
  18891.    npMem  Points to the memory block to free. This parameter must have been
  18892.    returned by a previous call to the WinAllocMem or WinReallocMem function.
  18893.  
  18894.    cbMem  Specifies the size of the memory to free; it must match the
  18895.    allocated size of the block.
  18896.  
  18897.  Return Value
  18898.  
  18899.    The return value is NULL if the function is successful. Otherwise, it
  18900.    returns the npMem parameter. This method of returning failure allows for
  18901.    updating the memory pointer and freeing the memory at the same time with a
  18902.    call similar to the following:
  18903.  
  18904.    npMem = WinFreeMem(hHeap, npMem, cbMem);
  18905.  
  18906.  Comments
  18907.  
  18908.    This function does not attempt to coalesce the block being freed with
  18909.    other free blocks. Use the WinAvailMem function to coalesce free blocks.
  18910.  
  18911.    If the heap was created with the HM_MOVEABLE option, the value of the
  18912.    cbMem parameter is ignored and the value of the size word in the allocated
  18913.    memory block is used instead.
  18914.  
  18915.    If the heap was created with the HM_MOVEABLE and HM_VALIDSIZE options, the
  18916.    value of the cbMem parameter is checked against the value of the size word
  18917.    and an error is generated if the two values are not the same.
  18918.  
  18919.  See Also
  18920.  
  18921.    WinAllocMem, WinAvailMem, WinCreateHeap, WinReallocMem
  18922.  
  18923.  
  18924.  ────────────────────────────────────────────────────────────────────────────
  18925.  WinGetClipPS
  18926.  ────────────────────────────────────────────────────────────────────────────
  18927.    HPS WinGetClipPS (hwnd, hwndClip, fs)
  18928.    HWND hwnd;              /*address of the parent window                  */
  18929.    HWND hwndClip;          /*handle of clipping type                       */
  18930.    USHORT fs;              /*clipping flags                                */
  18931.  
  18932.    The WinGetClipPS function returns a specially clipped presentation space
  18933.    for a specified window.
  18934.  
  18935.  Parameters
  18936.  
  18937.    hwnd  Identifies the parent window.
  18938.  
  18939.    hwndClip  Identifies the type of clipping to perform. This parameter can
  18940.    be one of the following values:
  18941.  
  18942.    Value             Meaning
  18943.    ──────────────────────────────────────────────────────────────────────────
  18944.    HWND_BOTTOM       Clip the last window in the sibling chain and continue
  18945.                      clipping until the next window is hwnd or NULL.
  18946.  
  18947.    HWND_TOP          Clip the first window in the sibling chain and continue
  18948.                      clipping until the next window is hwnd or NULL.
  18949.  
  18950.    NULL              Clip all siblings to the window identified by the hwnd
  18951.                      parameter.
  18952.    ──────────────────────────────────────────────────────────────────────────
  18953.  
  18954.    fs  Specifies one or more clipping flags. This parameter can be one of the
  18955.    following values:
  18956.  
  18957. ╓┌─┌───────────────────────┌─────────────────────────────────────────────────╖
  18958.    Value                   Meaning
  18959.    ──────────────────────────────────────────────────────────────────────────
  18960.    PSF_CLIPCHILDREN        Clip out all child windows of hwnd. Same as
  18961.                            PSF_CLIPWINDOWLIST and the hwndClip parameter
  18962.                            equal to the first child window of hwnd.
  18963.  
  18964.    PSF_CLIPDOWNWARDS       Clip out all windows from hwndClip to the
  18965.    Value                   Meaning
  18966.    ──────────────────────────────────────────────────────────────────────────
  18967.   PSF_CLIPDOWNWARDS       Clip out all windows from hwndClip to the
  18968.                            bottom-most sibling window of hwndClip.
  18969.  
  18970.    PSF_CLIPSIBLINGS        Clip out all sibling windows of hwnd. Same as
  18971.                            PSF_CLIPWINDOWLIST and hwndClip equal to NULL.
  18972.  
  18973.    PSF_CLIPUPWARDS         Clip out all windows from the sibling windows
  18974.                            directly in front of hwndClip to the front-most
  18975.                            sibling window of hwndClip.
  18976.  
  18977.    PSF_LOCKWINDOWUPDATE    The presentation space returned is not locked from
  18978.                            updating hwnd because of calls to
  18979.                            WinLockWindowUpdate.
  18980.  
  18981.    PSF_PARENTCLIP          Obtain presentation space with a visible region
  18982.                            for the parent window, but with window origin set
  18983.                            to the origin of hwnd.
  18984.    ──────────────────────────────────────────────────────────────────────────
  18985.  
  18986.    Value                   Meaning
  18987.    ──────────────────────────────────────────────────────────────────────────
  18988. 
  18989.  
  18990.  Return Value
  18991.  
  18992.    The return value identifies a presentation space if the function is
  18993.    successful, or it is NULL if an error occurs.
  18994.  
  18995.  See Also
  18996.  
  18997.    WinGetPS, WinLockWindowUpdate
  18998.  
  18999.  
  19000.  ────────────────────────────────────────────────────────────────────────────
  19001.  WinGetCurrentTime
  19002.  ────────────────────────────────────────────────────────────────────────────
  19003.    ULONG WinGetCurrentTime (hab)
  19004.    HAB hab;                /*handle of the anchor block                    */
  19005.  
  19006.    The WinGetCurrentTime function returns the current time.
  19007.  
  19008.  Parameters
  19009.  
  19010.    hab  Identifies the anchor block.
  19011.  
  19012.  Return Value
  19013.  
  19014.    The return value is the system timer count (in milliseconds) from the time
  19015.    the system is restarted.
  19016.  
  19017.  See Also
  19018.  
  19019.    WinQueryMsgTime
  19020.  
  19021.  
  19022.  ────────────────────────────────────────────────────────────────────────────
  19023.  WinGetErrorInfo
  19024.  ────────────────────────────────────────────────────────────────────────────
  19025.    PERRINFO WinGetErrorInfo (hab)
  19026.    HAB hab;                /*handle of the anchor block                    */
  19027.  
  19028.    The WinGetErrorInfo function returns detailed error information.
  19029.  
  19030.  Parameters
  19031.  
  19032.    hab  Identifies the anchor block.
  19033.  
  19034.  Return Value
  19035.  
  19036.    The return value points to an ERRINFO structure that contains information
  19037.    about the previous error code for the current thread, or it is NULL if no
  19038.    error information is available.
  19039.  
  19040.  Comments
  19041.  
  19042.    This function allocates a single private segment to contain the ERRINFO
  19043.    structure. All pointers to string fields within ERRINFO are offsets to
  19044.    memory within that segment. The ERRINFO structure has the following form:
  19045.  
  19046.    typedef struct _ERRINFO {    /* erri */
  19047.        USHORT    cbFixedErrInfo;
  19048.        ERRORID   idError;
  19049.        USHORT    cDetailLevel;
  19050.        USHORT    offaoffszMsg;
  19051.        USHORT    offBinaryData;
  19052.    } ERRINFO;
  19053.  
  19054.    For a full description, see Chapter 4, "Types, Macros, Structures."
  19055.  
  19056.    The memory allocated by this function is not freed until the returned
  19057.    pointer is passed to the WinFreeErrorInfo function.
  19058.  
  19059.    Like the WinGetLastError function, the WinGetErrorInfo function releases
  19060.    any saved error information after formatting the error message. If two
  19061.    calls are made to WinGetErrorInfo without any intervening calls, the
  19062.    second call will return NULL because the saved error information was
  19063.    released by the first call.
  19064.  
  19065.  See Also
  19066.  
  19067.    WinFreeErrorInfo, WinGetLastError
  19068.  
  19069.  
  19070.  ────────────────────────────────────────────────────────────────────────────
  19071.  WinGetKeyState
  19072.  ────────────────────────────────────────────────────────────────────────────
  19073.    SHORT WinGetKeyState (hwndDesktop, vkey)
  19074.    HWND hwndDesktop;       /*handle of the desktop                         */
  19075.    SHORT vkey;             /*virtual key                                   */
  19076.  
  19077.    The WinGetKeyState function returns the key state at the time the last
  19078.    message from the queue was posted. This function is used to determine
  19079.    whether a virtual key is up, down, or toggled.
  19080.  
  19081.    This function can be used to obtain the state of the mouse buttons with
  19082.    the VK_BUTTON1, VK_BUTTON2, and VK_BUTTON3 virtual-key codes.
  19083.  
  19084.  Parameters
  19085.  
  19086.    hwndDesktop  Identifies the desktop window. This parameter can be
  19087.    HWND_DESKTOP or the desktop window handle.
  19088.  
  19089.    vkey  Specifies the virtual-key value in the low byte and zero in the high
  19090.    byte.
  19091.  
  19092.  Return Value
  19093.  
  19094.    If the key is down, the 0x8000 bit is set (less than 0); if the key is up,
  19095.    this bit is not set. If the key is toggled, the 0x0001 bit is set (a key
  19096.    is toggled if it has been pressed an odd number of times since the system
  19097.    was started).
  19098.  
  19099.  See Also
  19100.  
  19101.    WinGetPhysKeyState
  19102.  
  19103.  
  19104.  ────────────────────────────────────────────────────────────────────────────
  19105.  WinGetLastError
  19106.  ────────────────────────────────────────────────────────────────────────────
  19107.    ERRORID WinGetLastError (hab)
  19108.    HAB hab;                /*handle of the anchor block                    */
  19109.  
  19110.    The WinGetLastError function returns the error state set by the failure of
  19111.    a Presentation Manager function. This function returns the last nonzero
  19112.    error code and sets the error code to zero.
  19113.  
  19114.  Parameters
  19115.  
  19116.    hab  Identifies the anchor block.
  19117.  
  19118.  Return Value
  19119.  
  19120.    The return value is the last error code.
  19121.  
  19122.  Comments
  19123.  
  19124.    In multiple-thread applications where there are multiple anchor blocks,
  19125.    errors are stored in the anchor block created by the WinInitialize
  19126.    function of the thread. The application must specify the correct
  19127.    anchor-block value for the thread calling WinGetLastError.
  19128.  
  19129.  See Also
  19130.  
  19131.    WinGetErrorInfo, WinInitialize
  19132.  
  19133.  
  19134.  ────────────────────────────────────────────────────────────────────────────
  19135.  WinGetMaxPosition
  19136.  ────────────────────────────────────────────────────────────────────────────
  19137.    BOOL WinGetMaxPosition (hwnd, pswp)
  19138.    HWND hwnd;              /*handle of the window                          */
  19139.    PSWP pswp;              /*address of structure for maximum window size  */
  19140.                            /*and position                                  */
  19141.  
  19142.    The WinGetMaxPosition function fills an SWP structure with the
  19143.    maximized-window size and position. On return, the SWP_SIZE and SWP_MOVE
  19144.    flags will have been combined using the OR operator into the fs field of
  19145.    the SWP structure.
  19146.  
  19147.  Parameters
  19148.  
  19149.    hwnd  Identifies the window whose maximum size will be retrieved.
  19150.  
  19151.    pswp  Points to the SWP structure that retrieves the size and position of
  19152.    a maximized window. The SWP structure has the following form:
  19153.  
  19154.    typedef struct _SWP {
  19155.        USHORT fs;
  19156.        SHORT  cy;
  19157.        SHORT  cx;
  19158.        SHORT  y;
  19159.        SHORT  x;
  19160.        HWND   hwndInsertBehind;
  19161.        HWND   hwnd;
  19162.    } SWP;
  19163.  
  19164.    For a full description, see Chapter 4, "Types, Macros, Structures."
  19165.  
  19166.  Return Value
  19167.  
  19168.    The return value is TRUE if the function is successful or FALSE if an
  19169.    error occurs.
  19170.  
  19171.  See Also
  19172.  
  19173.    WinGetMinPosition
  19174.  
  19175.  
  19176.  ────────────────────────────────────────────────────────────────────────────
  19177.  WinGetMinPosition
  19178.  ────────────────────────────────────────────────────────────────────────────
  19179.    BOOL WinGetMinPosition (hwnd, pswp, pptl)
  19180.    HWND hwnd;              /*handle of the window                          */
  19181.    PSWP pswp;              /*address of structure with icon information    */
  19182.    PPOINTL pptl;           /*address of structure with minimum window      */
  19183.                            /*position                                      */
  19184.  
  19185.    The WinGetMinPosition function fills an SWP structure with the
  19186.    minimized-window size and position. On return, the SWP_SIZE and SWP_MOVE
  19187.    flags will have been combined using the OR operator into the fs field of
  19188.    the SWP structure.
  19189.  
  19190.  Parameters
  19191.  
  19192.    hwnd  Identifies the window whose minimum size will be retrieved.
  19193.  
  19194.    pswp  Points to the SWP structure that will receive the size and position
  19195.    of a minimized-window icon. The SWP structure has the following form:
  19196.  
  19197.    typedef struct _SWP {
  19198.        USHORT fs;
  19199.        SHORT  cy;
  19200.        SHORT  cx;
  19201.        SHORT  y;
  19202.        SHORT  x;
  19203.        HWND   hwndInsertBehind;
  19204.        HWND   hwnd;
  19205.    } SWP;
  19206.  
  19207.    For a full description, see Chapter 4, "Types, Macros, Structures."
  19208.  
  19209.    pptl  Points to the POINTL structure that specifies the position (in
  19210.    screen coordinates) to place the minimized window. If NULL, the system
  19211.    will determine the position. Otherwise, an icon location as near as
  19212.    possible to the specified position is chosen.
  19213.  
  19214.    The POINTL structure has the following form:
  19215.  
  19216.    typedef struct _POINTL  {
  19217.        LONG  x;
  19218.        LONG  y;
  19219.    } POINTL;
  19220.  
  19221.    For a full description, see Chapter 4, "Types, Macros, Structures."
  19222.  
  19223.  Return Value
  19224.  
  19225.    The return value is TRUE if the function is successful or FALSE if an
  19226.    error occurs.
  19227.  
  19228.  See Also
  19229.  
  19230.    WinGetMaxPosition
  19231.  
  19232.  
  19233.  ────────────────────────────────────────────────────────────────────────────
  19234.  WinGetMsg
  19235.  ────────────────────────────────────────────────────────────────────────────
  19236.    BOOL WinGetMsg (hab, pqmsg, hwndFilter, msgFilterFirst, msgFilterLast)
  19237.    HAB hab;                /*handle of the anchor block                    */
  19238.    PQMSG pqmsg;            /*address of structure with message             */
  19239.    HWND hwndFilter;        /*window-filter handle                          */
  19240.    USHORT msgFilterFirst;  /*first message                                 */
  19241.    USHORT msgFilterLast;   /*last message                                  */
  19242.  
  19243.    The WinGetMsg function retrieves a message from the thread's message
  19244.    queue, waits if necessary, and returns when a message conforming to the
  19245.    filtering criteria is available.
  19246.  
  19247.  Parameters
  19248.  
  19249.    hab  Identifies the anchor block.
  19250.  
  19251.    pqmsg  Points to the QMSG structure that contains a message. The QMSG
  19252.    structure has the following form:
  19253.  
  19254.    typedef struct _QMSG {
  19255.        HWND hwnd;
  19256.        USHORT msg;
  19257.        MPARAM mp1;
  19258.        MPARAM mp2;
  19259.        ULONG time;
  19260.        POINTL ptl;
  19261.    } QMSG;
  19262.  
  19263.    For a full description, see Chapter 4, "Types, Macros, Structures."
  19264.  
  19265.    hwndFilter  Identifies the window filter.
  19266.  
  19267.    msgFilterFirst  Specifies the first message.
  19268.  
  19269.    msgFilterLast  Specifies the last message.
  19270.  
  19271.  Return Value
  19272.  
  19273.    The return value is TRUE if the returned message is not WM_QUIT. The
  19274.    return value is FALSE if the returned message is WM_QUIT.
  19275.  
  19276.  Comments
  19277.  
  19278.    Filtering allows an application to process messages in a different order
  19279.    than the one in the queue. Filtering is used so the application can
  19280.    receive messages of a particular type only, rather than receiving other
  19281.    types of messages at an inconvenient point in the logic of the
  19282.    application. For example, when a "mouse button down" message is received,
  19283.    the application can use filtering to wait for the "mouse button up"
  19284.    message without having to process other messages.
  19285.  
  19286.    When using filtering, you must ensure that a message satisfying the
  19287.    specification of the filtering parameters can occur; otherwise, the
  19288.    WinGetMsg function cannot completely execute. For example, calling the
  19289.    WinGetMsg function with the msgFilterFirst and msgFilterLast parameters
  19290.    equal to WM_CHAR and with the hwndFilter parameter set to a window handle
  19291.    that does not have the input focus prevents WinGetMsg from returning.
  19292.  
  19293.    Keystrokes are passed to the WinTranslateAccel function. This means that
  19294.    accelerator keys are translated into WM_COMMAND or WM_SYSCOMMAND messages
  19295.    and are not seen as WM_CHAR messages by the application.
  19296.  
  19297.    The hwndFilter parameter limits the returned message to a specific window
  19298.    or its child windows. When hwndFilter is NULL, the returned message can be
  19299.    for any window. The message identity is restricted to the range specified
  19300.    by the msgFilterFirst and msgFilterLast parameters. When msgFilterFirst
  19301.    and msgFilterLast are both zero, any message satisfies the range
  19302.    constraint. When msgFilterFirst is greater than msgFilterLast, messages
  19303.    except those whose identities lie between msgFilterFirst and msgFilterLast
  19304.    can be returned. Messages that do not conform to the filtering criteria
  19305.    remain in the queue.
  19306.  
  19307.    When msgFilterFirst and msgFilterLast are both zero, all messages are
  19308.    returned.
  19309.  
  19310.    The constants WM_MOUSEFIRST and WM_MOUSELAST can be used for
  19311.    msgFilterFirst and msgFilterLast to filter all but mouse messages.
  19312.  
  19313.    The constants WM_BUTTONCLICKFIRST and WM_BUTTONCLICKLAST can be used for
  19314.    msgFilterFirst and msgFilterLast to filter all but mouse button messages.
  19315.  
  19316.    The constants WM_DDE_FIRST and WM_DDE_LAST can be used for msgFilterFirst
  19317.    and msgFilterLast to filter all but dynamic data exchange messages.
  19318.  
  19319.  Example
  19320.  
  19321.    This example calls WinGetMsg to retrieve a message and WinDispatchMsg to
  19322.    send the message.
  19323.  
  19324.    HAB hab;
  19325.    QMSG qmsg;
  19326.  
  19327.    while (WinGetMsg(hab,    /* handle to the anchor block             */
  19328.            &qmsg,           /* address of the message queue structure */
  19329.            NULL,            /* accept messages for any window         */
  19330.            0,               /* first message to accept                */
  19331.            0))              /* accept all messages                    */
  19332.        WinDispatchMsg(hab, &qmsg);
  19333.  
  19334.  See Also
  19335.  
  19336.    WinDispatchMsg, WinPeekMsg, WinPostMsg, WinTranslateAccel,
  19337.    WinWaitMsg
  19338.  
  19339.  
  19340.  ────────────────────────────────────────────────────────────────────────────
  19341.  WinGetNextWindow
  19342.  ────────────────────────────────────────────────────────────────────────────
  19343.    HWND WinGetNextWindow (henum)
  19344.    HENUM henum;            /*handle of the enumeration list                */
  19345.  
  19346.    The WinGetNextWindow function obtains the handle of the next window in a
  19347.    specified enumeration list.
  19348.  
  19349.    The enumeration list details the window hierarchy at the time
  19350.    WinBeginEnumWindows was called. Enumeration starts with the top-most child
  19351.    window (listed first) and proceeds through the list each time the function
  19352.    is called, until all windows have been enumerated. Once all windows have
  19353.    been enumerated, the function returns NULL. The enumeration then returns
  19354.    to the top of the list and the handle of the top-most child window is
  19355.    returned on the next call.
  19356.  
  19357.    When a valid window handle is returned, the window is locked by this
  19358.    function. The window must then be unlocked by using the WinLockWindow
  19359.    function before WinGetNextWindow is called again.
  19360.  
  19361.  Parameters
  19362.  
  19363.    henum  Identifies the enumeration list. This parameter is created by the
  19364.    WinBeginEnumWindows function.
  19365.  
  19366.  Return Value
  19367.  
  19368.    The return value is the handle of the next window in the enumeration list,
  19369.    or it is NULL if an error occurs.
  19370.  
  19371.  See Also
  19372.  
  19373.    WinBeginEnumWindows, WinLockWindow
  19374.  
  19375.  
  19376.  ────────────────────────────────────────────────────────────────────────────
  19377.  WinGetPhysKeyState
  19378.  ────────────────────────────────────────────────────────────────────────────
  19379.    SHORT WinGetPhysKeyState (hwndDesktop, sc)
  19380.    HWND hwndDesktop;       /*handle of the desktop                         */
  19381.    SHORT sc;               /*scan code of the key                          */
  19382.  
  19383.    The WinGetPhysKeyState function returns the physical-key state of the key
  19384.    represented by the scan-code parameter. This function is not synchronized
  19385.    to the processing of input.
  19386.  
  19387.  Parameters
  19388.  
  19389.    hwndDesktop  Identifies the desktop window. This parameter can be
  19390.    HWND_DESKTOP or the desktop window handle.
  19391.  
  19392.    sc  Specifies the scan code of the key.
  19393.  
  19394.  Return Value
  19395.  
  19396.    The return value is a flag indicating if the key is currently up or down,
  19397.    and whether the key has gone down since the last time WinGetPhysKeyState
  19398.    was called. If the high bit is set (0x8000), the key is currently down,
  19399.    otherwise the key is currently up. If the low bit is set (0x0001), the key
  19400.    has gone down since the last time WinGetPhysKeyState was called.
  19401.  
  19402.  See Also
  19403.  
  19404.    WinGetKeyState
  19405.  
  19406.  
  19407.  ────────────────────────────────────────────────────────────────────────────
  19408.  WinGetPS
  19409.  ────────────────────────────────────────────────────────────────────────────
  19410.    HPS WinGetPS (hwnd)
  19411.    HWND hwnd;              /*handle of the window                          */
  19412.  
  19413.    The WinGetPS function retrieves a cache presentation space that is a cache
  19414.    micro presentation space present in the system. This space can be used for
  19415.    simple drawing operations that do not depend on long-term data being
  19416.    stored in the presentation space.
  19417.  
  19418.  Parameters
  19419.  
  19420.    hwnd  Identifies the window to retrieve a presentation space for.
  19421.  
  19422.  Return Value
  19423.  
  19424.    The return value identifies presentation space that can be used for
  19425.    drawing in the window.
  19426.  
  19427.  Comments
  19428.  
  19429.    The initial state of the presentation space is the same as that of a
  19430.    presentation space created using the GpiCreatePS function. The color table
  19431.    is in default color-index mode. The visible region associated with the
  19432.    presentation space depends on the window and class styles of the window
  19433.    identified by the hwnd parameter. The visible region can have one of the
  19434.    following values:
  19435.  
  19436.    Value             Meaning
  19437.    ──────────────────────────────────────────────────────────────────────────
  19438.    WS_CLIPCHILDREN   All the window's child windows are excluded.
  19439.  
  19440.    WS_CLIPSIBLINGS   All the window's sibling windows are excluded.
  19441.  
  19442.    WS_PARENTCLIP     The visible region is the same as that of the window's
  19443.                      parent window.
  19444.    ──────────────────────────────────────────────────────────────────────────
  19445.  
  19446.    Note that any presentation spaces created with the WinGetPS function must
  19447.    be released by calling the WinReleasePS function. This must be done before
  19448.    the application terminates.
  19449.  
  19450.  Example
  19451.  
  19452.    This example processes an application-defined message (IDM_FILL). It calls
  19453.    WinGetPS to get a presentation space to the entire window. It gets the
  19454.    dimensions of the current window, fills the window, and calls WinReleasePS
  19455.    to release the presentation space.
  19456.  
  19457.    case IDM_FILL:
  19458.        hps = WinGetPS(hwnd);           /* get ps for the entire window */
  19459.        WinQueryWindowRect(hwnd, &rcl);    /* get window dimensions     */
  19460.        WinFillRect(hps, &rcl, CLR_WHITE); /* clear entire window       */
  19461.        WinReleasePS(hps);                 /* release the ps            */
  19462.        return 0L;
  19463.  
  19464.  See Also
  19465.  
  19466.    GpiCreatePS, WinGetClipPS, WinGetScreenPS, WinReleasePS
  19467.  
  19468.  
  19469.  ────────────────────────────────────────────────────────────────────────────
  19470.  WinGetScreenPS
  19471.  ────────────────────────────────────────────────────────────────────────────
  19472.    HPS WinGetScreenPS (hwndDesktop)
  19473.    HWND hwndDesktop;       /*handle of the desktop                         */
  19474.  
  19475.    The WinGetScreenPS function returns a presentation space that can be used
  19476.    for drawing anywhere on the screen.
  19477.  
  19478.  Parameters
  19479.  
  19480.    hwndDesktop  Identifies the desktop window. This parameter can be
  19481.    HWND_DESKTOP or the desktop window handle.
  19482.  
  19483.  Return Value
  19484.  
  19485.    The return value is a presentation space, or NULL if an error occurs.
  19486.  
  19487.  Comments
  19488.  
  19489.    When your application finishes using the presentation space, the space
  19490.    should be released by calling the WinReleasePS function.
  19491.  
  19492.    The WinLockWindowUpdate function should be used to avoid updating the same
  19493.    part of the screen at the same time.
  19494.  
  19495.  See Also
  19496.  
  19497.    WinGetPS, WinLockWindowUpdate, WinReleasePS
  19498.  
  19499.  
  19500.  ────────────────────────────────────────────────────────────────────────────
  19501.  WinGetSysBitmap
  19502.  ────────────────────────────────────────────────────────────────────────────
  19503.    HBITMAP WinGetSysBitmap (hwndDesktop, ibm)
  19504.    HWND hwndDesktop;       /*handle of the desktop                         */
  19505.    USHORT ibm;             /*index of the system bitmap                    */
  19506.  
  19507.    The WinGetSysBitmap function returns a handle to one of the standard
  19508.    bitmaps provided by the system. This bitmap can be used for any of the
  19509.    normal bitmap operations. When your application is done with the bitmap,
  19510.    it should free it by calling GpiDeleteBitmap.
  19511.  
  19512.  Parameters
  19513.  
  19514.    hwndDesktop  Identifies the desktop window. This parameter can be
  19515.    HWND_DESKTOP or the desktop window handle.
  19516.  
  19517.    ibm  Specifies the system-bitmap index value. It can be one of the
  19518.    following values:
  19519.  
  19520. ╓┌─┌─────────────────────┌───────────────────────────────────────────────────╖
  19521.    Value                 Meaning
  19522.    ──────────────────────────────────────────────────────────────────────────
  19523.    SBMP_BTNCORNERS       Push button corners.
  19524.  
  19525.    SBMP_CHECKBOXES       Check box/radio button check mark.
  19526.  
  19527.    SBMP_CHILDSYSMENU     Smaller version of the system menu bitmap to use in
  19528.                          child windows.
  19529.  
  19530.    SBMP_DRIVE            A symbol used by the file system to indicate a disk
  19531.                          drive.
  19532.    Value                 Meaning
  19533.    ──────────────────────────────────────────────────────────────────────────
  19534.                         drive.
  19535.  
  19536.    SBMP_FILE             A symbol used by the file system to indicate a file.
  19537.  
  19538.    SBMP_FOLDER           A symbol used by the file system to show
  19539.                          subdirectories.
  19540.  
  19541.    SBMP_MAXBUTTON        Maximize button.
  19542.  
  19543.    SBMP_MENUATTACHED     A symbol used to indicate that a menu item has an
  19544.                          attached hierarchical menu.
  19545.  
  19546.    SBMP_MENUCHECK        Menu check mark.
  19547.  
  19548.    SBMP_MINBUTTON        Minimize button.
  19549.  
  19550.    SBMP_PROGRAM          A symbol used by the file system to indicate that a
  19551.                          file is an executable program.
  19552.  
  19553.    Value                 Meaning
  19554.    ──────────────────────────────────────────────────────────────────────────
  19555. 
  19556.    SBMP_RESTOREBUTTON    Restore button.
  19557.  
  19558.    SBMP_SBDNARROW        Scroll-bar down arrow.
  19559.  
  19560.    SBMP_SBLFARROW        Scroll-bar left arrow.
  19561.  
  19562.    SBMP_SBRGARROW        Scroll-bar right arrow.
  19563.  
  19564.    SBMP_SBUPARROW        Scroll-bar up arrow.
  19565.  
  19566.    SBMP_SIZEBOX          A symbol used to indicate an area of a window that a
  19567.                          user can click to resize the window.
  19568.  
  19569.    SBMP_SYSMENU          System menu.
  19570.  
  19571.    SBMP_TREEMINUS        A symbol used by the file system to show that an
  19572.                          entry in the directory tree contains no more files.
  19573.  
  19574.    Value                 Meaning
  19575.    ──────────────────────────────────────────────────────────────────────────
  19576. 
  19577.    SBMP_TREEPLUS         A symbol used by the file system to show that an
  19578.                          entry in the directory tree contains more files.
  19579.    ──────────────────────────────────────────────────────────────────────────
  19580.  
  19581.  
  19582.  Return Value
  19583.  
  19584.    The return value is a handle to a bitmap, or NULL if an error occurs.
  19585.  
  19586.  See Also
  19587.  
  19588.    GpiDeleteBitmap, WinDrawBitmap
  19589.  
  19590.  
  19591.  ────────────────────────────────────────────────────────────────────────────
  19592.  WinInflateRect
  19593.  ────────────────────────────────────────────────────────────────────────────
  19594.    BOOL WinInflateRect (hab, prcl, cx, cy)
  19595.    HAB hab;                /*handle of the anchor block                    */
  19596.    PRECTL prcl;            /*address of structure with expanded rectangle  */
  19597.    SHORT cx;               /*amount to expand width                        */
  19598.    SHORT cy;               /*amount to expand height                       */
  19599.  
  19600.    The WinInflateRect function expands the coordinates of a rectangle. If the
  19601.    specified expansion values are positive, the rectangle is expanded on all
  19602.    sides. If the specified expansion values are negative, the horizontal
  19603.    expansion value is subtracted from the left and added to the right, and
  19604.    the vertical expansion value is subtracted from the bottom and added to
  19605.    the top.
  19606.  
  19607.  Parameters
  19608.  
  19609.    hab  Identifies the anchor block.
  19610.  
  19611.    prcl  Points to the RECTL structure that contains the rectangle to be
  19612.    expanded. The RECTL structure has the following form:
  19613.  
  19614.    typedef struct _RECTL {
  19615.        LONG  xLeft;
  19616.        LONG  yBottom;
  19617.        LONG  xRight;
  19618.        LONG  yTop;
  19619.    } RECTL;
  19620.  
  19621.    For a full description, see Chapter 4, "Types, Macros, Structures."
  19622.  
  19623.    cx  Specifies the amount of horizontal expansion.
  19624.  
  19625.    cy  Specifies the amount of vertical expansion.
  19626.  
  19627.  Return Value
  19628.  
  19629.    The return value is always TRUE.
  19630.  
  19631.  See Also
  19632.  
  19633.    WinOffsetRect
  19634.  
  19635.  
  19636.  ────────────────────────────────────────────────────────────────────────────
  19637.  WinInitialize
  19638.  ────────────────────────────────────────────────────────────────────────────
  19639.    HAB WinInitialize (fsOptions)
  19640.    USHORT fsOptions;       /*initialization options                        */
  19641.  
  19642.    The WinInitialize function initializes a thread for making Presentation
  19643.    Manager function calls. This must be the first Presentation Manager
  19644.    function called by any thread that will be calling Presentation Manager
  19645.    functions.
  19646.  
  19647.  Parameters
  19648.  
  19649.    fsOptions  Specifies the initialization options. Currently this parameter
  19650.    must be zero.
  19651.  
  19652.  Return Value
  19653.  
  19654.    The return value is the handle of an anchor block, or NULL if an error
  19655.    occurred.
  19656.  
  19657.  Example
  19658.  
  19659.    This example calls WinInitialize so that the thread can use Presentation
  19660.    Manager functions, processes the message loop, and calls WinTerminate when
  19661.    it is finished calling Presentation Manager functions.
  19662.  
  19663.    HAB hab;                /* handle to the anchor block  */
  19664.  
  19665.    VOID cdecl main() {
  19666.        hab = WinInitialize(NULL);
  19667.        .
  19668.        . /* any other initialization */
  19669.        .
  19670.        while (WinGetMsg(hab, &qmsg, NULL, 0, 0))
  19671.            WinDispatchMsg(hab, &qmsg);
  19672.        WinTerminate(hab);
  19673.  
  19674.  See Also
  19675.  
  19676.    WinCreateMsgQueue, WinTerminate
  19677.  
  19678.  
  19679.  ────────────────────────────────────────────────────────────────────────────
  19680.  WinInSendMsg
  19681.  ────────────────────────────────────────────────────────────────────────────
  19682.    BOOL WinInSendMsg (hab)
  19683.    HAB hab;                /*handle of the anchor block                    */
  19684.  
  19685.    The WinInSendMsg function determines whether the current thread is
  19686.    processing a message sent by another thread.
  19687.  
  19688.  Parameters
  19689.  
  19690.    hab  Identifies the anchor block.
  19691.  
  19692.  Return Value
  19693.  
  19694.    The return value is TRUE if the current thread is processing a message
  19695.    sent by another thread, or FALSE if it is not processing a message.
  19696.  
  19697.  Comments
  19698.  
  19699.    The WinInSendMsg function can be used to tell if a function is being
  19700.    called recursively.
  19701.  
  19702.  See Also
  19703.  
  19704.    WinIsThreadActive, WinSendMsg
  19705.  
  19706.  
  19707.  ────────────────────────────────────────────────────────────────────────────
  19708.  WinIntersectRect
  19709.  ────────────────────────────────────────────────────────────────────────────
  19710.    BOOL WinIntersectRect (hab, prclDst, prclSrc1, prclSrc2)
  19711.    HAB hab;                /*handle of the anchor block                    */
  19712.    PRECTL prclDst;         /*address of structure for intersection         */
  19713.                            /*of rectangles                                 */
  19714.    PRECTL prclSrc1;        /*address of structure with first rectangle     */
  19715.    PRECTL prclSrc2;        /*address of structure with second rectangle    */
  19716.  
  19717.    The WinIntersectRect function calculates the intersection of two source
  19718.    rectangles and places the coordinates of the intersection rectangle into
  19719.    the destination rectangle. If the rectangles do not intersect, an empty
  19720.    rectangle (0, 0, 0, 0) is placed into the destination rectangle.
  19721.  
  19722.  Parameters
  19723.  
  19724.    hab  Identifies the anchor block.
  19725.  
  19726.    prclDst  Points to the RECTL structure that receives the intersection of
  19727.    the rectangles designated by the prclSrc1 and prclSrc2 parameters. The
  19728.    RECTL structure has the following form:
  19729.  
  19730.    typedef struct _RECTL {
  19731.        LONG  xLeft;
  19732.        LONG  yBottom;
  19733.        LONG  xRight;
  19734.        LONG  yTop;
  19735.    } RECTL;
  19736.  
  19737.    For a full description, see Chapter 4, "Types, Macros, Structures."
  19738.  
  19739.    prclSrc1  Points to the RECTL structure that contains the first source
  19740.    rectangle.
  19741.  
  19742.    prclSrc2  Points to the RECTL structure that contains the second source
  19743.    rectangle.
  19744.  
  19745.  Return Value
  19746.  
  19747.    The return value is TRUE if the source rectangles intersect, or FALSE if
  19748.    they do not.
  19749.  
  19750.  See Also
  19751.  
  19752.    WinUnionRect
  19753.  
  19754.  
  19755.  ────────────────────────────────────────────────────────────────────────────
  19756.  WinInvalidateRect
  19757.  ────────────────────────────────────────────────────────────────────────────
  19758.    BOOL WinInvalidateRect (hwnd, prcl, fIncludeChildren)
  19759.    HWND hwnd;              /*handle of window with changed update region   */
  19760.    PRECTL prcl;            /*address of structure with rectangle           */
  19761.    BOOL fIncludeChildren;  /*invalidation-scope flag                       */
  19762.  
  19763.    The WinInvalidateRect function adds a rectangle to a window's update
  19764.    region. The update region represents the area of the window that must be
  19765.    redrawn.
  19766.  
  19767.  Parameters
  19768.  
  19769.    hwnd  Identifies the window whose update region has changed. If this
  19770.    parameter is HWND_DESKTOP, this function updates the entire screen.
  19771.  
  19772.    prcl  Points to the RECTL structure that contains the coordinates of the
  19773.    rectangle to add to the window's update region. If this parameter is NULL,
  19774.    the entire window is put into the update region. The RECTL structure has
  19775.    the following form:
  19776.  
  19777.    typedef struct _RECTL {
  19778.        LONG  xLeft;
  19779.        LONG  yBottom;
  19780.        LONG  xRight;
  19781.        LONG  yTop;
  19782.    } RECTL;
  19783.  
  19784.    For a full description, see Chapter 4, "Types, Macros, Structures."
  19785.  
  19786.    fIncludeChildren  Specifies whether child windows of hwnd are included in
  19787.    the invalid region. If TRUE, child windows are included. If FALSE, they
  19788.    are not.
  19789.  
  19790.  Return Value
  19791.  
  19792.    The return value is TRUE if the function is successful or FALSE if an
  19793.    error occurs.
  19794.  
  19795.  Comments
  19796.  
  19797.    If the window style is WS_SYNCPAINT, the window is redrawn before
  19798.    returning from the WinInvalidateRect function.
  19799.  
  19800.    If the window style is WS_CLIPCHILDREN and part of the window's update
  19801.    region overlaps child windows that have the style WS_SYNCPAINT, those
  19802.    child windows are updated before WinInvalidateRect returns.
  19803.  
  19804.  Example
  19805.  
  19806.    This example gets the dimensions of the window and calls WinInvalidateRect
  19807.    to invalidate the window. The application will be sent a WM_PAINT message
  19808.    with the entire window as the update rectangle.
  19809.  
  19810.    WinQueryWindowRect(hwnd, &rcl);
  19811.    WinInvalidateRect(hwnd,   /* window to invalidate    */
  19812.        &rcl,                 /* invalid rectangle       */
  19813.        FALSE);               /* do not include children */
  19814.  
  19815.  See Also
  19816.  
  19817.    WinInvalidateRegion
  19818.  
  19819.  
  19820.  ────────────────────────────────────────────────────────────────────────────
  19821.  WinInvalidateRegion
  19822.  ────────────────────────────────────────────────────────────────────────────
  19823.    BOOL WinInvalidateRegion (hwnd, hrgn, fIncludeChildren)
  19824.    HWND hwnd;              /*handle of window with changed update region   */
  19825.    HRGN hrgn;              /*handle of the region to add                   */
  19826.    BOOL fIncludeChildren;  /*invalidation-scope flag                       */
  19827.  
  19828.    The WinInvalidateRegion function adds a region to a window's update
  19829.    region. The update region represents the area of the window that needs to
  19830.    be redrawn.
  19831.  
  19832.  Parameters
  19833.  
  19834.    hwnd  Identifies the window whose update region has changed. If this
  19835.    parameter is HWND_DESKTOP, this function updates the entire screen.
  19836.  
  19837.    hrgn  Identifies the region to be added to the window's update region. If
  19838.    this parameter is NULL, the entire window is put into the update region.
  19839.  
  19840.    fIncludeChildren  Specifies whether child windows of hwnd are included in
  19841.    the invalid region. If TRUE, child windows are included. If FALSE, they
  19842.    are not.
  19843.  
  19844.  Return Value
  19845.  
  19846.    The return value is TRUE if the function is successful or FALSE if an
  19847.    error occurs.
  19848.  
  19849.  Comments
  19850.  
  19851.    If the window style is WS_SYNCPAINT, the window is redrawn before
  19852.    returning from the WinInvalidateRegion function.
  19853.  
  19854.    If the window style is WS_CLIPCHILDREN and part of the window's update
  19855.    region overlaps child windows that have the style WS_SYNCPAINT, those
  19856.    child windows are updated before WinInvalidateRegion returns.
  19857.  
  19858.  See Also
  19859.  
  19860.    WinInvalidateRect
  19861.  
  19862.  
  19863.  ────────────────────────────────────────────────────────────────────────────
  19864.  WinInvertRect
  19865.  ────────────────────────────────────────────────────────────────────────────
  19866.    BOOL WinInvertRect (hps, prcl)
  19867.    HPS hps;                /*handle of the presentation space              */
  19868.    PRECTL prcl;            /*address of structure with rectangle to invert */
  19869.  
  19870.    The WinInvertRect function inverts a rectangular area. Inversion is a
  19871.    logical NOT operation and flips the bits of each pel.
  19872.  
  19873.  Parameters
  19874.  
  19875.    hps  Identifies the presentation space.
  19876.  
  19877.    prcl  Points to the RECTL structure that contains the coordinates of the
  19878.    rectangle to invert. The RECTL structure has the following form:
  19879.  
  19880.    typedef struct _RECTL {
  19881.        LONG  xLeft;
  19882.        LONG  yBottom;
  19883.        LONG  xRight;
  19884.        LONG  yTop;
  19885.    } RECTL;
  19886.  
  19887.    For a full description, see Chapter 4, "Types, Macros, Structures."
  19888.  
  19889.  Return Value
  19890.  
  19891.    The return value is TRUE if the function is successful or FALSE if an
  19892.    error occurs.
  19893.  
  19894.  See Also
  19895.  
  19896.    GpiBitBlt
  19897.  
  19898.  
  19899.  ────────────────────────────────────────────────────────────────────────────
  19900.  WinIsChild
  19901.  ────────────────────────────────────────────────────────────────────────────
  19902.    BOOL WinIsChild (hwnd, hwndParent)
  19903.    HWND hwnd;              /*handle of the child window                    */
  19904.    HWND hwndParent;        /*handle of the parent window                   */
  19905.  
  19906.    The WinIsChild function tests whether a specified window is a child of a
  19907.    specified parent window.
  19908.  
  19909.  Parameters
  19910.  
  19911.    hwnd  Identifies the child window.
  19912.  
  19913.    hwndParent  Identifies the parent window.
  19914.  
  19915.  Return Value
  19916.  
  19917.    The return value is TRUE if the child window is a descendant of the parent
  19918.    window. The return value is FALSE if the child window is not a descendant
  19919.    of the parent or if an error occurs.
  19920.  
  19921.  See Also
  19922.  
  19923.    WinSetParent
  19924.  
  19925.  
  19926.  ────────────────────────────────────────────────────────────────────────────
  19927.  WinIsPhysInputEnabled
  19928.  ────────────────────────────────────────────────────────────────────────────
  19929.    BOOL WinIsPhysInputEnabled (hwndDesktop)
  19930.    HWND hwndDesktop;       /*handle of the desktop                         */
  19931.  
  19932.    The WinIsPhysInputEnabled function returns the status of hardware input
  19933.    (on or off).
  19934.  
  19935.  Parameters
  19936.  
  19937.    hwndDesktop  Identifies the desktop window. This parameter can be
  19938.    HWND_DESKTOP or the desktop window handle.
  19939.  
  19940.  Return Value
  19941.  
  19942.    The return value is TRUE if input is enabled or FALSE if input is
  19943.    disabled.
  19944.  
  19945.  See Also
  19946.  
  19947.    WinEnablePhysInput
  19948.  
  19949.  
  19950.  ────────────────────────────────────────────────────────────────────────────
  19951.  WinIsRectEmpty
  19952.  ────────────────────────────────────────────────────────────────────────────
  19953.    BOOL WinIsRectEmpty (hab, prcl)
  19954.    HAB hab;                /*handle of the anchor block                    */
  19955.    PRECTL prcl;            /*address of structure with rectangle to check  */
  19956.  
  19957.    The WinIsRectEmpty function tests whether a rectangle is empty. (An empty
  19958.    rectangle is one with no area. The right side is less than or equal to the
  19959.    left and the bottom side is less than or equal to the top.)
  19960.  
  19961.  Parameters
  19962.  
  19963.    hab  Identifies the anchor block.
  19964.  
  19965.    prcl  Points to the RECTL structure that contains the rectangle to be
  19966.    tested. The RECTL structure has the following form:
  19967.  
  19968.    typedef struct _RECTL {
  19969.        LONG  xLeft;
  19970.        LONG  yBottom;
  19971.        LONG  xRight;
  19972.        LONG  yTop;
  19973.    } RECTL;
  19974.  
  19975.    For a full description, see Chapter 4, "Types, Macros, Structures."
  19976.  
  19977.  Return Value
  19978.  
  19979.    The return value is TRUE if the rectangle is empty or FALSE if the
  19980.    rectangle is not empty.
  19981.  
  19982.  See Also
  19983.  
  19984.    WinSetRectEmpty
  19985.  
  19986.  
  19987.  ────────────────────────────────────────────────────────────────────────────
  19988.  WinIsThreadActive
  19989.  ────────────────────────────────────────────────────────────────────────────
  19990.    BOOL WinIsThreadActive (hab)
  19991.    HAB hab;                /*handle of the anchor block                    */
  19992.  
  19993.    The WinIsThreadActive function determines whether the active window
  19994.    belongs to the calling thread.
  19995.  
  19996.  Parameters
  19997.  
  19998.    hab  Identifies the anchor block of the calling thread.
  19999.  
  20000.  Return Value
  20001.  
  20002.    The return value is TRUE if the active window belongs to the calling
  20003.    thread, or it is FALSE if the active window does not belong to the thread.
  20004.  
  20005.  See Also
  20006.  
  20007.    WinInSendMsg
  20008.  
  20009.  
  20010.  ────────────────────────────────────────────────────────────────────────────
  20011.  WinIsWindow
  20012.  ────────────────────────────────────────────────────────────────────────────
  20013.    BOOL WinIsWindow (hab, hwnd)
  20014.    HAB hab;                /*handle of the anchor block                    */
  20015.    HWND hwnd;              /*handle of window to test                      */
  20016.  
  20017.    The WinIsWindow function determines whether a specified window is valid.
  20018.  
  20019.  Parameters
  20020.  
  20021.    hab  Identifies the anchor block.
  20022.  
  20023.    hwnd  Identifies the window whose validity is to be checked.
  20024.  
  20025.  Return Value
  20026.  
  20027.    The return value is TRUE if the window is valid or FALSE if it is not.
  20028.  
  20029.  Comments
  20030.  
  20031.    An invalid window is one which has been destroyed. If hwnd contains the
  20032.    handle of an invalid window, or it contains the handle of something other
  20033.    than a window, this function will return FALSE.
  20034.  
  20035.  See Also
  20036.  
  20037.    WinIsWindowEnabled, WinIsWindowVisible
  20038.  
  20039.  
  20040.  ────────────────────────────────────────────────────────────────────────────
  20041.  WinIsWindowEnabled
  20042.  ────────────────────────────────────────────────────────────────────────────
  20043.    BOOL WinIsWindowEnabled (hwnd)
  20044.    HWND hwnd;              /*handle of window to check                     */
  20045.  
  20046.    The WinIsWindowEnabled function determines whether a specified window is
  20047.    enabled or disabled.
  20048.  
  20049.  Parameters
  20050.  
  20051.    hwnd  Identifies the window to check.
  20052.  
  20053.  Return Value
  20054.  
  20055.    The return value is TRUE if the window is enabled, or FALSE if it is
  20056.    disabled.
  20057.  
  20058.  See Also
  20059.  
  20060.    WinEnableWindow, WinIsWindowVisible
  20061.  
  20062.  
  20063.  ────────────────────────────────────────────────────────────────────────────
  20064.  WinIsWindowVisible
  20065.  ────────────────────────────────────────────────────────────────────────────
  20066.    BOOL WinIsWindowVisible (hwnd)
  20067.    HWND hwnd;              /*handle of the window to test                  */
  20068.  
  20069.    The WinIsWindowVisible function determines the visibility state of a
  20070.    window.
  20071.  
  20072.  Parameters
  20073.  
  20074.    hwnd  Identifies the window to test.
  20075.  
  20076.  Return Value
  20077.  
  20078.    The return value is TRUE if the specified window and all its parent
  20079.    windows have the WS_VISIBLE style bit set. The return value is FALSE if
  20080.    the window is not visible. Because the return value reflects only the
  20081.    value of the window's WS_VISIBLE flag, it may be TRUE even if the window
  20082.    is totally obscured by other windows.
  20083.  
  20084.  Comments
  20085.  
  20086.    A window possesses a visibility state indicated by the WS_VISIBLE style
  20087.    bit. When the WS_VISIBLE style bit is set, the window is shown and
  20088.    subsequent drawing into the window is displayed as long as the window or
  20089.    any of the windows in the parent chain have the WS_VISIBLE style.
  20090.  
  20091.    When the WS_VISIBLE style bit is not set, the window is not shown (hidden)
  20092.    and subsequent drawing into the window is not displayed.
  20093.  
  20094.    If the value of the WS_VISIBLE style bit has been changed, the message
  20095.    WM_WINDOWPOSCHANGED is sent to the window of the hwnd parameter before the
  20096.    function returns.
  20097.  
  20098.    Drawing to a window with a WS_VISIBLE style will not be displayed if the
  20099.    window is covered by other windows, or clipped by its parent.
  20100.  
  20101.  See Also
  20102.  
  20103.    WinIsWindowEnabled, WinShowWindow
  20104.  
  20105.  
  20106.  ────────────────────────────────────────────────────────────────────────────
  20107.  WinLoadAccelTable
  20108.  ────────────────────────────────────────────────────────────────────────────
  20109.    HACCEL WinLoadAccelTable (hab, hmod, idAccelTable)
  20110.    HAB hab;                /*handle of the anchor block                    */
  20111.    HMODULE hmod;           /*handle of the module                          */
  20112.    USHORT idAccelTable;    /*accelerator table identifier                  */
  20113.  
  20114.    The WinLoadAccelTable function loads an accelerator table.
  20115.  
  20116.  Parameters
  20117.  
  20118.    hab  Identifies the anchor block.
  20119.  
  20120.    hmod  Identifies the module that contains the accelerator table. This
  20121.    parameter can be either the module handle returned by the DosLoadModule
  20122.    function or NULL for the application's module.
  20123.  
  20124.    idAccelTable  Identifies the accelerator table.
  20125.  
  20126.  Return Value
  20127.  
  20128.    The return value is the handle of the accelerator table.
  20129.  
  20130.  See Also
  20131.  
  20132.    DosLoadModule, WinCreateAccelTable, WinDestroyAccelTable,
  20133.    WinSetAccelTable
  20134.  
  20135.  
  20136.  ────────────────────────────────────────────────────────────────────────────
  20137.  WinLoadDlg
  20138.  ────────────────────────────────────────────────────────────────────────────
  20139.    HWND WinLoadDlg (hwndParent, hwndOwner, pfnDlgProc, hmod, idDlg,
  20140.    pCreateParams)
  20141.    HWND hwndParent;        /*handle of the parent window                   */
  20142.    HWND hwndOwner;         /*handle of the owner window                    */
  20143.    PFNWP pfnDlgProc;       /*pointer to the dialog procedure               */
  20144.    HMODULE hmod;           /*handle of resource with dialog template       */
  20145.    USHORT idDlg;           /*dialog window and template                    */
  20146.    PVOID pCreateParams;    /*address of dialog-procedure data              */
  20147.  
  20148.    The WinLoadDlg function creates a dialog window from a dialog template and
  20149.    returns the handle of the dialog window created.
  20150.  
  20151.  Parameters
  20152.  
  20153.    hwndParent  Identifies the parent window of the dialog window.
  20154.  
  20155.    hwndOwner  Identifies the owner window for the dialog window.
  20156.  
  20157.    pfnDlgProc  Points to the dialog procedure.
  20158.  
  20159.    hmod  Identifies the module that contains the dialog template. This
  20160.    parameter can be either the module handle returned by the DosLoadModule
  20161.    function or NULL for the application's module.
  20162.  
  20163.    idDlg  Identifies the dialog window and the dialog-resource file.
  20164.  
  20165.    pCreateParams  Points to dialog-procedure data (application-specific data
  20166.    passed to the dialog procedure with the WM_INITDLG message).
  20167.  
  20168.  Return Value
  20169.  
  20170.    The return value is the handle of the dialog window created, or it is NULL
  20171.    if an error occurs.
  20172.  
  20173.  See Also
  20174.  
  20175.    DosLoadModule, WinCreateDlg, WinDestroyWindow, WinDlgBox,
  20176.    WinProcessDlg, WinSubstituteStrings
  20177.  
  20178.  
  20179.  ────────────────────────────────────────────────────────────────────────────
  20180.  WinLoadMenu
  20181.  ────────────────────────────────────────────────────────────────────────────
  20182.    HWND WinLoadMenu (hwndFrame, hmod, idMenu)
  20183.    HWND hwndFrame;         /*handle of the frame window                    */
  20184.    HMODULE hmod;           /*handle of the module with resource            */
  20185.    USHORT idMenu;          /*menu template identifier                      */
  20186.  
  20187.    The WinLoadMenu function creates a menu window from the menu template.
  20188.  
  20189.  Parameters
  20190.  
  20191.    hwndFrame  Identifies the frame window for the menu.
  20192.  
  20193.    hmod  Identifies the module that contains the menu template. This
  20194.    parameter can be either the module handle returned by the DosLoadModule
  20195.    function or NULL for the application's module.
  20196.  
  20197.    idMenu  Identifies the menu template in the resource identified by the
  20198.    hmod parameter.
  20199.  
  20200.  Return Value
  20201.  
  20202.    The return value is the handle of the menu window.
  20203.  
  20204.  Comments
  20205.  
  20206.    Menus are created as child windows of the frame window and are initially
  20207.    visible. If the menu contains submenus, these submenus are initially
  20208.    created as object windows that are owned by the menu window. If the
  20209.    submenus contain other submenus, these new submenus are also object
  20210.    windows whose owner is the submenu that contains it. The menu hierarchy is
  20211.    defined by the owner-window chain.
  20212.  
  20213.  See Also
  20214.  
  20215.    DosLoadModule, WinCreateMenu, WinQueryObjectWindow
  20216.  
  20217.  
  20218.  ────────────────────────────────────────────────────────────────────────────
  20219.  WinLoadMessage
  20220.  ────────────────────────────────────────────────────────────────────────────
  20221.    SHORT WinLoadMessage (hab, hmod, id, cchMax, pszBuffer)
  20222.    HAB hab;                /*handle of the anchor block                    */
  20223.    HMODULE hmod;           /*module handle                                 */
  20224.    USHORT id;              /*message identifier                            */
  20225.    SHORT cchMax;           /*buffer size                                   */
  20226.    PSZ pszBuffer;          /*address of buffer for message                 */
  20227.  
  20228.    The WinLoadMessage function loads a message from a resource, copies the
  20229.    message to the specified buffer, and appends a terminating null character.
  20230.  
  20231.  Parameters
  20232.  
  20233.    hab  Identifies the anchor block.
  20234.  
  20235.    hmod  Identifies the module that contains the message. This parameter can
  20236.    be either the module handle returned by the DosLoadModule function or NULL
  20237.    for the application's module.
  20238.  
  20239.    id  Identifies the message.
  20240.  
  20241.    cchMax  Specifies the size of the buffer.
  20242.  
  20243.    pszBuffer  Points to the buffer that receives the message.
  20244.  
  20245.  Return Value
  20246.  
  20247.    The return value is the length of the returned message (excluding the
  20248.    terminating null character). The return value can have a maximum value of
  20249.    (cchMax -1). The return value is zero if an error occurs.
  20250.  
  20251.  Comments
  20252.  
  20253.    Message resources contain up to 16 messages each. The resource identifier
  20254.    is calculated from the id parameter value passed to WinLoadMessage as
  20255.    follows:
  20256.  
  20257.          resource identifier = (id / 16) + 1
  20258.  
  20259.    To save storage on disk and in memory, applications should group their
  20260.    message resources sequentially, starting at a multiple of 16.
  20261.  
  20262.  See Also
  20263.  
  20264.    DosLoadModule, WinLoadString
  20265.  
  20266.  
  20267.  ────────────────────────────────────────────────────────────────────────────
  20268.  WinLoadPointer
  20269.  ────────────────────────────────────────────────────────────────────────────
  20270.    HPOINTER WinLoadPointer (hwndDesktop, hmod, idPtr)
  20271.    HWND hwndDesktop;       /*handle of the desktop                         */
  20272.    HMODULE hmod;           /*handle of the module with the resource        */
  20273.    USHORT idPtr;           /*resource identifier                           */
  20274.  
  20275.    The WinLoadPointer function loads a pointer. The pointer can then be used
  20276.    as the mouse pointer by calling the WinSetPointer function.
  20277.  
  20278.  Parameters
  20279.  
  20280.    hwndDesktop  Identifies the desktop window. This parameter can be
  20281.    HWND_DESKTOP or the desktop window handle.
  20282.  
  20283.    hmod  Identifies the module that contains the pointer. This parameter can
  20284.    be either the module handle returned by the DosLoadModule function or NULL
  20285.    for the application's module.
  20286.  
  20287.    idPtr  Identifies the pointer.
  20288.  
  20289.  Return Value
  20290.  
  20291.    The return value is a handle to the pointer if the function is successful,
  20292.    or NULL if an error occurs.
  20293.  
  20294.  Example
  20295.  
  20296.    This example calls WinLoadPointer to load an application-defined pointer.
  20297.    When processing the WM_MOUSEMOVE message, the loaded pointer is displayed
  20298.    by calling WinSetPointer.
  20299.  
  20300.    case WM_CREATE:
  20301.        hptrCrossHair = WinLoadPointer(HWND_DESKTOP,
  20302.            NULL,              /* load from .exe file    */
  20303.            IDP_CROSSHAIR);    /* identifies the pointer */
  20304.  
  20305.    case WM_MOUSEMOVE:
  20306.        WinSetPointer(HWND_DESKTOP, hptrCrossHair);
  20307.  
  20308.  See Also
  20309.  
  20310.    DosLoadModule, WinCreatePointer, WinDestroyPointer, WinDrawPointer,
  20311.    WinQuerySysPointer, WinSetPointer
  20312.  
  20313.  
  20314.  ────────────────────────────────────────────────────────────────────────────
  20315.  WinLoadString
  20316.  ────────────────────────────────────────────────────────────────────────────
  20317.    SHORT WinLoadString (hab, hmod, id, cchMax, pszBuffer)
  20318.    HAB hab;                /*handle of the anchor block                    */
  20319.    HMODULE hmod;           /*handle of the module with the string          */
  20320.    USHORT id;              /*string identifier                             */
  20321.    SHORT cchMax;           /*size of the buffer                            */
  20322.    PSZ pszBuffer;          /*address of the buffer for the string          */
  20323.  
  20324.    The WinLoadString function loads a string from a resource, copies the
  20325.    string to the specified buffer, and appends a terminating null character.
  20326.  
  20327.  Parameters
  20328.  
  20329.    hab  Identifies the anchor block.
  20330.  
  20331.    hmod  Identifies the module that contains the string. This parameter can
  20332.    be either the module handle returned by the DosLoadModule function or NULL
  20333.    for the application's module.
  20334.  
  20335.    id  Identifies the string identifier.
  20336.  
  20337.    cchMax  Specifies the size of the supplied buffer.
  20338.  
  20339.    pszBuffer  Points to the buffer that receives the string.
  20340.  
  20341.  Return Value
  20342.  
  20343.    The return value is the length of the returned string (excluding the
  20344.    terminating null character). The return value can have a maximum value of
  20345.    (cchMax -1). The return value is zero if an error occurs.
  20346.  
  20347.  Comments
  20348.  
  20349.    String resources contain up to 16 strings each. The resource identifier is
  20350.    calculated from the id value passed to WinLoadString as follows:
  20351.  
  20352.          resource identifier = (id / 16) + 1
  20353.  
  20354.    To save storage on disk and in memory, applications should group their
  20355.    string resources sequentially, starting at a multiple of 16.
  20356.  
  20357.  See Also
  20358.  
  20359.    DosLoadModule, WinLoadMessage
  20360.  
  20361.  
  20362.  ────────────────────────────────────────────────────────────────────────────
  20363.  WinLockHeap
  20364.  ────────────────────────────────────────────────────────────────────────────
  20365.    PVOID WinLockHeap (hHeap)
  20366.    HHEAP hHeap;            /*handle of the heap                            */
  20367.  
  20368.    The WinLockHeap function returns a far address to the beginning of the
  20369.    heap.
  20370.  
  20371.  Parameters
  20372.  
  20373.    hHeap  Identifies the heap. This parameter is returned by the
  20374.    WinCreateHeap function.
  20375.  
  20376.  Return Value
  20377.  
  20378.    The return value is a far pointer to the beginning of the segment that
  20379.    contains the passed heap.
  20380.  
  20381.  See Also
  20382.  
  20383.    WinAllocMem, WinCreateHeap
  20384.  
  20385.  
  20386.  ────────────────────────────────────────────────────────────────────────────
  20387.  WinLockVisRegions
  20388.  ────────────────────────────────────────────────────────────────────────────
  20389.    BOOL WinLockVisRegions (hwndDesktop, fLock)
  20390.    HWND hwndDesktop;       /*handle of the desktop                         */
  20391.    BOOL fLock;             /*lock/unlock flag                              */
  20392.  
  20393.    The WinLockVisRegions function locks or unlocks the visible regions of all
  20394.    windows on the screen, preventing any of the visible regions from
  20395.    changing.
  20396.  
  20397.  Parameters
  20398.  
  20399.    hwndDesktop  Identifies the desktop window. This parameter can be
  20400.    HWND_DESKTOP or the desktop window handle.
  20401.  
  20402.    fLock  Specifies whether to lock or unlock the visible regions. If TRUE,
  20403.    the visible regions are locked. If FALSE, the visible regions are
  20404.    unlocked.
  20405.  
  20406.  Comments
  20407.  
  20408.    This function is used to prevent a window's visible regions from changing
  20409.    while a thread performs a screen operation. For example, WinLockVisRegions
  20410.    should be used if the application is moving bits from one part of a window
  20411.    to another. Calling WinLockVisRegions during this operation ensures that
  20412.    no other window will appear on top of the window that bits are being
  20413.    copied from and therefore no physical change in the bits will take place.
  20414.    Using WinLockWindowUpdate for this bit copying will not work, because
  20415.    although no bits will changed in the locked area, it is still possible
  20416.    that the visible region of the presentation space being used for the bit
  20417.    copying might change.
  20418.  
  20419.    While the visible regions are locked, no messages should be sent and no
  20420.    functions called that could send messages.
  20421.  
  20422.    Only one thread can lock the visible regions at any one time. The same
  20423.    thread can call WinLockVisRegions multiple times. A lock count is
  20424.    maintained by the system and is incremented each time a locking call is
  20425.    made and decremented each time an unlocking call is made. The visible
  20426.    regions are unlocked when the count is zero.
  20427.  
  20428.    If WinLockVisRegions is called while another thread has locked the visible
  20429.    regions, the function will not return until the thread locking the visible
  20430.    regions has unlocked them.
  20431.  
  20432.  Return Value
  20433.  
  20434.    The return value is TRUE if the function is successful or FALSE if an
  20435.    error occurs.
  20436.  
  20437.  See Also
  20438.  
  20439.    WinLockWindowUpdate
  20440.  
  20441.  
  20442.  ────────────────────────────────────────────────────────────────────────────
  20443.  WinLockWindow
  20444.  ────────────────────────────────────────────────────────────────────────────
  20445.    HWND WinLockWindow (hwnd, fLock)
  20446.    HWND hwnd;              /*handle of the window                          */
  20447.    BOOL fLock;             /*lock/unlock flag                              */
  20448.  
  20449.    The WinLockWindow function locks or unlocks a specified window. A window
  20450.    cannot be destroyed while it is locked.
  20451.  
  20452.  Parameters
  20453.  
  20454.    hwnd  Identifies the window to be locked or unlocked.
  20455.  
  20456.    fLock  Specifies whether the window is to be locked or unlocked. If TRUE,
  20457.    the window is locked. If FALSE, the window is unlocked.
  20458.  
  20459.  Return Value
  20460.  
  20461.    The return value is the handle of the window that was locked or unlocked
  20462.    if the function is successful. It is NULL if an error occurred.
  20463.  
  20464.  Comments
  20465.  
  20466.    If the WinDestroyWindow function is called with a locked window handle,
  20467.    the window is not destroyed until the window is unlocked.
  20468.  
  20469.    A count is maintained of the number of times a window has been locked
  20470.    without a corresponding call to unlock the window. The window cannot be
  20471.    destroyed until the count is zero. The WinQueryWindowLockCount function
  20472.    can be called to get the current lock count.
  20473.  
  20474.  See Also
  20475.  
  20476.    WinDestroyWindow, WinLockWindowUpdate, WinQueryWindowLockCount
  20477.  
  20478.  
  20479.  ────────────────────────────────────────────────────────────────────────────
  20480.  WinLockWindowUpdate
  20481.  ────────────────────────────────────────────────────────────────────────────
  20482.    BOOL WinLockWindowUpdate (hwndDesktop, hwndLockUpdate)
  20483.    HWND hwndDesktop;       /*handle of the desktop                         */
  20484.    HWND hwndLockUpdate;    /*handle of the window to lock/unlock           */
  20485.  
  20486.    The WinLockWindowUpdate function prevents or allows the updating of a
  20487.    window and its child windows. While updating is locked, no drawing will
  20488.    take place on the screen. When updating is unlocked, portions of the
  20489.    screen are invalidated and repainted.
  20490.  
  20491.  Parameters
  20492.  
  20493.    hwndDesktop  Identifies the desktop window. This parameter can be
  20494.    HWND_DESKTOP or the desktop window handle.
  20495.  
  20496.    hwndLockUpdate  Identifies the window to be locked. If this parameter is
  20497.    NULL, all windows are unlocked.
  20498.  
  20499.  Return Value
  20500.  
  20501.    The return value is TRUE if the function is successful or FALSE if an
  20502.    error occurs.
  20503.  
  20504.  See Also
  20505.  
  20506.    WinLockVisRegions
  20507.  
  20508.  
  20509.  ────────────────────────────────────────────────────────────────────────────
  20510.  WinMapDlgPoints
  20511.  ────────────────────────────────────────────────────────────────────────────
  20512.    BOOL WinMapDlgPoints (hwndDlg, pptl, cwpt, fCalcWindowCoords)
  20513.    HWND hwndDlg;           /*handle of the dialog window                   */
  20514.    PPOINTL pptl;           /*address of array of structures with points    */
  20515.                            /*to map                                        */
  20516.    USHORT cwpt;            /*number of POINTL structures                   */
  20517.    BOOL fCalcWindowCoords; /*type of points                                */
  20518.  
  20519.    The WinMapDlgPoints function converts points of a dialog window from
  20520.    dialog coordinates to window coordinates or from window coordinates to
  20521.    dialog coordinates.
  20522.  
  20523.  Parameters
  20524.  
  20525.    hwndDlg  Identifies the dialog window.
  20526.  
  20527.    pptl  Points to the array of POINTL structures that contain the points to
  20528.    be converted. The converted points are substituted in the array. The
  20529.    POINTL structure has the following form:
  20530.  
  20531.    typedef struct _POINTL  {
  20532.        LONG  x;
  20533.        LONG  y;
  20534.    } POINTL;
  20535.  
  20536.    For a full description, see Chapter 4, "Types, Macros, Structures."
  20537.  
  20538.    cwpt  Specifies the number of POINTL structures in the pptl array.
  20539.  
  20540.    fCalcWindowCoords  Specifies the type of points to convert. If TRUE, the
  20541.    points are dialog coordinates and are converted to window coordinates
  20542.    relative to the dialog window. If FALSE, the points are window coordinates
  20543.    relative to the dialog window and are converted to dialog coordinates.
  20544.  
  20545.  Return Value
  20546.  
  20547.    The return value is TRUE if the function is successful or FALSE if an
  20548.    error occurs.
  20549.  
  20550.  See Also
  20551.  
  20552.    WinMapWindowPoints
  20553.  
  20554.  
  20555.  ────────────────────────────────────────────────────────────────────────────
  20556.  WinMapWindowPoints
  20557.  ────────────────────────────────────────────────────────────────────────────
  20558.    BOOL WinMapWindowPoints (hwndFrom, hwndTo, pptl, cwpt)
  20559.    HWND hwndFrom;          /*handle of the window to be mapped from        */
  20560.    HWND hwndTo;            /*handle of the window to be mapped to          */
  20561.    PPOINTL pptl;           /*address of array of structures with points    */
  20562.                            /*to map                                        */
  20563.    SHORT cwpt;             /*number of POINTL structures                   */
  20564.  
  20565.    The WinMapWindowPoints function converts a set of points from a coordinate
  20566.    space relative to one window to a coordinate space relative to another
  20567.    window.
  20568.  
  20569.  Parameters
  20570.  
  20571.    hwndFrom  Identifies the window from which points are converted. If this
  20572.    parameter is NULL or HWND_DESKTOP, the points are assumed to be in screen
  20573.    coordinates.
  20574.  
  20575.    hwndTo  Identifies the window to which points are converted. If this
  20576.    parameter is NULL or HWND_DESKTOP, the points are converted to screen
  20577.    coordinates.
  20578.  
  20579.    pptl  Points to an array of POINTL structures that contain the set of
  20580.    points. This parameter can also point to a RECTL structure, in which case
  20581.    the cwpt parameter should be set to 2. The POINTL structure has the
  20582.    following form:
  20583.  
  20584.    typedef struct _POINTL  {
  20585.        LONG  x;
  20586.        LONG  y;
  20587.    } POINTL;
  20588.  
  20589.    The RECTL structure has the following form:
  20590.  
  20591.    typedef struct _RECTL {    /* rcl */
  20592.        LONG  xLeft;
  20593.        LONG  yBottom;
  20594.        LONG  xRight;
  20595.        LONG  yTop;
  20596.    } RECTL;
  20597.  
  20598.    For a full description, see Chapter 4, "Types, Macros, Structures."
  20599.  
  20600.    cwpt  Specifies the number of POINTL structures in the pptl array.
  20601.  
  20602.  Return Value
  20603.  
  20604.    The return value is TRUE if the function is successful or FALSE if an
  20605.    error occurs.
  20606.  
  20607.  See Also
  20608.  
  20609.    WinMapDlgPoints
  20610.  
  20611.  
  20612.  ────────────────────────────────────────────────────────────────────────────
  20613.  WinMessageBox
  20614.  ────────────────────────────────────────────────────────────────────────────
  20615.    USHORT WinMessageBox (hwndParent, hwndOwner, pszText, pszCaption,
  20616.    idWindow, flStyle)
  20617.    HWND hwndParent;        /*handle of the parent window                   */
  20618.    HWND hwndOwner;         /*handle of the owner window                    */
  20619.    PSZ pszText;            /*address of text in message box                */
  20620.    PSZ pszCaption;         /*address of title of message box               */
  20621.    USHORT idWindow;        /*message-box identifier                        */
  20622.    USHORT flStyle;         /*type of message box                           */
  20623.  
  20624.    The WinMessageBox function creates, displays, and operates a message-box
  20625.    window. The message-box window consists of a message and a simple dialog
  20626.    with the user.
  20627.  
  20628.  Parameters
  20629.  
  20630.    hwndParent  Identifies the parent window of the newly created message-box
  20631.    window. This parameter is the desktop-window handle, HWND_DESKTOP, or NULL
  20632.    if the message box is a main window.
  20633.  
  20634.    hwndOwner  Identifies the owner window of the message-box window. The
  20635.    owner window is activated when WinMessageBox returns.
  20636.  
  20637.    pszText  Points to the text displayed as the message within the
  20638.    message-box window. The text will be automatically wrapped as necessary to
  20639.    fit within the message box. The "\n" characters can be used to force a
  20640.    line break, however this is not recommended except between paragraphs, as
  20641.    different fonts could change the appearance of the text.
  20642.  
  20643.    pszCaption  Points to the title of the message-box window. If this
  20644.    parameter is NULL, "Error" (the default title) is displayed. The maximum
  20645.    length of the text is device-dependent. If the text is too long, it will
  20646.    be clipped.
  20647.  
  20648.    idWindow  Identifies the identifier of the message-box window. This value
  20649.    is passed to the HK_HELP hook if the WM_HELP message is received by the
  20650.    message-box window.
  20651.  
  20652.    flStyle  Specifies the type of message-box window created. This parameter
  20653.    consists of a button flag, an icon flag, a default button flag, and any
  20654.    number of special flags. The following four lists describe the available
  20655.    flags which can be combined using the OR operator together for this
  20656.    parameter:
  20657.  
  20658.    Buttons                  Meaning
  20659.    ──────────────────────────────────────────────────────────────────────────
  20660.    MB_ABORTRETRYIGNORE      Message box contains Abort, Retry, and Ignore
  20661.                             push buttons.
  20662.  
  20663.    MB_ENTER                 Message box contains an Enter push button.
  20664.  
  20665.    MB_ENTERCANCEL           Message box contains Enter and Cancel push
  20666.                             buttons.
  20667.  
  20668.    MB_OK                    Message box contains an OK push button.
  20669.  
  20670.    MB_OKCANCEL              Message box contains OK and Cancel push buttons.
  20671.  
  20672.    MB_RETRYCANCEL           Message box contains Retry and Cancel push
  20673.                             buttons.
  20674.  
  20675.    MB_YESNO                 Message box contains Yes and No push buttons.
  20676.  
  20677.    MB_YESNOCANCEL           Message box contains Yes, No, and Cancel push
  20678.                             buttons.
  20679.    ──────────────────────────────────────────────────────────────────────────
  20680.  
  20681.    Icon                     Meaning
  20682.    ──────────────────────────────────────────────────────────────────────────
  20683.    MB_ICONASTERISK          Message box contains asterisk icon.
  20684.  
  20685.    MB_ICONEXCLAMATION       Message box contains exclamation-point icon.
  20686.  
  20687.    MB_ICONHAND              Message box contains hand icon.
  20688.  
  20689.    MB_ICONQUESTION          Message box contains question-mark icon.
  20690.  
  20691.    MB_NOICON                Message box does not contain an icon.
  20692.    ──────────────────────────────────────────────────────────────────────────
  20693.  
  20694.    Default button           Meaning
  20695.    ──────────────────────────────────────────────────────────────────────────
  20696.    MB_DEFBUTTON1            First button is the default (first button is
  20697.                             always the default unless MB_DEFBUTTON2 or
  20698.                             MB_DEFBUTTON3 is specified).
  20699.  
  20700.    MB_DEFBUTTON2            Second button is the default.
  20701.  
  20702.    MB_DEFBUTTON3            Third button is the default.
  20703.    ──────────────────────────────────────────────────────────────────────────
  20704.  
  20705.    Special flags            Meaning
  20706.    ──────────────────────────────────────────────────────────────────────────
  20707.    MB_APPLMODAL             Message box is application modal.
  20708.  
  20709.    MB_SYSTEMMODAL           Message box is system modal.
  20710.  
  20711.    MB_HELP                  Message box contains Help push button.
  20712.  
  20713.    MB_MOVEABLE              Message box is movable.
  20714.    ──────────────────────────────────────────────────────────────────────────
  20715.  
  20716.  Return Value
  20717.  
  20718.    The return value indicates the user's response to the message. It can be
  20719.    one of the following vlaues:
  20720.  
  20721.    Value                    Meaning
  20722.    ──────────────────────────────────────────────────────────────────────────
  20723.    MBID_ABORT               Abort button was selected.
  20724.  
  20725.    MBID_CANCEL              Cancel button was selected.
  20726.  
  20727.    MBID_ENTER               Enter button was selected.
  20728.  
  20729.    MBID_IGNORE              Ignore button was selected.
  20730.  
  20731.    MBID_NO                  No button was selected.
  20732.  
  20733.    MBID_OK                  OK button was selected.
  20734.  
  20735.    MBID_RETRY               Retry button was selected.
  20736.  
  20737.    MBID_YES                 Yes button was selected.
  20738.  
  20739.    MDID_ERROR               The WinMessageBox function failed──an error
  20740.                             occurred.
  20741.    ──────────────────────────────────────────────────────────────────────────
  20742.  
  20743.    If a message box has a Cancel button, MBID_CANCEL is returned if the
  20744.    ESCAPE key is pressed or if the Cancel button is selected. If the message
  20745.    box has no Cancel button, pressing the ESCAPE key has no effect.
  20746.  
  20747.  Comments
  20748.  
  20749.    If a message-box window is created as part of the processing of a dialog
  20750.    window, the dialog window should be made the owner of the message-box
  20751.    window.
  20752.  
  20753.    If a system modal message-box window is created to tell the user that the
  20754.    system is running out of memory, the strings passed into this function
  20755.    should not be taken from a resource file because an attempt to load the
  20756.    resource file may fail due to lack of memory. Such a message-box window
  20757.    can safely use the hand icon (MB_ICONHAND), however, because this icon is
  20758.    always memory-resident.
  20759.  
  20760.  Example
  20761.  
  20762.    This example shows a typical use of the WinMessageBox function when
  20763.    debugging an application. The C run-time function sprintf is used to
  20764.    format the body of the message. In this case, it converts the coordinates
  20765.    of the mouse pointer (retrieved with the WinQueryPointerPos function) into
  20766.    a string. The string is then displayed by calling WinMessageBox.
  20767.  
  20768.    CHAR szMsg[100];
  20769.    POINTL ptl;
  20770.  
  20771.    WinQueryPointerPos(HWND_DESKTOP, &ptl);
  20772.    sprintf(szMsg, "x = %ld   y = %ld", ptl.x, ptl.y);
  20773.    WinMessageBox(HWND_DESKTOP,
  20774.        hwndClient,                /* client-window handle  */
  20775.        szMsg,                     /* body of the message   */
  20776.        "Debugging information",   /* title of the message  */
  20777.        0,                         /* message box id        */
  20778.        MB_NOICON | MB_OK);        /* icon and button flags */
  20779.  
  20780.  See Also
  20781.  
  20782.    WinFlashWindow
  20783.  
  20784.  
  20785.  ────────────────────────────────────────────────────────────────────────────
  20786.  WinMsgMuxSemWait
  20787.  ────────────────────────────────────────────────────────────────────────────
  20788.    USHORT WinMsgMuxSemWait (pisemCleared, pmxsl, lTimeOut)
  20789.    PUSHORT pisemCleared;   /*address of variable that receives             */
  20790.                            /*index number                                  */
  20791.    PVOID pmxsl;            /*address of structure with semaphore list      */
  20792.    LONG lTimeOut;          /*length of time to wait                        */
  20793.  
  20794.    The WinMsgMuxSemWait function waits for one or more of the specified
  20795.    semaphores to clear. This function checks the specified list. If any of
  20796.    the semaphores are clear, the function returns. Otherwise, the function
  20797.    waits until the specified time elapses or until one of the semaphores in
  20798.    the list clears.
  20799.  
  20800.  Parameters
  20801.  
  20802.    pisemCleared  Points to the variable that receives the index number of the
  20803.    most recently cleared semaphore.
  20804.  
  20805.    pmxsl  Points to the MUXSEMLIST structure containing a semaphore list that
  20806.    defines the semaphores to be cleared. The semaphore list consists of one
  20807.    or more semaphore handles. The MUXSEMLIST structure has the following
  20808.    form:
  20809.  
  20810.    typedef struct _MUXSEMLIST {
  20811.        USHORT cmxs;
  20812.        MUXSEM amxs[16];
  20813.    } MUXSEMLIST;
  20814.  
  20815.    The structure may contain up to 16 semaphores.
  20816.  
  20817.    For a full description, see Chapter 4, "Types, Macros, Structures."
  20818.  
  20819.    lTimeOut  Specifies how long to wait for the semaphores to become
  20820.    available. If the value is greater then zero, this parameter specifies the
  20821.    number of milliseconds to wait before returning. If the value is
  20822.    SEM_IMMEDIATE_RETURN, the function returns immediately. If the value is
  20823.    SEM_INDEFINITE_WAIT, the function waits indefinitely.
  20824.  
  20825.  Return Value
  20826.  
  20827.    The return value is zero if the function is successful. Otherwise, it is
  20828.    an error value, which may be one of the following:
  20829.  
  20830.          ERROR_EXCL_SEM_ALREADY_OWNED
  20831.          ERROR_INTERRUPT
  20832.          ERROR_INVALID_EVENT_COUNT
  20833.          ERROR_INVALID_HANDLE
  20834.          ERROR_INVALID_LIST_FORMAT
  20835.          ERROR_SEM_TIMEOUT
  20836.          ERROR_TOO_MANY_MUXWAITERS
  20837.  
  20838.  Comments
  20839.  
  20840.    This function is identical to the DosMuxSemWait function with the
  20841.    following exceptions: Window messages sent via the WinSendMsg function by
  20842.    another thread may be received; the function can wait for 15 semaphores
  20843.    simultaneously (DosMaxSemWait can wait for 16).
  20844.  
  20845.    This function should be used to wait for a semaphore when the semaphore
  20846.    owner may need to issue a WinSendMsg function (or another Win function
  20847.    that implicitly issues a WinSendMsg function) before clearing the
  20848.    semaphore.
  20849.  
  20850.  See Also
  20851.  
  20852.    DosMuxSemWait, WinMsgSemWait, WinSendMsg
  20853.  
  20854.  
  20855.  ────────────────────────────────────────────────────────────────────────────
  20856.  WinMsgSemWait
  20857.  ────────────────────────────────────────────────────────────────────────────
  20858.    USHORT WinMsgSemWait (hsem, lTimeOut)
  20859.    HSEM hsem;              /*handle of the semaphore                       */
  20860.    LONG lTimeOut;          /*time-out value                                */
  20861.  
  20862.    The WinMsgSemWait function waits for a specified semaphore to be cleared.
  20863.    WinMsgSemWait waits until a thread uses the DosSemClear function to clear
  20864.    the semaphore or until a time-out occurs. If no previous thread has set
  20865.    the semaphore, WinMsgSemWait returns immediately.
  20866.  
  20867.  Parameters
  20868.  
  20869.    hsem  Identifies the semaphore to set. This value can be the handle of a
  20870.    system semaphore that has been previously created or opened by using the
  20871.    DosCreateSem or DosOpenSem function, or it can be the address of a RAM
  20872.    semaphore.
  20873.  
  20874.    lTimeOut  Specifies how long to wait for the semaphore to clear. If the
  20875.    value is greater then zero, this parameter specifies the number of
  20876.    milliseconds to wait before returning. If the value is
  20877.    SEM_IMMEDIATE_RETURN, the function returns immediately. If the value is
  20878.    SEM_INDEFINITE_WAIT, the function waits indefinitely.
  20879.  
  20880.  Return Value
  20881.  
  20882.    The return value is zero if the function is successful. Otherwise, it is
  20883.    an error value, which may be one of the following:
  20884.  
  20885.          ERROR_EXCL_SEM_ALREADY_OWNED
  20886.          ERROR_INTERRUPT
  20887.          ERROR_INVALID_HANDLE
  20888.          ERROR_SEM_TIMEOUT
  20889.  
  20890.  Comments
  20891.  
  20892.    This function is identical to DosSemWait except that in addition to
  20893.    waiting on the specified semaphore, window messages sent via the
  20894.    WinSendMsg function by another thread may be received.
  20895.  
  20896.  See Also
  20897.  
  20898.    DosCreateSem, DosOpenSem, DosSemClear, DosSemWait, WinMsgMuxSemWait,
  20899.    WinSendMsg
  20900.  
  20901.  
  20902.  ────────────────────────────────────────────────────────────────────────────
  20903.  WinMultWindowFromIDs
  20904.  ────────────────────────────────────────────────────────────────────────────
  20905.    SHORT WinMultWindowFromIDs (hwndParent, phwnd, idFirst, idLast)
  20906.    HWND hwndParent;        /*handle of the parent window                   */
  20907.    PHWND phwnd;            /*address of array of window handles            */
  20908.    USHORT idFirst;         /*first window identifier in range              */
  20909.    USHORT idLast;          /*last window identifier in range               */
  20910.  
  20911.    The WinMultWindowFromIDs function finds the handles of specified child
  20912.    windows that have window-identifier values within a specified range. This
  20913.    function may be used to enumerate all the items in a dialog group, for
  20914.    example, or to enumerate all the frame controls of a standard window. This
  20915.    function is faster than making individual calls to the WinWindowFromID
  20916.    function.
  20917.  
  20918.  Parameters
  20919.  
  20920.    hwndParent  Identifies the parent window.
  20921.  
  20922.    phwnd  Points to the array that contains the window handles. This array
  20923.    must contain (idLast - idFirst + 1) elements; the zero-based index of a
  20924.    window in the array is (idWindow - idFirst), where idWindow is the window
  20925.    identifier of the specified window. If there is no window for a window
  20926.    identifier within the range, the corresponding element in the array is
  20927.    NULL.
  20928.  
  20929.    idFirst  Identifies the first window-identifier value in the range
  20930.    (inclusive).
  20931.  
  20932.    idLast  Identifies the last window-identifier value in the range
  20933.    (inclusive).
  20934.  
  20935.  Return Value
  20936.  
  20937.    The return value is the number of window handles returned in the array.
  20938.    The return value is zero if no window handles are returned.
  20939.  
  20940.  See Also
  20941.  
  20942.    WinWindowFromID
  20943.  
  20944.  ────────────────────────────────────────────────────────────────────────────
  20945.  WinNextChar
  20946.  ────────────────────────────────────────────────────────────────────────────
  20947.    PSZ WinNextChar (hab, idcp, idcc, psz)
  20948.    HAB hab;                /*handle of the anchor block                    */
  20949.    USHORT idcp;            /*code page                                     */
  20950.    USHORT idcc;            /*country code                                  */
  20951.    PSZ psz;                /*address of character in string                */
  20952.  
  20953.    The WinNextChar function moves to the next character in a string.
  20954.  
  20955.  Parameters
  20956.  
  20957.    hab  Identifies the anchor block.
  20958.  
  20959.    idcp  Identifies the code page.
  20960.  
  20961.    idcc  Identifies the country code.
  20962.  
  20963.    psz  Points to a character in a null-terminated string.
  20964.  
  20965.  Return Value
  20966.  
  20967.    The return value points to the next character in the string or the NULL
  20968.    terminating character.
  20969.  
  20970.  See Also
  20971.  
  20972.    WinPrevChar
  20973.  
  20974.  
  20975.  ────────────────────────────────────────────────────────────────────────────
  20976.  WinOffsetRect
  20977.  ────────────────────────────────────────────────────────────────────────────
  20978.    BOOL WinOffsetRect (hab, prcl, cx, cy)
  20979.    HAB hab;                /*handle of the anchor block                    */
  20980.    PRECTL prcl;            /*address of the structure with rectangle       */
  20981.    SHORT cx;               /*horizontal offset                             */
  20982.    SHORT cy;               /*vertical offset                               */
  20983.  
  20984.    The WinOffsetRect function offsets a rectangle by adding a specified value
  20985.    to both the left and right coordinates and adding a specified value to
  20986.    both the top and bottom coordinates.
  20987.  
  20988.  Parameters
  20989.  
  20990.    hab  Identifies an anchor block.
  20991.  
  20992.    prcl  Points to the RECTL structure that contains the rectangle to be
  20993.    offset. The RECTL structure has the following form:
  20994.  
  20995.    typedef struct _RECTL {
  20996.        LONG  xLeft;
  20997.        LONG  yBottom;
  20998.        LONG  xRight;
  20999.        LONG  yTop;
  21000.    } RECTL;
  21001.  
  21002.    For a full description, see Chapter 4, "Types, Macros, Structures."
  21003.  
  21004.    cx  Specifies the value of the horizontal offset. This value is added to
  21005.    the left and right sides of the rectangle.
  21006.  
  21007.    cy  Specifies the value of the vertical offset. This value is added to the
  21008.    top and bottom sides of the rectangle.
  21009.  
  21010.  Return Value
  21011.  
  21012.    The return value is TRUE if the function is successful or FALSE if an
  21013.    error occurs.
  21014.  
  21015.  See Also
  21016.  
  21017.    WinInflateRect
  21018.  
  21019.  
  21020.  ────────────────────────────────────────────────────────────────────────────
  21021.  WinOpenClipbrd
  21022.  ────────────────────────────────────────────────────────────────────────────
  21023.    BOOL WinOpenClipbrd (hab)
  21024.    HAB hab;                /*handle of the anchor block                    */
  21025.  
  21026.    The WinOpenClipbrd function opens the clipboard and prevents other threads
  21027.    and processes from examining or changing the clipboard contents. If
  21028.    another thread or process already has the clipboard open, this function
  21029.    does not return until the clipboard is closed.
  21030.  
  21031.    Messages can be received from other threads and processes during the
  21032.    processing of this function.
  21033.  
  21034.  Parameters
  21035.  
  21036.    hab  Identifies the anchor block.
  21037.  
  21038.  Return Value
  21039.  
  21040.    The return value is TRUE if the function is successful or FALSE if an
  21041.    error occurs.
  21042.  
  21043.  See Also
  21044.  
  21045.    WinCloseClipbrd, WinEnumClipbrdFmts
  21046.  
  21047.  
  21048.  ────────────────────────────────────────────────────────────────────────────
  21049.  WinOpenWindowDC
  21050.  ────────────────────────────────────────────────────────────────────────────
  21051.    HDC WinOpenWindowDC (hwnd)
  21052.    HWND hwnd;              /*handle of the window                          */
  21053.  
  21054.    The WinOpenWindowDC function opens a device context for a window.
  21055.  
  21056.  Parameters
  21057.  
  21058.    hwnd  Identifies the window with the device context.
  21059.  
  21060.  Return Value
  21061.  
  21062.    The return value is the handle of the device context.
  21063.  
  21064.  Comments
  21065.  
  21066.    Only one device context can be opened for each window.
  21067.  
  21068.    A handle to a device context is used to associate a presentation space
  21069.    with the window.
  21070.  
  21071.    The window device context is automatically closed when its associated
  21072.    window is destroyed. It must not be closed with the DevCloseDC function.
  21073.  
  21074.    This function is used by applications that typically have a lot of state
  21075.    information associated with a presentation space, such as coordinate
  21076.    mapping transforms, attributes, fonts, etc. This interface provides a
  21077.    "global" presentation space for a given window. This global can be kept in
  21078.    the application until the window is destroyed.
  21079.  
  21080.  See Also
  21081.  
  21082.    WinQueryWindowDC
  21083.  
  21084.  
  21085.  ────────────────────────────────────────────────────────────────────────────
  21086.  WinPeekMsg
  21087.  ────────────────────────────────────────────────────────────────────────────
  21088.    BOOL WinPeekMsg (hab, pqmsg, hwndFilter, msgFilterFirst, msgFilterLast,
  21089.    fs)
  21090.    HAB hab;                /*handle of the anchor block                    */
  21091.    PQMSG pqmsg;            /*address of structure                          */
  21092.    HWND hwndFilter;        /*handle of the filter window                   */
  21093.    USHORT msgFilterFirst;  /*first message                                 */
  21094.    USHORT msgFilterLast;   /*last message                                  */
  21095.    USHORT fs;              /*status of message in queue                    */
  21096.  
  21097.    The WinPeekMsg function inspects the thread's message queue.
  21098.  
  21099.  Parameters
  21100.  
  21101.    hab  Identifies the anchor block.
  21102.  
  21103.    pqmsg  Points to the QMSG structure. The QMSG structure has the following
  21104.    form:
  21105.  
  21106.    typedef struct _QMSG {
  21107.        HWND hwnd;
  21108.        USHORT msg;
  21109.        MPARAM mp1;
  21110.        MPARAM mp2;
  21111.        ULONG time;
  21112.        POINTL ptl;
  21113.    } QMSG;
  21114.  
  21115.    For a full description, see Chapter 4, "Types, Macros, Structures."
  21116.  
  21117.    hwndFilter  Identifies the window filter.
  21118.  
  21119.    msgFilterFirst  Specifies the first message.
  21120.  
  21121.    msgFilterLast  Specifies the last message.
  21122.  
  21123.    fs  Specifies whether to remove the message from the queue. If this
  21124.    parameter is PM_REMOVE, the message is removed from the queue. If this
  21125.    parameter is PM_NOREMOVE, the message remains in the queue. An application
  21126.    should specify only one of these flags. If neither flag is specified, the
  21127.    message is not removed. If both are specified, the message is removed.
  21128.  
  21129.  Return Value
  21130.  
  21131.    The return value is TRUE if a message is available, or it is FALSE if no
  21132.    message is available.
  21133.  
  21134.  Comments
  21135.  
  21136.    This function is identical to the WinGetMsg function, except that it does
  21137.    not wait for the arrival of a message and allows for leaving the message
  21138.    in the queue.
  21139.  
  21140.    The constants WM_MOUSEFIRST and WM_MOUSELAST can be used for
  21141.    msgFilterFirst and msgFilterLast to filter all but mouse messages.
  21142.  
  21143.    The constants WM_BUTTONCLICKFIRST and WM_BUTTONCLICKLAST can be used for
  21144.    msgFilterFirst and msgFilterLast to filter all but mouse button messages.
  21145.  
  21146.    The constants WM_DDE_FIRST and WM_DDE_LAST can be used for msgFilterFirst
  21147.    and msgFilterLast to filter all but dynamic data exchange messages.
  21148.  
  21149.  See Also
  21150.  
  21151.    WinGetMsg
  21152.  
  21153.  
  21154.  ────────────────────────────────────────────────────────────────────────────
  21155.  WinPostMsg
  21156.  ────────────────────────────────────────────────────────────────────────────
  21157.    BOOL WinPostMsg (hwnd, msg, mp1, mp2)
  21158.    HWND hwnd;              /*handle of the window to post message to       */
  21159.    USHORT msg;             /*message                                       */
  21160.    MPARAM mp1;             /*first message parameter                       */
  21161.    MPARAM mp2;             /*second message parameter                      */
  21162.  
  21163.    The WinPostMsg function posts a message to the message queue for the
  21164.    specified window.
  21165.  
  21166.  Parameters
  21167.  
  21168.    hwnd  Identifies the window to post the message to. If this parameter is
  21169.    NULL, the message is posted to the queue associated with the current
  21170.    thread.
  21171.  
  21172.    msg  Specifies the message.
  21173.  
  21174.    mp1  Specifies the first message parameter.
  21175.  
  21176.    mp2  Specifies second message parameter.
  21177.  
  21178.  Return Value
  21179.  
  21180.    The return value is TRUE if the function is successful or FALSE if an
  21181.    error occurs.
  21182.  
  21183.  Comments
  21184.  
  21185.    The following are some of the differences between WinPostMsg and
  21186.    WinSendMsg:
  21187.  
  21188.    ■  WinPostMsg returns immediately. WinSendMsg waits for the receiver to
  21189.       return.
  21190.  
  21191.    ■  A thread that does not have a message queue can still call WinPostMsg.
  21192.       It cannot call WinSendMsg.
  21193.  
  21194.    ■  Calling WinSendMsg to send a message to another thread is costly in
  21195.       terms of CPU time. This is not true of the WinPostMsg.
  21196.  
  21197.  See Also
  21198.  
  21199.    WinBroadcastMsg, WinGetMsg, WinPeekMsg, WinSendMsg
  21200.  
  21201.  
  21202.  ────────────────────────────────────────────────────────────────────────────
  21203.  WinPostQueueMsg
  21204.  ────────────────────────────────────────────────────────────────────────────
  21205.    BOOL WinPostQueueMsg (hmq, msg, mp1, mp2)
  21206.    HMQ hmq;                /*handle of the message queue                   */
  21207.    USHORT msg;             /*message                                       */
  21208.    MPARAM mp1;             /*first message parameter                       */
  21209.    MPARAM mp2;             /*second message parameter                      */
  21210.  
  21211.    The WinPostQueueMsg function posts a message to a message queue. This
  21212.    function can be used to post messages to any queue in the system.
  21213.  
  21214.  Parameters
  21215.  
  21216.    hmq  Identifies the message queue.
  21217.  
  21218.    msg  Specifies the message.
  21219.  
  21220.    mp1  Specifies the first message parameter.
  21221.  
  21222.    mp2  Specifies the second message parameter.
  21223.  
  21224.  Return Value
  21225.  
  21226.    The return value is TRUE if the function is successful or FALSE if an
  21227.    error occurs or if the queue was full.
  21228.  
  21229.  Comments
  21230.  
  21231.    The last three parameters are placed into the queue as part of a QMSG
  21232.    structure. The QMSG hwnd field is set to NULL, and the QMSG time and pt
  21233.    fields are derived from the system time and mouse position at the time
  21234.    WinPostQueueMsg was called.
  21235.  
  21236.  See Also
  21237.  
  21238.    WinPostMsg, WinSendMsg
  21239.  
  21240.  
  21241.  ────────────────────────────────────────────────────────────────────────────
  21242.  WinPrevChar
  21243.  ────────────────────────────────────────────────────────────────────────────
  21244.    PSZ WinPrevChar (hab, idcp, idcc, pszStart, psz)
  21245.    HAB hab;                /*handle of the anchor block                    */
  21246.    USHORT idcp;            /*code page                                     */
  21247.    USHORT idcc;            /*country code                                  */
  21248.    PSZ pszStart;           /*address of string with character              */
  21249.    PSZ psz;                /*address of character in string                */
  21250.  
  21251.    The WinPrevChar function moves to the previous character in a string.
  21252.  
  21253.  Parameters
  21254.  
  21255.    hab  Identifies the anchor block.
  21256.  
  21257.    idcp  Identifies the code page.
  21258.  
  21259.    idcc  Identifies the country code.
  21260.  
  21261.    pszStart  Points to the character string that contains the character
  21262.    pointed to by the psz parameter.
  21263.  
  21264.    psz  Points to a character in the string pointed to by the pszStart
  21265.    parameter.
  21266.  
  21267.  Return Value
  21268.  
  21269.    The return value points to the previous character in a string, or to the
  21270.    first character if the psz parameter equals the pszStart parameter.
  21271.  
  21272.  See Also
  21273.  
  21274.    WinNextChar
  21275.  
  21276.  
  21277.  ────────────────────────────────────────────────────────────────────────────
  21278.  WinProcessDlg
  21279.  ────────────────────────────────────────────────────────────────────────────
  21280.    USHORT WinProcessDlg (hwndDlg)
  21281.    HWND hwndDlg;           /*handle of the dialog queue                    */
  21282.  
  21283.    The WinProcessDlg function processes messages intended for a dialog
  21284.    window. This function does not return until the WinDismissDlg function is
  21285.    called by the dialog procedure.
  21286.  
  21287.  Parameters
  21288.  
  21289.    hwndDlg  Identifies a dialog window.
  21290.  
  21291.  Return Value
  21292.  
  21293.    The return value is set to the value returned by the WinDismissDlg
  21294.    function.
  21295.  
  21296.  See Also
  21297.  
  21298.    WinDismissDlg, WinDlgBox, WinLoadDlg
  21299.  
  21300.  
  21301.  ────────────────────────────────────────────────────────────────────────────
  21302.  WinPtInRect
  21303.  ────────────────────────────────────────────────────────────────────────────
  21304.    BOOL WinPtInRect (hab, prcl, pptl)
  21305.    HAB hab;                /*handle of the anchor block                    */
  21306.    PRECTL prcl;            /*address of structure with rectangle           */
  21307.                            /*coordinates                                   */
  21308.    PPOINTL pptl;           /*address of structure with point coordinates   */
  21309.  
  21310.    The WinPtInRect function determines whether a point lies within a
  21311.    rectangle.
  21312.  
  21313.  Parameters
  21314.  
  21315.    hab  Identifies an anchor block.
  21316.  
  21317.    prcl  Points to a RECTL structure containing the rectangle to be checked.
  21318.    The RECTL structure has the following form:
  21319.  
  21320.    typedef struct _RECTL {
  21321.        LONG  xLeft;
  21322.        LONG  yBottom;
  21323.        LONG  xRight;
  21324.        LONG  yTop;
  21325.    } RECTL;
  21326.  
  21327.    For a full description, see Chapter 4, "Types, Macros, Structures."
  21328.  
  21329.    pptl  Points to a POINTL structure containing the point to be checked. The
  21330.    POINTL structure has the following form:
  21331.  
  21332.    typedef struct _POINTL {
  21333.        LONG  x;
  21334.        LONG  y;
  21335.    } POINTL;
  21336.  
  21337.    For a full description, see Chapter 4, "Types, Macros, Structures."
  21338.  
  21339.  Return Value
  21340.  
  21341.    The return value is TRUE if the point lies within the rectangle, or FALSE
  21342.    if the point is outside the rectangle.
  21343.  
  21344.  Example
  21345.  
  21346.    This example processes a WM_BUTTON1UP message, converts the mouse pointer
  21347.    coordinates into a POINTL structure, and calls WinPtInRect to determine if
  21348.    the mouse was clicked in the predefined global rectangle.
  21349.  
  21350.    RECTL rclGlobal;    /* global set to some predefined rectangle */
  21351.    POINTL ptl;
  21352.    HPS hps;
  21353.  
  21354.    case WM_BUTTON1UP:
  21355.        ptl.x = (LONG) SHORT1FROMMP(mp1);
  21356.        ptl.y = (LONG) SHORT2FROMMP(mp1);
  21357.        if (WinPtInRect(hab,   /* anchor-block handle      */
  21358.            &rclGlobal,        /* address of the rectangle */
  21359.            &ptl)) {           /* address of the point     */
  21360.  
  21361.  See Also
  21362.  
  21363.    GpiPtInRegion
  21364.  
  21365.  
  21366.  ────────────────────────────────────────────────────────────────────────────
  21367.  WinQueryAccelTable
  21368.  ────────────────────────────────────────────────────────────────────────────
  21369.    HACCEL WinQueryAccelTable (hab, hwndFrame)
  21370.    HAB hab;                /*handle of the anchor block                    */
  21371.    HWND hwndFrame;         /*handle of the frame window                    */
  21372.  
  21373.    The WinQueryAccelTable function queries the window or queue accelerator
  21374.    table.
  21375.  
  21376.  Parameters
  21377.  
  21378.    hab  Identifies an anchor block.
  21379.  
  21380.    hwndFrame  Identifies the frame window. This parameter can be NULL.
  21381.  
  21382.  Return Value
  21383.  
  21384.    The return value is an accelerator-table handle if the function is
  21385.    successful, or NULL if an error occurred.
  21386.  
  21387.  Comments
  21388.  
  21389.    If the hwndFrame parameter is NULL, then the handle of the queue
  21390.    accelerator is returned. Otherwise, the handle of the window accelerator
  21391.    table is returned by sending the WM_QUERYACCELTABLE message to the frame
  21392.    window specified by hwndFrame.
  21393.  
  21394.  See Also
  21395.  
  21396.    WinCreateAccelTable
  21397.  
  21398.  
  21399.  ────────────────────────────────────────────────────────────────────────────
  21400.  WinQueryActiveWindow
  21401.  ────────────────────────────────────────────────────────────────────────────
  21402.    HWND WinQueryActiveWindow (hwndDesktop, fLock)
  21403.    HWND hwndDesktop;       /*handle of the desktop                         */
  21404.    BOOL fLock;             /*lock/unlock flag                              */
  21405.  
  21406.    The WinQueryActiveWindow function retrieves the active frame window.
  21407.  
  21408.  Parameters
  21409.  
  21410.    hwndDesktop  Identifies the desktop window. This parameter can be
  21411.    HWND_DESKTOP or the desktop window handle.
  21412.  
  21413.    fLock  Specifies whether the active window should be locked. If TRUE, the
  21414.    window is locked. If FALSE, it is not.
  21415.  
  21416.  Return Value
  21417.  
  21418.    The return value is the active window handle or NULL if no window was
  21419.    active at the time of the call or the hwndDesktop handle is invalid.
  21420.  
  21421.  Comments
  21422.  
  21423.    If this function is called while the active window is changing, then it
  21424.    may return NULL, indicating that no window was active at the time of the
  21425.    call. Since a NULL value can also be returned if the hwndDesktop handle is
  21426.    invalid, you must call WinGetLastError to determine if a NULL return value
  21427.    is caused by an invalid hwndDesktop handle or because the active window
  21428.    was changing when you made the call.
  21429.  
  21430.    If the active window is locked by this function, then you must at some
  21431.    point call the WinLockWindow function to unlock the window. The reason for
  21432.    locking the window is so that the window cannot be destroyed until you are
  21433.    done using it.
  21434.  
  21435.  See Also
  21436.  
  21437.    WinLockWindow, WinQueryFocus
  21438.  
  21439.  
  21440.  ────────────────────────────────────────────────────────────────────────────
  21441.  WinQueryAtomLength
  21442.  ────────────────────────────────────────────────────────────────────────────
  21443.    USHORT WinQueryAtomLength (hAtomTbl, atom)
  21444.    HATOMTBL hAtomTbl;      /*handle of the atom table                      */
  21445.    ATOM atom;              /*atom                                          */
  21446.  
  21447.    The WinQueryAtomLength function queries the length of a string associated
  21448.    with the passed atom. The purpose of this function is to allow an
  21449.    application to determine the size of the buffer to pass to the
  21450.    WinQueryAtomName function.
  21451.  
  21452.  Parameters
  21453.  
  21454.    hAtomTbl  Identifies an atom table. This handle must have been created by
  21455.    a previous call to the WinCreateAtomTable function.
  21456.  
  21457.    atom  Specifies the atom whose length is to be returned.
  21458.  
  21459.  Return Value
  21460.  
  21461.    The return value is the length of the string associated with the atom, not
  21462.    including the null terminating byte. If the specified atom or atom table
  21463.    is invalid, the return value is zero. Integer atoms always return a length
  21464.    of 6.
  21465.  
  21466.  See Also
  21467.  
  21468.    WinCreateAtomTable, WinQueryAtomName
  21469.  
  21470.  
  21471.  ────────────────────────────────────────────────────────────────────────────
  21472.  WinQueryAtomName
  21473.  ────────────────────────────────────────────────────────────────────────────
  21474.    USHORT WinQueryAtomName (hAtomTbl, atom, pszBuffer, cchBufferMax)
  21475.    HATOMTBL hAtomTbl;      /*handle of the atom table                      */
  21476.    ATOM atom;              /*atom                                          */
  21477.    PSZ pszBuffer;          /*address of the buffer                         */
  21478.    USHORT cchBufferMax;    /*length of the buffer                          */
  21479.  
  21480.    The WinQueryAtomName function retrieves an atom name associated with an
  21481.    atom.
  21482.  
  21483.  Parameters
  21484.  
  21485.    hAtomTbl  Identifies an atom table. This handle must have been created by
  21486.    a previous call to the WinCreateAtomTable function.
  21487.  
  21488.    atom  Specifies an atom identifying the character string to retrieve. For
  21489.    integer atoms, the format of the string is #ddddd, where ddddd are decimal
  21490.    digits in the system code page (which will be an ASCII code page). No
  21491.    leading zeros are generated, and the length can be from three to seven
  21492.    characters.
  21493.  
  21494.    pszBuffer  Points to the buffer to receive the character string.
  21495.  
  21496.    cchBufferMax  Specifies the maximum size (in bytes) of the buffer pointed
  21497.    to by pszBuffer.
  21498.  
  21499.  Return Value
  21500.  
  21501.    The return value is the actual number of bytes copied to the buffer,
  21502.    excluding the null terminating byte. If the specified atom or the atom
  21503.    table is invalid, the return value is zero.
  21504.  
  21505.  See Also
  21506.  
  21507.    WinCreateAtomTable, WinFindAtom, WinQueryAtomLength
  21508.  
  21509.  
  21510.  ────────────────────────────────────────────────────────────────────────────
  21511.  WinQueryAtomUsage
  21512.  ────────────────────────────────────────────────────────────────────────────
  21513.    USHORT WinQueryAtomUsage (hAtomTbl, atom)
  21514.    HATOMTBL hAtomTbl;      /*handle of the atom table                      */
  21515.    ATOM atom;              /*atom                                          */
  21516.  
  21517.    The WinQueryAtomUsage function returns the number of times an atom has
  21518.    been used.
  21519.  
  21520.  Parameters
  21521.  
  21522.    hAtomTbl  Identifies an atom table. This handle must have been created by
  21523.    a previous call to the WinCreateAtomTable function.
  21524.  
  21525.    atom  Specifies the atom whose use count is to be returned.
  21526.  
  21527.  Return Value
  21528.  
  21529.    The return value is the use count of the atom. It is 0xFFFF for integer
  21530.    atoms. If the atom table or atom is invalid, then the return value is
  21531.    zero.
  21532.  
  21533.  See Also
  21534.  
  21535.    WinAddAtom, WinCreateAtomTable
  21536.  
  21537.  
  21538.  ────────────────────────────────────────────────────────────────────────────
  21539.  WinQueryCapture
  21540.  ────────────────────────────────────────────────────────────────────────────
  21541.    HWND WinQueryCapture (hwndDesktop, fLock)
  21542.    HWND hwndDesktop;       /*handle of the desktop                         */
  21543.    BOOL fLock;             /*lock/unlock flag                              */
  21544.  
  21545.    The WinQueryCapture function returns the window handle of the window that
  21546.    has the mouse capture.
  21547.  
  21548.  Parameters
  21549.  
  21550.    hwndDesktop  Identifies the desktop window. This parameter can be
  21551.    HWND_DESKTOP or the desktop window handle.
  21552.  
  21553.    fLock  Specifies whether the window that has the mouse capture should be
  21554.    locked. If TRUE, the window is locked. If FALSE, it is not.
  21555.  
  21556.  Return Value
  21557.  
  21558.    The return value is the window handle with the mouse capture, or NULL if
  21559.    no window has the capture or an error occurred.
  21560.  
  21561.  Comments
  21562.  
  21563.    If the window that has the mouse capture is locked by this function, then
  21564.    you must at some point call the WinLockWindow function to unlock the
  21565.    window. The reason for locking the window is so that the window cannot be
  21566.    destroyed until you are done using it.
  21567.  
  21568.  See Also
  21569.  
  21570.    WinLockWindow, WinSetCapture
  21571.  
  21572.  
  21573.  ────────────────────────────────────────────────────────────────────────────
  21574.  WinQueryClassInfo
  21575.  ────────────────────────────────────────────────────────────────────────────
  21576.    BOOL WinQueryClassInfo (hab, pszClassName, pclsi)
  21577.    HAB hab;                /*handle of the anchor block                    */
  21578.    PSZ pszClassName;       /*address of the class name                     */
  21579.    PCLASSINFO pclsi;       /*address of structure for class information    */
  21580.  
  21581.    The WinQueryClassInfo function retrieves window class information. This
  21582.    function is used in creating subclasses of a given class.
  21583.  
  21584.  Parameters
  21585.  
  21586.    hab  Identifies an anchor block.
  21587.  
  21588.    pszClassName  Points to a null-terminated string containing the class
  21589.    name. The class name is either an application-specified name as defined by
  21590.    the WinRegisterClass function or the name of a preregistered WC class.
  21591.  
  21592.    pclsi  Points to a CLASSINFO structure that will contain the retrieved
  21593.    information about the class. The CLASSINFO structure has the following
  21594.    form:
  21595.  
  21596.    typedef struct _CLASSINFO {
  21597.        ULONG   flClassStyle;
  21598.        PFNWP   pfnWindowProc;
  21599.        USHORT  cbWindowData;
  21600.    } CLASSINFO;
  21601.  
  21602.    For a full description, see Chapter 4, "Types, Macros, Structures."
  21603.  
  21604.  Return Value
  21605.  
  21606.    The return value is TRUE if the function is successful. Otherwise, it is
  21607.    FALSE, indicating that the class does not exist.
  21608.  
  21609.  See Also
  21610.  
  21611.    WinRegisterClass
  21612.  
  21613.  
  21614.  ────────────────────────────────────────────────────────────────────────────
  21615.  WinQueryClassName
  21616.  ────────────────────────────────────────────────────────────────────────────
  21617.    SHORT WinQueryClassName (hwnd, cchMax, psz)
  21618.    HWND hwnd;              /*handle of the window                          */
  21619.    SHORT cchMax;           /*length of the buffer                          */
  21620.    PSZ psz;                /*address of the buffer                         */
  21621.  
  21622.    The WinQueryClassName function copies the window class name, as a
  21623.    null-terminated string, into a buffer.
  21624.  
  21625.    If the class name is longer than (cchMax - 1), only the first (cchMax - 1)
  21626.    characters of the class name are copied.
  21627.  
  21628.    If the specified window is of any of the preregistered WC classes, the
  21629.    class name returned is in the form #nnnnn, where nnnnn is up to five
  21630.    digits that correspond to the low word of the WC class-name constant.
  21631.  
  21632.  Parameters
  21633.  
  21634.    hwnd  Identifies a window.
  21635.  
  21636.    cchMax  Specifies the length of the buffer pointed to by the psz
  21637.    parameter.
  21638.  
  21639.    psz  Points to a buffer for the class name.
  21640.  
  21641.  Return Value
  21642.  
  21643.    The return value is the length of the returned class name, not including
  21644.    the null termination character.
  21645.  
  21646.  See Also
  21647.  
  21648.    WinQueryClassInfo, WinRegisterClass
  21649.  
  21650.  
  21651.  ────────────────────────────────────────────────────────────────────────────
  21652.  WinQueryClipbrdData
  21653.  ────────────────────────────────────────────────────────────────────────────
  21654.    ULONG WinQueryClipbrdData (hab, fmt)
  21655.    HAB hab;                /*handle of the anchor block                    */
  21656.    USHORT fmt;             /*specifies the format of the data              */
  21657.  
  21658.    The WinQueryClipbrdData function obtains a handle to the current clipboard
  21659.    data having a specified format.
  21660.  
  21661.    The returned data handle cannot be used after the WinCloseClipbrd function
  21662.    is called. For this reason, the application must either copy the data, if
  21663.    required for long-term use, or process the data before WinCloseClipbrd is
  21664.    called.
  21665.  
  21666.    The application should not free the data handle itself nor leave it locked
  21667.    in any way.
  21668.  
  21669.  Parameters
  21670.  
  21671.    hab  Identifies an anchor block.
  21672.  
  21673.    fmt  Specifies the format of the data that is accessed by this function.
  21674.  
  21675.  Return Value
  21676.  
  21677.    The return value is a handle to the data in the clipboard in the format
  21678.    specified by the fmt parameter. If the format does not exist or if an
  21679.    error occurred, the return value is NULL.
  21680.  
  21681.  Comments
  21682.  
  21683.    For a description of the possible formats and data handles, see the
  21684.    WinSetClipbrdData function.
  21685.  
  21686.  See Also
  21687.  
  21688.    WinCloseClipbrd, WinOpenClipbrd, WinSetClipbrdData
  21689.  
  21690.  
  21691.  ────────────────────────────────────────────────────────────────────────────
  21692.  WinQueryClipbrdFmtInfo
  21693.  ────────────────────────────────────────────────────────────────────────────
  21694.    BOOL WinQueryClipbrdFmtInfo (hab, fmt, pfsFmtInfo)
  21695.    HAB hab;                /*handle of the anchor block                    */
  21696.    USHORT fmt;             /*specifies data format                         */
  21697.    PUSHORT pfsFmtInfo;     /*receives memory model and usage flags         */
  21698.  
  21699.    The WinQueryClipbrdFmtInfo function determines whether a particular format
  21700.    of data is present in the clipboard and, if so, provides information about
  21701.    that format.
  21702.  
  21703.  Parameters
  21704.  
  21705.    hab  Identifies an anchor block.
  21706.  
  21707.    fmt  Specifies the format of the data that this function queries. The
  21708.    following list describes the standard clipboard formats:
  21709.  
  21710. ╓┌─┌─────────────────┌───────────────────────────────────────────────────────╖
  21711.    Value             Meaning
  21712.    ──────────────────────────────────────────────────────────────────────────
  21713.    CF_BITMAP         The data is a bitmap. The CFI_HANDLE memory-model flag
  21714.                      must be set in the pfsFmtInfo parameter.
  21715.  
  21716.    Value             Meaning
  21717.    ──────────────────────────────────────────────────────────────────────────
  21718. 
  21719.    CF_DSPBITMAP      The data is a bitmap representation of a private data
  21720.                      format. The clipboard viewer can use this format to
  21721.                      display a private format. The memory-model flag
  21722.                      CFI_HANDLE must be set in the pfsFmtInfo parameter.
  21723.  
  21724.    CF_METAFILE       The data is a metafile. The CFI_HANDLE memory-model flag
  21725.                      must be set in the pfsFmtInfo parameter.
  21726.  
  21727.    CF_DSPMETAFILE    The data is a metafile representation of a private data
  21728.                      format. The clipboard viewer can use this format to
  21729.                      display a private format. The memory-model flag
  21730.                      CFI_HANDLE must be set in the pfsFmtInfo parameter.
  21731.  
  21732.    CF_TEXT           The data is an array of text characters, which may
  21733.                      include newline characters to mark line breaks. The null
  21734.                      character indicates the end of the text data. The
  21735.                      CFI_SELECTOR memory-model flag must be set in the
  21736.                      pfsFmtInfo parameter.
  21737.    Value             Meaning
  21738.    ──────────────────────────────────────────────────────────────────────────
  21739.                     pfsFmtInfo parameter.
  21740.  
  21741.    CF_DSPTEXT        The data is a textual representation of a private data
  21742.                      format. The clipboard viewer can use this format to
  21743.                      display a private format. The memory-model flag
  21744.                      CFI_SELECTOR must be set in the pfsFmtInfo parameter.
  21745.    ──────────────────────────────────────────────────────────────────────────
  21746.  
  21747.  
  21748.    pfsFmtInfo  Points to a variable that receives the memory-model and usage
  21749.    (CFI) flags. It consists of a memory-model flag and a usage flag from the
  21750.    following lists:
  21751.  
  21752.    Memory-model flag  Meaning
  21753.    ──────────────────────────────────────────────────────────────────────────
  21754.    CFI_SELECTOR       Handle is a selector plus zero offset to a segment in
  21755.                       storage.
  21756.  
  21757.    CFI_HANDLE         Handle is the handle to a metafile or bitmap.
  21758.    ──────────────────────────────────────────────────────────────────────────
  21759.  
  21760.    Usage flag         Meaning
  21761.    ──────────────────────────────────────────────────────────────────────────
  21762.    CFI_OWNERFREE      Handle is not freed by the WinEmptyClipbrd function.
  21763.                       The application must free the data if necessary.
  21764.  
  21765.    CFI_OWNERDISPLAY   Format will be drawn by the clipboard owner in the
  21766.                       clipboard-viewer window by means of the
  21767.                       WM_PAINTCLIPBOARD message. The ulData parameter should
  21768.                       be NULL.
  21769.    ──────────────────────────────────────────────────────────────────────────
  21770.  
  21771.  Return Value
  21772.  
  21773.    The return value is TRUE if the format exists. Otherwise, it is FALSE,
  21774.    indicating that the format does not exist.
  21775.  
  21776.  Comments
  21777.  
  21778.    For a description of the possible formats and data handles, see the
  21779.    WinSetClipbrdData function.
  21780.  
  21781.  See Also
  21782.  
  21783.    WinOpenClipbrd, WinSetClipbrdData
  21784.  
  21785.  
  21786.  ────────────────────────────────────────────────────────────────────────────
  21787.  WinQueryClipbrdOwner
  21788.  ────────────────────────────────────────────────────────────────────────────
  21789.    HWND WinQueryClipbrdOwner (hab, fLock)
  21790.    HAB hab;                /*handle of the anchor block                    */
  21791.    BOOL fLock;             /*lock/unlock viewer flag                       */
  21792.  
  21793.    The WinQueryClipbrdOwner function obtains the handle of the window that
  21794.    currently owns the clipboard (if any).
  21795.  
  21796.  Parameters
  21797.  
  21798.    hab  Identifies an anchor block.
  21799.  
  21800.    fLock  Specifies whether the clipboard owner window should be locked. If
  21801.    TRUE, the window is locked. If FALSE, it is not.
  21802.  
  21803.  Return Value
  21804.  
  21805.    The return value is the window handle of the current clipboard owner. If
  21806.    the clipboard is not owned by any window or if an error occurred, the
  21807.    return value is NULL.
  21808.  
  21809.  Comments
  21810.  
  21811.    If the clipboard owner window is locked by this function, then you must at
  21812.    some point call the WinLockWindow function to unlock the window. The
  21813.    reason for locking the window is so that the window cannot be destroyed
  21814.    until you are done using it.
  21815.  
  21816.  See Also
  21817.  
  21818.    WinLockWindow, WinQueryClipbrdViewer, WinSetClipbrdOwner
  21819.  
  21820.  
  21821.  ────────────────────────────────────────────────────────────────────────────
  21822.  WinQueryClipbrdViewer
  21823.  ────────────────────────────────────────────────────────────────────────────
  21824.    HWND WinQueryClipbrdViewer (hab, fLock)
  21825.    HAB hab;                /*handle of the anchor block                    */
  21826.    BOOL fLock;             /*lock/unlock viewer flag                       */
  21827.  
  21828.    The WinQueryClipbrdViewer function obtains the handle of the current
  21829.    clipboard viewer window (if any).
  21830.  
  21831.  Parameters
  21832.  
  21833.    hab  Identifies an anchor block.
  21834.  
  21835.    fLock  Specifies whether the clipboard owner window should be locked. If
  21836.    TRUE, the window is locked. If FALSE, it is not.
  21837.  
  21838.  Return Value
  21839.  
  21840.    The return value is the handle of the current clipboard viewer window. If
  21841.    the clipboard does not have a current viewer window or if an error
  21842.    occurred, the return value is NULL.
  21843.  
  21844.  Comments
  21845.  
  21846.    If the clipboard owner window is locked by this function, then you must at
  21847.    some point call the WinLockWindow function to unlock the window. The
  21848.    reason for locking the window is so that the window cannot be destroyed
  21849.    until you are done using it.
  21850.  
  21851.  See Also
  21852.  
  21853.    WinLockWindow, WinQueryClipbrdOwner, WinSetClipbrdViewer
  21854.  
  21855.  
  21856.  ────────────────────────────────────────────────────────────────────────────
  21857.  WinQueryCp
  21858.  ────────────────────────────────────────────────────────────────────────────
  21859.    USHORT WinQueryCp (hmq)
  21860.    HMQ hmq;                /*handle of the message queue                   */
  21861.  
  21862.    The WinQueryCp function retrieves the code page for the specified message
  21863.    queue.
  21864.  
  21865.  Parameters
  21866.  
  21867.    hmq  Identifies a message queue.
  21868.  
  21869.  Return Value
  21870.  
  21871.    The return value is the code page for the specified message queue if the
  21872.    function is successful. Otherwise, it is zero, indicating that an error
  21873.    occurred.
  21874.  
  21875.  See Also
  21876.  
  21877.    DosGetCp, GpiQueryCp, VioGetCp
  21878.  
  21879.  
  21880.  ────────────────────────────────────────────────────────────────────────────
  21881.  WinQueryCpList
  21882.  ────────────────────────────────────────────────────────────────────────────
  21883.    USHORT WinQueryCpList (hab, ccpMax, pacp)
  21884.    HAB hab;                /*handle of the anchor block                    */
  21885.    USHORT ccpMax;          /*maximum number of code pages to retrieve      */
  21886.    PUSHORT pacp;           /*address of array to receive code pages        */
  21887.  
  21888.    The WinQueryCpList function obtains available code pages.
  21889.  
  21890.  Parameters
  21891.  
  21892.    hab  Identifies an anchor block.
  21893.  
  21894.    ccpMax  Specifies the maximum number of code pages that will be returned.
  21895.  
  21896.    pacp  Points to an array that will receive the available code pages. It
  21897.    will include all code pages available to the Gpi and Vio functions,
  21898.    including any EBCDIC ones. This list is a superset of those code pages
  21899.    available to the WinSetCp function and the Dos functions.
  21900.  
  21901.  Return Value
  21902.  
  21903.    The return value is the the total number of code pages in the system.
  21904.  
  21905.  See Also
  21906.  
  21907.    GpiSetCp, VioGetCp, WinQueryCp, WinSetCp
  21908.  
  21909.  
  21910.  ────────────────────────────────────────────────────────────────────────────
  21911.  WinQueryCursorInfo
  21912.  ────────────────────────────────────────────────────────────────────────────
  21913.    BOOL WinQueryCursorInfo (hwndDesktop, pcsri)
  21914.    HWND hwndDesktop;       /*handle of the desktop                         */
  21915.    PCURSORINFO pcsri;      /*address of structure for cursor information   */
  21916.  
  21917.    The WinQueryCursorInfo function retrieves information about the current
  21918.    cursor.
  21919.  
  21920.  Parameters
  21921.  
  21922.    hwndDesktop  Identifies the desktop window. This parameter can be
  21923.    HWND_DESKTOP or the desktop window handle.
  21924.  
  21925.    pcsri  Points to a CURSORINFO structure that receives information about
  21926.    the current cursor. The values are equivalent to the parameters to the
  21927.    WinCreateCursor function, except that the fs field never includes the
  21928.    CURSOR_SETPOS flag. The size and position of the cursor are returned in
  21929.    window coordinates relative to the window identified by the hwnd field of
  21930.    the structure. The CURSORINFO structure has the following form:
  21931.  
  21932.    typedef struct _CURSORINFO {
  21933.        HWND   hwnd;
  21934.        SHORT  x;
  21935.        SHORT  y;
  21936.        SHORT  cx;
  21937.        SHORT  cy;
  21938.        USHORT fs;
  21939.        RECTL  rclClip;
  21940.    } CURSORINFO;
  21941.  
  21942.    For a full description, see Chapter 4, "Types, Macros, Structures."
  21943.  
  21944.  Return Value
  21945.  
  21946.    The return value is TRUE if the cursor exists, or FALSE if it does not.
  21947.  
  21948.  See Also
  21949.  
  21950.    WinCreateCursor, WinDestroyCursor, WinShowCursor
  21951.  
  21952.  
  21953.  ────────────────────────────────────────────────────────────────────────────
  21954.  WinQueryDefinition
  21955.  ────────────────────────────────────────────────────────────────────────────
  21956.    USHORT WinQueryDefinition (hab, hProgHandle, ppib, cbMax)
  21957.    HAB hab;                /*handle of the anchor block                    */
  21958.    HPROGRAM hProgHandle;   /*handle of the program                         */
  21959.    PPIBSTRUCT ppib;        /*address of structure for program information  */
  21960.    USHORT cbMax;           /*length of ppib buffer                         */
  21961.  
  21962.    The WinQueryDefinition function retrieves information about a program or
  21963.    program group.
  21964.  
  21965.  Parameters
  21966.  
  21967.    hab  Identifies the anchor block.
  21968.  
  21969.    hProgHandle  Identifies the program or group.
  21970.  
  21971.    ppib  Points to a PIBSTRUCT structure that receives the program
  21972.    information data. If the hProgHandle parameter is a group handle, only the
  21973.    program type and program title fields are significant. The structure has
  21974.    the following form:
  21975.  
  21976.    typedef struct _PIBSTRUCT {
  21977.        PROGTYPE  progt;
  21978.        CHAR      szTitle[MAXNAMEL+1];
  21979.        CHAR      szIconFileName[MAXPATHL+1];
  21980.        CHAR      szExecutable[MAXPATHL+1];
  21981.        CHAR      szStartupDir[MAXPATHL+1];
  21982.        XYWINSIZE xywinInitial;
  21983.        USHORT    res1;
  21984.        LHANDLE   res2;
  21985.        USHORT    cchEnvironmentVars;
  21986.        PCH       pchEnvironmentVars;
  21987.        USHORT    cchProgramParameter;
  21988.        PCH       pchProgramParameter;
  21989.    } PIBSTRUCT;
  21990.  
  21991.    For a full description, see Chapter 4, "Types, Macros, Structures."
  21992.  
  21993.    cbMax  Specifies the maximum length of data (in bytes) that can be
  21994.    returned in the data structure pointed to by ppib. If cbMax is zero, this
  21995.    function returns the number of bytes in the program information block.
  21996.  
  21997.  Return Value
  21998.  
  21999.    The return value is the length of the data actually returned in the data
  22000.    structure, or zero if an error occurred.
  22001.  
  22002.    If the target is a program rather than a program group, the data returned
  22003.    in ppib is in a format usable by the WinAddProgram function.
  22004.  
  22005.  See Also
  22006.  
  22007.    WinAddProgram
  22008.  
  22009.  
  22010.  ────────────────────────────────────────────────────────────────────────────
  22011.  WinQueryDesktopWindow
  22012.  ────────────────────────────────────────────────────────────────────────────
  22013.    HWND WinQueryDesktopWindow (hab, hdc)
  22014.    HAB hab;                /*handle of the anchor block                    */
  22015.    HDC hdc;                /*handle of the device context                  */
  22016.  
  22017.    The WinQueryDesktopWindow function retrieves the desktop window handle.
  22018.  
  22019.  Parameters
  22020.  
  22021.    hab  Identifies an anchor block.
  22022.  
  22023.    hdc  Identifies a device context. For MS OS/2, version 1.1, this parameter
  22024.    must be NULL.
  22025.  
  22026.  Return Value
  22027.  
  22028.    The return value is the desktop window handle or NULL if the device does
  22029.    not support windowing.
  22030.  
  22031.  Comments
  22032.  
  22033.    For most Win calls the constant HWND_DESKTOP can be used for the desktop
  22034.    window handle.
  22035.  
  22036.  See Also
  22037.  
  22038.    WinCreateWindow, WinQueryObjectWindow
  22039.  
  22040.  
  22041.  ────────────────────────────────────────────────────────────────────────────
  22042.  WinQueryDlgItemShort
  22043.  ────────────────────────────────────────────────────────────────────────────
  22044.    BOOL WinQueryDlgItemShort (hwndDlg, idItem, pResult, fSigned)
  22045.    HWND hwndDlg;           /*handle of the dialog box                      */
  22046.    USHORT idItem;          /*dialog-item identifier                        */
  22047.    PSHORT pResult;         /*address of variable for result                */
  22048.    BOOL fSigned;           /*signed/unsigned flag                          */
  22049.  
  22050.    The WinQueryDlgItemShort function translates the text of a dialog item
  22051.    into an integer value. This function is useful in translating a numerical
  22052.    input field into a numeric value for further processing.
  22053.  
  22054.  Parameters
  22055.  
  22056.    hwndDlg  Identifies a dialog-box window.
  22057.  
  22058.    idItem  Identifies the dialog item whose text is translated. The
  22059.    dialog-item text is assumed to be an ASCII string.
  22060.  
  22061.    pResult  Points to the integer value resulting from the translation.
  22062.  
  22063.    fSigned  Specifies whether the item text is treated as signed or unsigned.
  22064.    If this parameter is TRUE, the item text is treated as signed, in which
  22065.    case the translation checks for a minus sign in the text. If it is FALSE,
  22066.    the item text is treated as unsigned.
  22067.  
  22068.  Return Value
  22069.  
  22070.    The return value is TRUE if the function is successful or FALSE if an
  22071.    error occurs.
  22072.  
  22073.  Comments
  22074.  
  22075.    If the text string does not contain a valid representation of a number, as
  22076.    in "size," or "-3" when fSigned is FALSE, then the return value will be
  22077.    FALSE.
  22078.  
  22079.  See Also
  22080.  
  22081.    WinSetDlgItemShort
  22082.  
  22083.  
  22084.  ────────────────────────────────────────────────────────────────────────────
  22085.  WinQueryDlgItemText
  22086.  ────────────────────────────────────────────────────────────────────────────
  22087.    USHORT WinQueryDlgItemText (hwndDlg, idItem, cchBufferMax, pszBuf)
  22088.    HWND hwndDlg;           /*handle of the dialog box                      */
  22089.    USHORT idItem;          /*identifies the dialog item                    */
  22090.    SHORT cchBufferMax;     /*size of the buffer                            */
  22091.    PSZ pszBuf;             /*address of the buffer                         */
  22092.  
  22093.    The WinQueryDlgItemText function retrieves the text associated with the
  22094.    specified dialog item.
  22095.  
  22096.  Parameters
  22097.  
  22098.    hwndDlg  Identifies the dialog box.
  22099.  
  22100.    idItem  Identifies the dialog item.
  22101.  
  22102.    cchBufferMax  Specifies the maximum number of characters to place in the
  22103.    buffer pointed to by the pszBuf parameter.
  22104.  
  22105.    pszBuf  Points to a buffer that receives the dialog item text.
  22106.  
  22107.  Return Value
  22108.  
  22109.    The return value is the length of the dialog item text, or zero if an
  22110.    error occurred.
  22111.  
  22112.  See Also
  22113.  
  22114.    WinQueryDlgItemTextLength
  22115.  
  22116.  
  22117.  ────────────────────────────────────────────────────────────────────────────
  22118.  WinQueryDlgItemTextLength
  22119.  ────────────────────────────────────────────────────────────────────────────
  22120.    SHORT WinQueryDlgItemTextLength (hwndDlg, idItem)
  22121.    HWND hwndDlg;           /*handle of the dialog box                      */
  22122.    USHORT idItem;          /*dialog-item identifier                        */
  22123.  
  22124.    The WinQueryDlgItemTextLength function retrieves the length of the dialog
  22125.    item text, not including any null termination character.
  22126.  
  22127.    This function sends a WM_QUERYFRAMEINFO message to the window identified
  22128.    by the hwndDlg parameter.
  22129.  
  22130.  Parameters
  22131.  
  22132.    hwndDlg  Identifies the dialog box.
  22133.  
  22134.    idItem  Identifies the dialog item.
  22135.  
  22136.  Return Value
  22137.  
  22138.    The return value is the length of the dialog item text, or zero if an
  22139.    error occurred.
  22140.  
  22141.  See Also
  22142.  
  22143.    WinQueryDlgItemText
  22144.  
  22145.  
  22146.  ────────────────────────────────────────────────────────────────────────────
  22147.  WinQueryFocus
  22148.  ────────────────────────────────────────────────────────────────────────────
  22149.    HWND WinQueryFocus (hwndDesktop, fLock)
  22150.    HWND hwndDesktop;       /*handle of the desktop                         */
  22151.    BOOL fLock;             /*lock/unlock flag                              */
  22152.  
  22153.    The WinQueryFocus function returns the handle of the window that currently
  22154.    has the focus.
  22155.  
  22156.  Parameters
  22157.  
  22158.    hwndDesktop  Identifies the desktop window. This parameter can be
  22159.    HWND_DESKTOP or the desktop window handle.
  22160.  
  22161.    fLock  Specifies whether the focus window should be locked. If TRUE, the
  22162.    window is locked. If FALSE, it is not.
  22163.  
  22164.  Return Value
  22165.  
  22166.    The return value is a handle to the focus window or NULL if there is no
  22167.    focus window or an error occurs.
  22168.  
  22169.  Comments
  22170.  
  22171.    If the focus window is locked by this function, then you must at some
  22172.    point call the WinLockWindow function to unlock the window. The reason for
  22173.    locking the window is so that the window cannot be destroyed until you are
  22174.    done using it.
  22175.  
  22176.  See Also
  22177.  
  22178.    WinFocusChange, WinLockWindow, WinQueryActiveWindow, WinSetFocus
  22179.  
  22180.  
  22181.  ────────────────────────────────────────────────────────────────────────────
  22182.  WinQueryMsgPos
  22183.  ────────────────────────────────────────────────────────────────────────────
  22184.    BOOL WinQueryMsgPos (hab, pptl)
  22185.    HAB hab;                /*handle of the anchor block                    */
  22186.    PPOINTL pptl;           /*address of structure for pointer position     */
  22187.  
  22188.    The WinQueryMsgPos function retrieves the pointer position, in screen
  22189.    coordinates, when the last message obtained from the current message queue
  22190.    was posted. To obtain the current position of the pointer, use the
  22191.    WinQueryPointerPos function.
  22192.  
  22193.  Parameters
  22194.  
  22195.    hab  Identifies an anchor block.
  22196.  
  22197.    pptl  Points to a POINTL structure that receives the pointer position in
  22198.    screen coordinates. The pointer position is the same as that in the ptl
  22199.    field of the QMSG structure. The POINTL structure has the following form:
  22200.  
  22201.    typedef struct _POINTL  {
  22202.        LONG  x;
  22203.        LONG  y;
  22204.    } POINTL;
  22205.  
  22206.    For a full description, see Chapter 4, "Types, Macros, Structures."
  22207.  
  22208.  Return Value
  22209.  
  22210.    The return value is TRUE if the function is successful or FALSE if an
  22211.    error occurs.
  22212.  
  22213.  See Also
  22214.  
  22215.    WinQueryPointerPos
  22216.  
  22217.  
  22218.  ────────────────────────────────────────────────────────────────────────────
  22219.  WinQueryMsgTime
  22220.  ────────────────────────────────────────────────────────────────────────────
  22221.    ULONG WinQueryMsgTime (hab)
  22222.    HAB hab;                /*handle of the anchor block                    */
  22223.  
  22224.    The WinQueryMsgTime function retrieves the message time for the last
  22225.    message retrieved by the WinGetMsg or WinPeekMsg function from the current
  22226.    message queue.
  22227.  
  22228.    The message time is the time, in milliseconds, when the message was
  22229.    posted. The time value is the same as that in the time field of the QMSG
  22230.    structure.
  22231.  
  22232.    You cannot assume that time values are always increasing. Since the time
  22233.    value is the number of milliseconds since the system was booted, it is
  22234.    possible that the value may wrap to zero. To accurately calculate time
  22235.    delays between messages, subtract the time of the first message from the
  22236.    time of the second.
  22237.  
  22238.  Parameters
  22239.  
  22240.    hab  Identifies an anchor block.
  22241.  
  22242.  Return Value
  22243.  
  22244.    The return value is the time, in milliseconds, when the message was
  22245.    posted.
  22246.  
  22247.  See Also
  22248.  
  22249.    WinGetCurrentTime, WinGetMsg, WinPeekMsg
  22250.  
  22251.  
  22252.  ────────────────────────────────────────────────────────────────────────────
  22253.  WinQueryObjectWindow
  22254.  ────────────────────────────────────────────────────────────────────────────
  22255.    HWND WinQueryObjectWindow (hwndDesktop)
  22256.    HWND hwndDesktop;       /*handle of the desktop                         */
  22257.  
  22258.    The WinQueryObjectWindow function returns the desktop object-window
  22259.    handle.
  22260.  
  22261.  Parameters
  22262.  
  22263.    hwndDesktop  Identifies the desktop window. This parameter can be
  22264.    HWND_DESKTOP or the desktop window handle.
  22265.  
  22266.  Return Value
  22267.  
  22268.    The return value is the desktop object-window handle, or NULL if an error
  22269.    occurs.
  22270.  
  22271.  Comments
  22272.  
  22273.    For most API calls the constant HWND_OBJECT can be used for the desktop
  22274.    object-window handle.
  22275.  
  22276.  See Also
  22277.  
  22278.    WinQueryDesktopWindow
  22279.  
  22280.  
  22281.  ────────────────────────────────────────────────────────────────────────────
  22282.  WinQueryPointer
  22283.  ────────────────────────────────────────────────────────────────────────────
  22284.    HPOINTER WinQueryPointer (hwndDesktop)
  22285.    HWND hwndDesktop;       /*handle of the desktop                         */
  22286.  
  22287.    The WinQueryPointer function retrieves the handle to the desktop pointer.
  22288.  
  22289.  Parameters
  22290.  
  22291.    hwndDesktop  Identifies the desktop window. This parameter can be
  22292.    HWND_DESKTOP or the desktop window handle.
  22293.  
  22294.  Return Value
  22295.  
  22296.    The return value is a handle to the desktop pointer or NULL if an error
  22297.    occurred.
  22298.  
  22299.  See Also
  22300.  
  22301.    WinQuerySysPointer, WinSetPointer
  22302.  
  22303.  
  22304.  ────────────────────────────────────────────────────────────────────────────
  22305.  WinQueryPointerInfo
  22306.  ────────────────────────────────────────────────────────────────────────────
  22307.    BOOL WinQueryPointerInfo (hptr, pptri)
  22308.    HPOINTER hptr;          /*handle of the pointer                         */
  22309.    PPOINTERINFO pptri;     /*address of structure for pointer information  */
  22310.  
  22311.    The WinQueryPointerInfo function retrieves information about the mouse
  22312.    pointer such as the pointer's bitmap handle and hotspot coordinates.
  22313.  
  22314.  Parameters
  22315.  
  22316.    hptr  Identifies a pointer.
  22317.  
  22318.    pptri  Points to a POINTERINFO structure that receives information about
  22319.    the mouse pointer. The POINTERINFO structure has the following form:
  22320.  
  22321.    typedef struct _POINTERINFO {
  22322.        BOOL    fPointer;
  22323.        SHORT   xHotspot;
  22324.        SHORT   yHotspot;
  22325.        HBITMAP hbmPointer;
  22326.    } POINTERINFO;
  22327.  
  22328.    For a full description, see Chapter 4, "Types, Macros, Structures."
  22329.  
  22330.  Return Value
  22331.  
  22332.    The return value is TRUE if the function is successful or FALSE if an
  22333.    error occurs.
  22334.  
  22335.  See Also
  22336.  
  22337.    WinQueryPointerPos
  22338.  
  22339.  
  22340.  ────────────────────────────────────────────────────────────────────────────
  22341.  WinQueryPointerPos
  22342.  ────────────────────────────────────────────────────────────────────────────
  22343.    BOOL WinQueryPointerPos (hwndDesktop, pptl)
  22344.    HWND hwndDesktop;       /*handle of desktop window                      */
  22345.    PPOINTL pptl;           /*address of structure for pointer position     */
  22346.  
  22347.    The WinQueryPointerPos function retrieves the mouse pointer position. The
  22348.    position returned is the position of the pointer at the time
  22349.    WinQueryPointerPos is called and is not synchronized with the WinGetMsg
  22350.    and WinPeekMsg functions. Use the WinQueryMsgPos function to get the
  22351.    pointer position of the last message obtained via WinGetMsg or WinPeekMsg.
  22352.  
  22353.  Parameters
  22354.  
  22355.    hwndDesktop  Identifies the desktop window. This parameter can be
  22356.    HWND_DESKTOP or the desktop window handle.
  22357.  
  22358.    pptl  Points to a POINTL structure that receives the pointer position in
  22359.    screen coordinates. The POINTL structure has the following form:
  22360.  
  22361.    typedef struct _POINTL  {
  22362.        LONG  x;
  22363.        LONG  y;
  22364.    } POINTL;
  22365.  
  22366.    For a full description, see Chapter 4, "Types, Macros, Structures."
  22367.  
  22368.  Return Value
  22369.  
  22370.    The return value is TRUE if the function is successful or FALSE if an
  22371.    error occurs.
  22372.  
  22373.  Comments
  22374.  
  22375.    The position retrieved is in screen coordinates, not window coordinates.
  22376.    You can convert screen coordinates to window coordinates with the
  22377.    WinMapWindowPoints function.
  22378.  
  22379.  See Also
  22380.  
  22381.    WinGetMsg, WinPeekMsg, WinQueryMsgPos, WinQueryPointerInfo
  22382.  
  22383.  
  22384.  ────────────────────────────────────────────────────────────────────────────
  22385.  WinQueryProfileData
  22386.  ────────────────────────────────────────────────────────────────────────────
  22387.    BOOL WinQueryProfileData (hab, pszAppName, pszKeyName, pvBuf, cbBuf)
  22388.    HAB hab;                /*handle of the anchor block                    */
  22389.    PSZ pszAppName;         /*address of the application name               */
  22390.    PSZ pszKeyName;         /*address of the keyname                        */
  22391.    PVOID pvBuf;            /*address of the buffer                         */
  22392.    PUSHORT cbBuf;          /*length of the buffer                          */
  22393.  
  22394.    The WinQueryProfileData function retrieves binary data from the os2.ini
  22395.    file. Where the data is located is determined by an application name and a
  22396.    keyname which are passed to the function.
  22397.  
  22398.  Parameters
  22399.  
  22400.    hab  Identifies an anchor block.
  22401.  
  22402.    pszAppName  Points to a null-terminated text string that contains the name
  22403.    of the application. Its length must be less than 1024 bytes, including the
  22404.    null termination character. The application name is always case-dependent.
  22405.  
  22406.    pszKeyName  Points to a null-terminated text string that contains the
  22407.    keyname. Its length must be less than 1024 bytes, including the null
  22408.    termination character. If pszKeyName is NULL, all keynames and their data
  22409.    are deleted. The keyname is always case-dependent.
  22410.  
  22411.    pvBuf  Points to a buffer that receives the data.
  22412.  
  22413.    cbBuf  Points to a variable that contains the size of the buffer pointed
  22414.    to by pvBuf. When the function returns, this variable will contain the
  22415.    actual number of bytes placed into the buffer.
  22416.  
  22417.  Return Value
  22418.  
  22419.    The return value is TRUE if the function is successful or FALSE if an
  22420.    error occurs.
  22421.  
  22422.  Comments
  22423.  
  22424.    You can find out the size of the data prior to calling this function by
  22425.    calling WinQueryProfileSize.
  22426.  
  22427.  See Also
  22428.  
  22429.    WinQueryProfileSize, WinWriteProfileData
  22430.  
  22431.  
  22432.  ────────────────────────────────────────────────────────────────────────────
  22433.  WinQueryProfileInt
  22434.  ────────────────────────────────────────────────────────────────────────────
  22435.    SHORT WinQueryProfileInt (hab, pszAppName, pszKeyName, sError)
  22436.    HAB hab;                /*handle of the anchor block                    */
  22437.    PSZ pszAppName;         /*address of the application name               */
  22438.    PSZ pszKeyName;         /*address of the keyname                        */
  22439.    SHORT sError;           /*value returned if keyname not found           */
  22440.  
  22441.    The WinQueryProfileInt function retrieves an integer from the os2.ini
  22442.    file. Where the integer is located is determined by an application name
  22443.    and a keyname which are passed to this function. The integer must have
  22444.    been previously stored as a text string using the WinWriteProfileString
  22445.    function. For example, a text string stored as "123" would be returned as
  22446.    the integer 123. The text string may contain a leading minus sign if the
  22447.    number is negative.
  22448.  
  22449.  Parameters
  22450.  
  22451.    hab  Identifies the anchor block.
  22452.  
  22453.    pszAppName  Points to a null-terminated text string that contains the name
  22454.    of the application. Its length must be less than 1024 bytes, including the
  22455.    null termination character. The application name is always case-dependent.
  22456.  
  22457.    pszKeyName  Points to a null-terminated text string that contains the
  22458.    keyname. Its length must be less than 1024 bytes, including the null
  22459.    termination character. If pszKeyName is NULL, all keynames and their data
  22460.    are deleted. The keyname is always case-dependent.
  22461.  
  22462.    sError  Specifies the error value returned if the keyname (pszKeyName)
  22463.    cannot be found.
  22464.  
  22465.  Return Value
  22466.  
  22467.    The return value is the integer representation of the text string. If the
  22468.    keyname cannot be found, the error value specified by sError is returned.
  22469.  
  22470.  See Also
  22471.  
  22472.    WinQueryProfileData, WinWriteProfileString
  22473.  
  22474.  
  22475.  ────────────────────────────────────────────────────────────────────────────
  22476.  WinQueryProfileSize
  22477.  ────────────────────────────────────────────────────────────────────────────
  22478.    USHORT WinQueryProfileSize (hab, pszAppName, pszKeyName, pcb)
  22479.    HAB hab;                /*handle of the anchor block                    */
  22480.    PSZ pszAppName;         /*points to the application name                */
  22481.    PSZ pszKeyName;         /*points to the keyname                         */
  22482.    PUSHORT pcb;            /*points to variable with length of the data    */
  22483.  
  22484.    The WinQueryProfileSize function retrieves the size of the data stored at
  22485.    a specified location in the os2.ini file. Where the data is located is
  22486.    determined by an application name and a keyname which are passed to this
  22487.    function. This function is typically called prior to calling
  22488.    WinQueryProfileData in order to determine how much memory to allocate for
  22489.    the data.
  22490.  
  22491.  Parameters
  22492.  
  22493.    hab  Identifies an anchor block.
  22494.  
  22495.    pszAppName  Points to a null-terminated text string that contains the name
  22496.    of the application. Its length must be less than 1024 bytes, including the
  22497.    null termination character. The application name is always case-dependent.
  22498.  
  22499.    pszKeyName  Points to a null-terminated text string that contains the
  22500.    keyname. Its length must be less than 1024 bytes, including the null
  22501.    termination character. If pszKeyName is NULL, all keynames and their data
  22502.    are deleted. The keyname is always case-dependent.
  22503.  
  22504.    pcb  Points to a variable that will receive the length of the data. If an
  22505.    error occurs, the length will not be returned.
  22506.  
  22507.  Return Value
  22508.  
  22509.    The return value is zero if the function is successful. Otherwise, it is
  22510.    an error value.
  22511.  
  22512.  See Also
  22513.  
  22514.    WinQueryProfileData, WinQueryProfileString
  22515.  
  22516.  
  22517.  ────────────────────────────────────────────────────────────────────────────
  22518.  WinQueryProfileString
  22519.  ────────────────────────────────────────────────────────────────────────────
  22520.    USHORT WinQueryProfileString (hab, pszAppName, pszKeyName, pszError,
  22521.    pszBuf, cchBuf)
  22522.    HAB hab;                /*handle of the anchor block                    */
  22523.    PSZ pszAppName;         /*points to the application name                */
  22524.    PSZ pszKeyName;         /*points to the keyname                         */
  22525.    PSZ pszError;           /*points to a default string                    */
  22526.    PSZ pszBuf;             /*address of the buffer for the string          */
  22527.    USHORT cchBuf;          /*size of buffer                                */
  22528.  
  22529.    The WinQueryProfileString function retrieves a string from the os2.ini
  22530.    file. Where the string is located is determined by an application name and
  22531.    a keyname which are passed to this function.
  22532.  
  22533.  Parameters
  22534.  
  22535.    hab  Identifies an anchor block.
  22536.  
  22537.    pszAppName  Points to a null-terminated text string that contains the name
  22538.    of the application. Its length must be less than 1024 bytes, including the
  22539.    null termination character. The application name is always case-dependent.
  22540.  
  22541.    pszKeyName  Points to a null-terminated text string that contains the
  22542.    keyname. Its length must be less than 1024 bytes, including the null
  22543.    termination character. If pszKeyName is NULL, all keynames and their data
  22544.    are deleted. The keyname is always case-dependent.
  22545.  
  22546.    pszError  Points to a null-terminated string that is placed in pszBuf if
  22547.    the key is not found.
  22548.  
  22549.    pszBuf  Points to a buffer that will receive the null-terminated string.
  22550.  
  22551.    cchBuf  Specifies the length of the buffer (pszBuf). If the retrieved
  22552.    string is longer than this value, it will be truncated.
  22553.  
  22554.  Return Value
  22555.  
  22556.    The return value is the number of characters in the buffer pointed to by
  22557.    pszBuf.
  22558.  
  22559.  See Also
  22560.  
  22561.    WinWriteProfileString
  22562.  
  22563.  
  22564.  ────────────────────────────────────────────────────────────────────────────
  22565.  WinQueryProgramTitles
  22566.  ────────────────────────────────────────────────────────────────────────────
  22567.    USHORT WinQueryProgramTitles (hab, hGroup, paproge, cbBuf, pcTitles)
  22568.    HAB hab;                /*handle of the anchor block                    */
  22569.    HPROGRAM hGroup;        /*handle of the group                           */
  22570.    PPROGRAMENTRY paproge;  /*array of PROGRAMENTRY structures              */
  22571.    USHORT cbBuf;           /*length of paproge buffer                      */
  22572.    PUSHORT pcTitles;       /*receives number of titles                     */
  22573.  
  22574.    The WinQueryProgramTitles function obtains information about programs
  22575.    within a specified program group.
  22576.  
  22577.    This function can be used to find out the number of entries within a group
  22578.    by passing a buffer of zero bytes. The function will return the total
  22579.    number of entries within the group.
  22580.  
  22581.    The list of returned program entries may contain group handles. This
  22582.    allows the tree structure to be built by the caller. Note, though, that
  22583.    information from only one level of the tree structure is returned by this
  22584.    call.
  22585.  
  22586.    The handle specified can also be a program handle, in which case the
  22587.    buffer will contain only the entry for one program. Thus, this call can be
  22588.    used to get the program title.
  22589.  
  22590.  Parameters
  22591.  
  22592.    hab  Identifies the anchor block.
  22593.  
  22594.    hGroup  Identifies the group for which information is returned. This
  22595.    handle is either the handle of a program group or SGH_ROOT for the root
  22596.    group.
  22597.  
  22598.    paproge  Points to a storage area where the program information is
  22599.    returned. This is an array of PROGRAMENTRY structures. The PROGRAMENTRY
  22600.    structure has the following form:
  22601.  
  22602.    typedef struct _PROGRAMENTRY {
  22603.        HPROGRAM hprog;
  22604.        PROGTYPE progt;
  22605.        CHAR     szTitle[MAXNAMEL+1];
  22606.    } PROGRAMENTRY;
  22607.  
  22608.    For a full description, see Chapter 4, "Types, Macros, Structures."
  22609.  
  22610.    cbBuf  Specifies the total length (in bytes) of the area pointed to by the
  22611.    paproge parameter. Values of cbBuf less than the size of a PROGRAMENTRY
  22612.    structure are invalid.
  22613.  
  22614.    pcTitles  Points to a variable that receives the count of the available
  22615.    titles. If the hGroup parameter is SGH_ROOT or SGH_MASTER and the buffer
  22616.    length specified in the cbBuf parameter is too small to hold all the
  22617.    titles, the return value is zero, none of the titles are copied to the
  22618.    buffer, and pcTitles contains the number of titles available. If hGroup is
  22619.    a program handle, both the return value and pcTitles are the number of
  22620.    handles available.
  22621.  
  22622.  Return Value
  22623.  
  22624.    The return value is the count of available titles. If an error occurred,
  22625.    the return value is zero.
  22626.  
  22627.  See Also
  22628.  
  22629.    WinAddProgram
  22630.  
  22631.  
  22632.  ────────────────────────────────────────────────────────────────────────────
  22633.  WinQueryQueueInfo
  22634.  ────────────────────────────────────────────────────────────────────────────
  22635.    BOOL WinQueryQueueInfo (hmq, pmqi, cbCopy)
  22636.    HMQ hmq;                /*handle of the message queue                   */
  22637.    PMQINFO pmqi;           /*address of structure for queue information    */
  22638.    USHORT cbCopy;          /*number of bytes of information to copy        */
  22639.  
  22640.    The WinQueryQueueInfo function is used to obtain information about a
  22641.    specified queue, such as the process and thread identifier associated with
  22642.    the queue, the maximum number of messages the queue can hold, and the
  22643.    queue procedure address.
  22644.  
  22645.  Parameters
  22646.  
  22647.    hmq  Identifies the message queue. This handle must either have been
  22648.    created by a previous call to WinCreateMsgQueue, or it must be HMQ_CURRENT
  22649.    to specify the message queue of the thread that is calling this function.
  22650.  
  22651.    pmqi  Points to an MQINFO structure that will receive information about
  22652.    the message queue. This MQINFO structure has the following form:
  22653.  
  22654.    typedef struct _MQINFO {
  22655.        USHORT cb;
  22656.        PID    pid;
  22657.        TID    tid;
  22658.        USHORT cmsgs;
  22659.        PVOID  pReserved;
  22660.    } MQINFO;
  22661.  
  22662.    For a full description, see Chapter 4, "Types, Macros, Structures."
  22663.  
  22664.    cbCopy  Specifies the number of bytes of data that will be copied into the
  22665.    MQINFO structure. Normally, it should be set to the length of the
  22666.    structure.
  22667.  
  22668.  Return Value
  22669.  
  22670.    The return value is TRUE if the function is successful or FALSE if an
  22671.    error occurs.
  22672.  
  22673.  Comments
  22674.  
  22675.    An important side effect of this function is that a DLL procedure or hook
  22676.    can use this function to find out if the current thread has a message
  22677.    queue associated with it.
  22678.  
  22679.  See Also
  22680.  
  22681.    WinCreateMsgQueue
  22682.  
  22683.  
  22684.  ────────────────────────────────────────────────────────────────────────────
  22685.  WinQueryQueueStatus
  22686.  ────────────────────────────────────────────────────────────────────────────
  22687.    ULONG WinQueryQueueStatus (hwndDesktop)
  22688.    HWND hwndDesktop;       /*handle of the desktop                         */
  22689.  
  22690.    The WinQueryQueueStatus function returns a code that indicates the status
  22691.    of the message queue associated with the current queue.
  22692.  
  22693.    This function is very fast and is typically used inside loops to determine
  22694.    whether the WinGetMsg or WinPeekMsg function should be called to process
  22695.    input.
  22696.  
  22697.  Parameters
  22698.  
  22699.    hwndDesktop  Identifies the desktop window. This parameter can be
  22700.    HWND_DESKTOP or the desktop window handle.
  22701.  
  22702.  Return Value
  22703.  
  22704.    The high word of the return value indicates the types of messages
  22705.    currently in the queue. The low word of the return value shows the types
  22706.    of messages added to the queue since the last call to WinQueryQueueStatus
  22707.    that are still in the queue.
  22708.  
  22709.    The following list describes the types of messages that may be in the
  22710.    queue:
  22711.  
  22712. ╓┌─┌─────────────────┌───────────────────────────────────────────────────────╖
  22713.    Value             Meaning
  22714.    ──────────────────────────────────────────────────────────────────────────
  22715.    QS_KEY            A WM_CHAR message is in the queue.
  22716.  
  22717.    QS_MOUSE          A WM_MOUSEMOVE or WM_BUTTON message is in the queue.
  22718.  
  22719.    QS_MOUSEBUTTON    A WM_BUTTON message is in the queue.
  22720.  
  22721.    QS_MOUSEMOVE      A WM_MOUSEMOVE message is in the queue.
  22722.  
  22723.    QS_PAINT          A WM_PAINT message is in the queue.
  22724.    Value             Meaning
  22725.    ──────────────────────────────────────────────────────────────────────────
  22726.   QS_PAINT          A WM_PAINT message is in the queue.
  22727.  
  22728.    QS_POSTMSG        A posted message other than those listed above is in the
  22729.                      queue.
  22730.  
  22731.    QS_SEM1           A WM_SEM1 message is in the queue.
  22732.  
  22733.    QS_SEM2           A WM_SEM2 message is in the queue.
  22734.  
  22735.    QS_SEM3           A WM_SEM3 message is in the queue.
  22736.  
  22737.    QS_SEM4           A WM_SEM4 message is in the queue.
  22738.  
  22739.    QS_SENDMSG        A message sent by another application is in the queue.
  22740.  
  22741.    QS_TIMER          A WM_TIMER message is in the queue.
  22742.    ──────────────────────────────────────────────────────────────────────────
  22743.  
  22744.  
  22745.  See Also
  22746.  
  22747.    WinGetMsg, WinPeekMsg
  22748.  
  22749.  
  22750.  ────────────────────────────────────────────────────────────────────────────
  22751.  WinQuerySysColor
  22752.  ────────────────────────────────────────────────────────────────────────────
  22753.    COLOR WinQuerySysColor (hwndDesktop, clr, lReserved)
  22754.    HWND hwndDesktop;       /*handle of the desktop                         */
  22755.    COLOR clr;              /*color index of color to retrieve              */
  22756.    LONG lReserved;         /*reserved                                      */
  22757.  
  22758.    The WinQuerySysColor function retrieves a specified system color.
  22759.  
  22760.  Parameters
  22761.  
  22762.    hwndDesktop  Identifies the desktop window. This parameter can be
  22763.    HWND_DESKTOP or the desktop window handle.
  22764.  
  22765.    clr  Specifies the system color-index value to be returned. This parameter
  22766.    must be one of the SYSCLR index values. For a description of the possible
  22767.    color indexes, see the WinSetSysColors function.
  22768.  
  22769.    lReserved  Reserved; must be zero.
  22770.  
  22771.  Return Value
  22772.  
  22773.    The return value is the RGB value corresponding to the index value
  22774.    specified by the clr parameter.
  22775.  
  22776.  See Also
  22777.  
  22778.    WinSetSysColors
  22779.  
  22780.  
  22781.  ────────────────────────────────────────────────────────────────────────────
  22782.  WinQuerySysModalWindow
  22783.  ────────────────────────────────────────────────────────────────────────────
  22784.    HWND WinQuerySysModalWindow (hwndDesktop, fLock)
  22785.    HWND hwndDesktop;       /*handle of the desktop                         */
  22786.    BOOL fLock;             /*lock/unlock flag                              */
  22787.  
  22788.    The WinQuerySysModalWindow function returns the current system modal
  22789.    window.
  22790.  
  22791.  Parameters
  22792.  
  22793.    hwndDesktop  Identifies the desktop window. This parameter can be
  22794.    HWND_DESKTOP or the desktop window handle.
  22795.  
  22796.    fLock  Specifies whether the system modal window should be locked during
  22797.    processing. If this parameter is TRUE, the window is locked. If FALSE, it
  22798.    is not.
  22799.  
  22800.  Return Value
  22801.  
  22802.    The return value is the handle of the current system modal window. If
  22803.    there is none, the return value is NULL.
  22804.  
  22805.  Comments
  22806.  
  22807.    If the system modal window is locked by this function, then you must at
  22808.    some point call the WinLockWindow function to unlock the window. The
  22809.    reason for locking the window is so that the window cannot be destroyed
  22810.    until you are done using it.
  22811.  
  22812.  See Also
  22813.  
  22814.    WinLockWindow, WinSetSysModalWindow
  22815.  
  22816.  
  22817.  ────────────────────────────────────────────────────────────────────────────
  22818.  WinQuerySysPointer
  22819.  ────────────────────────────────────────────────────────────────────────────
  22820.    HPOINTER WinQuerySysPointer (hwndDesktop, iptr, fLoad)
  22821.    HWND hwndDesktop;       /*handle of the desktop                         */
  22822.    SHORT iptr;             /*system-pointer identifier                     */
  22823.    BOOL fLoad;             /*load/unload flag                              */
  22824.  
  22825.    The WinQuerySysPointer function returns the system pointer handle.
  22826.  
  22827.  Parameters
  22828.  
  22829.    hwndDesktop  Identifies the desktop window. This parameter can be
  22830.    HWND_DESKTOP or the desktop window handle.
  22831.  
  22832.    iptr  Specifies the system pointer from the following list. The appearance
  22833.    of system pointers is implementation dependent.
  22834.  
  22835. ╓┌─┌───────────────────────┌─────────────────────────────────────────────────╖
  22836.    Value                   Meaning
  22837.    ──────────────────────────────────────────────────────────────────────────
  22838.    SPTR_APPICON            Standard application icon
  22839.  
  22840.    SPTR_ARROW              Normal arrow pointer
  22841.  
  22842.    SPTR_ICONERROR          Exclamation-mark icon
  22843.  
  22844.    SPTR_ICONINFORMATION    Hand icon
  22845.  
  22846.    SPTR_ICONQUESTION       Question-mark icon
  22847.  
  22848.    SPTR_ICONWARNING        Note icon
  22849.  
  22850.    Value                   Meaning
  22851.    ──────────────────────────────────────────────────────────────────────────
  22852. 
  22853.    SPTR_MOVE               Move pointer
  22854.  
  22855.    SPTR_SIZENESW           Upward sloping double-headed arrow
  22856.  
  22857.    SPTR_SIZENS             Vertical double-headed arrow
  22858.  
  22859.    SPTR_SIZENWSE           Downward sloping double-headed arrow
  22860.  
  22861.    SPTR_SIZEWE             Horizontal double-headed arrow
  22862.  
  22863.    SPTR_TEXT               Text I-beam pointer
  22864.  
  22865.    SPTR_WAIT               Hourglass pointer
  22866.    ──────────────────────────────────────────────────────────────────────────
  22867.  
  22868.  
  22869.    fLoad  Specifies whether to copy the system pointer. If this parameter is
  22870.    TRUE, the system pointer is copied and the handle to the new pointer is
  22871.    returned. If it is FALSE, then the system pointer handle is returned. You
  22872.    should specify TRUE if you intend to modify an existing pointer.
  22873.  
  22874.  Return Value
  22875.  
  22876.    The return value is a pointer handle.
  22877.  
  22878.  Example
  22879.  
  22880.    This example calls WinQuerySysPointer to get a handle to the system
  22881.    pointer, and then loads an application-defined pointer. After it is done
  22882.    using the application-defined pointer, it restores it to the system
  22883.    pointer.
  22884.  
  22885.    /* get the system pointer */
  22886.  
  22887.    hptrDefault = WinQuerySysPointer(HWND_DESKTOP, SPTR_ARROW, FALSE);
  22888.  
  22889.    /* load an application-defined pointer */
  22890.  
  22891.    hptrCrossHair = WinLoadPointer(HWND_DESKTOP, NULL, IDP_CROSSHAIR);
  22892.  
  22893.    /* change the pointer to the application pointer */
  22894.  
  22895.    WinSetPointer(HWND_DESKTOP, hptrCrossHair);
  22896.  
  22897.    /* restore the system pointer */
  22898.  
  22899.    WinSetPointer(HWND_DESKTOP, hptrDefault);
  22900.  
  22901.  See Also
  22902.  
  22903.    WinQueryPointer, WinQueryPointerInfo
  22904.  
  22905.  
  22906.  ────────────────────────────────────────────────────────────────────────────
  22907.  WinQuerySystemAtomTable
  22908.  ────────────────────────────────────────────────────────────────────────────
  22909.    HATOMTBL WinQuerySystemAtomTable (VOID)
  22910.  
  22911.    The WinQuerySystemAtomTable function returns the handle of the system atom
  22912.    table. This allows two different applications to share an atom table.
  22913.  
  22914.  Parameters
  22915.  
  22916.    This function has no parameters.
  22917.  
  22918.  Return Value
  22919.  
  22920.    The return value is the handle of the system atom table.
  22921.  
  22922.  See Also
  22923.  
  22924.    WinCreateAtomTable
  22925.  
  22926.  
  22927.  ────────────────────────────────────────────────────────────────────────────
  22928.  WinQuerySysValue
  22929.  ────────────────────────────────────────────────────────────────────────────
  22930.    LONG WinQuerySysValue (hwndDesktop, iSysValue)
  22931.    HWND hwndDesktop;       /*handle of the desktop                         */
  22932.    SHORT iSysValue;        /*system value to retrieve                      */
  22933.  
  22934.    The WinQuerySysValue function retrieves a specified system value.
  22935.  
  22936.  Parameters
  22937.  
  22938.    hwndDesktop  Identifies the desktop window. This parameter can be
  22939.    HWND_DESKTOP or the desktop window handle.
  22940.  
  22941.    iSysValue  Specifies the system value.
  22942.  
  22943.  Return Value
  22944.  
  22945.    The return value is the system value if the function was successful, or
  22946.    zero if an error occurred.
  22947.  
  22948.  Comments
  22949.  
  22950.    The following list describes the system values:
  22951.  
  22952. ╓┌─┌───────────────────┌─────────────────────────────────────────────────────╖
  22953.    Value               Meaning
  22954.    ──────────────────────────────────────────────────────────────────────────
  22955.    Value               Meaning
  22956.    ──────────────────────────────────────────────────────────────────────────
  22957.    SV_CMOUSEBUTTONS    Specifies the number of mouse buttons: 1, 2, or 3.
  22958.  
  22959.    SV_MOUSEPRESENT     Specifies whether the mouse is present. A value of
  22960.                        TRUE means the mouse is present.
  22961.  
  22962.    SV_SWAPBUTTON       Specifies if the mouse buttons are swapped. TRUE if
  22963.                        mouse buttons are swapped.
  22964.  
  22965.    SV_CXDBLCLK         Specifies the mouse double click horizontal spacing.
  22966.                        The horizontal spatial requirement for considering two
  22967.                        mouse clicks a double click is met if the horizontal
  22968.                        distance between two mouse clicks is less than this
  22969.                        value.
  22970.  
  22971.    SV_CYDBLCLK         Specifies the mouse double click vertical spacing. The
  22972.                        vertical spatial requirement for considering two mouse
  22973.                        clicks a double click is met if the vertical distance
  22974.                        between two mouse clicks is less than this value.
  22975.  
  22976.    Value               Meaning
  22977.    ──────────────────────────────────────────────────────────────────────────
  22978. 
  22979.    SV_DBLCLKTIME       Specifies the mouse double click time in milliseconds.
  22980.                        The temporal requirement for considering two mouse
  22981.                        clicks a double click is met if the time between two
  22982.                        mouse clicks is less than this value.
  22983.  
  22984.    SV_CXSIZEBORDER     Specifies the count of pels along the x-axis in the
  22985.                        left and right parts of a window sizing border.
  22986.  
  22987.    SV_CYSIZEBORDER     Specifies the count of pels along the y-axis in the
  22988.                        top and bottom sections of a window sizing border.
  22989.  
  22990.    SV_ALARM            Specifies whether calls to WinAlarm generate a sound.
  22991.                        A value of TRUE means sound is generated.
  22992.  
  22993.    SV_CURSORRATE       Specifies the cursor blinking rate in milliseconds.
  22994.                        The blinking rate is the time that the cursor remains
  22995.                        visible or invisible. Twice this value is the length
  22996.                        of a complete cursor visible/invisible cycle.
  22997.    Value               Meaning
  22998.    ──────────────────────────────────────────────────────────────────────────
  22999.                       of a complete cursor visible/invisible cycle.
  23000.  
  23001.    SV_FIRSTSCROLLRATE  Specifies the delay (in milliseconds) until scroll bar
  23002.                        autorepeat activity begins when the mouse is held down
  23003.                        on a scroll bar arrow or within a scroll bar.
  23004.  
  23005.    SV_SCROLLRATE       Specifies the delay (in milliseconds) between scroll
  23006.                        bar autorepeat events.
  23007.  
  23008.    SV_NUMBEREDLISTS    Reserved.
  23009.  
  23010.    SV_ERRORFREQ        Specifies the frequency (in cycles per second) of a
  23011.                        WinAlarm WA_ERROR sound.
  23012.  
  23013.    SV_NOTEFREQ         Specifies the frequency (in cycles per second) of a
  23014.                        WinAlarm WA_NOTE sound.
  23015.  
  23016.    SV_WARNINGFREQ      Specifies the frequency (in cycles per second) of a
  23017.                        WinAlarm WA_WARNING sound.
  23018.    Value               Meaning
  23019.    ──────────────────────────────────────────────────────────────────────────
  23020.                       WinAlarm WA_WARNING sound.
  23021.  
  23022.    SV_ERRORDURATION    Specifies the duration (in milliseconds) of a WinAlarm
  23023.                        WA_ERROR sound.
  23024.  
  23025.    SV_NOTEDURATION     Specifies the duration (in milliseconds) of a WinAlarm
  23026.                        WA_NOTE sound.
  23027.  
  23028.    SV_WARNINGDURATION  Specifies the duration (in milliseconds) of a WinAlarm
  23029.                        WA_WARNING sound.
  23030.  
  23031.    SV_CXSCREEN         Specifies the count of pels along the screen's x-axis.
  23032.  
  23033.    SV_CYSCREEN         Specifies the count of pels along the screen's y-axis.
  23034.  
  23035.    SV_CXVSCROLL        Specifies the count of pels along the x-axis of a
  23036.                        vertical scroll bar.
  23037.  
  23038.    SV_CYHSCROLL        Specifies the count of pels along the y-axis of a
  23039.    Value               Meaning
  23040.    ──────────────────────────────────────────────────────────────────────────
  23041.   SV_CYHSCROLL        Specifies the count of pels along the y-axis of a
  23042.                        horizontal scroll bar.
  23043.  
  23044.    SV_CXHSCROLLARROW   Specifies the count of pels along the x-axis of a
  23045.                        horizontal scroll bar arrow.
  23046.  
  23047.    SV_CYVSCROLLARROW   Specifies the count of pels along the y-axis of a
  23048.                        vertical scroll bar arrow.
  23049.  
  23050.    SV_CXBORDER         Specifies the count of pels along the x-axis of a
  23051.                        window border.
  23052.  
  23053.    SV_CYBORDER         Specifies the count of pels along the y-axis of a
  23054.                        window border.
  23055.  
  23056.    SV_CXDLGFRAME       Specifies the count of pels along the x-axis of a
  23057.                        dialog frame.
  23058.  
  23059.    SV_CYDLGFRAME       Specifies the count of pels along the y-axis of a
  23060.    Value               Meaning
  23061.    ──────────────────────────────────────────────────────────────────────────
  23062.   SV_CYDLGFRAME       Specifies the count of pels along the y-axis of a
  23063.                        dialog frame.
  23064.  
  23065.    SV_CYTITLEBAR       Specifies the count of pels along the y-axis of a
  23066.                        title-bar window.
  23067.  
  23068.    SV_CXHSLIDER        Specifies the count of pels along the x-axis of a
  23069.                        horizontal scroll bar slider.
  23070.  
  23071.    SV_CYVSLIDER        Specifies the count of pels along the y-axis of a
  23072.                        vertical scroll bar slider.
  23073.  
  23074.    SV_CXMINMAXBUTTON   Specifies the width (in pels) of a minimize/ maximize
  23075.                        button.
  23076.  
  23077.    SV_CYMINMAXBUTTON   Specifies the height (in pels) of a minimize/ maximize
  23078.                        button.
  23079.  
  23080.    SV_CYMENU           Specifies the height (in pels) of an action-bar menu.
  23081.    Value               Meaning
  23082.    ──────────────────────────────────────────────────────────────────────────
  23083.   SV_CYMENU           Specifies the height (in pels) of an action-bar menu.
  23084.  
  23085.    SV_CXFULLSCREEN     Specifies the count of pels along the x-axis of a
  23086.                        maximized frame window's client window.
  23087.  
  23088.    SV_CYFULLSCREEN     Specifies the count of pels along the y-axis of a
  23089.                        maximized frame window's client window.
  23090.  
  23091.    SV_CXICON           Specifies the count of pels along an icon's x-axis.
  23092.  
  23093.    SV_CYICON           Specifies the count of pels along an icon's y-axis.
  23094.  
  23095.    SV_CXPOINTER        Specifies the count of pels along the mouse pointer's
  23096.                        x-axis.
  23097.  
  23098.    SV_CYPOINTER        Specifies the count of pels along the mouse pointer's
  23099.                        y-axis.
  23100.  
  23101.    SV_DEBUG            Reserved.
  23102.    Value               Meaning
  23103.    ──────────────────────────────────────────────────────────────────────────
  23104.   SV_DEBUG            Reserved.
  23105.  
  23106.    SV_CURSORLEVEL      Specifies the cursor display count. The cursor is
  23107.                        visible only when the display count is zero.
  23108.  
  23109.    SV_POINTERLEVEL     Specifies the mouse pointer display count. The mouse
  23110.                        is visible only when the display count is zero.
  23111.  
  23112.    SV_TRACKRECTLEVEL   Specifies the tracking rectangle display count. The
  23113.                        tracking rectangle is visible only when the display
  23114.                        count is zero.
  23115.  
  23116.    SV_CTIMERS          Specifies the number of available timers.
  23117.  
  23118.    SV_CXBYTEALIGN      Set by a device driver at initialization time to
  23119.                        indicate any horizontal alignment that is more
  23120.                        efficient for the driver.
  23121.  
  23122.    SV_CYBYTEALIGN      Set by a device driver at initialization time to
  23123.    Value               Meaning
  23124.    ──────────────────────────────────────────────────────────────────────────
  23125.   SV_CYBYTEALIGN      Set by a device driver at initialization time to
  23126.                        indicate any vertical alignment that is more efficient
  23127.                        for the driver.
  23128.  
  23129.    SV_CSYSVALUES       Specifies the number of system values.
  23130.    ──────────────────────────────────────────────────────────────────────────
  23131.  
  23132.  
  23133.  See Also
  23134.  
  23135.    WinSetSysValue
  23136.  
  23137.  
  23138.  ────────────────────────────────────────────────────────────────────────────
  23139.  WinQueryTaskTitle
  23140.  ────────────────────────────────────────────────────────────────────────────
  23141.    USHORT WinQueryTaskTitle (idProcess, pszTitle, cbTitle)
  23142.    USHORT idProcess;       /*identifies the process                        */
  23143.    PSZ pszTitle;           /*address of the buffer                         */
  23144.    USHORT cbTitle;         /*length of the buffer                          */
  23145.  
  23146.    The WinQueryTaskTitle function obtains the title under which a specified
  23147.    application was started or added to the switch list. If this function is
  23148.    used after a switch-list entry is created for the application, the title
  23149.    in the switch-list entry is obtained.
  23150.  
  23151.    This function is useful when an application should use the same name in
  23152.    its window title and its entry in the switch list as the end-user invokes
  23153.    to start the application. This provides a visual link for the user.
  23154.  
  23155.  Parameters
  23156.  
  23157.    idProcess  Identifies the application whose title is requested.
  23158.  
  23159.    pszTitle  Points to the buffer to receive the title. The received string
  23160.    will be null-terminated.
  23161.  
  23162.    cbTitle  Specifies the length, in bytes, of the pszTitle buffer. If the
  23163.    retrieved title is longer then this length, it will be truncated.
  23164.  
  23165.  Return Value
  23166.  
  23167.    The return value is zero if the function is successful. Otherwise, it is
  23168.    an error value.
  23169.  
  23170.  Comments
  23171.  
  23172.    The length of the title is guaranteed not to exceed MAXNAMEL bytes, plus
  23173.    one for the null-terminating character.
  23174.  
  23175.  See Also
  23176.  
  23177.    WinAddSwitchEntry
  23178.  
  23179.  
  23180.  ────────────────────────────────────────────────────────────────────────────
  23181.  WinQueryUpdateRect
  23182.  ────────────────────────────────────────────────────────────────────────────
  23183.    BOOL WinQueryUpdateRect (hwnd, prcl)
  23184.    HWND hwnd;              /*handle of the window                          */
  23185.    PRECTL prcl;            /*address of structure for update rectangle     */
  23186.  
  23187.    The WinQueryUpdateRect function retrieves the rectangle that bounds the
  23188.    update region of a specified window. This function, in conjunction with
  23189.    the WinValidateRect function, is useful for implementing an incremental
  23190.    update scheme as an alternative to the WinBeginPaint and WinEndPaint
  23191.    functions. You can use the returned update rectangle as the clip region
  23192.    for a presentation space so that drawing output can be clipped to the
  23193.    window's update region.
  23194.  
  23195.  Parameters
  23196.  
  23197.    hwnd  Identifies the window whose update rectangle is retrieved.
  23198.  
  23199.    prcl  Points to a RECTL structure that receives the coordinates of the
  23200.    rectangle bounding the window's update region. The RECTL structure has the
  23201.    following form:
  23202.  
  23203.    typedef struct _RECTL {
  23204.        LONG  xLeft;
  23205.        LONG  yBottom;
  23206.        LONG  xRight;
  23207.        LONG  yTop;
  23208.    } RECTL;
  23209.  
  23210.    For a full description, see Chapter 4, "Types, Macros, Structures."
  23211.  
  23212.  Return Value
  23213.  
  23214.    The return value is TRUE if the function is successful or FALSE if an
  23215.    error occurs.
  23216.  
  23217.  See Also
  23218.  
  23219.    WinBeginPaint, WinEndPaint, WinQueryUpdateRegion, WinValidateRect
  23220.  
  23221.  
  23222.  ────────────────────────────────────────────────────────────────────────────
  23223.  WinQueryUpdateRegion
  23224.  ────────────────────────────────────────────────────────────────────────────
  23225.    SHORT WinQueryUpdateRegion (hwnd, hrgn)
  23226.    HWND hwnd;              /*handle of the window                          */
  23227.    HRGN hrgn;              /*handle of the region                          */
  23228.  
  23229.    The WinQueryUpdateRegion function obtains the update region of a window.
  23230.    This function, in conjunction with the WinValidateRegion function, is
  23231.    useful for implementing an alternative update scheme to the use of the
  23232.    WinBeginPaint and WinEndPaint functions. You can use the returned update
  23233.    region as the clip region for a presentation space so that drawing output
  23234.    can be clipped to the window's update region.
  23235.  
  23236.  Parameters
  23237.  
  23238.    hwnd  Identifies the window whose update region is to be retrieved.
  23239.  
  23240.    hrgn  Identifies the region that will receive the window's update region.
  23241.  
  23242.  Return Value
  23243.  
  23244.    The return value is the type of the region identified by the hrgn
  23245.    parameter, as defined by the GpiCombineRegion function.
  23246.  
  23247.  See Also
  23248.  
  23249.    GpiCombineRegion, WinBeginPaint, WinEndPaint, WinValidateRegion
  23250.  
  23251.  
  23252.  ────────────────────────────────────────────────────────────────────────────
  23253.  WinQueryVersion
  23254.  ────────────────────────────────────────────────────────────────────────────
  23255.    ULONG WinQueryVersion (hab)
  23256.    HAB hab;                /*handle of the anchor block                    */
  23257.  
  23258.    The WinQueryVersion function returns the version and revision level of MS
  23259.    OS/2.
  23260.  
  23261.  Parameters
  23262.  
  23263.    hab  Identifies an anchor block.
  23264.  
  23265.  Return Value
  23266.  
  23267.    The return value is the version number, consisting of the major and minor
  23268.    version number and the revision character. The low word contains the minor
  23269.    version in the low byte and the major version in the high byte. The high
  23270.    word contains the revision character in the low byte. You can use the
  23271.    following macros to extract this information:
  23272.  
  23273.    Macro                       Result
  23274.    ──────────────────────────────────────────────────────────────────────────
  23275.    LOBYTE(LOUSHORT(return))    Retrieves the major version number.
  23276.  
  23277.    HIBYTE(LOUSHORT(return))    Retrieves the minor version number.
  23278.  
  23279.    LOUCHAR(HIUSHORT(return))   Retrieves the revision character.
  23280.    ──────────────────────────────────────────────────────────────────────────
  23281.  
  23282.  See Also
  23283.  
  23284.    DosGetVersion
  23285.  
  23286.  
  23287.  ────────────────────────────────────────────────────────────────────────────
  23288.  WinQueryWindow
  23289.  ────────────────────────────────────────────────────────────────────────────
  23290.    HWND WinQueryWindow (hwnd, cmd, fLock)
  23291.    HWND hwnd;              /*handle of the window                          */
  23292.    SHORT cmd;              /*which window to retrieve                      */
  23293.    BOOL fLock;             /*lock/unlock flag                              */
  23294.  
  23295.    The WinQueryWindow function retrieves the handle of a window that has a
  23296.    specified relationship to a specified window.
  23297.  
  23298.    If WinQueryWindow is used to enumerate windows of other threads, it is not
  23299.    guaranteed that all the windows are enumerated, because the z ordering of
  23300.    the windows may change during the enumeration. The WinGetNextWindow
  23301.    function must be used for this purpose.
  23302.  
  23303.  Parameters
  23304.  
  23305.    hwnd  Identifies a window. The window handle retrieved is relative to this
  23306.    window, based on the value in the cmd parameter.
  23307.  
  23308.    cmd  Specifies which window to retrieve. The following are the possible
  23309.    values:
  23310.  
  23311.    Value             Meaning
  23312.    ──────────────────────────────────────────────────────────────────────────
  23313.    QW_BOTTOM         Bottommost child window.
  23314.  
  23315.    QW_FRAMEOWNER     Returns the owner of hwnd, normalized so that it shares
  23316.                      the same parent as hwnd.
  23317.  
  23318.    QW_NEXT           Next window in z order (window below).
  23319.  
  23320.    QW_NEXTTOP        Next main window in the enumeration order defined for
  23321.                      the ALT+ESCAPE function of the user interface.
  23322.  
  23323.    QW_OWNER          Owner of window.
  23324.  
  23325.    QW_PARENT         Parent of window; HWND_OBJECT if object window.
  23326.  
  23327.    QW_PREV           Previous window in z order (window above).
  23328.  
  23329.    QW_PREVTOP        Previous main window, in the enumeration order defined
  23330.                      by QW_NEXTTOP.
  23331.  
  23332.    QW_TOP            Topmost child window.
  23333.    ──────────────────────────────────────────────────────────────────────────
  23334.  
  23335.    fLock  Specifies whether the retrieved window is to be locked or unlocked.
  23336.    If TRUE, the window is locked. If FALSE, it is not.
  23337.  
  23338.  Return Value
  23339.  
  23340.    The return value is the handle of the window related to the window
  23341.    identified by the hwnd parameter.
  23342.  
  23343.  Comments
  23344.  
  23345.    If the retrieved window is locked by this function, then you must at some
  23346.    point call the WinLockWindow function to unlock the window. The reason for
  23347.    locking the window is so that the window cannot be destroyed until you
  23348.    have finished using it.
  23349.  
  23350.  See Also
  23351.  
  23352.    WinGetNextWindow, WinLockWindow
  23353.  
  23354.  
  23355.  ────────────────────────────────────────────────────────────────────────────
  23356.  WinQueryWindowDC
  23357.  ────────────────────────────────────────────────────────────────────────────
  23358.    HDC WinQueryWindowDC (hwnd)
  23359.    HWND hwnd;              /*handle of the window                          */
  23360.  
  23361.    The WinQueryWindowDC function retrieves the device context created by a
  23362.    call to the WinOpenWindowDC function for the specified window.
  23363.  
  23364.  Parameters
  23365.  
  23366.    hwnd  Identifies the window that has the device context.
  23367.  
  23368.  Return Value
  23369.  
  23370.    The return value is the handle of the device context or NULL if an error
  23371.    occurred.
  23372.  
  23373.  See Also
  23374.  
  23375.    WinOpenWindowDC
  23376.  
  23377.  
  23378.  ────────────────────────────────────────────────────────────────────────────
  23379.  WinQueryWindowLockCount
  23380.  ────────────────────────────────────────────────────────────────────────────
  23381.    SHORT WinQueryWindowLockCount (hwnd)
  23382.    HWND hwnd;              /*handle of the window                          */
  23383.  
  23384.    The WinQueryWindowLockCount function returns a window's lock count. Since
  23385.    a window may be locked by another thread or process at any time, the value
  23386.    returned by this function may also change at any time.
  23387.  
  23388.  Parameters
  23389.  
  23390.    hwnd  Identifies the window whose lock count is being retrieved.
  23391.  
  23392.  Return Value
  23393.  
  23394.    The return value is the window lock count if the window is locked.
  23395.    Otherwise, it is zero, indicating that the window is not locked or that an
  23396.    error occurred.
  23397.  
  23398.  See Also
  23399.  
  23400.    WinLockWindow
  23401.  
  23402.  
  23403.  ────────────────────────────────────────────────────────────────────────────
  23404.  WinQueryWindowPos
  23405.  ────────────────────────────────────────────────────────────────────────────
  23406.    BOOL WinQueryWindowPos (hwnd, pswp)
  23407.    HWND hwnd;              /*handle of the window                          */
  23408.    PSWP pswp;              /*address of the structure for window           */
  23409.                            /*information                                   */
  23410.  
  23411.    The WinQueryWindowPos function retrieves a window's size and position.
  23412.  
  23413.  Parameters
  23414.  
  23415.    hwnd  Identifies the window to get the size and position of.
  23416.  
  23417.    pswp  Points to an SWP structure that receives the window's size and
  23418.    position. The SWP structure has the following form:
  23419.  
  23420.    typedef struct _SWP {
  23421.        USHORT fs;
  23422.        SHORT  cy;
  23423.        SHORT  cx;
  23424.        SHORT  y;
  23425.        SHORT  x;
  23426.        HWND   hwndInsertBehind;
  23427.        HWND   hwnd;
  23428.    } SWP;
  23429.  
  23430.    For a full description, see Chapter 4, "Types, Macros, Structures."
  23431.  
  23432.  Return Value
  23433.  
  23434.    The return value is TRUE if the function is successful or FALSE if an
  23435.    error occurs.
  23436.  
  23437.  See Also
  23438.  
  23439.    WinSetWindowPos
  23440.  
  23441.  
  23442.  ────────────────────────────────────────────────────────────────────────────
  23443.  WinQueryWindowProcess
  23444.  ────────────────────────────────────────────────────────────────────────────
  23445.    BOOL WinQueryWindowProcess (hwnd, ppid, ptid)
  23446.    HWND hwnd;              /*handle of the window                          */
  23447.    PPID ppid;              /*address of variable for process identifier    */
  23448.    PTID ptid;              /*address of variable for thread identifier     */
  23449.  
  23450.    The WinQueryWindowProcess function obtains the process identifier and
  23451.    thread identifier of the thread that created a window.
  23452.  
  23453.  Parameters
  23454.  
  23455.    hwnd  Identifies the window.
  23456.  
  23457.    ppid  Specifies the process identifier of the thread that created the
  23458.    window. It can be NULL if you aren't interested in this value.
  23459.  
  23460.    ptid  Specifies the thread identifier of the thread that created the
  23461.    window. It can be NULL if you aren't interested in this value.
  23462.  
  23463.  Return Value
  23464.  
  23465.    The return value is TRUE if the function is successful or FALSE if an
  23466.    error occurs.
  23467.  
  23468.  See Also
  23469.  
  23470.    DosGetPID
  23471.  
  23472.  
  23473.  ────────────────────────────────────────────────────────────────────────────
  23474.  WinQueryWindowPtr
  23475.  ────────────────────────────────────────────────────────────────────────────
  23476.    PVOID WinQueryWindowPtr (hwnd, index)
  23477.    HWND hwnd;              /*handle of the window                          */
  23478.    SHORT index;            /*index to the pointer                          */
  23479.  
  23480.    The WinQueryWindowPtr function retrieves a pointer value from a specified
  23481.    window's reserved memory.
  23482.  
  23483.    The window handle that is passed to this function can be the handle of a
  23484.    window with the same or a different message queue from the caller; that
  23485.    is, this function allows the caller to obtain data from windows belonging
  23486.    to other threads.
  23487.  
  23488.  Parameters
  23489.  
  23490.    hwnd  Identifies the window that contains the pointer to retrieve.
  23491.  
  23492.    index  Specifies the zero-based index of the pointer to retrieve. Valid
  23493.    values are in the range zero through the number of bytes of window data
  23494.    (for example, a value of 8 would be an index to the third pointer), or
  23495.    QWP_PFNWP to address the index of the window procedure.
  23496.  
  23497.  Return Value
  23498.  
  23499.    The return value is the specified ULONG value in the window's reserved
  23500.    memory.
  23501.  
  23502.  Comments
  23503.  
  23504.    The specified index is valid only if all the bytes referenced are within
  23505.    the reserved memory. For example, this function would fail if an index
  23506.    value of zero was specified and only two bytes had been reserved.
  23507.  
  23508.  See Also
  23509.  
  23510.    WinQueryWindowULong, WinSetWindowPtr
  23511.  
  23512.  
  23513.  ────────────────────────────────────────────────────────────────────────────
  23514.  WinQueryWindowRect
  23515.  ────────────────────────────────────────────────────────────────────────────
  23516.    BOOL WinQueryWindowRect (hwnd, prcl)
  23517.    HWND hwnd;              /*handle of the window                          */
  23518.    PRECTL prcl;            /*address of structure for window coordinates   */
  23519.  
  23520.    The WinQueryWindowRect function retrieves the coordinates of a window.
  23521.  
  23522.  Parameters
  23523.  
  23524.    hwnd  Identifies the window whose coordinates are retrieved.
  23525.  
  23526.    prcl  Points to a RECTL structure that receives the window's coordinates.
  23527.    The xLeft and yBottom fields will be zero. The xRight and yTop fields will
  23528.    contain the width and height of the window. The RECTL structure has the
  23529.    following form:
  23530.  
  23531.    typedef struct _RECTL {
  23532.        LONG  xLeft;
  23533.        LONG  yBottom;
  23534.        LONG  xRight;
  23535.        LONG  yTop;
  23536.    } RECTL;
  23537.  
  23538.  Return Value
  23539.  
  23540.    The return value is TRUE if the function is successful or FALSE if an
  23541.    error occurs.
  23542.  
  23543.  Example
  23544.  
  23545.    This example calls WinQueryWindowRect to get the dimensions of the window,
  23546.    and then calls WinFillRect to fill the window.
  23547.  
  23548.    HPS hps;
  23549.    RECTL rcl;
  23550.  
  23551.    WinQueryWindowRect(hwnd, &rcl);       /* get window dimensions */
  23552.    WinFillRect(hps, &rcl, CLR_WHITE);    /* clear entire window   */
  23553.  
  23554.  See Also
  23555.  
  23556.    WinQueryWindowPos
  23557.  
  23558.  
  23559.  ────────────────────────────────────────────────────────────────────────────
  23560.  WinQueryWindowText
  23561.  ────────────────────────────────────────────────────────────────────────────
  23562.    SHORT WinQueryWindowText (hwnd, cbBuf, pszBuf)
  23563.    HWND hwnd;              /*handle of the window                          */
  23564.    SHORT cbBuf;            /*length of the buffer                          */
  23565.    PSZ pszBuf;             /*address of the buffer                         */
  23566.  
  23567.    The WinQueryWindowText function copies window text into a buffer. If the
  23568.    window is a frame window, the title-bar window text is copied.
  23569.  
  23570.    If the window text is longer than (cbBuf - 1), only the first (cbBuf - 1)
  23571.    characters of window text are copied.
  23572.  
  23573.    This function sends a WM_QUERYWINDOWPARAMS message to the window
  23574.    identified by the hwnd parameter.
  23575.  
  23576.  Parameters
  23577.  
  23578.    hwnd  Identifies the window containing the text.
  23579.  
  23580.    cbBuf  Specifies the length of the buffer pointed to by the pszBuf
  23581.    parameter. If the text is larger then this value, it will be truncated.
  23582.  
  23583.    pszBuf  Points to a buffer the receives the window text.
  23584.  
  23585.  Return Value
  23586.  
  23587.    The return value is the length of the returned text.
  23588.  
  23589.  Comments
  23590.  
  23591.    You can determine the size of the window text ahead of time by calling the
  23592.    WinQueryWindowTextLength function.
  23593.  
  23594.  See Also
  23595.  
  23596.    WinQueryWindowTextLength
  23597.  
  23598.  
  23599.  ────────────────────────────────────────────────────────────────────────────
  23600.  WinQueryWindowTextLength
  23601.  ────────────────────────────────────────────────────────────────────────────
  23602.    SHORT WinQueryWindowTextLength (hwnd)
  23603.    HWND hwnd;              /*handle of the window                          */
  23604.  
  23605.    The WinQueryWindowTextLength function retrieves the length of the window
  23606.    text, not including any null termination character.
  23607.  
  23608.    This function sends a WM_QUERYFRAMEINFO message to the window identified
  23609.    by the hwnd parameter.
  23610.  
  23611.  Parameters
  23612.  
  23613.    hwnd  Identifies the window containing the text.
  23614.  
  23615.  Return Value
  23616.  
  23617.    The return value is the length of the window text.
  23618.  
  23619.  See Also
  23620.  
  23621.    WinQueryWindowText
  23622.  
  23623.  
  23624.  ────────────────────────────────────────────────────────────────────────────
  23625.  WinQueryWindowULong
  23626.  ────────────────────────────────────────────────────────────────────────────
  23627.    ULONG WinQueryWindowULong (hwnd, index)
  23628.    HWND hwnd;              /*handle of the window                          */
  23629.    SHORT index;            /*index of value to retrieve                    */
  23630.  
  23631.    The WinQueryWindowULong function retrieves an unsigned long integer value
  23632.    at a specified offset into the reserved memory of a given window.
  23633.  
  23634.    The window handle that is passed to this function can be the handle of a
  23635.    window with the same or a different message queue from the caller; that
  23636.    is, this function allows the caller to obtain data from windows belonging
  23637.    to other threads.
  23638.  
  23639.  Parameters
  23640.  
  23641.    hwnd  Identifies the window to query.
  23642.  
  23643.    index  Specifies the zero-based index of the ULONG value to retrieve.
  23644.    Valid values are in the range zero through the number of bytes of window
  23645.    data (for example, a value of 8 would be an index to the third long
  23646.    integer), or any of the following QWL values:
  23647.  
  23648. ╓┌─┌─────────────────────┌───────────────────────────────────────────────────╖
  23649.    Value                 Meaning
  23650.    ──────────────────────────────────────────────────────────────────────────
  23651.    QWL_HHEAP             Handle of the heap.
  23652.  
  23653.    QWL_HMQ               Handle of the message queue of the window.
  23654.  
  23655.    QWL_HWNDFOCUSSAVE     Handle of the window that last had the focus.
  23656.  
  23657.    QWL_STYLE             Window style.
  23658.  
  23659.    QWL_USER              ULONG value present in windows of the following
  23660.                          preregistered window classes:
  23661.  
  23662.                              WC_DIALOG
  23663.                              WC_FRAME
  23664.                              WC_LISTBOX
  23665.                              WC_BUTTON
  23666.                              WC_STATIC
  23667.                              WC_ENTRYFIELD
  23668.                              WC_SCROLLBAR
  23669.    Value                 Meaning
  23670.    ──────────────────────────────────────────────────────────────────────────
  23671.                             WC_SCROLLBAR
  23672.                              WC_MENU
  23673.  
  23674.                          This value can be used to retrieve
  23675.                          application-specific data in controls.
  23676.    ──────────────────────────────────────────────────────────────────────────
  23677.  
  23678.  
  23679.  Return Value
  23680.  
  23681.    The return value is the specified ULONG value in the window's reserved
  23682.    memory.
  23683.  
  23684.  Comments
  23685.  
  23686.    The specified index is valid only if all the bytes referenced are within
  23687.    the reserved memory. For example, this function would fail if an index
  23688.    value of zero was specified and only two bytes had been reserved.
  23689.  
  23690.  See Also
  23691.  
  23692.    WinQueryWindowUShort, WinRegisterClass, WinSetWindowULong
  23693.  
  23694.  
  23695.  ────────────────────────────────────────────────────────────────────────────
  23696.  WinQueryWindowUShort
  23697.  ────────────────────────────────────────────────────────────────────────────
  23698.    USHORT WinQueryWindowUShort (hwnd, index)
  23699.    HWND hwnd;              /*handle of the window                          */
  23700.    SHORT index;            /*index of value to retrieve                    */
  23701.  
  23702.    The WinQueryWindowUShort function retrieves an unsigned short integer
  23703.    value at a specified offset into the reserved memory of a given window.
  23704.  
  23705.    The window handle that is passed to this function can be the handle of a
  23706.    window with the same or a different message queue from the caller; that
  23707.    is, this function allows the caller to obtain data from windows belonging
  23708.    to other threads.
  23709.  
  23710.  Parameters
  23711.  
  23712.    hwnd  Identifies the window to query.
  23713.  
  23714.    index  Specifies the zero-based index of the USHORT value to retrieve.
  23715.    Valid values are in the range zero through the number of bytes of window
  23716.    data (for example, a value of 8 would be an index to the fifth integer),
  23717.    or any of the following QWS values:
  23718.  
  23719.    Value     Meaning
  23720.    ──────────────────────────────────────────────────────────────────────────
  23721.    QWS_ID    Window identifier (as passed by the WinCreateWindow function).
  23722.  
  23723.    QWS_USER  USHORT value present in windows of the following preregistered
  23724.              window classes:
  23725.  
  23726.                  WC_DIALOG
  23727.                  WC_FRAME
  23728.                  WC_LISTBOX
  23729.                  WC_BUTTON
  23730.                  WC_STATIC
  23731.                  WC_ENTRYFIELD
  23732.                  WC_SCROLLBAR
  23733.                  WC_MENU
  23734.  
  23735.              This value can be used to retrieve application-specific data in
  23736.              controls.
  23737.    ──────────────────────────────────────────────────────────────────────────
  23738.  
  23739.  Return Value
  23740.  
  23741.    The return value is the USHORT value in the window's reserved memory.
  23742.  
  23743.  See Also
  23744.  
  23745.    WinCreateWindow, WinQueryWindowULong, WinRegisterClass,
  23746.    WinSetWindowUShort
  23747.  
  23748.  
  23749.  ────────────────────────────────────────────────────────────────────────────
  23750.  WinReallocMem
  23751.  ────────────────────────────────────────────────────────────────────────────
  23752.    NPBYTE WinReallocMem (hHeap, npMem, cbOld, cbNew)
  23753.    HHEAP hHeap;            /*handle of the heap                            */
  23754.    NPBYTE npMem;           /*address of memory block to reallocate         */
  23755.    USHORT cbOld;           /*old memory block length                       */
  23756.    USHORT cbNew;           /*new memory block length                       */
  23757.  
  23758.    The WinReallocMem function reallocates the size of a memory block on the
  23759.    heap.
  23760.  
  23761.    The calling routine must specify both the old size of the memory object
  23762.    and the new size. If the new size is larger than the old size, then this
  23763.    function calls the WinAllocMem function to allocate the new, larger
  23764.    object, copies the number of bytes specified by the cbOld parameter from
  23765.    the old object to the new, frees the old object, and returns a pointer to
  23766.    the new object. (It never causes an object to grow in place.)
  23767.  
  23768.    If the passed heap is created with the HM_MOVEABLE option, then the value
  23769.    of the cbOld parameter is ignored and the value in the size word of the
  23770.    allocated object is used. On completion, the size word contains the value
  23771.    of the cbNew parameter. If this function has to move the object in order
  23772.    to satisfy the request, then the handle value word is updated by adding to
  23773.    it the distance of the move, in bytes. The returned address is then the
  23774.    address of the first reserved word.
  23775.  
  23776.  Parameters
  23777.  
  23778.    hHeap  Identifies the heap. This parameter must have been returned from a
  23779.    previous call to the WinCreateHeap function.
  23780.  
  23781.    npMem  Points to the memory block to be reallocated. The low two bits of
  23782.    npMem are ignored, although they are preserved in the return value of this
  23783.    function, even if the memory object is moved as a result of growing.
  23784.    Except for the two low bits, the value of the npMem parameter must have
  23785.    been returned by either the WinAllocMem function or a previous call to
  23786.    WinReallocMem.
  23787.  
  23788.    cbOld  Specifies the old size of the memory block, in bytes.
  23789.  
  23790.    cbNew  Specifies the new size of the memory block, in bytes.
  23791.  
  23792.  Return Value
  23793.  
  23794.    The return value is a pointer to the reallocated memory block if the
  23795.    function was successful. Otherwise, it is NULL, indicating that the memory
  23796.    could not be reallocated to the requested size.
  23797.  
  23798.    The return pointer is a 16-bit offset from the start of the segment
  23799.    containing the heap of the reallocated memory object. The function returns
  23800.    NULL when the memory object cannot be reallocated because an invalid heap
  23801.    handle is specified, there is not enough room in the heap to increase the
  23802.    object to the specified size, or the npMem parameter points to memory
  23803.    outside the bounds of the passed heap.
  23804.  
  23805.  See Also
  23806.  
  23807.    WinAllocMem, WinCreateHeap, WinFreeMem
  23808.  
  23809.  
  23810.  ────────────────────────────────────────────────────────────────────────────
  23811.  WinRegisterClass
  23812.  ────────────────────────────────────────────────────────────────────────────
  23813.    BOOL WinRegisterClass (hab, pszClassName, pfnWndProc, flStyle,
  23814.    cbWindowData)
  23815.    HAB hab;                /*handle of the anchor block                    */
  23816.    PSZ pszClassName;       /*points to the class name                      */
  23817.    PFNWP pfnWndProc;       /*address of the window procedure               */
  23818.    ULONG flStyle;          /*window-style flags                            */
  23819.    USHORT cbWindowData;    /*amount of reserved data                       */
  23820.  
  23821.    The WinRegisterClass function registers a window class.
  23822.  
  23823.    When an application registers a private class with the window procedure in
  23824.    a dynamic-link library, it is the application's responsibility to resolve
  23825.    the window procedure address before issuing WinRegisterClass.
  23826.  
  23827.    Private classes are deleted when the process that registers them
  23828.    terminates.
  23829.  
  23830.  Parameters
  23831.  
  23832.    hab  Identifies the anchor block.
  23833.  
  23834.    pszClassName  Points to the window classname. It can either be an
  23835.    application-specified name or the name of one of the following
  23836.    preregistered classes:
  23837.  
  23838. ╓┌─┌─────────────────┌───────────────────────────────────────────────────────╖
  23839.    Class             Description
  23840.    ──────────────────────────────────────────────────────────────────────────
  23841.    WC_BUTTON         A button control, including push buttons, radio buttons,
  23842.                      check boxes, and user buttons.
  23843.  
  23844.    WC_ENTRYFIELD     An entry-field control that allows single line-text
  23845.                      editing.
  23846.  
  23847.    WC_FRAME          A standard frame window.
  23848.  
  23849.    WC_LISTBOX        A list box that displays a scrolling list of items.
  23850.  
  23851.    WC_MENU           A menu, including the action bar and pull-down menus.
  23852.  
  23853.    WC_SCROLLBAR      A scroll bar that allows a user to scroll the contents
  23854.                      of a window.
  23855.  
  23856.    WC_STATIC         A static control that displays text, icon, or bitmap
  23857.                      data.
  23858.    Class             Description
  23859.    ──────────────────────────────────────────────────────────────────────────
  23860.                     data.
  23861.  
  23862.    WC_TITLEBAR       A title-bar control that displays the title of a window
  23863.                      across the top of the frame and also allows the user to
  23864.                      drag the frame window to a new location.
  23865.    ──────────────────────────────────────────────────────────────────────────
  23866.  
  23867.  
  23868.    pfnWndProc  Points to the window procedure, which can be NULL if the
  23869.    application does not provide its own window procedure.
  23870.  
  23871.    flStyle  Specifies the default window style, which can be any of the
  23872.    standard CS class styles, in addition to any class-specific styles that
  23873.    may be defined. These styles can be augmented when a window of this class
  23874.    is created. A public window class is created if the CS_PUBLIC style is
  23875.    specified; otherwise, a private class is created. Public classes are
  23876.    available for window creation from any process. Private classes are only
  23877.    available to the registering process.
  23878.  
  23879.    The following list describes the standard classes:
  23880.  
  23881. ╓┌─┌───────────────────┌─────────────────────────────────────────────────────╖
  23882.    Style               Meaning
  23883.    ──────────────────────────────────────────────────────────────────────────
  23884.    CS_CLIPCHILDREN     Sets the WS_CLIPCHILDREN style for windows created
  23885.                        using this class.
  23886.  
  23887.    CS_CLIPSIBLINGS     Sets the WS_CLIPSIBLINGS style for windows created
  23888.                        using this class.
  23889.  
  23890.    CS_FRAME            Identifies windows created using this class as frame
  23891.                        windows. Frame windows receive the special
  23892.                        WM_FRAMEDESTROY message when they are being destroyed.
  23893.  
  23894.    CS_HITTEST          Directs the system to send WM_HITTEST messages to
  23895.                        windows of this class whenever the mouse moves in the
  23896.                        window.
  23897.  
  23898.    CS_MOVENOTIFY       Directs the system to send WM_MOVE messages to the
  23899.                        window whenever the window moves.
  23900.    Style               Meaning
  23901.    ──────────────────────────────────────────────────────────────────────────
  23902.                       window whenever the window moves.
  23903.  
  23904.    CS_PARENTCLIP       Sets the WS_PARENTCLIP style for windows created using
  23905.                        this class.
  23906.  
  23907.    CS_PUBLIC           Creates a public window class.
  23908.  
  23909.    CS_SAVEBITS         Sets the WS_SAVEBITS style for windows created using
  23910.                        this class.
  23911.  
  23912.    CS_SIZEREDRAW       Directs the system to invalidate the entire window
  23913.                        whenever the size of the window changes.
  23914.  
  23915.    CS_SYNCPAINT        Sets the WS_SYNCPAINT style for windows created using
  23916.                        this class.
  23917.    ──────────────────────────────────────────────────────────────────────────
  23918.  
  23919.  
  23920.    cbWindowData  Specifies the number of bytes of storage reserved per window
  23921.    created of this class for application use.
  23922.  
  23923.  Return Value
  23924.  
  23925.    The return value is TRUE if the function is successful or FALSE if an
  23926.    error occurs.
  23927.  
  23928.  Example
  23929.  
  23930.    This example calls WinRegisterClass to register a class, return FALSE if
  23931.    an error occurs.
  23932.  
  23933.    HAB hab;
  23934.    CHAR szClassName[] = "Generic"; /* window class name      */
  23935.  
  23936.    if (!WinRegisterClass(hab,   /* anchor-block handle       */
  23937.            szClassName,         /* class name                */
  23938.            GenericWndProc,      /* window procedure          */
  23939.            0L,                  /* window style              */
  23940.            0))                  /* amount of reserved memory */
  23941.        return (FALSE);
  23942.  
  23943.  See Also
  23944.  
  23945.    WinQueryClassInfo, WinQueryClassName, WinQueryWindowPtr,
  23946.    WinQueryWindowULong, WinQueryWindowUShort
  23947.  
  23948.  
  23949.  ────────────────────────────────────────────────────────────────────────────
  23950.  WinRegisterWindowDestroy
  23951.  ────────────────────────────────────────────────────────────────────────────
  23952.    BOOL WinRegisterWindowDestroy (hwnd, fRegister)
  23953.    HWND hwnd;              /*handle of the window                          */
  23954.    BOOL fRegister;         /*register flag                                 */
  23955.  
  23956.    The WinRegisterWindowDestroy function notifies other applications when the
  23957.    specified window is destroyed.
  23958.  
  23959.  Parameters
  23960.  
  23961.    hwnd  Identifies the window being destroyed.
  23962.  
  23963.    fRegister  Specifies whether the window is to be registered. If fRegister
  23964.    is TRUE, this function registers the window so that when it is destroyed,
  23965.    a WM_OTHERWINDOWDESTROYED message is broadcast to all main windows of
  23966.    other tasks. Registering the window is accomplished by incrementing a
  23967.    register count. If fRegister is FALSE, this routine unregisters the window
  23968.    by decreasing the register count by one, although the window is not fully
  23969.    unregistered until the count reaches zero.
  23970.  
  23971.  Return Value
  23972.  
  23973.    The return value is TRUE if the function is successful or FALSE if an
  23974.    error occurs.
  23975.  
  23976.  See Also
  23977.  
  23978.    WinDestroyWindow
  23979.  
  23980.  
  23981.  ────────────────────────────────────────────────────────────────────────────
  23982.  WinReleaseHook
  23983.  ────────────────────────────────────────────────────────────────────────────
  23984.    BOOL WinReleaseHook (hab, hmq, iHook, pfnHook, hmod)
  23985.    HAB hab;                /*handle of the anchor block                    */
  23986.    HMQ hmq;                /*handle of the message queue                   */
  23987.    SHORT iHook;            /*hook identifier                               */
  23988.    PFN pfnHook;            /*address of the hook procedure                 */
  23989.    HMODULE hmod;           /*handle of the module with hook procedure      */
  23990.  
  23991.    The WinReleaseHook function releases an application hook from a hook
  23992.    chain.
  23993.  
  23994.  Parameters
  23995.  
  23996.    hab  Identifies the anchor block.
  23997.  
  23998.    hmq  Specifies the message queue from which the hook is to be released. If
  23999.    hmq is NULL, the hook is released from the system hook chain. If hmq is
  24000.    HMQ_CURRENT, the hook is released from the message queue associated with
  24001.    the current thread (calling thread).
  24002.  
  24003.    iHook  Specifies the type of hook chain. This parameter can be one of the
  24004.    following values:
  24005.  
  24006.    Hook type             Description
  24007.    ──────────────────────────────────────────────────────────────────────────
  24008.    HK_HELP               Monitors the WM_HELP message.
  24009.  
  24010.    HK_INPUT              Monitors messages in a message queue.
  24011.  
  24012.    HK_JOURNALPLAYBACK    Allows applications to insert events into the system
  24013.                          input queue.
  24014.  
  24015.    HK_JOURNALRECORD      Allows applications to record system input queue
  24016.                          events.
  24017.  
  24018.    HK_MSGFILTER          Monitors input events during system modal loops.
  24019.  
  24020.    HK_SENDMSG            Monitors messages sent with WinSendMsg.
  24021.    ──────────────────────────────────────────────────────────────────────────
  24022.  
  24023.    pfnHook  Points to the hook routine.
  24024.  
  24025.    hmod  Identifies the module that contains the hook procedure. This
  24026.    parameter can be either the module handle returned by the DosLoadModule
  24027.    function or NULL for the application's module.
  24028.  
  24029.  Return Value
  24030.  
  24031.    The return value is TRUE if the function is successful or FALSE if an
  24032.    error occurs.
  24033.  
  24034.  Comments
  24035.  
  24036.    If a system hook is called by a process other than the process that set
  24037.    the hook, the DLL containing the hook will not be unloaded until every
  24038.    process is exited that referenced it. For most system hooks, this applies
  24039.    until the machine is rebooted. For the most part, this is not a problem;
  24040.    as with swapping, the unused DLL will end up somewhere in your swap space,
  24041.    never to be used again. The only complication is that when you are
  24042.    developing the hook the DLL containing the hook is still in use, and you
  24043.    cannot copy over it or link into it.
  24044.  
  24045.  See Also
  24046.  
  24047.    DosLoadModule, WinSendMsg, WinSetHook
  24048.  
  24049.  
  24050.  ────────────────────────────────────────────────────────────────────────────
  24051.  WinReleasePS
  24052.  ────────────────────────────────────────────────────────────────────────────
  24053.    BOOL WinReleasePS (hps)
  24054.    HPS hps;                /*handle of the presentation space              */
  24055.  
  24056.    The WinReleasePS function releases a cache presentation space obtained
  24057.    using the WinGetPS function.
  24058.  
  24059.    Only a cache presentation space should be released using this function.
  24060.    The presentation space is returned to the cache for reuse. The
  24061.    presentation space handle should not be used following this function.
  24062.  
  24063.  Parameters
  24064.  
  24065.    hps  Identifies the cache presentation space to release.
  24066.  
  24067.  Return Value
  24068.  
  24069.    The return value is TRUE if the function is successful or FALSE if an
  24070.    error occurs.
  24071.  
  24072.  Comments
  24073.  
  24074.    Before an application terminates, it must call WinReleasePS to release any
  24075.    cache presentation spaces obtained by using the WinGetPS function.
  24076.  
  24077.  Example
  24078.  
  24079.    This example processes an application-defined message (IDM_FILL). It calls
  24080.    WinGetPS to get a presentation space to the entire window. It gets the
  24081.    dimensions of the current window, fills the window, and calls WinReleasePS
  24082.    to release the presentation space.
  24083.  
  24084.    case IDM_FILL:
  24085.        hps = WinGetPS(hwnd);           /* get ps for the entire window */
  24086.        WinQueryWindowRect(hwnd, &rcl);    /* get window dimensions     */
  24087.        WinFillRect(hps, &rcl, CLR_WHITE); /* clear entire window       */
  24088.        WinReleasePS(hps);                 /* release the ps            */
  24089.  
  24090.  See Also
  24091.  
  24092.    WinGetPS
  24093.  
  24094.  
  24095.  ────────────────────────────────────────────────────────────────────────────
  24096.  WinRemoveSwitchEntry
  24097.  ────────────────────────────────────────────────────────────────────────────
  24098.    USHORT WinRemoveSwitchEntry (hSwitch)
  24099.    HSWITCH hSwitch;        /*handle of the switch list                     */
  24100.  
  24101.    The WinRemoveSwitchEntry function removes a specified entry from the
  24102.    switch list.
  24103.  
  24104.    Switch-list entries for full-screen applications cannot be removed using
  24105.    this function. These entries are removed automatically by the system when
  24106.    the application terminates.
  24107.  
  24108.  Parameters
  24109.  
  24110.    hSwitch  Identifies the switch-list entry for the application to remove.
  24111.  
  24112.  Return Value
  24113.  
  24114.    The return value is zero if the function is successful. Otherwise, it is
  24115.    nonzero, indicating that an error occurred.
  24116.  
  24117.  See Also
  24118.  
  24119.    WinAddSwitchEntry, WinChangeSwitchEntry
  24120.  
  24121.  
  24122.  ────────────────────────────────────────────────────────────────────────────
  24123.  WinScrollWindow
  24124.  ────────────────────────────────────────────────────────────────────────────
  24125.    SHORT WinScrollWindow (hwnd, dx, dy, prclScroll, prclClip, hrgnUpdate,
  24126.    prclUpdate, fs)
  24127.    HWND hwnd;              /*handle of the window to scroll                */
  24128.    SHORT dx;               /*amount of horizontal scrolling                */
  24129.    SHORT dy;               /*amount of vertical scrolling                  */
  24130.    PRECTL prclScroll;      /*address of structure with scroll rectangle    */
  24131.    PRECTL prclClip;        /*address of structure with clip rectangle      */
  24132.    HRGN hrgnUpdate;        /*handle of the update region                   */
  24133.    PRECTL prclUpdate;      /*address of the structure for the update       */
  24134.                            /*rectangle                                     */
  24135.    USHORT fs;              /*scrolling flags                               */
  24136.  
  24137.    The WinScrollWindow function scrolls the contents of a window rectangle.
  24138.  
  24139.    No application should move bits in its own window by any other method than
  24140.    by using WinScrollWindow.
  24141.  
  24142.    The cursor and the track rectangle are also scrolled when they intersect
  24143.    with the scrolled region.
  24144.  
  24145.  Parameters
  24146.  
  24147.    hwnd  Identifies the window to scroll.
  24148.  
  24149.    dx  Specifies the amount of horizontal scrolling (in device units).
  24150.  
  24151.    dy  Specifies the amount of vertical scrolling (in device units).
  24152.  
  24153.    prclScroll  Points to a RECTL structure that specifies the scroll
  24154.    rectangle. If prclScroll is NULL, the entire window will be scrolled. The
  24155.    RECTL structure has the following form:
  24156.  
  24157.    typedef struct _RECTL {
  24158.        LONG  xLeft;
  24159.        LONG  yBottom;
  24160.        LONG  xRight;
  24161.        LONG  yTop;
  24162.    } RECTL;
  24163.  
  24164.    For a full description, see Chapter 4, "Types, Macros, Structures."
  24165.  
  24166.    prclClip  Points to a RECTL structure that specifies the clip rectangle.
  24167.    This structure takes precedence over the prclScroll rectangle. Bits
  24168.    outside of the prclClip rectangle are not affected even if they are in
  24169.    prclScroll.
  24170.  
  24171.    hrgnUpdate  Identifies the region that is modified to hold the region
  24172.    invalidated by scrolling. This parameter may be NULL.
  24173.  
  24174.    prclUpdate  Points to a RECTL structure that receives the boundaries of
  24175.    the rectangle invalidated by scrolling. This parameter may be NULL.
  24176.  
  24177.    fs  Specifies flags controlling the scrolling. It can be a combination of
  24178.    the following values:
  24179.  
  24180.    Value             Meaning
  24181.    ──────────────────────────────────────────────────────────────────────────
  24182.    SW_SCROLLCHILDREN All child windows are scrolled.
  24183.  
  24184.    SW_INVALIDATERGN  The invalid region created as a result of scrolling will
  24185.                      be added to update regions of those windows affected.
  24186.                      This may result in the sending of WM_PAINT messages to
  24187.                      WS_SYNCPAINT windows before the WinScrollWindow function
  24188.                      returns.
  24189.    ──────────────────────────────────────────────────────────────────────────
  24190.  
  24191.  Return Value
  24192.  
  24193.    The return value is a code indicating the type of invalid region created
  24194.    by scrolling:
  24195.  
  24196.    Value           Meaning
  24197.    ──────────────────────────────────────────────────────────────────────────
  24198.    ERROR           Error in the passed region.
  24199.  
  24200.    NULLREGION      Scrolling produced no invalidation.
  24201.  
  24202.    SIMPLEREGION    Scrolling produced rectangular invalidation.
  24203.  
  24204.    COMPLEXREGION   Scrolling produced a nonrectangular invalidation.
  24205.    ──────────────────────────────────────────────────────────────────────────
  24206.  
  24207.  Comments
  24208.  
  24209.    To quickly repeat scrolling, omit the SW_INVALIDATERGN flag from the fs
  24210.    parameter and accumulate the update area by specifying a region for the
  24211.    hrgnUpdate parameter or a rectangle for the prclUpdate parameter. When
  24212.    scrolling is completed, you can repaint the window by calling
  24213.    WinInvalidateRegion or WinInvalidateRect, depending on whether you
  24214.    specified the hrgnUpdate or prclUpdate parameter.
  24215.  
  24216.    Typically, an application will set the SW_INVALIDATERGN flag in fs and let
  24217.    the system handle the update regions of the affected windows. In this
  24218.    case, the hrgnUpdate and prclUpdate parameters can both be set to NULL.
  24219.  
  24220.    If the hwnd parameter does not have the WS_CLIPCHILDREN style, the bits of
  24221.    any child window falling inside the scrolled area will also be scrolled.
  24222.    If this is the case, WinScrollWindow should be called with
  24223.    SW_SCROLLCHILDREN.
  24224.  
  24225.    The cursor and tracking rectangle are always hidden if they are in the
  24226.    window being scrolled or a child of that window, and the cursor is always
  24227.    offset by the distance scrolled. The tracking rectangle's position is left
  24228.    alone. Both are then shown once scrolling is done.
  24229.  
  24230.  See Also
  24231.  
  24232.    GpiCombineRegion
  24233.  
  24234.  
  24235.  ────────────────────────────────────────────────────────────────────────────
  24236.  WinSendDlgItemMsg
  24237.  ────────────────────────────────────────────────────────────────────────────
  24238.    MRESULT WinSendDlgItemMsg (hwndDlg, idItem, msg, mp1, mp2)
  24239.    HWND hwndDlg;           /*handle of the dialog box                      */
  24240.    USHORT idItem;          /*dialog-item identifier                        */
  24241.    USHORT msg;             /*message                                       */
  24242.    MPARAM mp1;             /*first message parameter                       */
  24243.    MPARAM mp2;             /*second message parameter                      */
  24244.  
  24245.    The WinSendDlgItemMsg function sends a message to the specified dialog
  24246.    item in the dialog window. The function does not return until the message
  24247.    has been processed by the dialog item.
  24248.  
  24249.    This function is equivalent to the following:
  24250.  
  24251.    WinSendMsg(WinWindowFromID(hwndDlg, idItem), msg, mp1, mp2);
  24252.  
  24253.  Parameters
  24254.  
  24255.    hwndDlg  Identifies the dialog window.
  24256.  
  24257.    idItem  Identifies the dialog item that receives the message.
  24258.  
  24259.    msg  Specifies the message.
  24260.  
  24261.    mp1  Specifies message parameter 1.
  24262.  
  24263.    mp2  Specifies message parameter 2.
  24264.  
  24265.  Return Value
  24266.  
  24267.    The return value is the result returned by the dialog item to which the
  24268.    message was sent.
  24269.  
  24270.  See Also
  24271.  
  24272.    WinSendMsg, WinWindowFromID
  24273.  
  24274.  
  24275.  ────────────────────────────────────────────────────────────────────────────
  24276.  WinSendMsg
  24277.  ────────────────────────────────────────────────────────────────────────────
  24278.    MRESULT WinSendMsg (hwnd, msg, mp1, mp2)
  24279.    HWND hwnd;              /*handle of the receiving window                */
  24280.    USHORT msg;             /*message                                       */
  24281.    MPARAM mp1;             /*first message parameter                       */
  24282.    MPARAM mp2;             /*second message parameter                      */
  24283.  
  24284.    The WinSendMsg function sends a message to the specified window.
  24285.  
  24286.    This function does not return until the message has been processed by the
  24287.    window procedure. If the window receiving the message belongs to the same
  24288.    thread, the window function is called immediately as a subroutine. If the
  24289.    window is of another thread or process, Presentation Manager switches to
  24290.    the appropriate thread and calls the appropriate window function, passing
  24291.    the message to the window function. The message is not placed in the
  24292.    destination thread's queue.
  24293.  
  24294.  Parameters
  24295.  
  24296.    hwnd  Identifies the window to send the message to.
  24297.  
  24298.    msg  Specifies the message.
  24299.  
  24300.    mp1  Specifies message parameter 1.
  24301.  
  24302.    mp2  Specifies message parameter 2.
  24303.  
  24304.  Return Value
  24305.  
  24306.    The return value is the result returned by the invoked window procedure.
  24307.  
  24308.  Comments
  24309.  
  24310.    The WM_USER constant marks the beginning of values you can use for your
  24311.    own messages. For example, you might have a section of a header file that
  24312.    looks like this:
  24313.  
  24314.    #define WM_USERMSG00  (WM_USER + 0)
  24315.    #define WM_USERMSG01  (WM_USER + 1)
  24316.    #define WM_USERMSG02  (WM_USER + 2)
  24317.    #define WM_USERMSG03  (WM_USER + 3)
  24318.  
  24319.    The following lists some of the differences between WinPostMsg and
  24320.    WinSendMsg:
  24321.  
  24322.    ■  WinPostMsg returns immediately. WinSendMsg waits for the receiver to
  24323.       return.
  24324.  
  24325.    ■  A thread that does not have a message queue can still call WinPostMsg.
  24326.       It cannot call WinSendMsg.
  24327.  
  24328.    ■  Calling WinSendMsg to send a message to another thread is costly in
  24329.       terms of CPU time. This is not true of WinPostMsg.
  24330.  
  24331.  Example
  24332.  
  24333.    This example gets the window handle of the system menu and calls
  24334.    WinSendMsg to send a message to disable the Close menu item.
  24335.  
  24336.    HWND hwndSysMenu;
  24337.  
  24338.    hwndSysMenu = WinWindowFromID(hwndDlg, FID_SYSMENU);
  24339.    WinSendMsg(hwndSysMenu, MM_SETITEMATTR,
  24340.        MPFROM2SHORT(SC_CLOSE, TRUE),
  24341.        MPFROM2SHORT(MIA_DISABLED, MIA_DISABLED));
  24342.  
  24343.  See Also
  24344.  
  24345.    WinBroadcastMsg, WinPostMsg
  24346.  
  24347.  
  24348.  ────────────────────────────────────────────────────────────────────────────
  24349.  WinSetAccelTable
  24350.  ────────────────────────────────────────────────────────────────────────────
  24351.    BOOL WinSetAccelTable (hab, haccel, hwndFrame)
  24352.    HAB hab;                /*handle of the anchor block                    */
  24353.    HACCEL haccel;          /*handle of the accelerator table               */
  24354.    HWND hwndFrame;         /*handle of the frame window                    */
  24355.  
  24356.    The WinSetAccelTable function sets the window or queue accelerator table.
  24357.  
  24358.  Parameters
  24359.  
  24360.    hab  Identifies the anchor block.
  24361.  
  24362.    haccel  Identifies the accelerator table. If haccel is NULL, the effect of
  24363.    this function is to remove any accelerator table in effect for the window
  24364.    or queue.
  24365.  
  24366.    hwndFrame  Identifies the frame window. If hwndFrame is NULL, the queue
  24367.    accelerator table is set. Otherwise, the window accelerator table is set,
  24368.    by sending the WM_SETACCELTABLE message to hwndFrame.
  24369.  
  24370.  Return Value
  24371.  
  24372.    The return value is TRUE if the function is successful or FALSE if an
  24373.    error occurs.
  24374.  
  24375.  See Also
  24376.  
  24377.    WinCreateAccelTable, WinLoadAccelTable
  24378.  
  24379.  
  24380.  ────────────────────────────────────────────────────────────────────────────
  24381.  WinSetActiveWindow
  24382.  ────────────────────────────────────────────────────────────────────────────
  24383.    BOOL WinSetActiveWindow (hwndDesktop, hwnd)
  24384.    HWND hwndDesktop;       /*handle of the desktop                         */
  24385.    HWND hwnd;              /*handle of the window to make active           */
  24386.  
  24387.    The WinSetActiveWindow function makes the frame window of hwnd the active
  24388.    window. It does this by finding the first frame window parent of hwnd,
  24389.    using hwnd if it is a frame window. It then finds the last window
  24390.    associated with this frame window that had the focus. Then the focus is
  24391.    set to this window that previously had the focus, using the function
  24392.    WinSetFocus. This sets the focus to this window and activates all frame
  24393.    windows that are parents of this window.
  24394.  
  24395.    The window handle of the window that receives the focus is stored in the
  24396.    frame window's reserved memory. This memory can be queried by using a
  24397.    QWL_HWNDFOCUSSAVE index with the WinQueryWindowULong function.
  24398.  
  24399.    If the active window is changing, the following events occur:
  24400.  
  24401.    ■  If the action of setting the active window results in a different
  24402.       window receiving the focus, the window that currently has the focus
  24403.       will receive a WM_SETFOCUS message indicating the loss of focus.
  24404.  
  24405.    ■  If the action of setting the active window results in a different
  24406.       window becoming active, a WM_ACTIVATE message is sent to the current
  24407.       active window, indicating a loss of the active status.
  24408.  
  24409.    ■  The new active window is established.
  24410.  
  24411.    ■  A WM_ACTIVATE message indicating the acquisition of active status is
  24412.       sent to the new window.
  24413.  
  24414.  Parameters
  24415.  
  24416.    hwndDesktop  Identifies the desktop window. This parameter can be
  24417.    HWND_DESKTOP or the desktop window handle.
  24418.  
  24419.    hwnd  Identifies either a frame window or the child of a frame window. If
  24420.    it is a child, the parent frame window will become the active window.
  24421.  
  24422.  Return Value
  24423.  
  24424.    The return value is TRUE if the function is successful. Otherwise, it is
  24425.    FALSE, indicating that an error occurred.
  24426.  
  24427.  See Also
  24428.  
  24429.    WinQueryActiveWindow, WinQueryFocus, WinQueryWindowULong, WinSetFocus
  24430.  
  24431.  
  24432.  ────────────────────────────────────────────────────────────────────────────
  24433.  WinSetCapture
  24434.  ────────────────────────────────────────────────────────────────────────────
  24435.    BOOL WinSetCapture (hwndDesktop, hwnd)
  24436.    HWND hwndDesktop;       /*handle of the desktop                         */
  24437.    HWND hwnd;              /*handle of the window to receive all mouse     */
  24438.                            /*messages                                      */
  24439.  
  24440.    The WinSetCapture function sets the mouse capture to the specified window.
  24441.    With the mouse capture set to a window, all mouse input is directed to
  24442.    that window, regardless of whether the mouse is over that window. Only one
  24443.    window can have the mouse captured at a time.
  24444.  
  24445.    When the WinSetCapture function is called to release the mouse capture, a
  24446.    WM_MOUSEMOVE message is posted, regardless of whether the mouse pointer
  24447.    has actually moved.
  24448.  
  24449.  Parameters
  24450.  
  24451.    hwndDesktop  Identifies the desktop window. This parameter can be
  24452.    HWND_DESKTOP or the desktop window handle.
  24453.  
  24454.    hwnd  Identifies the window that is to receive all mouse messages. This
  24455.    parameter can take the special value HWND_THREADCAPTURE to capture the
  24456.    mouse to the current thread rather than to a particular window. If hwnd is
  24457.    NULL, mouse capture is released.
  24458.  
  24459.  Return Value
  24460.  
  24461.    The return value is TRUE if the function is successful or FALSE if an
  24462.    error occurs. If an application calls this function while the mouse is
  24463.    currently captured by a different window, the function will fail and
  24464.    return FALSE.
  24465.  
  24466.  See Also
  24467.  
  24468.    WinQueryCapture
  24469.  
  24470.  
  24471.  ────────────────────────────────────────────────────────────────────────────
  24472.  WinSetClipbrdData
  24473.  ────────────────────────────────────────────────────────────────────────────
  24474.    BOOL WinSetClipbrdData (hab, ulData, fmt, fsFmtInfo)
  24475.    HAB hab;                /*handle of the anchor block                    */
  24476.    ULONG ulData;           /*data object                                   */
  24477.    USHORT fmt;             /*specifies the format                          */
  24478.    USHORT fsFmtInfo;       /*specifies the data type                       */
  24479.  
  24480.    The WinSetClipbrdData function puts data into the clipboard. Data of the
  24481.    specified format already in the clipboard is freed by this function.
  24482.  
  24483.  Parameters
  24484.  
  24485.    hab  Identifies an anchor block.
  24486.  
  24487.    ulData  Specifies the data object being put into the clipboard. If this
  24488.    parameter is NULL, a WM_RENDERFMT message is sent to the clipboard owner
  24489.    window, to render the format when the WinQueryClipbrdData function is
  24490.    called with the specified format. Once the data object has been put into
  24491.    the clipboard, the object it refers to (if given by a reference such as a
  24492.    selector or handle) is no longer accessible by the application. To access
  24493.    the data after it has been placed into the clipboard, use the
  24494.    WinQueryClipbrdData function.
  24495.  
  24496.    fmt  Specifies the format of the data object specified by the ulData
  24497.    parameter. The following list describes the standard clipboard formats:
  24498.  
  24499. ╓┌─┌─────────────────┌───────────────────────────────────────────────────────╖
  24500.    Value             Meaning
  24501.    ──────────────────────────────────────────────────────────────────────────
  24502.    CF_BITMAP         The data is a bitmap. The CFI_HANDLE memory-model flag
  24503.                      must be set in the fsFmtInfo parameter.
  24504.  
  24505.    CF_DSPBITMAP      The data is a bitmap representation of a private data
  24506.                      format. The clipboard viewer can use this format to
  24507.                      display a private format. The memory-model flag
  24508.                      CFI_HANDLE must be set in the fsFmtInfo parameter.
  24509.    Value             Meaning
  24510.    ──────────────────────────────────────────────────────────────────────────
  24511.                     CFI_HANDLE must be set in the fsFmtInfo parameter.
  24512.  
  24513.    CF_METAFILE       The data is a metafile. The CFI_HANDLE memory-model flag
  24514.                      must be set in the fsFmtInfo parameter.
  24515.  
  24516.    CF_DSPMETAFILE    The data is a metafile representation of a private data
  24517.                      format. The clipboard viewer can use this format to
  24518.                      display a private format. The memory-model flag
  24519.                      CFI_HANDLE must be set in the fsFmtInfo parameter.
  24520.  
  24521.    CF_TEXT           The data is an array of text characters, which may
  24522.                      include newline characters to mark line breaks. The null
  24523.                      character indicates the end of the text data. The
  24524.                      CFI_SELECTOR memory-model flag must be set in the
  24525.                      fsFmtInfo parameter.
  24526.  
  24527.    CF_DSPTEXT        The data is a textual representation of a private data
  24528.                      format. The clipboard viewer can use this format to
  24529.                      display a private format. The memory-model flag
  24530.    Value             Meaning
  24531.    ──────────────────────────────────────────────────────────────────────────
  24532.                     display a private format. The memory-model flag
  24533.                      CFI_SELECTOR must be set in the fsFmtInfo parameter.
  24534.    ──────────────────────────────────────────────────────────────────────────
  24535.  
  24536.  
  24537.    fsFmtInfo  Specifies the type of data specified by the ulData parameter.
  24538.    This consists of memory-model and usage flags, as follows:
  24539.  
  24540.    Memory-model flag  Meaning
  24541.    ──────────────────────────────────────────────────────────────────────────
  24542.    CFI_HANDLE         Handle is the handle to a metafile or bitmap.
  24543.  
  24544.    CFI_SELECTOR       Handle is a selector plus zero offset to a segment in
  24545.                       storage.
  24546.    ──────────────────────────────────────────────────────────────────────────
  24547.  
  24548.    Usage flag         Meaning
  24549.    ──────────────────────────────────────────────────────────────────────────
  24550.    CFI_OWNERDISPLAY   Format will be drawn by the clipboard owner in the
  24551.                       clipboard-viewer window by means of the
  24552.                       WM_PAINTCLIPBOARD message. The ulData parameter should
  24553.                       be NULL.
  24554.  
  24555.    CFI_OWNERFREE      Handle is not freed by the WinEmptyClipboard function.
  24556.                       The application must free the data, if necessary.
  24557.    ──────────────────────────────────────────────────────────────────────────
  24558.  
  24559.    Any number of the usage flags may be specified, but only one of the memory
  24560.    models may be specified. When using WinSetClipbrdData for user-defined
  24561.    formats, an application puts a user-defined format into the clipboard. It
  24562.    may then specify the CFI_SELECTOR memory model. The system then saves the
  24563.    selector so that if the calling application terminates, normally or
  24564.    abnormally, the data is still available. The system frees the selector
  24565.    from the calling process; therefore, the calling process may no longer use
  24566.    the selector.
  24567.  
  24568.  Return Value
  24569.  
  24570.    The return value is TRUE if data is placed in the clipboard, or FALSE if
  24571.    an error occurred.
  24572.  
  24573.  See Also
  24574.  
  24575.    WinEmptyClipbrd, WinQueryClipbrdData
  24576.  
  24577.  
  24578.  ────────────────────────────────────────────────────────────────────────────
  24579.  WinSetClipbrdOwner
  24580.  ────────────────────────────────────────────────────────────────────────────
  24581.    BOOL WinSetClipbrdOwner (hab, hwnd)
  24582.    HAB hab;                /*handle of the anchor block                    */
  24583.    HWND hwnd;              /*handle of the clipboard owner                 */
  24584.  
  24585.    The WinSetClipbrdOwner function sets the current clipboard owner window.
  24586.    The clipboard owner window receives the following clipboard-related
  24587.    messages at appropriate times:
  24588.  
  24589.          WM_RENDERFMT
  24590.          WM_DESTROYCLIPBOARD
  24591.          WM_SIZECLIPBOARD
  24592.          WM_VSCROLLCLIPBOARD
  24593.          WM_HSCROLLCLIPBOARD
  24594.          WM_PAINTCLIPBOARD
  24595.  
  24596.  Parameters
  24597.  
  24598.    hab  Identifies an anchor block.
  24599.  
  24600.    hwnd  Identifies a new clipboard owner window. If this parameter is NULL,
  24601.    the clipboard owner is released and no new owner is established.
  24602.  
  24603.  Return Value
  24604.  
  24605.    The return value is TRUE if the function is successful or FALSE if an
  24606.    error occurs.
  24607.  
  24608.  See Also
  24609.  
  24610.    WinQueryClipbrdOwner, WinSetClipbrdViewer
  24611.  
  24612.  
  24613.  ────────────────────────────────────────────────────────────────────────────
  24614.  WinSetClipbrdViewer
  24615.  ────────────────────────────────────────────────────────────────────────────
  24616.    BOOL WinSetClipbrdViewer (hab, hwnd)
  24617.    HAB hab;                /*handle of the anchor block                    */
  24618.    HWND hwnd;              /*handle of the clipboard viewer                */
  24619.  
  24620.    The WinSetClipbrdViewer function sets the current clipboard-viewer window
  24621.    to a specified window.
  24622.  
  24623.    The clipboard-viewer window receives the WM_DRAWCLIPBOARD message when the
  24624.    contents of the clipboard change. This allows the viewer window to display
  24625.    an up-to-date version of the clipboard contents.
  24626.  
  24627.  Parameters
  24628.  
  24629.    hab  Identifies an anchor block.
  24630.  
  24631.    hwnd  Identifies a new clipboard viewer window. If this parameter is NULL,
  24632.    the clipboard viewer is released and no new viewer is established.
  24633.  
  24634.  Return Value
  24635.  
  24636.    The return value is TRUE if there is a clipboard-viewer window on
  24637.    completion of the function. Otherwise, it is FALSE, indicating that there
  24638.    is no clipboard-viewer window.
  24639.  
  24640.  See Also
  24641.  
  24642.    WinQueryClipbrdViewer, WinSetClipbrdOwner
  24643.  
  24644.  
  24645.  ────────────────────────────────────────────────────────────────────────────
  24646.  WinSetCp
  24647.  ────────────────────────────────────────────────────────────────────────────
  24648.    BOOL WinSetCp (hmq, idcp)
  24649.    HMQ hmq;                /*handle of the message queue                   */
  24650.    USHORT idcp;            /*code page                                     */
  24651.  
  24652.    The WinSetCp function sets the queue code page for the message queue.
  24653.  
  24654.  Parameters
  24655.  
  24656.    hmq  Identifies a message queue.
  24657.  
  24658.    idcp  Specifies a code page. It must be one of the ASCII code pages
  24659.    defined in the config.sys file.
  24660.  
  24661.  Return Value
  24662.  
  24663.    The return value is TRUE if the function is successful or FALSE if an
  24664.    error occurs.
  24665.  
  24666.  See Also
  24667.  
  24668.    DosSetCp, GpiSetCp, VioSetCp, WinQueryCp, WinQueryCpList
  24669.  
  24670.  
  24671.  ────────────────────────────────────────────────────────────────────────────
  24672.  WinSetDlgItemShort
  24673.  ────────────────────────────────────────────────────────────────────────────
  24674.    BOOL WinSetDlgItemShort (hwndDlg, idItem, usValue, fSigned)
  24675.    HWND hwndDlg;           /*handle of the dialog box                      */
  24676.    USHORT idItem;          /*dialog-item identifier                        */
  24677.    USHORT usValue;         /*value to set                                  */
  24678.    BOOL fSigned;           /*signed/unsigned flag                          */
  24679.  
  24680.    The WinSetDlgItemShort function sets the text of a dialog-box item to the
  24681.    string representation of a specified integer value. The item is identified
  24682.    by its identifier. The text produced is always an ASCII string.
  24683.  
  24684.  Parameters
  24685.  
  24686.    hwndDlg  Identifies the dialog-box window.
  24687.  
  24688.    idItem  Identifies the dialog item that is changed.
  24689.  
  24690.    usValue  Specifies the integer value used to generate the item text.
  24691.  
  24692.    fSigned  Specifies whether the usValue parameter is signed or unsigned. If
  24693.    this parameter is TRUE, usValue is signed. If it is FALSE, usValue is
  24694.    unsigned.
  24695.  
  24696.  Return Value
  24697.  
  24698.    The return value is TRUE if the function is successful or FALSE if an
  24699.    error occurs.
  24700.  
  24701.  See Also
  24702.  
  24703.    WinQueryDlgItemShort
  24704.  
  24705.  
  24706.  ────────────────────────────────────────────────────────────────────────────
  24707.  WinSetDlgItemText
  24708.  ────────────────────────────────────────────────────────────────────────────
  24709.    BOOL WinSetDlgItemText (hwndDlg, idItem, pszText)
  24710.    HWND hwndDlg;           /*handle of the dialog box                      */
  24711.    USHORT idItem;          /*dialog-item identifier                        */
  24712.    PSZ pszText;            /*text to set                                   */
  24713.  
  24714.    The WinSetDlgItemText function sets the text in a dialog item. It is
  24715.    equivalent to the following:
  24716.  
  24717.    WinSetWindowText(WinWindowFromID(hwndDlg, idItem), pszText);
  24718.  
  24719.  Parameters
  24720.  
  24721.    hwndDlg  Identifies a dialog window.
  24722.  
  24723.    idItem  Identifies the identifier of the dialog item.
  24724.  
  24725.    pszText  Points to a null-terminated string that contains the text to be
  24726.    set for the dialog item.
  24727.  
  24728.  Return Value
  24729.  
  24730.    The return value is TRUE if the function is successful or FALSE if an
  24731.    error occurs.
  24732.  
  24733.  See Also
  24734.  
  24735.    WinSetWindowText, WinWindowFromID
  24736.  
  24737.  
  24738.  ────────────────────────────────────────────────────────────────────────────
  24739.  WinSetFocus
  24740.  ────────────────────────────────────────────────────────────────────────────
  24741.    BOOL WinSetFocus (hwndDesktop, hwndSetFocus)
  24742.    HWND hwndDesktop;       /*handle of the desktop                         */
  24743.    HWND hwndSetFocus;      /*handle of the window receiving the focus      */
  24744.  
  24745.    The WinSetFocus function sets the focus window.
  24746.  
  24747.  Parameters
  24748.  
  24749.    hwndDesktop  Identifies the desktop window. This parameter can be
  24750.    HWND_DESKTOP or the desktop window handle.
  24751.  
  24752.    hwndSetFocus  Identifies the window that receives the focus. This
  24753.    parameter must be equal to or be a descendant of the window identified by
  24754.    the hwndDesktop parameter. If hwndSetFocus identifies a desktop window or
  24755.    is NULL, no window on the device associated with hwndDesktop receives the
  24756.    focus.
  24757.  
  24758.  Return Value
  24759.  
  24760.    The return value is TRUE if the function is successful or FALSE if an
  24761.    error occurs.
  24762.  
  24763.  Comments
  24764.  
  24765.    If hwndSetFocus does not have the focus when this function is called, the
  24766.    following events occur:
  24767.  
  24768.    ■  If a window currently has the focus, it receives a WM_SETFOCUS message,
  24769.       indicating the loss of the focus.
  24770.  
  24771.    ■  If a window currently is selected, it receives a WM_SETSELECTION
  24772.       message, indicating the window is deselected.
  24773.  
  24774.    ■  If changing the focus causes a change in the active window, a
  24775.       WM_ACTIVATE message is sent to the active window, indicating the loss
  24776.       of active status.
  24777.  
  24778.    ■  If a new application is being made the active application, a
  24779.       WM_ACTIVATE message is sent to the active application, indicating the
  24780.       loss of active status.
  24781.  
  24782.    ■  The new active and focus windows and the active application are
  24783.       established.
  24784.  
  24785.    ■  If a new application is being made the active application, a
  24786.       WM_ACTIVATE message is sent to the new application, indicating the
  24787.       acquisition of active status.
  24788.  
  24789.    ■  If the active window is changing, a WM_ACTIVATE message is sent to the
  24790.       new main window, indicating the acquisition of active status.
  24791.  
  24792.    ■  If a new window is selected, it receives a WM_SETSELECTION message,
  24793.       indicating the window has been selected.
  24794.  
  24795.    ■  The new focus window is sent a WM_SETFOCUS message, indicating the
  24796.       acquisition of focus.
  24797.  
  24798.    Using the WinQueryActiveWindow or the WinQueryFocus function during
  24799.    processing of the WinSetFocus function results in the previous active and
  24800.    focus windows being returned until the new active and focus windows are
  24801.    established. In other words, even though a WM_SETFOCUS message with the
  24802.    fFocus parameter set to FALSE or a WM_ACTIVATE message with the fActive
  24803.    parameter set to FALSE may have been sent to the previous windows, those
  24804.    windows are considered to be active and have the focus until the system
  24805.    establishes the new active and focus windows.
  24806.  
  24807.    If WinSetFocus is called during WM_ACTIVATE message processing, a
  24808.    WM_SETFOCUS message with the fFocus parameter set to FALSE is not sent,
  24809.    since no window has the focus.
  24810.  
  24811.    If no window has the input focus, then WM_CHAR messages are posted to the
  24812.    active window's queue.
  24813.  
  24814.  Example
  24815.  
  24816.    This example retrieves an integer from a dialog entry field. It then
  24817.    checks for a valid number. If not found, it displays a message box
  24818.    indicating that an error occurred, and then calls WinSetFocus to set the
  24819.    focus back to the entry field that caused the error.
  24820.  
  24821.    fError = WinQueryDlgItemShort(hwndDlg, idEntryField, &ivalue, TRUE);
  24822.    if (fError || (ivalue < iLoRange) || (ivalue > iHiRange)) {
  24823.        WinMessageBox(HWND_DESKTOP, hwndFrame, (PSZ) szErrMsg,
  24824.            NULL, idMessageBox, MB_OK );
  24825.        WinSetFocus(HWND_DESKTOP, WinWindowFromID(hwndDlg, idEntryField));
  24826.    }
  24827.    else {
  24828.  
  24829.  See Also
  24830.  
  24831.    WinFocusChange, WinQueryActiveWindow, WinQueryFocus,
  24832.    WinSetActiveWindow
  24833.  
  24834.  
  24835.  ────────────────────────────────────────────────────────────────────────────
  24836.  WinSetHook
  24837.  ────────────────────────────────────────────────────────────────────────────
  24838.    BOOL WinSetHook (hab, hmq, iHook, pfnHook, hmod)
  24839.    HAB hab;                /*handle of the anchor block                    */
  24840.    HMQ hmq;                /*handle of the message queue                   */
  24841.    SHORT iHook;            /*type of hook chain                            */
  24842.    PFN pfnHook;            /*address of the hook procedure                 */
  24843.    HMODULE hmod;           /*handle of the module with the hook procedure  */
  24844.  
  24845.    The WinSetHook function installs an application procedure into a specified
  24846.    hook chain. In this function, queue hooks are called before system hooks.
  24847.  
  24848.    A call to WinSetHook installs the hook at the head of either the system or
  24849.    queue chain. The most recently installed hook is called first.
  24850.  
  24851.  Parameters
  24852.  
  24853.    hab  Identifies an anchor block.
  24854.  
  24855.    hmq  Identifies the queue to which the hook chain belongs. If this param-
  24856.    eter is NULL, the hook is installed in the system hook chain. If it is
  24857.    HMQ_CURRENT, the hook is installed in the message queue associated with
  24858.    the current thread (calling thread).
  24859.  
  24860.    iHook  Specifies the type of hook chain. This parameter can be one of the
  24861.    following values:
  24862.  
  24863. ╓┌─┌─────────────────────┌───────────────────────────────────────────────────╖
  24864.    Hook type             Description
  24865.    ──────────────────────────────────────────────────────────────────────────
  24866.    Hook type             Description
  24867.    ──────────────────────────────────────────────────────────────────────────
  24868.    HK_HELP               Monitors the WM_HELP message. Returns BOOL. If
  24869.                          FALSE, next hook in chain is called. If TRUE, the
  24870.                          next hook in the chain is not called.
  24871.  
  24872.    HK_INPUT              Monitors messages in specified message queue.
  24873.                          Returns BOOL. If FALSE, next hook in the chain is
  24874.                          called. If TRUE, the message is not passed on to the
  24875.                          next hook in the chain.
  24876.  
  24877.    HK_JOURNALPLAYBACK    Allows applications to insert events into the system
  24878.                          input queue. Returns LONG time-out value. This value
  24879.                          is the time to wait (in milliseconds) before
  24880.                          processing the current message. Never calls the next
  24881.                          hook in the chain.
  24882.  
  24883.    HK_JOURNALRECORD      Allows applications to record system input queue
  24884.                          events. Returns VOID. Next hook in chain is always
  24885.                          called.
  24886.  
  24887.    Hook type             Description
  24888.    ──────────────────────────────────────────────────────────────────────────
  24889. 
  24890.    HK_MSGFILTER          Monitors input events during system modal loops.
  24891.                          Returns BOOL. If FALSE, next hook in the chain is
  24892.                          called. If TRUE, the message is not passed on to the
  24893.                          next hook in the chain.
  24894.  
  24895.    HK_SENDMSG            Monitors messages sent with WinSendMsg. Returns
  24896.                          VOID. Next hook in chain is always called.
  24897.    ──────────────────────────────────────────────────────────────────────────
  24898.  
  24899.  
  24900.    pfnHook  Points to an application hook procedure.
  24901.  
  24902.    hmod  Identifies the module that contains the hook procedure. This
  24903.    parameter can be either the module handle returned by the DosLoadModule
  24904.    function or NULL for the application's module.
  24905.  
  24906.  Return Value
  24907.  
  24908.    The return value is TRUE if the function is successful or FALSE if an
  24909.    error occurs.
  24910.  
  24911.  Comments
  24912.  
  24913.    You should use the handle returned from WinCreateMsgQueue for the hmq
  24914.    parameter. If this is not available, you can use the WinQueryWindowULong
  24915.    function with the index QWL_HMQ to obtain the queue handle associated with
  24916.    a window handle.
  24917.  
  24918.    Note: If a system hook is installed, the procedure must be contained in a
  24919.    DLL; the procedure may be called from different applications, which do not
  24920.    have access to code segments that are contained in a .exe file.
  24921.  
  24922.  See Also
  24923.  
  24924.    DosLoadModule, WinCreateMsgQueue, WinQueryWindowULong, WinReleaseHook,
  24925.    WinSendMsg
  24926.  
  24927.  
  24928.  ────────────────────────────────────────────────────────────────────────────
  24929.  WinSetKeyboardStateTable
  24930.  ────────────────────────────────────────────────────────────────────────────
  24931.    BOOL WinSetKeyboardStateTable (hwndDesktop, pKeyStateTable, fSet)
  24932.    HWND hwndDesktop;       /*handle of the desktop                         */
  24933.    PBYTE pKeyStateTable;   /*address of the key table                      */
  24934.    BOOL fSet;              /*set/copy flag                                 */
  24935.  
  24936.    The WinSetKeyboardStateTable function gets or sets the keyboard state.
  24937.    This function does not change the physical state of the keyboard; it
  24938.    changes the value returned by the WinGetKeyState function, not the value
  24939.    returned by the WinGetPhysKeyState function.
  24940.  
  24941.    To set the state of a single key you must get the entire table, modify the
  24942.    individual key, and then set the table from the modified value.
  24943.  
  24944.  Parameters
  24945.  
  24946.    hwndDesktop  Identifies the desktop window. This parameter can be
  24947.    HWND_DESKTOP or the desktop window handle.
  24948.  
  24949.    pKeyStateTable  Points to a 256-byte table indexed by virtual-key value.
  24950.    For any virtual key, the 0x80 bit is set if the key is down and cleared if
  24951.    it is up. The 0x01 bit is set if the key is toggled (pressed an odd number
  24952.    of times) and cleared otherwise.
  24953.  
  24954.    fSet  Specifies whether the keyboard state is set or copied. If this
  24955.    parameter is TRUE, the keyboard state is set from pKeyStateTable. If this
  24956.    parameter is FALSE, the keyboard state is copied to pKeyStateTable.
  24957.  
  24958.  Return Value
  24959.  
  24960.    The return value is TRUE if the function is successful or FALSE if an
  24961.    error occurs.
  24962.  
  24963.  See Also
  24964.  
  24965.    WinGetKeyState, WinGetPhysKeyState
  24966.  
  24967.  
  24968.  ────────────────────────────────────────────────────────────────────────────
  24969.  WinSetMultWindowPos
  24970.  ────────────────────────────────────────────────────────────────────────────
  24971.    BOOL WinSetMultWindowPos (hab, pswp, cswp)
  24972.    HAB hab;                /*handle of the anchor block                    */
  24973.    PSWP pswp;              /*address of array of SWP structures            */
  24974.    USHORT cswp;            /*number of SWP structures                      */
  24975.  
  24976.    The WinSetMultWindowPos function performs the WinSetWindowPos function for
  24977.    specified windows using the pswp parameter, an array of structures whose
  24978.    elements correspond to the input parameters of WinSetWindowPos. All
  24979.    windows being positioned must have the same parent window.
  24980.  
  24981.    It is more efficient to use this function than to issue multiple
  24982.    WinSetWindowPos calls, as it causes less screen updating.
  24983.  
  24984.  Parameters
  24985.  
  24986.    hab  Identifies an anchor block.
  24987.  
  24988.    pswp  Points to an array of SWP data structures whose elements correspond
  24989.    to the input parameters of WinSetWindowPos. The SWP structure has the
  24990.    following form:
  24991.  
  24992.    typedef struct _SWP {
  24993.        USHORT fs;
  24994.        SHORT  cy;
  24995.        SHORT  cx;
  24996.        SHORT  y;
  24997.        SHORT  x;
  24998.        HWND   hwndInsertBehind;
  24999.        HWND   hwnd;
  25000.    } SWP;
  25001.  
  25002.    For a full description, see Chapter 4, "Types, Macros, Structures."
  25003.  
  25004.    cswp  Specifies the number of SWP structures.
  25005.  
  25006.  Return Value
  25007.  
  25008.    The return value is TRUE if the function is successful or FALSE if an
  25009.    error occurs.
  25010.  
  25011.  Comments
  25012.  
  25013.    This function sends the following messages. If you process these messages,
  25014.    you must be careful to not cause an infinite loop by calling the
  25015.    WinSetWindowPos or WinSetMultWindowPos functions.
  25016.  
  25017.          WM_ACTIVATE
  25018.          WM_ADJUSTWINDOWPOS
  25019.          WM_CALCVALIDRECTS
  25020.          WM_MOVE
  25021.          WM_SHOW
  25022.          WM_SIZE
  25023.  
  25024.  See Also
  25025.  
  25026.    WinSetWindowPos
  25027.  
  25028.  
  25029.  ────────────────────────────────────────────────────────────────────────────
  25030.  WinSetOwner
  25031.  ────────────────────────────────────────────────────────────────────────────
  25032.    BOOL WinSetOwner (hwnd, hwndNewOwner)
  25033.    HWND hwnd;              /*handle of the window whose owner is changed   */
  25034.    HWND hwndNewOwner;      /*handle of the new owner window                */
  25035.  
  25036.    The WinSetOwner function changes the owner of a specified window. The
  25037.    owner window and the owned window must have been created by the same
  25038.    thread.
  25039.  
  25040.    The WinQueryWindow function can be used to obtain the handle of the owner
  25041.    window.
  25042.  
  25043.  Parameters
  25044.  
  25045.    hwnd  Identifies the window whose owner is changed.
  25046.  
  25047.    hwndNewOwner  Identifies the new owner window. If this parameter is NULL,
  25048.    the window's owner is set to NULL.
  25049.  
  25050.  Return Value
  25051.  
  25052.    The return value is TRUE if the function is successful or FALSE if an
  25053.    error occurs.
  25054.  
  25055.  See Also
  25056.  
  25057.    WinQueryWindow, WinSetParent
  25058.  
  25059.  
  25060.  ────────────────────────────────────────────────────────────────────────────
  25061.  WinSetParent
  25062.  ────────────────────────────────────────────────────────────────────────────
  25063.    BOOL WinSetParent (hwnd, hwndNewParent, fRedraw)
  25064.    HWND hwnd;              /*handle of the window whose parent is changed  */
  25065.    HWND hwndNewParent;     /*handle of the new parent window               */
  25066.    BOOL fRedraw;           /*redraw flag                                   */
  25067.  
  25068.    The WinSetParent function sets the parent window for the window identified
  25069.    by the hwnd parameter to the window identified by the hwndNewParent
  25070.    parameter.
  25071.  
  25072.  Parameters
  25073.  
  25074.    hwnd  Identifies the window whose parent will be changed.
  25075.  
  25076.    hwndNewParent  Identifies the new parent window. If this parameter is a
  25077.    desktop-window handle or HWND_DESKTOP, the hwnd window becomes a main
  25078.    window. The new parent window cannot be a descendant of the hwnd window.
  25079.    If hwndNewParent is not equal to HWND_OBJECT, the windows identified by
  25080.    the hwndNewParent and hwnd parameters must both be descendants of the same
  25081.    desktop window.
  25082.  
  25083.    fRedraw  Specifies a redraw indicator. If this parameter is TRUE, any
  25084.    necessary redrawing of both the old parent and the new parent windows is
  25085.    performed (if the hwnd window is visible). If this parameter is FALSE, no
  25086.    redrawing of the old and new parent windows is performed. This avoids an
  25087.    extra device update when subsequent calls cause the windows to be redrawn.
  25088.  
  25089.  Return Value
  25090.  
  25091.    The return value is TRUE if the parent window is successfully changed.
  25092.    Otherwise, it is FALSE, indicating that the parent window was not
  25093.    successfully changed.
  25094.  
  25095.  See Also
  25096.  
  25097.    WinIsChild, WinSetOwner
  25098.  
  25099.  
  25100.  ────────────────────────────────────────────────────────────────────────────
  25101.  WinSetPointer
  25102.  ────────────────────────────────────────────────────────────────────────────
  25103.    BOOL WinSetPointer (hwndDesktop, hptrNew)
  25104.    HWND hwndDesktop;       /*handle of the desktop                         */
  25105.    HPOINTER hptrNew;       /*handle of the pointer                         */
  25106.  
  25107.    The WinSetPointer function changes the mouse pointer.
  25108.  
  25109.  Parameters
  25110.  
  25111.    hwndDesktop  Identifies the desktop window. This parameter can be
  25112.    HWND_DESKTOP or the desktop window handle.
  25113.  
  25114.    hptrNew  Identifies the new pointer. If the hptrNew parameter is NULL, the
  25115.    pointer is removed from the screen.
  25116.  
  25117.  Return Value
  25118.  
  25119.    The return value is TRUE if the function is successful or FALSE if an
  25120.    error occurs.
  25121.  
  25122.  Comments
  25123.  
  25124.    If you process the WM_MOUSEMOVE message, and you don't call the
  25125.    WinDefWindowProc function as part of that processing, then you should call
  25126.    this function to set the mouse pointer. This function is quite fast if the
  25127.    mouse pointer is not changed.
  25128.  
  25129.    The following functions can be used to obtain a handle to a pointer that
  25130.    can be used as the mouse pointer:
  25131.  
  25132.    Function             Description
  25133.    ──────────────────────────────────────────────────────────────────────────
  25134.    WinCreatePointer     Creates a pointer from a bitmap.
  25135.  
  25136.    WinQueryPointer      Retrieves a handle for the desktop pointer.
  25137.  
  25138.    WinLoadPointer       Loads a pointer from a resource file or dynamic-link
  25139.                         module.
  25140.  
  25141.    WinQuerySysPointer   Retrieves a handle for one of the system pointers.
  25142.    ──────────────────────────────────────────────────────────────────────────
  25143.  
  25144.  Example
  25145.  
  25146.    This example calls WinLoadPointer to load an application-defined pointer.
  25147.    When processing the WM_MOUSEMOVE message, the loaded pointer is displayed
  25148.    by calling WinSetPointer.
  25149.  
  25150.    case WM_CREATE:
  25151.        hptrCrossHair = WinLoadPointer(HWND_DESKTOP,
  25152.            NULL,              /* load from .exe file    */
  25153.            IDP_CROSSHAIR);    /* identifies the pointer */
  25154.  
  25155.    case WM_MOUSEMOVE:
  25156.        WinSetPointer(HWND_DESKTOP, hptrCrossHair);
  25157.  
  25158.  See Also
  25159.  
  25160.    WinCreatePointer, WinDefWindowProc, WinLoadPointer, WinQueryPointer,
  25161.    WinQuerySysPointer
  25162.  
  25163.  
  25164.  ────────────────────────────────────────────────────────────────────────────
  25165.  WinSetPointerPos
  25166.  ────────────────────────────────────────────────────────────────────────────
  25167.    BOOL WinSetPointerPos (hwndDesktop, x, y)
  25168.    HWND hwndDesktop;       /*handle of the desktop                         */
  25169.    SHORT x;                /*horizontal position                           */
  25170.    SHORT y;                /*vertical position                             */
  25171.  
  25172.    The WinSetPointerPos function sets the mouse pointer position.
  25173.  
  25174.  Parameters
  25175.  
  25176.    hwndDesktop  Identifies the desktop window. This parameter can be
  25177.    HWND_DESKTOP or the desktop window handle.
  25178.  
  25179.    x  Specifies the x position of the pointer (in screen coordinates).
  25180.  
  25181.    y  Specifies the y position of the pointer (in screen coordinates).
  25182.  
  25183.  Return Value
  25184.  
  25185.    The return value is TRUE if the function is successful or FALSE if an
  25186.    error occurs.
  25187.  
  25188.  See Also
  25189.  
  25190.    WinQueryPointerPos
  25191.  
  25192.  
  25193.  ────────────────────────────────────────────────────────────────────────────
  25194.  WinSetRect
  25195.  ────────────────────────────────────────────────────────────────────────────
  25196.    BOOL WinSetRect (hab, prcl, xLeft, yBottom, xRight, yTop)
  25197.    HAB hab;                /*handle of the anchor block                    */
  25198.    PRECTL prcl;            /*address of structure with rectangle to set    */
  25199.    SHORT xLeft;            /*left side                                     */
  25200.    SHORT yBottom;          /*bottom side                                   */
  25201.    SHORT xRight;           /*right side                                    */
  25202.    SHORT yTop;             /*top side                                      */
  25203.  
  25204.    The WinSetRect function sets rectangle coordinates. This function is
  25205.    equivalent to assigning the left, top, right, and bottom arguments to the
  25206.    appropriate fields of the RECTL structure. The coordinates of the
  25207.    rectangle are sign-extended before being placed into the RECTL structure.
  25208.  
  25209.  Parameters
  25210.  
  25211.    hab  Identifies an anchor block.
  25212.  
  25213.    prcl  Points to a RECTL structure that contains the rectangle to be set.
  25214.    The RECTL structure has the following form:
  25215.  
  25216.    typedef struct _RECTL {
  25217.        LONG  xLeft;
  25218.        LONG  yBottom;
  25219.        LONG  xRight;
  25220.        LONG  yTop;
  25221.    } RECTL;
  25222.  
  25223.    For a full description, see Chapter 4, "Types, Macros, Structures."
  25224.  
  25225.    xLeft  Specifies the left edge of the rectangle.
  25226.  
  25227.    yBottom  Specifies the bottom edge of the rectangle.
  25228.  
  25229.    xRight  Specifies the right edge of the rectangle.
  25230.  
  25231.    yTop  Specifies the top edge of the rectangle.
  25232.  
  25233.  Return Value
  25234.  
  25235.    The return value is always TRUE.
  25236.  
  25237.  See Also
  25238.  
  25239.    WinSetRectEmpty
  25240.  
  25241.  
  25242.  ────────────────────────────────────────────────────────────────────────────
  25243.  WinSetRectEmpty
  25244.  ────────────────────────────────────────────────────────────────────────────
  25245.    BOOL WinSetRectEmpty (hab, prcl)
  25246.    HAB hab;                /*handle of the anchor block                    */
  25247.    PRECTL prcl;            /*address of structure with rectangle to set    */
  25248.                            /*to empty                                      */
  25249.  
  25250.    The WinSetRectEmpty function sets a rectangle to empty. This function is
  25251.    equivalent to WinSetRect(hab, prcl, 0, 0, 0, 0).
  25252.  
  25253.  Parameters
  25254.  
  25255.    hab  Identifies an anchor block.
  25256.  
  25257.    prcl  Points to a RECTL structure that contains the rectangle to be set to
  25258.    empty. The RECTL structure has the following form:
  25259.  
  25260.    typedef struct _RECTL {
  25261.        LONG  xLeft;
  25262.        LONG  yBottom;
  25263.        LONG  xRight;
  25264.        LONG  yTop;
  25265.    } RECTL;
  25266.  
  25267.    For a full description, see Chapter 4, "Types, Macros, Structures."
  25268.  
  25269.  Return Value
  25270.  
  25271.    The return value is always TRUE.
  25272.  
  25273.  See Also
  25274.  
  25275.    WinCopyRect, WinSetRect
  25276.  
  25277.  
  25278.  ────────────────────────────────────────────────────────────────────────────
  25279.  WinSetSysColors
  25280.  ────────────────────────────────────────────────────────────────────────────
  25281.    BOOL WinSetSysColors (hwndDesktop, flOptions, flFormat, clrFirst, cclr,
  25282.    pclr)
  25283.    HWND hwndDesktop;       /*handle of the desktop                         */
  25284.    ULONG flOptions;        /*color options                                 */
  25285.    ULONG flFormat;         /*format options                                */
  25286.    COLOR clrFirst;         /*first color to set                            */
  25287.    ULONG cclr;             /*number of colors to set                       */
  25288.    PCOLOR pclr;            /*address of color definitions                  */
  25289.  
  25290.    The WinSetSysColors function sets system color values. This function sends
  25291.    a WM_SYSCOLORCHANGE message to all main windows in the system to indicate
  25292.    that the colors have changed. When this message is received, applications
  25293.    that depend on the system colors can query the new color values by using
  25294.    the WinQuerySysColor function.
  25295.  
  25296.    After the WM_SYSCOLORCHANGE messages are sent, all windows in the system
  25297.    are invalidated so that they will be redrawn with the new system colors.
  25298.  
  25299.    WinSetSysColors does not write any system color changes to the os2.ini
  25300.    file.
  25301.  
  25302.  Parameters
  25303.  
  25304.    hwndDesktop  Identifies the desktop window. This parameter can be
  25305.    HWND_DESKTOP or the desktop window handle.
  25306.  
  25307.    flOptions  Specifies the following options:
  25308.  
  25309.    Value             Meaning
  25310.    ──────────────────────────────────────────────────────────────────────────
  25311.    LCOL_PURECOLOR    Indicates that color dithering should not be used to
  25312.                      create colors not available in the physical palette. If
  25313.                      this option is set, only pure colors will be used and no
  25314.                      dithering will be done.
  25315.  
  25316.    LCOL_RESET        Indicates that the system colors are all to be reset to
  25317.                      default before processing the remainder of the data in
  25318.                      this function.
  25319.    ──────────────────────────────────────────────────────────────────────────
  25320.  
  25321.    flFormat  Specifies the format of entries in the table, as follows:
  25322.  
  25323.    Value             Meaning
  25324.    ──────────────────────────────────────────────────────────────────────────
  25325.    LCOLF_CONSECRGB   Array of RGB values that correspond to color indexes.
  25326.                      Each entry is 4 bytes.
  25327.  
  25328.    LCOLF_INDRGB      Array of (index, RGB) values. Each pair of entries is 8
  25329.                      bytes──4 bytes index and 4 bytes color value.
  25330.    ──────────────────────────────────────────────────────────────────────────
  25331.  
  25332.    clrFirst  Specifies the starting system color index (this parameter is
  25333.    only relevant for the LCOLF_CONSECRGB format). The following system color
  25334.    indexes are defined (each successive index is one larger than its
  25335.    predecessor):
  25336.  
  25337. ╓┌─┌──────────────────────────┌──────────────────────────────────────────────╖
  25338.    Value                      Meaning
  25339.    ──────────────────────────────────────────────────────────────────────────
  25340.    SYSCLR_ACTIVEBORDER        Border fill of active window
  25341.  
  25342.    SYSCLR_ACTIVETITLE         Title bar of active window
  25343.  
  25344.    SYSCLR_APPWORKSPACE        Background of certain main windows
  25345.  
  25346.    SYSCLR_BACKGROUND          Screen background
  25347.  
  25348.    SYSCLR_HELPBACKGROUND      Background of help panels
  25349.    Value                      Meaning
  25350.    ──────────────────────────────────────────────────────────────────────────
  25351.   SYSCLR_HELPBACKGROUND      Background of help panels
  25352.  
  25353.    SYSCLR_HELPHILITE          Highlight of help text
  25354.  
  25355.    SYSCLR_HELPTEXT            Help text
  25356.  
  25357.    SYSCLR_INACTIVEBORDER      Border fill of inactive window
  25358.  
  25359.    SYSCLR_INACTIVETITLE       Title bar of inactive window
  25360.  
  25361.    SYSCLR_MENU                Menu background
  25362.  
  25363.    SYSCLR_MENUTEXT            Menu text
  25364.  
  25365.    SYSCLR_SCROLLBAR           Scroll bar
  25366.  
  25367.    SYSCLR_TITLETEXT           Title text
  25368.  
  25369.    SYSCLR_WINDOW              Window background
  25370.    Value                      Meaning
  25371.    ──────────────────────────────────────────────────────────────────────────
  25372.   SYSCLR_WINDOW              Window background
  25373.  
  25374.    SYSCLR_WINDOWFRAME         Window border line
  25375.  
  25376.    SYSCLR_WINDOWSTATICTEXT    Static text
  25377.  
  25378.    SYSCLR_WINDOWTEXT          Window text
  25379.    ──────────────────────────────────────────────────────────────────────────
  25380.  
  25381.  
  25382.    cclr  Specifies the number of elements supplied in pclr. This parameter
  25383.    may be zero if, for example, the color table is merely to be reset to the
  25384.    default. For LCOLF_INDRGB, this parameter must be an even number. The
  25385.    constant SYSCLR_CSYSCOLORS is set to the total number of system colors.
  25386.  
  25387.    pclr  Specifies the start address of the application data area containing
  25388.    the color-table definition data. The format depends on the value of the
  25389.    flFormat parameter. Each color value is a 4-byte integer. The low byte is
  25390.    the blue intensity value (0x000000FF), the second byte is the green
  25391.    intensity value (0x0000FF00), and the third byte is the red intensity
  25392.    value (0x00FF0000). The intensity for each color may range between 0 and
  25393.    255.
  25394.  
  25395.  Return Value
  25396.  
  25397.    The return value is TRUE if the function is successful or FALSE if an
  25398.    error occurs.
  25399.  
  25400.  See Also
  25401.  
  25402.    WinQuerySysColor
  25403.  
  25404.  
  25405.  ────────────────────────────────────────────────────────────────────────────
  25406.  WinSetSysModalWindow
  25407.  ────────────────────────────────────────────────────────────────────────────
  25408.    BOOL WinSetSysModalWindow (hwndDesktop, hwnd)
  25409.    HWND hwndDesktop;       /*handle of the desktop                         */
  25410.    HWND hwnd;              /*handle of the window that becomes system      */
  25411.                            /*modal                                         */
  25412.  
  25413.    The WinSetSysModalWindow function makes a window the system modal window
  25414.    or ends the system modal state.
  25415.  
  25416.  Parameters
  25417.  
  25418.    hwndDesktop  Identifies the desktop window. This parameter can be
  25419.    HWND_DESKTOP or the desktop window handle.
  25420.  
  25421.    hwnd  Identifies the window that is to become the system modal window. If
  25422.    this parameter is NULL, the system modal state terminates and input
  25423.    processing returns to its normal state.
  25424.  
  25425.  Return Value
  25426.  
  25427.    The return value is TRUE if the function is successful or FALSE if an
  25428.    error occurs.
  25429.  
  25430.  Comments
  25431.  
  25432.    Input processing can enter a system modal state. In this state, all mouse
  25433.    and keyboard input is directed to a special main window, called the system
  25434.    modal window, or to one of its child windows. All other main windows act
  25435.    as if they are disabled and no interaction is possible with them.
  25436.  
  25437.    The disabled windows are not actually disabled but rather made
  25438.    noninteractive. No messages are sent to these windows when the system
  25439.    modal state is entered or left, and their WS_DISABLE style bits are not
  25440.    changed.
  25441.  
  25442.    Where a system modal window exists and another window is explicitly made
  25443.    the active window, the newly activated window becomes the system modal
  25444.    window, replacing the previous system modal window, which then becomes a
  25445.    noninteractive window. When the system modal window is destroyed, the
  25446.    window activated as a result becomes the system modal window.
  25447.  
  25448.    This function should be called only while processing keyboard or mouse
  25449.    input.
  25450.  
  25451.    The new system modal window is not locked during the processing of this
  25452.    function.
  25453.  
  25454.  See Also
  25455.  
  25456.    WinQuerySysModalWindow
  25457.  
  25458.  
  25459.  ────────────────────────────────────────────────────────────────────────────
  25460.  WinSetSysValue
  25461.  ────────────────────────────────────────────────────────────────────────────
  25462.    BOOL WinSetSysValue (hwndDesktop, iSysValue, lValue)
  25463.    HWND hwndDesktop;       /*handle of the desktop                         */
  25464.    SHORT iSysValue;        /*system value to change                        */
  25465.    LONG lValue;            /*new system value                              */
  25466.  
  25467.    The WinSetSysValue function sets the system value.
  25468.  
  25469.  Parameters
  25470.  
  25471.    hwndDesktop  Identifies the desktop window. This parameter can be
  25472.    HWND_DESKTOP or the desktop window handle.
  25473.  
  25474.    iSysValue  Specifies the system value. This parameter must be a valid SV
  25475.    value. For a complete list of possible system values, see the following
  25476.    "Comments" section.
  25477.  
  25478.    lValue  Specifies the system value. Durations are in milliseconds.
  25479.    Frequencies are in hertz, with values between 25H and 7FFFH being valid.
  25480.  
  25481.  Return Value
  25482.  
  25483.    The return value is TRUE if the system value is successfully set.
  25484.    Otherwise, it is FALSE, indicating that an error occurred.
  25485.  
  25486.  Comments
  25487.  
  25488.    The following list describes the system values:
  25489.  
  25490. ╓┌─┌─────────────────────┌───────────────────────────────────────────────────╖
  25491.    Value                 Meaning
  25492.    ──────────────────────────────────────────────────────────────────────────
  25493.    SV_CMOUSEBUTTONS      Specifies the number of mouse buttons: 1, 2, or 3.
  25494.  
  25495.    SV_MOUSEPRESENT       Specifies whether the mouse is present. A value of
  25496.    Value                 Meaning
  25497.    ──────────────────────────────────────────────────────────────────────────
  25498.   SV_MOUSEPRESENT       Specifies whether the mouse is present. A value of
  25499.                          TRUE means the mouse is present.
  25500.  
  25501.    SV_SWAPBUTTON         Specifies if the mouse buttons are swapped. TRUE if
  25502.                          mouse buttons are swapped.
  25503.  
  25504.    SV_CXDBLCLK           Specifies the mouse double click horizontal spacing.
  25505.                          The horizontal spatial requirement for considering
  25506.                          two mouse clicks a double click is met if the
  25507.                          horizontal distance between two mouse clicks is less
  25508.                          than this value.
  25509.  
  25510.    SV_CYDBLCLK           Specifies the mouse double click vertical spacing.
  25511.                          The vertical spatial requirement for considering two
  25512.                          mouse clicks a double click is met if the vertical
  25513.                          distance between two mouse clicks is less than this
  25514.                          value.
  25515.  
  25516.    SV_DBLCLKTIME         Specifies the mouse double click time in
  25517.    Value                 Meaning
  25518.    ──────────────────────────────────────────────────────────────────────────
  25519.   SV_DBLCLKTIME         Specifies the mouse double click time in
  25520.                          milliseconds. The temporal requirement for
  25521.                          considering two mouse clicks a double click is met
  25522.                          if the time between two mouse clicks is less than
  25523.                          this value.
  25524.  
  25525.    SV_CXSIZEBORDER       Specifies the count of pels along the x-axis in the
  25526.                          left and right parts of a window sizing border.
  25527.  
  25528.    SV_CYSIZEBORDER       Specifies the count of pels along the y-axis in the
  25529.                          top and bottom sections of a window sizing border.
  25530.  
  25531.    SV_ALARM              Specifies whether calls to WinAlarm generate a
  25532.                          sound. A value of TRUE means sound is generated.
  25533.  
  25534.    SV_CURSORRATE         Specifies the cursor blinking rate in milliseconds.
  25535.                          The blinking rate is the time that the cursor
  25536.                          remains visible or invisible. Twice this value is
  25537.                          the length of a complete cursor visible/invisible
  25538.    Value                 Meaning
  25539.    ──────────────────────────────────────────────────────────────────────────
  25540.                         the length of a complete cursor visible/invisible
  25541.                          cycle.
  25542.  
  25543.    SV_FIRSTSCROLLRATE    Specifies the delay (in milliseconds) until scroll
  25544.                          bar autorepeat activity begins when the mouse is
  25545.                          held down on a scroll bar arrow or within a scroll
  25546.                          bar.
  25547.  
  25548.    SV_SCROLLRATE         Specifies the delay (in milliseconds) between scroll
  25549.                          bar autorepeat events.
  25550.  
  25551.    SV_NUMBEREDLISTS      Reserved.
  25552.  
  25553.    SV_ERRORFREQ          Specifies the frequency (in cycles per second) of a
  25554.                          WinAlarm WA_ERROR sound.
  25555.  
  25556.    SV_NOTEFREQ           Specifies the frequency (in cycles per second) of a
  25557.                          WinAlarm WA_NOTE sound.
  25558.  
  25559.    Value                 Meaning
  25560.    ──────────────────────────────────────────────────────────────────────────
  25561. 
  25562.    SV_WARNINGFREQ        Specifies the frequency (in cycles per second) of a
  25563.                          WinAlarm WA_WARNING sound.
  25564.  
  25565.    SV_ERRORDURATION      Specifies the duration (in milliseconds) of a
  25566.                          WinAlarm WA_ERROR sound.
  25567.  
  25568.    SV_NOTEDURATION       Specifies the duration (in milliseconds) of a
  25569.                          WinAlarm WA_NOTE sound.
  25570.  
  25571.    SV_WARNINGDURATION    Specifies the duration (in milliseconds) of a
  25572.                          WinAlarm WA_WARNING sound.
  25573.  
  25574.    SV_CXSCREEN           Specifies the count of pels along the screen's
  25575.                          x-axis.
  25576.  
  25577.    SV_CYSCREEN           Specifies the count of pels along the screen's
  25578.                          y-axis.
  25579.  
  25580.    Value                 Meaning
  25581.    ──────────────────────────────────────────────────────────────────────────
  25582. 
  25583.    SV_CXVSCROLL          Specifies the count of pels along the x-axis of a
  25584.                          vertical scroll bar.
  25585.  
  25586.    SV_CYHSCROLL          Specifies the count of pels along the y-axis of a
  25587.                          horizontal scroll bar.
  25588.  
  25589.    SV_CXHSCROLLARROW     Specifies the count of pels along the x-axis of a
  25590.                          horizontal scroll bar arrow.
  25591.  
  25592.    SV_CYVSCROLLARROW     Specifies the count of pels along the y-axis of a
  25593.                          vertical scroll bar arrow.
  25594.  
  25595.    SV_CXBORDER           Specifies the count of pels along the x-axis of a
  25596.                          window border.
  25597.  
  25598.    SV_CYBORDER           Specifies the count of pels along the y-axis of a
  25599.                          window border.
  25600.  
  25601.    Value                 Meaning
  25602.    ──────────────────────────────────────────────────────────────────────────
  25603. 
  25604.    SV_CXDLGFRAME         Specifies the count of pels along the x-axis of a
  25605.                          dialog frame.
  25606.  
  25607.    SV_CYDLGFRAME         Specifies the count of pels along the y-axis of a
  25608.                          dialog frame.
  25609.  
  25610.    SV_CYTITLEBAR         Specifies the count of pels along the y-axis of a
  25611.                          title bar window.
  25612.  
  25613.    SV_CXHSLIDER          Specifies the count of pels along the x-axis of a
  25614.                          horizontal scroll bar slider.
  25615.  
  25616.    SV_CYVSLIDER          Specifies the count of pels along the y-axis of a
  25617.                          vertical scroll bar slider.
  25618.  
  25619.    SV_CXMINMAXBUTTON     Specifies the width (in pels) of a minimize/
  25620.                          maximize button.
  25621.  
  25622.    Value                 Meaning
  25623.    ──────────────────────────────────────────────────────────────────────────
  25624. 
  25625.    SV_CYMINMAXBUTTON     Specifies the height (in pels) of a minimize/
  25626.                          maximize button.
  25627.  
  25628.    SV_CYMENU             Specifies the height (in pels) of a menu.
  25629.  
  25630.    SV_CXFULLSCREEN       Specifies the count of pels along the x-axis of a
  25631.                          maximized frame window's client window.
  25632.  
  25633.    SV_CYFULLSCREEN       Specifies the count of pels along the y-axis of a
  25634.                          maximized frame window's client window.
  25635.  
  25636.    SV_CXICON             Specifies the count of pels along an icon's x-axis.
  25637.  
  25638.    SV_CYICON             Specifies the count of pels along an icon's y-axis.
  25639.  
  25640.    SV_CXPOINTER          Specifies the count of pels along the mouse
  25641.                          pointer's x-axis.
  25642.  
  25643.    Value                 Meaning
  25644.    ──────────────────────────────────────────────────────────────────────────
  25645. 
  25646.    SV_CYPOINTER          Specifies the count of pels along the mouse
  25647.                          pointer's y-axis.
  25648.  
  25649.    SV_DEBUG              Reserved.
  25650.  
  25651.    SV_CURSORLEVEL        Specifies the cursor display count. The cursor is
  25652.                          visible only when the display count is zero.
  25653.  
  25654.    SV_POINTERLEVEL       Specifies the mouse pointer display count. The mouse
  25655.                          is visible only when the display count is zero.
  25656.  
  25657.    SV_TRACKRECTLEVEL     Specifies the tracking rectangle display count. The
  25658.                          tracking rectangle is visible only when the display
  25659.                          count is zero.
  25660.  
  25661.    SV_CTIMERS            Specifies the number of available timers.
  25662.  
  25663.    SV_CXBYTEALIGN        Set by a device driver at initialization time to
  25664.    Value                 Meaning
  25665.    ──────────────────────────────────────────────────────────────────────────
  25666.   SV_CXBYTEALIGN        Set by a device driver at initialization time to
  25667.                          indicate any horizontal alignment that is more
  25668.                          efficient for the driver.
  25669.  
  25670.    SV_CYBYTEALIGN        Set by a device driver at initialization time to
  25671.                          indicate any vertical alignment that is more
  25672.                          efficient for the driver.
  25673.  
  25674.    SV_CSYSVALUES         Specifies the number of system values.
  25675.    ──────────────────────────────────────────────────────────────────────────
  25676.  
  25677.  
  25678.  See Also
  25679.  
  25680.    WinQuerySysValue
  25681.  
  25682.  
  25683.  ────────────────────────────────────────────────────────────────────────────
  25684.  WinSetWindowBits
  25685.  ────────────────────────────────────────────────────────────────────────────
  25686.    BOOL WinSetWindowBits (hwnd, index, flData, flMask)
  25687.    HWND hwnd;              /*handle of the window                          */
  25688.    SHORT index;            /*index of the bits                             */
  25689.    ULONG flData;           /*data to set                                   */
  25690.    ULONG flMask;           /*mask of bits to set                           */
  25691.  
  25692.    The WinSetWindowBits function sets particular bits in the reserved memory
  25693.    of a window.
  25694.  
  25695.  Parameters
  25696.  
  25697.    hwnd  Identifies the window whose reserved memory is to be changed.
  25698.  
  25699.    index  Specifies the zero-based index of the ULONG value to set. Valid
  25700.    values are in the range zero through the number of bytes of window data
  25701.    (for example, a value of 8 would be an index to the third long integer),
  25702.    or any of the QWL values described in the WinSetWindowULong function.
  25703.  
  25704.    flData  Specifies the data to be written into the window's reserved
  25705.    memory.
  25706.  
  25707.    flMask  Specifies a mask value. The mask contains 1 where data is to be
  25708.    written and 0 where the data is to be unchanged.
  25709.  
  25710.  Return Value
  25711.  
  25712.    The return value is TRUE if the function is successful or FALSE if an
  25713.    error occurs.
  25714.  
  25715.  See Also
  25716.  
  25717.    WinSetWindowULong
  25718.  
  25719.  
  25720.  ────────────────────────────────────────────────────────────────────────────
  25721.  WinSetWindowPos
  25722.  ────────────────────────────────────────────────────────────────────────────
  25723.    BOOL WinSetWindowPos (hwnd, hwndInsertBehind, x, y, cx, cy, fs)
  25724.    HWND hwnd;              /*handle of the window being set                */
  25725.    HWND hwndInsertBehind;  /*placement-order handle                        */
  25726.    SHORT x;                /*horizontal position                           */
  25727.    SHORT y;                /*vertical position                             */
  25728.    SHORT cx;               /*width                                         */
  25729.    SHORT cy;               /*height                                        */
  25730.    USHORT fs;              /*window-positioning flags                      */
  25731.  
  25732.    The WinSetWindowPos function sets the position of a window.
  25733.  
  25734.  Parameters
  25735.  
  25736.    hwnd  Identifies the window whose position is being set.
  25737.  
  25738.    hwndInsertBehind  Identifies relative window-placement order. This
  25739.    parameter is ignored if the fs parameter's SWP_ZORDER option is not
  25740.    selected. Values that can be specified are as follows:
  25741.  
  25742.    Value        Meaning
  25743.    ──────────────────────────────────────────────────────────────────────────
  25744.    HWND_BOTTOM  Places the hwnd window behind all sibling windows.
  25745.  
  25746.    HWND_TOP     Places the hwnd window on top of all sibling windows.
  25747.  
  25748.    Other        Identifies the sibling window behind which the hwnd window is
  25749.                 to be placed.
  25750.    ──────────────────────────────────────────────────────────────────────────
  25751.  
  25752.    x  Specifies the x position of the hwnd window in window coordinates
  25753.    relative to the lower-left corner of its parent window. This parameter is
  25754.    ignored if the fs parameter's SWP_MOVE option is not selected.
  25755.  
  25756.    y  Specifies the y position of the hwnd window in window coordinates
  25757.    relative to the lower-left corner of its parent window. This parameter is
  25758.    ignored if the fs parameter's SWP_MOVE option is not selected.
  25759.  
  25760.    cx  Specifies the horizontal window size (in device units). This parameter
  25761.    is ignored if the fs parameter's SWP_SIZE option is not selected.
  25762.  
  25763.    cy  Specifies the vertical window size (in device units). This parameter
  25764.    is ignored if the fs parameter's SWP_SIZE option is not selected.
  25765.  
  25766.    fs  Identifies the window-positioning options. One or more of the
  25767.    following options can be specified:
  25768.  
  25769. ╓┌─┌───────────────────────┌─────────────────────────────────────────────────╖
  25770.    Value                   Meaning
  25771.    ──────────────────────────────────────────────────────────────────────────
  25772.    SWP_ACTIVATE            Causes the window to be activated and the focus to
  25773.                            be set to the window that lost the focus the last
  25774.                            time the frame window was deactivated. The
  25775.                            activated window may not become the top window if
  25776.                            it owns other frame windows.
  25777.  
  25778.    SWP_DEACTIVATE          Deactivate the window, if it is the active window.
  25779.  
  25780.    SWP_EXTSTATECHANGE      This flag is for application use. It is used to
  25781.                            pass an additional flag to the portion of code
  25782.                            that is handling messages.
  25783.  
  25784.    SWP_FOCUSACTIVATE       Specifies that a frame window is receiving the
  25785.                            focus. This flag is set so that an application
  25786.                            that is processing the WM_ADJUSTWINDOWPOS message
  25787.                            can tell if the message was sent as the result of
  25788.                            a focus change.
  25789.  
  25790.    Value                   Meaning
  25791.    ──────────────────────────────────────────────────────────────────────────
  25792. 
  25793.    SWP_FOCUSDEACTIVATE     Specifies that a frame window is losing the focus.
  25794.  
  25795.    SWP_HIDE                Specifies that the window is to be hidden when
  25796.                            created.
  25797.  
  25798.    SWP_MAXIMIZE            With SWP_MINIMIZE, causes a window to be
  25799.                            minimized, maximized, or restored. SWP_MAXIMIZE
  25800.                            and SWP_MINIMIZE are mutually exclusive. If either
  25801.                            SWP_MINIMIZE or SWP_MAXIMIZE is specified, then
  25802.                            both SWP_MOVE and SWP_SIZE must also be specified.
  25803.                            WinSetWindowPos and WinSetMultWindowPos depend on
  25804.                            the previous state of the window; these flags
  25805.                            cause the appropriate state to be toggled, as
  25806.                            follows: the x, y, cx, and cy parameters specify
  25807.                            the size and position to which the window will be
  25808.                            restored if it is subsequently restored. This
  25809.                            should be the normal size of the window.
  25810.  
  25811.    Value                   Meaning
  25812.    ──────────────────────────────────────────────────────────────────────────
  25813. 
  25814.    SWP_MINIMIZE            See SWP_MAXIMIZE.
  25815.  
  25816.    SWP_MOVE                Change the window x,y position.
  25817.  
  25818.    SWP_NOADJUST            Do not send a WM_ADJUSTWINDOWPOS message to the
  25819.                            window while processing (in other words, don't
  25820.                            give the window a chance to readjust itself).
  25821.  
  25822.    SWP_NOREDRAW            Do not redraw changes.
  25823.  
  25824.    SWP_RESTORE             Restore a minimized or maximized window.
  25825.  
  25826.    SWP_SHOW                Specifies that the window is to be shown when
  25827.                            created.
  25828.  
  25829.    SWP_SIZE                Change the window size.
  25830.  
  25831.    SWP_ZORDER              Change the relative window placement.
  25832.    Value                   Meaning
  25833.    ──────────────────────────────────────────────────────────────────────────
  25834.   SWP_ZORDER              Change the relative window placement.
  25835.    ──────────────────────────────────────────────────────────────────────────
  25836.  
  25837.  
  25838.  Return Value
  25839.  
  25840.    The return value is TRUE if the function is successful or FALSE if an
  25841.    error occurs.
  25842.  
  25843.  Comments
  25844.  
  25845.    If a window created with the CS_SAVEBITS style is moved, reduced in size,
  25846.    or hidden, the saved screen image is used to redraw the area uncovered
  25847.    when the window size changes, if those bits are still valid.
  25848.  
  25849.    If the CS_SIZEREDRAW style is present, the entire window area is assumed
  25850.    invalid if sized. Otherwise, a WM_CALCVALIDRECTS message is sent to the
  25851.    window to inform the window manager which bits it may be possible to
  25852.    preserve.
  25853.  
  25854.    Messages sent from WinSetWindowPos and WinSetMultWindowPos have specific
  25855.    orders within the window positioning process. The process begins with
  25856.    redundancy checks and precalculations on every window for each requested
  25857.    operation. For example, if SWP_SHOW is present but the window is already
  25858.    visible, then SWP_SHOW is turned off. If SWP_SIZE is present and the new
  25859.    size is equal to the previous size, SWP_SIZE is turned off. If the
  25860.    operations will create new results, the information is calculated and
  25861.    stored. For example, if being sized or moved, the new window rectangle is
  25862.    stored for later use. It is at this point that the WM_ADJUSTWINDOWPOS
  25863.    message is sent to any window that is being sized or moved. It is also at
  25864.    this point that the WM_CALCVALIDRECTS message is sent to any window that
  25865.    is being sized and does not have the CS_SIZEREDRAW window style.
  25866.  
  25867.    When the new window state is calculated, the window-management process
  25868.    begins. Window areas that can be preserved are moved from the old to the
  25869.    new positions, window areas that are invalidated by these operations are
  25870.    calculated and distributed as update regions, and so forth. When this is
  25871.    finished, and before any synchronous-paint windows are repainted, the
  25872.    WM_SIZE message is sent to any windows that have changed size. Next, all
  25873.    the synchronous-paint windows that can be repainted are repainted and the
  25874.    entire process is complete.
  25875.  
  25876.    If a synchronous-paint parent window has a size-sensitive area displayed
  25877.    that includes synchronous-paint child windows, the parent window will
  25878.    reposition those windows when it receives the WM_SIZE message. Their
  25879.    invalid regions will be added to the parent window's invalid region,
  25880.    resulting in one update after the parent window's WM_SIZE message, rather
  25881.    than many independent and subsequently duplicated updates.
  25882.  
  25883.    The following messages are sent by this function:
  25884.  
  25885.    Value                  Meaning
  25886.    ──────────────────────────────────────────────────────────────────────────
  25887.    WM_CALCVALIDRECTS      Sent to determine the area of a window that it may
  25888.                           be possible to preserve as the window is sized.
  25889.  
  25890.    WM_SIZE                Sent if the size of the window has changed, after
  25891.                           the change has been effected.
  25892.  
  25893.    WM_MOVE                Sent when a window with CS_MOVENOTIFY class style
  25894.                           moves its absolute position.
  25895.  
  25896.    WM_ACTIVATE            Sent if a different window becomes the active
  25897.                           window. For more information, see the
  25898.                           WinSetActiveWindow function.
  25899.  
  25900.    WM_ADJUSTWINDOWPOS     Sent if SWP_NOADJUST is not specified. The
  25901.                           message's mp1 parameter points to an SWP structure
  25902.                           that has been filled in by the WinSetWindowPos
  25903.                           function with the proposed move/size data. The
  25904.                           window can adjust this new position by changing the
  25905.                           contents of the SWP structure.
  25906.    ──────────────────────────────────────────────────────────────────────────
  25907.  
  25908.  Example
  25909.  
  25910.    This example gets the dimensions of the desktop window, and calls
  25911.    WinSetWindowPos to place the application's frame window in the upper left
  25912.    corner. By positioning the window relative to the desktop window, the
  25913.    window position is device-independent; it will work on any display adapter
  25914.    now matter what the vertical and horizontal resolution is.
  25915.  
  25916.    RECTL rcl;
  25917.  
  25918.    WinQueryWindowRect(HWND_DESKTOP, &rcl);
  25919.    WinSetWindowPos(hwndFrame, HWND_TOP,
  25920.        rcl.xLeft,                                      /* x pos  */
  25921.        rcl.yTop - 60,                                  /* y pos  */
  25922.        140,                                            /* x size */
  25923.        60,                                             /* y size */
  25924.        SWP_ACTIVATE | SWP_MOVE | SWP_SIZE | SWP_SHOW); /* flags  */
  25925.  
  25926.  See Also
  25927.  
  25928.    WinSetActiveWindow, WinSetMultWindowPos
  25929.  
  25930.  
  25931.  ────────────────────────────────────────────────────────────────────────────
  25932.  WinSetWindowPtr
  25933.  ────────────────────────────────────────────────────────────────────────────
  25934.    BOOL WinSetWindowPtr (hwnd, index, p)
  25935.    HWND hwnd;              /*handle of the window                          */
  25936.    SHORT index;            /*index of the reserved memory                  */
  25937.    PVOID p;                /*pointer to place into reserved memory         */
  25938.  
  25939.    The WinSetWindowPtr function places a pointer value into the reserved
  25940.    memory of a window.
  25941.  
  25942.  Parameters
  25943.  
  25944.    hwnd  Identifies the window whose reserved memory will be changed.
  25945.  
  25946.    index  Specifies the zero-based index of the pointer value to set. Valid
  25947.    values are in the range zero through the number of bytes of window data
  25948.    (for example, a value of 8 would be an index to the third pointer). The
  25949.    value QWP_PFNWP can be used as the index for the address of the window
  25950.    procedure for the window.
  25951.  
  25952.    p  Specifies the pointer to store in the window's reserved memory.
  25953.  
  25954.  Return Value
  25955.  
  25956.    The return value is TRUE if the function is successful or FALSE if an
  25957.    error occurs.
  25958.  
  25959.  See Also
  25960.  
  25961.    WinQueryWindowPtr, WinSetWindowULong
  25962.  
  25963.  
  25964.  ────────────────────────────────────────────────────────────────────────────
  25965.  WinSetWindowText
  25966.  ────────────────────────────────────────────────────────────────────────────
  25967.    BOOL WinSetWindowText (hwnd, pszText)
  25968.    HWND hwnd;              /*handle of the window                          */
  25969.    PSZ pszText;            /*points to the text to set                     */
  25970.  
  25971.    The WinSetWindowText function sets the window text for a window to the
  25972.    specified text. This function sends a WM_SETWINDOWPARAMS message to the
  25973.    hwnd window.
  25974.  
  25975.    If this function is called with a frame-window handle, the text of the
  25976.    title-bar-frame control is changed.
  25977.  
  25978.  Parameters
  25979.  
  25980.    hwnd  Identifies the window to set the text for.
  25981.  
  25982.    pszText  Points to the window text.
  25983.  
  25984.  Return Value
  25985.  
  25986.    The return value is TRUE if the function is successful or FALSE if an
  25987.    error occurs.
  25988.  
  25989.  See Also
  25990.  
  25991.    WinQueryWindowText
  25992.  
  25993.  
  25994.  ────────────────────────────────────────────────────────────────────────────
  25995.  WinSetWindowULong
  25996.  ────────────────────────────────────────────────────────────────────────────
  25997.    BOOL WinSetWindowULong (hwnd, index, ul)
  25998.    HWND hwnd;              /*handle of the window                          */
  25999.    SHORT index;            /*index into reserved memory                    */
  26000.    ULONG ul;               /*value to place in reserved memory             */
  26001.  
  26002.    The WinSetWindowULong function places an unsigned long integer value into
  26003.    the reserved memory of a window.
  26004.  
  26005.  Parameters
  26006.  
  26007.    hwnd  Identifies the window whose reserved memory is to be changed.
  26008.  
  26009.    index  Specifies the zero-based index of the ULONG value to set. Valid
  26010.    values are in the range zero through the number of bytes of window data
  26011.    (for example, a value of 8 would be an index to the third long integer),
  26012.    or any of the following QWL values:
  26013.  
  26014. ╓┌─┌─────────────────────┌───────────────────────────────────────────────────╖
  26015.    Value                 Meaning
  26016.    ──────────────────────────────────────────────────────────────────────────
  26017.    QWL_HHEAP             Handle of the heap.
  26018.  
  26019.    QWL_HMQ               Handle of the message queue of the window.
  26020.  
  26021.    Value                 Meaning
  26022.    ──────────────────────────────────────────────────────────────────────────
  26023. 
  26024.    QWL_HWNDFOCUSSAVE     Handle of the window that last had the focus.
  26025.  
  26026.    QWL_STYLE             Window style.
  26027.  
  26028.    QWL_USER              ULONG value present in windows of the following
  26029.                          preregistered window classes:
  26030.  
  26031.                              WC_BUTTON
  26032.                              WC_DIALOG
  26033.                              WC_ENTRYFIELD
  26034.                              WC_FRAME
  26035.                              WC_LISTBOX
  26036.                              WC_MENU
  26037.                              WC_SCROLLBAR
  26038.                              WC_STATIC
  26039.  
  26040.                          This value can be used to retrieve
  26041.                          application-specific data in controls.
  26042.    Value                 Meaning
  26043.    ──────────────────────────────────────────────────────────────────────────
  26044.                         application-specific data in controls.
  26045.    ──────────────────────────────────────────────────────────────────────────
  26046.  
  26047.  
  26048.    ul  Specifies the unsigned long integer to place in the window's reserved
  26049.    memory.
  26050.  
  26051.  Return Value
  26052.  
  26053.    The return value is TRUE if the function is successful or FALSE if an
  26054.    error occurs.
  26055.  
  26056.  Comments
  26057.  
  26058.    The specified index is valid only if all the bytes referenced are within
  26059.    the reserved memory. For example, this function would fail if an index
  26060.    value of zero was specified and only 2 bytes had been reserved.
  26061.  
  26062.  See Also
  26063.  
  26064.    WinQueryWindowULong, WinRegisterClass, WinSetWindowBits,
  26065.    WinSetWindowUShort
  26066.  
  26067.  
  26068.  ────────────────────────────────────────────────────────────────────────────
  26069.  WinSetWindowUShort
  26070.  ────────────────────────────────────────────────────────────────────────────
  26071.    BOOL WinSetWindowUShort (hwnd, index, us)
  26072.    HWND hwnd;              /*handle of the window                          */
  26073.    SHORT index;            /*index into reserved memory                    */
  26074.    USHORT us;              /*value to place in reserved memory             */
  26075.  
  26076.    The WinSetWindowUShort function places an unsigned short integer into the
  26077.    reserved memory of a window.
  26078.  
  26079.  Parameters
  26080.  
  26081.    hwnd  Identifies the window whose reserved memory is to be changed.
  26082.  
  26083.    index  Specifies the zero-based index of the USHORT value to set. Valid
  26084.    values are in the range zero through the number of bytes of window data
  26085.    (for example, a value of 8 would be an index to the fifth short integer),
  26086.    or any of the following QWS values:
  26087.  
  26088.    Value     Meaning
  26089.    ──────────────────────────────────────────────────────────────────────────
  26090.    QWS_ID    Index of the window identifier (as passed by the WinCreateWindow
  26091.              function).
  26092.  
  26093.    QWS_USER  Index of an unsigned short value present in windows of the
  26094.              following preregistered window classes:
  26095.  
  26096.                  WC_BUTTON
  26097.                  WC_DIALOG
  26098.                  WC_ENTRYFIELD
  26099.                  WC_FRAME
  26100.                  WC_LISTBOX
  26101.                  WC_MENU
  26102.                  WC_SCROLLBAR
  26103.                  WC_STATIC
  26104.  
  26105.              This value can be used to set application-specific data in
  26106.              controls.
  26107.    ──────────────────────────────────────────────────────────────────────────
  26108.  
  26109.    us  Specifies the unsigned short integer to place in the window's reserved
  26110.    memory.
  26111.  
  26112.  Return Value
  26113.  
  26114.    The return value is TRUE if the function is successful or FALSE if an
  26115.    error occurs.
  26116.  
  26117.  See Also
  26118.  
  26119.    WinCreateWindow, WinQueryWindowUShort, WinRegisterClass,
  26120.    WinSetWindowULong
  26121.  
  26122.  
  26123.  ────────────────────────────────────────────────────────────────────────────
  26124.  WinShowCursor
  26125.  ────────────────────────────────────────────────────────────────────────────
  26126.    BOOL WinShowCursor (hwnd, fShow)
  26127.    HWND hwnd;              /*handle of the window                          */
  26128.    BOOL fShow;             /*show/hide flag                                */
  26129.  
  26130.    The WinShowCursor function displays or hides the cursor associated with a
  26131.    specified window. A cursor show level count is kept internally. (You can
  26132.    retrieve this value using the WinQuerySysValue function with
  26133.    SV_CURSORLEVEL as the system value.) It is incremented by a hide operation
  26134.    and decremented by a show operation. The cursor is visible only if the
  26135.    count is zero.
  26136.  
  26137.  Parameters
  26138.  
  26139.    hwnd  Identifies the window to which the cursor belongs.
  26140.  
  26141.    fShow  Specifies whether the cursor is shown or hidden. If TRUE, the
  26142.    cursor is made visible. If FALSE, the cursor is made invisible.
  26143.  
  26144.  Return Value
  26145.  
  26146.    The return value is TRUE if the function is successful or FALSE if an
  26147.    error occurs.
  26148.  
  26149.  See Also
  26150.  
  26151.    WinCreateCursor, WinDestroyCursor, WinQueryCursorInfo,
  26152.    WinQuerySysValue
  26153.  
  26154.  
  26155.  ────────────────────────────────────────────────────────────────────────────
  26156.  WinShowPointer
  26157.  ────────────────────────────────────────────────────────────────────────────
  26158.    BOOL WinShowPointer (hwndDesktop, fShow)
  26159.    HWND hwndDesktop;       /*handle of the desktop                         */
  26160.    BOOL fShow;             /*show/hide flag                                */
  26161.  
  26162.    The WinShowPointer function shows or hides the mouse pointer. A pointer
  26163.    show level count is kept internally. (You can retrieve this value using
  26164.    the WinQuerySysValue function with SV_POINTERLEVEL as the system value.)
  26165.    It is incremented by a hide operation and decremented by a show operation.
  26166.    The pointer is visible only if the count is zero. If a mouse exists, the
  26167.    initial setting of the pointer display level is 0. Otherwise, it is 1.
  26168.  
  26169.  Parameters
  26170.  
  26171.    hwndDesktop  Identifies the desktop window. This parameter can be
  26172.    HWND_DESKTOP or the desktop window handle.
  26173.  
  26174.    fShow  Specifies whether the pointer is shown or hidden. If TRUE, the
  26175.    pointer is made visible. If FALSE, the pointer is made invisible.
  26176.  
  26177.  Return Value
  26178.  
  26179.    The return value is TRUE if the function is successful or FALSE if an
  26180.    error occurs.
  26181.  
  26182.  See Also
  26183.  
  26184.    WinQuerySysValue
  26185.  
  26186.  
  26187.  ────────────────────────────────────────────────────────────────────────────
  26188.  WinShowTrackRect
  26189.  ────────────────────────────────────────────────────────────────────────────
  26190.    BOOL WinShowTrackRect (hwnd, fShow)
  26191.    HWND hwnd;              /*handle of the window                          */
  26192.    BOOL fShow;             /*show/hide flag                                */
  26193.  
  26194.    The WinShowTrackRect function hides or shows the tracking rectangle. A
  26195.    track rectangle show level count is kept internally. (You can retrieve
  26196.    this value using the WinQuerySysValue function with SV_TRACTRECTLEVEL as
  26197.    the system value.) It is incremented by a hide operation and decremented
  26198.    by a show operation. The track rectangle is visible only if the count is
  26199.    zero.
  26200.  
  26201.  Parameters
  26202.  
  26203.    hwnd  Identifies the window passed to the WinTrackRect function.
  26204.  
  26205.    fShow  Specifies whether the rectangle is shown or hidden. If fShow is
  26206.    TRUE, the function shows the tracking rectangle. If fShow is FALSE, the
  26207.    function hides the tracking rectangle.
  26208.  
  26209.  Return Value
  26210.  
  26211.    The return value is TRUE if the function is successful or FALSE if an
  26212.    error occurs.
  26213.  
  26214.  Comments
  26215.  
  26216.    An application must call this function to hide a rectangle it is tracking
  26217.    if there is a possibility of corrupting the track rectangle while drawing
  26218.    (showing it afterward). Since rclTrack in the TRACKINFO structure is
  26219.    updating continuously, the application can examine the current tracking
  26220.    rectangle coordinates to determine whether temporary hiding is necessary.
  26221.  
  26222.    An application needs to call WinShowTrackRect only during asynchronous
  26223.    drawing. If an application is drawing on one thread and issuing the
  26224.    WinTrackRect function on another, pieces of a tracking rectangle may be
  26225.    left behind. The drawing thread should call WinShowTrackRect when tracking
  26226.    may be in progress. The application should provide for communication
  26227.    between the two threads to ensure that if one thread is tracking, the
  26228.    drawing thread will issue WinShowTrackRect. This can be achieved with a
  26229.    semaphore.
  26230.  
  26231.  See Also
  26232.  
  26233.    WinQuerySysValue, WinTrackRect
  26234.  
  26235.  
  26236.  ────────────────────────────────────────────────────────────────────────────
  26237.  WinShowWindow
  26238.  ────────────────────────────────────────────────────────────────────────────
  26239.    BOOL WinShowWindow (hwnd, fShow)
  26240.    HWND hwnd;              /*handle of the window                          */
  26241.    BOOL fShow;             /*show/hide flag                                */
  26242.  
  26243.    The WinShowWindow function sets the window visibility state.
  26244.  
  26245.  Parameters
  26246.  
  26247.    hwnd  Identifies the window whose visibility state is being set.
  26248.  
  26249.    fShow  Identifies the new visibility state. If fShow is TRUE, the function
  26250.    sets the window state to visible. If fShow is FALSE, the function sets the
  26251.    window state to invisible.
  26252.  
  26253.  Return Value
  26254.  
  26255.    The return value is TRUE if the function is successful or FALSE if an
  26256.    error occurs.
  26257.  
  26258.  Comments
  26259.  
  26260.    A window possesses a visibility state indicated by the WS_VISIBLE style
  26261.    bit. When the WS_VISIBLE style bit is set, the window is shown and
  26262.    subsequent drawing into the window is displayed, as long as the window or
  26263.    any of the windows in the parent chain have the WS_VISIBLE style.
  26264.  
  26265.    When the WS_VISIBLE style bit is not set, the window is not shown (hidden)
  26266.    and subsequent drawing into the window is not displayed.
  26267.  
  26268.    If the value of the WS_VISIBLE style bit has been changed, the
  26269.    WM_WINDOWPOSCHANGED message is sent to the window of the hwnd parameter
  26270.    before the function returns.
  26271.  
  26272.    Drawing to a window with a WS_VISIBLE style will not be displayed if the
  26273.    window is covered by other windows or clipped by its parent.
  26274.  
  26275.  See Also
  26276.  
  26277.    WinIsWindowVisible
  26278.  
  26279.  
  26280.  ────────────────────────────────────────────────────────────────────────────
  26281.  WinStartTimer
  26282.  ────────────────────────────────────────────────────────────────────────────
  26283.    USHORT WinStartTimer (hab, hwnd, idTimer, lTimeOut)
  26284.    HAB hab;                /*handle of the anchor block                    */
  26285.    HWND hwnd;              /*handle of the window                          */
  26286.    USHORT idTimer;         /*timer identifier                              */
  26287.    USHORT lTimeOut;        /*time-out value                                */
  26288.  
  26289.    The WinStartTimer function starts a timer. A time-out value is specified,
  26290.    and every time a time-out occurs, a WM_TIMER message is posted to the
  26291.    specified window.
  26292.  
  26293.    A second call to WinStartTimer for a timer that already exists will reset
  26294.    that timer.
  26295.  
  26296.  Parameters
  26297.  
  26298.    hab  Identifies the anchor block.
  26299.  
  26300.    hwnd  Identifies the window that is part of the timer identification. If
  26301.    the hwnd parameter is NULL, then the idTimer parameter is ignored and
  26302.    WinStartTimer returns a unique nonzero identification value that
  26303.    identifies the timer. The timer message is posted in the queue associated
  26304.    with the current thread, with the hwnd parameter equal to NULL.
  26305.  
  26306.    idTimer  Identifies the timer. If hwnd is NULL, this parameter is ignored.
  26307.  
  26308.    lTimeOut  Specifies the timer delay, in milliseconds. An lTimeOut value of
  26309.    zero will cause the timer to time out as fast as possible; generally, this
  26310.    is about 1/18 of a second.
  26311.  
  26312.  Return Value
  26313.  
  26314.    The return value is TRUE if the function is successful and if hwnd is not
  26315.    NULL. Otherwise, it is FALSE, indicating that an error occurred. If hwnd
  26316.    is NULL, the return value is a unique nonzero value, or zero if an error
  26317.    occurs.
  26318.  
  26319.  Comments
  26320.  
  26321.    If the hwnd parameter is NULL, then the return value from this function
  26322.    must be used as the idTimer parameter in any subsequent call to
  26323.    WinStopTimer.
  26324.  
  26325.  See Also
  26326.  
  26327.    WinStopTimer
  26328.  
  26329.  
  26330.  ────────────────────────────────────────────────────────────────────────────
  26331.  WinStopTimer
  26332.  ────────────────────────────────────────────────────────────────────────────
  26333.    BOOL WinStopTimer (hab, hwnd, idTimer)
  26334.    HAB hab;                /*handle of the anchor block                    */
  26335.    HWND hwnd;              /*handle of the window                          */
  26336.    USHORT idTimer;         /*timer identifier                              */
  26337.  
  26338.    The WinStopTimer function stops a timer. When this function is called, no
  26339.    further messages are received from the stopped timer, even if it has timed
  26340.    out since the last call to the WinGetMsg function.
  26341.  
  26342.  Parameters
  26343.  
  26344.    hab  Identifies the anchor block.
  26345.  
  26346.    hwnd  Identifies the window containing the timer.
  26347.  
  26348.    idTimer  Identifies the timer.
  26349.  
  26350.  Return Value
  26351.  
  26352.    The return value is TRUE if the function is successful or FALSE if an
  26353.    error occurs.
  26354.  
  26355.  See Also
  26356.  
  26357.    WinGetMsg, WinStartTimer
  26358.  
  26359.  
  26360.  ────────────────────────────────────────────────────────────────────────────
  26361.  WinSubclassWindow
  26362.  ────────────────────────────────────────────────────────────────────────────
  26363.    PFNWP WinSubclassWindow (hwnd, pfnwp)
  26364.    HWND hwnd;              /*handle of the window to subclass              */
  26365.    PFNWP pfnwp;            /*address of new window procedure               */
  26366.  
  26367.    The WinSubclassWindow function subclasses a window by replacing its window
  26368.    procedure with another window procedure specified by the pfnwp parameter.
  26369.  
  26370.  Parameters
  26371.  
  26372.    hwnd  Identifies the window to subclass.
  26373.  
  26374.    pfnwp  Points to the address of the procedure used to subclass the window.
  26375.  
  26376.  Return Value
  26377.  
  26378.    The return value, if the function is successful, is the address of the
  26379.    previous window procedure that belongs to the window specified by the hwnd
  26380.    parameter. Otherwise, the return value is 0L.
  26381.  
  26382.  Comments
  26383.  
  26384.    To subclass a window effectively, the new window procedure should call the
  26385.    old window procedure, rather than the WinDefWindowProc function, for those
  26386.    messages it does not process itself.
  26387.  
  26388.    To reverse the effect of subclassing, call WinSubclassWindow again using
  26389.    the old window procedure address.
  26390.  
  26391.    It is not possible to subclass a window created by another process.
  26392.  
  26393.  See Also
  26394.  
  26395.    WinDefWindowProc
  26396.  
  26397.  
  26398.  ────────────────────────────────────────────────────────────────────────────
  26399.  WinSubstituteStrings
  26400.  ────────────────────────────────────────────────────────────────────────────
  26401.    SHORT WinSubstituteStrings (hwnd, pszSrc, cchDstMax, pszDst)
  26402.    HWND hwnd;              /*handle of the window                          */
  26403.    PSZ pszSrc;             /*address of the source string                  */
  26404.    SHORT cchDstMax;        /*size of destination string buffer             */
  26405.    PSZ pszDst;             /*address of buffer for destination string      */
  26406.  
  26407.    The WinSubstituteStrings function performs a substitution process on a
  26408.    text string, replacing certain marker characters with text supplied by the
  26409.    application. The WinSubstituteStrings function is particularly useful for
  26410.    displaying variable information in dialog boxes, menus, and other
  26411.    user-interface functions. Variable information can include things such as
  26412.    filenames, which cannot be statically declared within resource files.
  26413.  
  26414.    This function is called by the system while creating the child windows in
  26415.    a dialog box. It allows the child windows to perform substitutions in
  26416.    their window text.
  26417.  
  26418.  Parameters
  26419.  
  26420.    hwnd  Identifies the window that processes the function.
  26421.  
  26422.    pszSrc  Points to the null-terminated text string to perform the
  26423.    substitution.
  26424.  
  26425.    cchDstMax  Specifies the maximum number of characters that can be returned
  26426.    in the pszDst parameter.
  26427.  
  26428.    pszDst  Points to the null-terminated text string produced by the
  26429.    substitution process. The string is truncated if it would otherwise
  26430.    contain more than the number of characters specified by the cchDstMax
  26431.    parameter. When truncation occurs, the last character of the truncated
  26432.    string is always the NULL termination character.
  26433.  
  26434.  Return Value
  26435.  
  26436.    The return value is the number of characters returned in pszDst, not
  26437.    including the terminating NULL character. The maximum value is (cchDstMax
  26438.    - 1). It is zero if an error occurred.
  26439.  
  26440.  Comments
  26441.  
  26442.    When a string of the form %n is encountered in the source string, where n
  26443.    is a digit from 0 through 9, a WM_SUBSTITUTESTRING message is sent to the
  26444.    specified window. This message returns a text string to use as a
  26445.    substitution for the %n in the destination string, which is otherwise an
  26446.    exact copy of the source string.
  26447.  
  26448.    If % is encountered in the source, % is copied to the destination, but no
  26449.    other substitution occurs. If %x occurs in the source, where x is neither
  26450.    a digit nor %, then the source is copied to the destination unchanged.
  26451.  
  26452.    The source and destination strings must not overlap in memory.
  26453.  
  26454.    To use this function, your application must process WM_SUBSTITUTESTRING
  26455.    messages and perform the requested string substitution.
  26456.  
  26457.  
  26458.  ────────────────────────────────────────────────────────────────────────────
  26459.  WinSubtractRect
  26460.  ────────────────────────────────────────────────────────────────────────────
  26461.    BOOL WinSubtractRect (hab, prclDst, prclSrc1, prclSrc2)
  26462.    HAB hab;                /*handle of the anchor block                    */
  26463.    PRECTL prclDst;         /*address of the destination rectangle          */
  26464.                            /*structure                                     */
  26465.    PRECTL prclSrc1;        /*address of the first rectangle structure      */
  26466.    PRECTL prclSrc2;        /*address of the second rectangle structure     */
  26467.  
  26468.    The WinSubtractRect function subtracts one rectangle from another by
  26469.    subtracting the prclSrc2 parameter from the prclSrc1 parameter.
  26470.    Subtracting one rectangle from another does not always result in a
  26471.    rectangular area; in this case, WinSubtractRect returns prclSrc1 in the
  26472.    prclDst parameter. For this reason, WinSubtractRect provides only an
  26473.    approximation of subtraction. However, the area described by prclDst is
  26474.    always greater than or equal to the "true" result of the subtraction. You
  26475.    can use the GpiCombineRegion function to calculate the true result of the
  26476.    subtraction of two rectangular areas, although WinSubtractRect does it
  26477.    much faster.
  26478.  
  26479.  Parameters
  26480.  
  26481.    hab  Identifies an anchor block.
  26482.  
  26483.    prclDst  Points to a RECTL structure that contains the result of the
  26484.    subtraction of the prclSrc2 parameter from the prclSrc1 parameter. The
  26485.    RECTL structure has the following form:
  26486.  
  26487.    typedef struct _RECTL {
  26488.        LONG  xLeft;
  26489.        LONG  yBottom;
  26490.        LONG  xRight;
  26491.        LONG  yTop;
  26492.    } RECTL;
  26493.  
  26494.    For a full description, see Chapter 4, "Types, Macros, Structures."
  26495.  
  26496.    prclSrc1  Points to a RECTL structure that contains the first source
  26497.    rectangle.
  26498.  
  26499.    prclSrc2  Points to a RECTL structure that contains the second source
  26500.    rectangle.
  26501.  
  26502.  Return Value
  26503.  
  26504.    The return value is TRUE if the prclDst parameter points to a nonempty
  26505.    rectangle. Otherwise, it is FALSE, indicating that prclDst is an empty
  26506.    rectangle.
  26507.  
  26508.  See Also
  26509.  
  26510.    GpiCombineRegion, WinUnionRect
  26511.  
  26512.  
  26513.  ────────────────────────────────────────────────────────────────────────────
  26514.  WinTerminate
  26515.  ────────────────────────────────────────────────────────────────────────────
  26516.    BOOL WinTerminate (hab)
  26517.    HAB hab;                /*handle of the anchor block                    */
  26518.  
  26519.    The WinTerminate function terminates an application thread's use of
  26520.    Presentation Manager and releases all its associated resources. It is
  26521.    recommended that you call this function prior to termination of your
  26522.    application. However, if it is not issued, all Presentation Manager
  26523.    resources allocated to the thread are deallocated when the program
  26524.    terminates──whether normally or abnormally──by Presentation Manager code
  26525.    executed as part of the exit-list processing.
  26526.  
  26527.  Parameters
  26528.  
  26529.    hab  Identifies the anchor block.
  26530.  
  26531.  Return Value
  26532.  
  26533.    The return value is TRUE if the function is successful or FALSE if an
  26534.    error occurs.
  26535.  
  26536.  See Also
  26537.  
  26538.    WinInitialize
  26539.  
  26540.  
  26541.  ────────────────────────────────────────────────────────────────────────────
  26542.  WinThrow
  26543.  ────────────────────────────────────────────────────────────────────────────
  26544.    VOID WinThrow (pctchbf, sErrorReturn)
  26545.    PCATCHBUF pctchbf;      /*address of structure with execution           */
  26546.                            /*environment                                   */
  26547.    SHORT sErrorReturn;     /*error code to return                          */
  26548.  
  26549.    The WinThrow function restores the execution environment to the values
  26550.    saved in the buffer pointed to by the pctchbf parameter. Execution then
  26551.    transfers to the WinCatch function that copied the environment to pctchbf.
  26552.  
  26553.  Parameters
  26554.  
  26555.    pctchbf  Points to a CATCHBUF structure that contains the execution
  26556.    environment. It must have been set by a previous WinCatch function call.
  26557.    The CATCHBUF structure has the following form:
  26558.  
  26559.    typedef struct _CATCHBUF {
  26560.        ULONG reserved[4];
  26561.    } CATCHBUF;
  26562.  
  26563.    For a full description, see Chapter 4, "Types, Macros, Structures."
  26564.  
  26565.    sErrorReturn  Specifies the value to be returned to the WinCatch function.
  26566.    The meaning of the value is determined by the application.
  26567.  
  26568.  Return Value
  26569.  
  26570.    This function does not return a value.
  26571.  
  26572.  Comments
  26573.  
  26574.    The routine that calls WinCatch is responsible for freeing any resources
  26575.    allocated between the time WinCatch was called and the time WinThrow was
  26576.    called.
  26577.  
  26578.  Example
  26579.  
  26580.    This example calls WinCatch to save the current execution environment
  26581.    before calling a recursive sort function. The first return from WinCatch
  26582.    is zero. If the doSort function calls WinThrow, execution will again
  26583.    return to the WinCatch function. This time, WinCatch will return the
  26584.    STACKOVERFLOW error passed by the doSort function. The doSort function is
  26585.    recursive, that is, it calls itself. It maintains a variable,
  26586.    usStackCheck, that is used to check to see how much stack space has been
  26587.    used. If more then 3K of the stack has been used, it calls WinThrow to
  26588.    drop out of all the nested function calls back into the function that
  26589.    called WinCatch.
  26590.  
  26591.    USHORT usStackCheck
  26592.    CATCHBUF ctchbf;
  26593.  
  26594.    main() {
  26595.        SHORT sErrorReturn;
  26596.  
  26597.        sErrorReturn = WinCatch(&ctchbf); /* save execution environment */
  26598.        if (sErrorReturn) {
  26599.            .
  26600.            . /* error processing */
  26601.            .
  26602.        }
  26603.        usStackCheck = 0;               /* initialize stack usage count */
  26604.        doSort(1, 1000);                /* call sort function           */
  26605.    }
  26606.  
  26607.    VOID doSort(sLeft, sRight)
  26608.    SHORT sLeft, sRight;
  26609.    {
  26610.        SHORT i, sLast;
  26611.  
  26612.        /*
  26613.         * check to see if more then 3K of the stack has been used, and if
  26614.         * so, call WinThrow to drop back into the original calling program
  26615.         */
  26616.  
  26617.        usStackCheck += 10;
  26618.        if (usStackCheck > (3 * 1024))
  26619.            WinThrow(&ctchbf, STACKOVERFLOW);
  26620.        .
  26621.        . /* sorting algorithm */
  26622.        .
  26623.        doSort(sLeft, sLast - 1);         /* note recursive call         */
  26624.        usStackCheck -= 10;               /* update stack check variable */
  26625.    }
  26626.  
  26627.  See Also
  26628.  
  26629.    WinCatch
  26630.  
  26631.  
  26632.  ────────────────────────────────────────────────────────────────────────────
  26633.  WinTrackRect
  26634.  ────────────────────────────────────────────────────────────────────────────
  26635.    BOOL WinTrackRect (hwnd, hps, pti)
  26636.    HWND hwnd;              /*handle of the window                          */
  26637.    HPS hps;                /*presentation-space handle                     */
  26638.    PTRACKINFO pti;         /*address of structure for tracking information */
  26639.  
  26640.    The WinTrackRect function draws a tracking rectangle.
  26641.  
  26642.  Parameters
  26643.  
  26644.    hwnd  Identifies the window in which tracking is to take place. If hwnd
  26645.    identifies the desktop window or HWND_DESKTOP, tracking will take place
  26646.    over the entire screen. It is assumed that the style of this window is not
  26647.    WS_CLIPCHILDREN.
  26648.  
  26649.    hps  Identifies the presentation space to be used for drawing the clipping
  26650.    rectangle. If hps is NULL, the hwnd parameter is used to calculate a
  26651.    presentation space for tracking. (It is assumed that tracking takes place
  26652.    within the window identified by hwnd and that the style of this window is
  26653.    not set to WS_CLIPCHILDREN.) When the drag rectangle appears, it is not
  26654.    clipped by any children within the window. If the window style is
  26655.    WS_CLIPCHILDREN and the application wants the drag rectangle to be
  26656.    clipped, it must explicitly pass an appropriate presentation space.
  26657.  
  26658.    pti  Points to a TRACKINFO structure. The TRACKINFO structure has the
  26659.    following form:
  26660.  
  26661.    typedef struct _TRACKINFO {
  26662.        SHORT  cxBorder;
  26663.        SHORT  cyBorder;
  26664.        SHORT  cxGrid;
  26665.        SHORT  cyGrid;
  26666.        SHORT  cxKeyboard;
  26667.        SHORT  cyKeyboard;
  26668.        RECTL  rclTrack;
  26669.        RECTL  rclBoundary;
  26670.        POINTL ptlMinTrackSize;
  26671.        POINTL ptlMaxTrackSize;
  26672.        USHORT fs;
  26673.    } TRACKINFO;
  26674.  
  26675.    For a full description, see Chapter 4, "Types, Macros, Structures."
  26676.  
  26677.  Return Value
  26678.  
  26679.    The return value is TRUE if the function is successful. Otherwise, it is
  26680.    FALSE, indicating that an error occurred or that the mouse was already
  26681.    captured when WinTrackRect was called. Only one tracking rectangle may be
  26682.    in use at a time.
  26683.  
  26684.  Comments
  26685.  
  26686.    This function provides general-purpose mouse tracking. WinTrackRect draws
  26687.    a rectangle and allows the user to position the entire rectangle or make a
  26688.    specific side or corner smaller or larger. The resulting rectangle is then
  26689.    returned to the application, which can use this new information for size
  26690.    and position data. For example, to move and size windows by using the wide
  26691.    sizing borders, the window manager interface simply calls WinTrackRect.
  26692.  
  26693.    WinTrackRect allows the caller to control such limiting values as the
  26694.    following:
  26695.  
  26696.    ■  A maximum and minimum tracking size
  26697.  
  26698.    ■  The widths of the tracking rectangle's sides
  26699.  
  26700.    If the TF_SETPOINTERPOS flag is included, the mouse pointer is positioned
  26701.    at the center of the tracking rectangle. Otherwise, the mouse pointer is
  26702.    not moved from its current position. At this point, there is an
  26703.    established distance between the mouse position and the part of the
  26704.    tracking rectangle that it moves, the value of which is kept constant.
  26705.  
  26706.    While moving or sizing with the keyboard interface, the mouse pointer is
  26707.    repositioned along with the tracking rectangle's new size or position.
  26708.  
  26709.    During tracking, the following keys are active:
  26710.  
  26711.    Value     Meaning
  26712.    ──────────────────────────────────────────────────────────────────────────
  26713.    ENTER     Accepts the new position or size.
  26714.  
  26715.    LEFT      Moves the mouse pointer and tracking rectangle left.
  26716.  
  26717.    UP        Moves the mouse pointer and tracking rectangle up.
  26718.  
  26719.    RIGHT     Moves the mouse pointer and tracking rectangle right.
  26720.  
  26721.    DOWN      Moves the mouse pointer and tracking rectangle down.
  26722.  
  26723.    ESC       Cancels the current tracking operation. In this case, the value
  26724.              of the tracking rectangle is undefined on exit.
  26725.    ──────────────────────────────────────────────────────────────────────────
  26726.  
  26727.    The mouse and the keyboard interface can be intermixed. The caller need
  26728.    not include the TF_SETPOINTERPOS flag to be able to use the keyboard
  26729.    interface; this simply initializes the position of the mouse pointer.
  26730.  
  26731.    Tracking movements using the keyboard arrow keys are in increments of the
  26732.    cxGrid and cyGrid fields, regardless of whether TF_GRID is specified. If
  26733.    TF_GRID is specified, the interior of the tracking rectangle is allowed
  26734.    only on multiples of cxGrid and cyGrid. The default value for cxGrid is
  26735.    the system-font character width, and the default value for cyGrid is half
  26736.    the height of the system font.
  26737.  
  26738.    The tracking rectangle is usually logically "on top" of objects it tracks,
  26739.    so that the user can see the old size and position while tracking the new.
  26740.    Thus, it is possible for a window below the tracking rectangle to update
  26741.    while part of the tracking rectangle is above it.
  26742.  
  26743.    Since the tracking rectangle is drawn in exclusive-OR mode, no window can
  26744.    draw below the tracking rectangle (and thereby obliterate it) without
  26745.    first notifying the tracking code, because fragments of the tracking
  26746.    rectangle can be left behind. If the window doing the drawing is clipped
  26747.    from the window the tracking is occurring in, there is no problem.
  26748.  
  26749.    To prevent a window that is currently processing a WM_PAINT message from
  26750.    drawing over the tracking rectangle, MS OS/2 treats the tracking rectangle
  26751.    as a system-wide resource, only one of which can be in use at any one
  26752.    time. If there is a risk of the currently updating window drawing on the
  26753.    tracking rectangle, MS OS/2 removes the tracking rectangle while that
  26754.    window and its child windows update, and then replaces it. This is done
  26755.    specifically by the WinBeginPaint and WinEndPaint functions. If the
  26756.    tracking rectangle overlaps, it is removed by WinBeginPaint. With the
  26757.    WinEndPaint function, all child windows are updated by using the
  26758.    WinUpdateWindow function before the tracking rectangle is redrawn.
  26759.  
  26760.    WinTrackRect has a modal loop within its function. The modal loop has a
  26761.    HK_MSGFILTER hook and hook code MSGF_TRACK. For an explanation of this
  26762.    hook type, see the WinSetHook function.
  26763.  
  26764.    The rectangle tracked by WinTrackRect is guaranteed to be within the
  26765.    specified tracking bounds and dimensions. If the rectangle passed is out
  26766.    of these bounds, or is too large or too small, it is modified to a
  26767.    rectangle that meets those limits.
  26768.  
  26769.  See Also
  26770.  
  26771.    WinBeginPaint, WinEndPaint, WinSetHook, WinUpdateWindow
  26772.  
  26773.  
  26774.  ────────────────────────────────────────────────────────────────────────────
  26775.  WinTranslateAccel
  26776.  ────────────────────────────────────────────────────────────────────────────
  26777.    BOOL WinTranslateAccel (hab, hwnd, haccel, pqmsg)
  26778.    HAB hab;                /*handle of the anchor block                    */
  26779.    HWND hwnd;              /*handle of the window                          */
  26780.    HACCEL haccel;          /*handle of the accelerator table               */
  26781.    PQMSG pqmsg;            /*address of structure with message             */
  26782.  
  26783.    The WinTranslateAccel function translates a WM_CHAR message. If it is a
  26784.    WM_CHAR message in the specified accelerator table, WinTranslateAccel
  26785.    translates the message pointed to by the pqmsg parameter. The message is
  26786.    translated into a WM_COMMAND, WM_SYSCOMMAND, or WM_HELP message.
  26787.  
  26788.  Parameters
  26789.  
  26790.    hab  Identifies the anchor block.
  26791.  
  26792.    hwnd  Identifies the destination window. Normally, this parameter
  26793.    identifies a frame window.
  26794.  
  26795.    haccel  Identifies the accelerator table.
  26796.  
  26797.    pqmsg  Points to a QMSG structure that contains the message to be
  26798.    translated. The QMSG structure has the following form:
  26799.  
  26800.    typedef struct _QMSG {
  26801.        HWND   hwnd;
  26802.        USHORT msg;
  26803.        MPARAM mp1;
  26804.        MPARAM mp2;
  26805.        ULONG  time;
  26806.        POINTL ptl;
  26807.    } QMSG;
  26808.  
  26809.    For a full description, see Chapter 4, "Types, Macros, Structures."
  26810.  
  26811.  Return Value
  26812.  
  26813.    The return value is TRUE if the function is successful──that is, if the
  26814.    message matches an accelerator in the table. Otherwise, it is FALSE,
  26815.    indicating that an error occurred.
  26816.  
  26817.  Comments
  26818.  
  26819.    It is possible to have accelerators that do not correspond to items in a
  26820.    menu. If the command value does not match any items in the menu, the
  26821.    message is still translated.
  26822.  
  26823.    Generally, applications do not have to call this function. It is normally
  26824.    called automatically by WinGetMsg and WinPeekMsg when a WM_CHAR message is
  26825.    received, with the window handle of the active window as the first
  26826.    parameter. The standard frame window procedure always passes WM_COMMAND
  26827.    messages to the FID_CLIENT window. Since the message is physically changed
  26828.    by WinTranslateAccel, applications will not receive the WM_CHAR messages
  26829.    that resulted in WM_COMMAND, WM_SYSCOMMAND, or WM_HELP messages.
  26830.  
  26831.  See Also
  26832.  
  26833.    WinGetMsg, WinPeekMsg
  26834.  
  26835.  
  26836.  ────────────────────────────────────────────────────────────────────────────
  26837.  WinUnionRect
  26838.  ────────────────────────────────────────────────────────────────────────────
  26839.    BOOL WinUnionRect (hab, prclDst, prclSrc1, prclSrc2)
  26840.    HAB hab;                /*handle of the anchor block                    */
  26841.    PRECTL prclDst;         /*address of the destination rectangle          */
  26842.                            /*structure                                     */
  26843.    PRECTL prclSrc1;        /*address of the first rectangle structure      */
  26844.    PRECTL prclSrc2;        /*address of the second rectangle structure     */
  26845.  
  26846.    The WinUnionRect function calculates a rectangle that bounds the two
  26847.    source rectangles.
  26848.  
  26849.  Parameters
  26850.  
  26851.    hab  Identifies an anchor block.
  26852.  
  26853.    prclDst  Points to a RECTL structure that will receive a rectangle
  26854.    bounding the rectangles pointed to by the prclSrc1 and prclSrc2
  26855.    parameters. The RECTL structure has the following form:
  26856.  
  26857.    typedef struct _RECTL {
  26858.        LONG  xLeft;
  26859.        LONG  yBottom;
  26860.        LONG  xRight;
  26861.        LONG  yTop;
  26862.    } RECTL;
  26863.  
  26864.    For a full description, see Chapter 4, "Types, Macros, Structures."
  26865.  
  26866.    prclSrc1  Points to a RECTL structure that contains the first source
  26867.    rectangle.
  26868.  
  26869.    prclSrc2  Points to a RECTL structure that contains the second source
  26870.    rectangle.
  26871.  
  26872.  Return Value
  26873.  
  26874.    The return value is TRUE if prclDst is a nonempty rectangle. Otherwise, it
  26875.    is FALSE, indicating that an error occurred or that the prclDst rectangle
  26876.    is empty. If one of the source rectangles is NULL, the other is returned.
  26877.  
  26878.  See Also
  26879.  
  26880.    WinIntersectRect, WinSubtractRect
  26881.  
  26882.  
  26883.  ────────────────────────────────────────────────────────────────────────────
  26884.  WinUpdateWindow
  26885.  ────────────────────────────────────────────────────────────────────────────
  26886.    BOOL WinUpdateWindow (hwnd)
  26887.    HWND hwnd;              /*handle of the window                          */
  26888.  
  26889.    The WinUpdateWindow function forces a window and its associated child
  26890.    windows to be updated.
  26891.  
  26892.  Parameters
  26893.  
  26894.    hwnd  Identifies the window to be updated.
  26895.  
  26896.  Return Value
  26897.  
  26898.    The return value is TRUE if the function is successful or FALSE if an
  26899.    error occurs.
  26900.  
  26901.  Comments
  26902.  
  26903.    If hwnd is a child window of a parent window that was created without the
  26904.    WS_CLIPCHILDREN style, the update region of hwnd is removed from the
  26905.    update region of the parent window. This is so that after the hwnd window
  26906.    is redrawn, the parent window will not draw over what was just drawn for
  26907.    hwnd.
  26908.  
  26909.  See Also
  26910.  
  26911.    WinInvalidateRect
  26912.  
  26913.  
  26914.  ────────────────────────────────────────────────────────────────────────────
  26915.  WinUpper
  26916.  ────────────────────────────────────────────────────────────────────────────
  26917.    USHORT WinUpper (hab, idcp, idcc, psz)
  26918.    HAB hab;                /*handle of the anchor block                    */
  26919.    USHORT idcp;            /*code-page identifier                          */
  26920.    USHORT idcc;            /*country-code identifier                       */
  26921.    PSZ psz;                /*address of the string to convert              */
  26922.  
  26923.    The WinUpper function converts a string to uppercase in place.
  26924.  
  26925.  Parameters
  26926.  
  26927.    hab  Identifies the anchor block.
  26928.  
  26929.    idcp  Identifies the code page. If idcp is NULL, the current process's
  26930.    code page is used.
  26931.  
  26932.    idcc  Identifies the country code. If idcc is NULL, the default country
  26933.    specified in the config.sys file is used.
  26934.  
  26935.    psz  Points to the string to be converted.
  26936.  
  26937.  Return Value
  26938.  
  26939.    The return value is the length of the converted string.
  26940.  
  26941.  See Also
  26942.  
  26943.    WinUpperChar
  26944.  
  26945.  
  26946.  ────────────────────────────────────────────────────────────────────────────
  26947.  WinUpperChar
  26948.  ────────────────────────────────────────────────────────────────────────────
  26949.    USHORT WinUpperChar (hab, idcp, idcc, c)
  26950.    HAB hab;