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