File:  [OS/2 SDKs] / os232sdk / toolkt20 / c / samples / opendlg / gpi.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Thu Aug 9 12:26:30 2018 UTC (7 years, 9 months ago) by root
Branches: msft, MAIN
CVS tags: os2sdk-1990, HEAD
Microsoft OS/2 SDK 2.0 05-30-1990

/***************************************************************************\
* GPI.C -- GPI Helper routines
* Created by Microsoft, IBM  Corporation 1990
\***************************************************************************/


#define INCL_GPI
#include "tool.h"

/***************************************************************************\
* GetTextExtent helper function
\***************************************************************************/

ULONG EXPENTRY GetTextExtent(HPS hps, PCH lpstr, int cch) {
    POINTL rgptl[TXTBOX_COUNT];

    if (cch) {
        GpiQueryTextBox(hps, (LONG)cch, lpstr, 5L, rgptl);
        return(MAKEULONG((SHORT)(rgptl[TXTBOX_CONCAT].x - rgptl[TXTBOX_BOTTOMLEFT].x),
                     (SHORT)(rgptl[TXTBOX_TOPLEFT].y - rgptl[TXTBOX_BOTTOMLEFT].y)));
    } else
        return(0L);
    }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.