home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / os2sdk / os2sdk11 / tk4 / opendlg / gpi.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-02-20  |  855 b   |  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 CALLBACK 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.