[comp.windows.ms.programmer] HOW CAN I GET COURIER

rdthomps@vela.acs.oakland.edu (Robert D. Thompson) (05/06/91)

	I need to get a listbox to display it's contents in the
	COURIER font.  Although the SDK clearly shows how to select
	font stock objects and print corresponding text output
	via TextOut and other device oriented functions, I cannot
	seem to get a listbox to display it's contents in a
	font other than the system font.

	Do I need to make an "OWNER_DRAW" listbox or something ???

	Thanks in advance for any help...Regards |(8>
---
Robert
rdthomps@vela.acs.oakland.edu

neh@rci.dk (Niels Erik Holm) (05/07/91)

rdthomps@vela.acs.oakland.edu (Robert D. Thompson) writes:


>	I need to get a listbox to display it's contents in the
>	COURIER font.  Although the SDK clearly shows how to select
>	font stock objects and print corresponding text output
>	via TextOut and other device oriented functions, I cannot
>	seem to get a listbox to display it's contents in a
>	font other than the system font.

>	Do I need to make an "OWNER_DRAW" listbox or something ???


No, you do not have to make an owner drawn listbox control.

The method is to send a WM_SETFONT message to the control. I.e.

	HFONT font;

	font = CreateFont (....)

	SendDlgItemMessage(hDlg,LISTBOX,WM_SETFONT,(WORD)font,(LONG)TRUE);

I haven't tried this, when the listbox is NOT part of a dialog box, but I
assume the method is similar.

Niels Erik Holm
RC International
Denmark
---------------------------------------------------------------------------
Every day, once a day, give yourself a present. Don't plan it, don't wait
for it, just... let it happen.  Could be a new shirt at the men's store,
a catnap in your office chair, or two cups of good, hot, black coffee.
(Dale Cooper in Twin Peaks).
---------------------------------------------------------------------------

Norbert_Unterberg@p4.f36.n245.z2.fidonet.org (Norbert Unterberg) (05/08/91)

 >         I need to get a listbox to display it's contents in the
 >         COURIER font.  Although the SDK clearly shows how to select
 >         font stock objects and print corresponding text output
 >         via TextOut and other device oriented functions, I cannot
 >         seem to get a listbox to display it's contents in a
 >         font other than the system font.

Just send a WM_SETFONT message to the listbox, with the wParam set to the new 
font's HFONT.

Norbert