Xref: utzoo comp.windows.ms:10404 comp.windows.ms.programmer:1373 Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!emory!wuarchive!cec2!news From: dave@wucs1.wustl.edu (David T Mitchell III) Newsgroups: comp.windows.ms,comp.windows.ms.programmer Subject: Re: fonts on buttons Message-ID: <1991Mar15.204133.11633@cec1.wustl.edu> Date: 15 Mar 91 20:41:33 GMT References: <1991Mar10.011755.27922@macc.wisc.edu> <1991Mar11.184336.5874@cec1.wustl.edu> <1991Mar12.230333.10131@isc.rit.edu> Organization: Washington University, St. Louis MO Lines: 27 In article <1991Mar12.230333.10131@isc.rit.edu> cms2839@isc.rit.edu (a.stranger) writes: >In article <1991Mar11.184336.5874@cec1.wustl.edu> dave@wucs1.wustl.edu (David T Mitchell III) writes: >>How do I set the font for a child window (non-dialog box)? >> >>For instance, I have a window that's got Helv 8pt type in >>it, and I'd like to make the pushbuttons 8pt as well. >> > i don't think that you can do this >directly , but you could make a bitmap of the word that you need on the >button in the correct typeface , and then use a button of class owner >draw to display it . > > @ a.stranger - CMS2839@ritvax.isc.rit.edu @ I figured it out. You just need to send the child window a WM_SETFONT message. The thing that messed me up was that the hFont handle you pass in SendMessage(hwndChild, WM_SETFONT, hFont, TRUE/FALSE) needs to be a handle to a logical font (as in hFont= CreateFont(....)), not a handle to one selected (as in hFont= SelectObject(hdc, CreateFont(...)) ). Works fine, now. Don't forget to DestroyObject your hFont when your all done. dave dave@wusc1.wustl.edu the mira corporation 314/434-4343