home *** CD-ROM | disk | FTP | other *** search
/ Inside Multimedia 1995 July / IMM0795.ISO / share / os2 / pmfract / src / gpi.c < prev    next >
C/C++ Source or Header  |  1994-01-24  |  855b  |  24 lines

  1. /***************************************************************************\
  2. * GPI.C -- GPI Helper routines
  3. * Created by Microsoft Corporation, 1989
  4. \***************************************************************************/
  5.  
  6.  
  7. #define INCL_GPI
  8. #include "tool.h"
  9.  
  10. /***************************************************************************\
  11. * GetTextExtent helper function
  12. \***************************************************************************/
  13.  
  14. ULONG EXPENTRY GetTextExtent(HPS hps, PCH lpstr, int cch) {
  15.     POINTL rgptl[TXTBOX_COUNT];
  16.  
  17.     if (cch) {
  18.         GpiQueryTextBox(hps, (LONG)cch, lpstr, 5L, rgptl);
  19.         return(MAKEULONG((SHORT)(rgptl[TXTBOX_CONCAT].x - rgptl[TXTBOX_BOTTOMLEFT].x),
  20.                      (SHORT)(rgptl[TXTBOX_TOPLEFT].y - rgptl[TXTBOX_BOTTOMLEFT].y)));
  21.     } else
  22.         return(0L);
  23.     }
  24.