🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #9740

Re: GetTextExtentPoint32

#9740
From: JD
Date: Sat, 12 Jun 2004 14:05
25 lines
1695 bytes
"Fishface" <invalid@ddress.ok?> wrote:
>JD wrote:
>
>> The problem is that I have absolutely no clue how to get the font
>> from the control.
>
>WM_GETFONT ?

I can't recall the exact wording from MS but the problem with
that is that Static Text Controls don't process messages.
However, I just got it working !!

I had to EnumChildWindows looking for a class name of "Static",
convert it's HWND to a HDC and then use:

   HFONT hfOld = SelectObject( hDC, GetStockObject(DEFAULT_GUI_FONT) );

DEFAULT_GUI_FONT is documented for win95 only but it worked on
XP so I'm trusting that it's ok.

Now that that works, I can get rid of all the extra code and
just use GetDC( NULL ) and set the font.

~ JD
Technical Details
Message-ID: <40cb0dac$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <40ca2cbe$1@newsgroups.borland.com> <n3dkc0d02r2u4da7ogbiilasdi4t43tbno@4ax.com> <40ca656d$1@newsgroups.borland.com> <40cafe17$1@newsgroups.borland.com> <40cb05a0@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,e169022c7b789c9d
X-Google-Attributes: gid10cc67,public
From: "JD" <nospam@nospam.com>
Sender: "JD" <nospam@nospam.com>
Reply-To: "JD" <nospam@nospam.com>
Subject: Re: GetTextExtentPoint32
Newsgroups: borland.public.cppbuilder.nativeapi
X-User-Info: 172.170.181.185     
References: <40ca2cbe$1@newsgroups.borland.com> <n3dkc0d02r2u4da7ogbiilasdi4t43tbno@4ax.com> <40ca656d$1@newsgroups.borland.com> <40cafe17$1@newsgroups.borland.com> <40cb05a0@newsgroups.borland.com>
NNTP-Posting-Host: 207.105.83.66
Message-ID: <40cb0dac$1@newsgroups.borland.com>
Date: 12 Jun 2004 07:05:32 -0700
X-Trace: newsgroups.borland.com 1087049132 207.105.83.66 (12 Jun 2004 07:05:32 -0700)
Lines: 26
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail