home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!gatech!news.byu.edu!yvax.byu.edu!cunyvm!m00bc
- Newsgroups: comp.os.ms-windows.programmer.misc
- Subject: Fonts question
- Message-ID: <92206.210733M00BC@CUNYVM.BITNET>
- From: Alex Vinogradov <M00BC@CUNYVM.BITNET>
- Date: Friday, 24 Jul 1992 21:07:33 EDT
- Organization: City University of New York/ University Computer Center
- Lines: 25
-
- May be someone would be able to help me with the following problem (Microsoft
- technical support couldn't):
-
- My application which uses the default SYSTEM font needs to create a dialog
- box which has to use MS Sans Serif font. I specified Suns Serif in the .RC
- file and it worked fine for all predefined controls in the dialog box. The
- problems began when I had to add a custom control to the dialog box. I was
- hoping that if I would GetDC (hDlg), where hDlg is the handle to the dialog
- box window, I would get a device context with the Sans Serif font in it, but
- it wasn't the case: my device context had the default SYSTEM font in it. I
- tried many different things, and the only one which appeared to work was
- using WM_GETFONT / WM_SETFONT message handling (and receiving hFont in
- wParam). The problem with it though is that it gives me Sans Serif when I
- am converting hFont to logical font by using GetObject (), but when I am trying
- to SelectObject (hdc, hFont) and than GetTextMetrics (hdc, &tm), my tm
- structure still gets the SYSTEM font in it.
-
- Did anyone had this problem ? Did anyone found _any_ way to retreive the
- metrics of a font used by a dialog box ?
-
- Any info is greatly appreciated. Please reply via e-mail only to one of the
- following accounts:
- m00bc@cunyvm.cuny.edu
- alexv@bklyn.bitnet
- alexv%bklyn@cunyvm.cuny.edu
-