🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Getting text from within a window

#5501
From: Jeff
Date: Wed, 10 Aug 2005 16:49
23 lines
1962 bytes
How would I get a handle to the label? I've used FindWindow() to get the 
window handle, but I'm not sure how to get handles to its children?

"Alan Bellingham" <alanb@episys.com> wrote in message 
news:jjbkf1dj2a6342jtcioi4oe7esqbeaui7i@4ax.com...
> "Jeff" <Jeff@nospam.com> wrote:
>
>>I'm trying to get static text that is in a window. I've got a handle to 
>>the
>>window, but every thing I've tried (i.e. GetWindowText(), WM_GETTEXT) has
>>only retrieved the caption. How can I retrieve the text of a label within
>>the window?
>
> Send the message (or call GetWindowText()) with the window handle of the
> label, not of its parent.
>
> This assumes the label is a window. If not, then you're probably out of
> luck unless the parent window exposes a special API for the purpose.
> IIRC, the VCL TLabel is not a window, but rather something the parent
> window draws when required.
> Alan Bellingham
> -- 
> ACCU Conference 2006 - 19-22 April, Randolph Hotel, Oxford, UK 
Technical Details
Message-ID: <42fa2ffc@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newsread.com!news-xfer.newsread.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <42fa2cc5@newsgroups.borland.com> <jjbkf1dj2a6342jtcioi4oe7esqbeaui7i@4ax.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,148e8a2231e7af2d
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Jeff" <Jeff@nospam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <42fa2cc5@newsgroups.borland.com> <jjbkf1dj2a6342jtcioi4oe7esqbeaui7i@4ax.com>
Subject: Re: Getting text from within a window
Date: Wed, 10 Aug 2005 10:49:02 -0600
Lines: 25
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
NNTP-Posting-Host: 198.68.195.202
Message-ID: <42fa2ffc@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1123692540 198.68.195.202 (10 Aug 2005 09:49:00 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newsread.com!news-xfer.newsread.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail