home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.ms-windows.programmer.misc
- Path: sparky!uunet!wupost!darwin.sura.net!haven.umd.edu!wam.umd.edu!castanos
- From: castanos@wam.umd.edu (Jose Alberto Castanos)
- Subject: Re: Bold fonts only in Dialog boxes??
- Message-ID: <1992Sep1.001406.3485@wam.umd.edu>
- Sender: usenet@wam.umd.edu (USENET News system)
- Nntp-Posting-Host: rac2.wam.umd.edu
- Organization: University of Maryland, College Park
- References: <1992Aug27.090853.1@cortex>
- Date: Tue, 1 Sep 1992 00:14:06 GMT
- Lines: 57
-
- In article <1992Aug27.090853.1@cortex> mboucher@cortex.prospect.com (Mike Boucher) writes:
- >Hey there,
- >
- >I'm using MS C 7.0 and SDK to create dialog box resources. I include the line
- >
- >FONT 9, "Courier"
- >
- >So that I have a fixed width font. What I get is Courier BOLD in the dialog.
- >I can only get "plain" courier in my Word Processor. If I change the font to
- >something like Arial, I still get BOLD!!
- >
- >What can I do to get a "plain", fixed-width, MS supplied font?
- >
-
-
- The following example from the SDK does the trick, but you have to change the
- font of each control in the dialog box. Is there a way to get a normal weight
- font using the FONT statement?
-
-
- From the SDK documentation:
- --------------------------
-
- This example changes the font used by controls in a dialog box to a font
- that is not bold.
-
- HFONT hfontDlg;
- LOGFONT lFont;
-
- case WM_INITDIALOG:
-
- /* Get dialog box font and create version that is not bold. */
-
- hfontDlg = (HFONT) NULL;
- if ((hfontDlg = (HFONT) SendMessage(hdlg, WM_GETFONT, 0, 0L))) {
- if (GetObject(hfontDlg, sizeof(LOGFONT), (LPSTR) &lFont)) {
- lFont.lfWeight = FW_NORMAL;
- if (hfontDlg = CreateFontIndirect((LPLOGFONT) &lFont)) {
- SendDlgItemMessage(hdlg, ID_CTRL1, WM_SETFONT,
-
- (WPARAM) hfontDlg, 0);
- SendDlgItemMessage(hdlg, ID_CTRL2, WM_SETFONT,
- (WPARAM) hfontDlg, 0);
- .
- . /* Set font for remaining controls. */
- .
- }
- }
- }
- return TRUE;
-
-
- -------------------------------------------------------------------------------
- Jose A. Castanos | Computer Science Dept. |"If a person never contradicts
- (castanos@wam.umd.edu) | University of Maryland | himself, it must be that he
- | College Park, MD | says nothing." -M. de Unamuno
- -------------------------------------------------------------------------------
-