Re: Default Font Bolded
"ntufarellich" <[email protected]>
| Newsgroups | gmane.comp.windows.wtl |
|---|---|
| Message-ID | <[email protected]> |
Take a look at these: http://blogs.msdn.com/oldnewthing/archive/2005/07/07/436435.aspx and http://msdn.microsoft.com/en-us/library/dd144925(VS.85).aspx The documentation of GetStockObject function on MSDN (the second link) says: It is not recommended that you employ this method to obtain the current font used by dialogs and windows. Instead, use the SystemParametersInfo function with the SPI_GETNONCLIENTMETRICS parameter to retrieve the current font. SystemParametersInfo will take into account the current theme and provides font information for captions, menus, and message dialogs. --- In [email protected], "yarp" <lac@...> wrote: > > Really ? So, I will probably end up creating a Font, but this returns back to my initial question: > > Why is the font bold on first call and then normal ? > > Does it mean that something in the OnPaint procedure has altered the Font and that -as you pointed out- a new font has been created which is now in use ? > > I just would like to understand what happened. > > Yarp > > > --- In [email protected], "Johann Gerell" <johann@> wrote: > > > > > thanks, this is very interesting. But I wanted to avoid > > > to create a new font and reuse a default DC font instead. > > > > > > My question was rather: how do I force a given DC font > > > boldness to normal ? > > > > > > If you do that, then you *are* creating a new font. > > > > > > /Johann > > > > > > -----Original Message----- > > From: [email protected] [mailto:[email protected]] On Behalf Of yarp > > Sent: den 9 mars 2010 08:19 > > To: [email protected] > > Subject: [wtl] Re: Default Font Bolded > > > > Hi, > > thanks, this is very interesting. But I wanted to avoid to create a new font > > and reuse a default DC font instead. > > > > My question was rather: how do I force a given DC font boldness to normal ? > > > > Yarp > > > > --- In [email protected], "Political" <politicalconfusion@> wrote: > > > > > > I've used SPI_GETNONCLIENTMETRICS with SystemParametersInfo() to get a > > default GUI font in the past. Something like this: > > > > > > NONCLIENTMETRICS ncm; > > > ncm.cbSize = sizeof( ncm ); > > > SystemParametersInfo( SPI_GETNONCLIENTMETRICS, ncm.cbSize, &ncm, 0 ); > > > ncm.lfCaptionFont.lfWeight = FW_NORMAL; > > > HFONT hFont = CreateFontIndirect( &(ncm.lfCaptionFont) ); > > > > > > > > > This creates non-bold Tahoma in WinXP and Segoe UI in Win7. > > > > > > > > > > > > > > > > > > ------------------------------------ > > > > Yahoo! Groups Links > > > ------------------------------------ Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/wtl/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/wtl/join (Yahoo! ID required) <*> To change settings via email: [email protected] [email protected] <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/