home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / os / mswindo / programm / misc / 4401 < prev    next >
Encoding:
Text File  |  1992-12-22  |  1.5 KB  |  40 lines

  1. Newsgroups: comp.os.ms-windows.programmer.misc
  2. Path: sparky!uunet!haven.umd.edu!darwin.sura.net!zaphod.mps.ohio-state.edu!cs.utexas.edu!torn!nott!emr1!jagrant
  3. From: jagrant@emr1.emr.ca (John Grant)
  4. Subject: Re: How get font information on a dialog box control?
  5. Message-ID: <1992Dec21.200658.8615@emr1.emr.ca>
  6. Keywords: QuickC, Dialog Box Control, Font
  7. Organization: Energy, Mines, and Resources, Ottawa
  8. References: <dagwag.724793817@meryl>
  9. Date: Mon, 21 Dec 1992 20:06:58 GMT
  10. Lines: 28
  11.  
  12. In article <dagwag.724793817@meryl> dagwag@meryl.csd.uu.se writes:
  13. >
  14. > I have created a (modeless) dialog box, defined at compile-time using
  15. >"Dialog Editor", included in the MS QuickC/Win package.  The dialog box
  16. >contains a text field control (LTEXT) for displaying text.
  17. >
  18. > At run-time I need to know the width and height of the characters to
  19. >display in this text field but I can't get hold of the right
  20. >information. GetTextMetrics() returns the _same_ data regardless of the
  21. >font (specified w "Dialog Editor") I use. Why?
  22. > GetDialogBaseUnits() does not return any useful information either, I
  23. >have received the same size (20x10) on all the fonts (System,
  24. >Courier,..)  I have tried. I calculated the different fonts to be 16x10,
  25. >20x8, etc on a certain device.
  26. >
  27. > Wrong functions? Any ideas?
  28. >
  29. > I use QC/Win 1.0, Win 3.1. 
  30.     
  31.     If you can get the HFONT for the window, you can use
  32.     GetObject() to get the LOGFONT contents for the font.
  33.  
  34.     I'm not sure how you get the HFONT, though.
  35.  
  36. -- 
  37. John A. Grant                        jagrant@emr1.emr.ca
  38. Airborne Geophysics
  39. Geological Survey of Canada, Ottawa
  40.