🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Getting text from within a window

#5500
From: Alan Bellingham
Date: Wed, 10 Aug 2005 16:45
17 lines
1681 bytes
"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: <jjbkf1dj2a6342jtcioi4oe7esqbeaui7i@4ax.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!feeder.xsnews.nl!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!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>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,148e8a2231e7af2d
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: Alan Bellingham <alanb@episys.com>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: Getting text from within a window
Date: Wed, 10 Aug 2005 17:45:35 +0100
Reply-To: alanb@episys.com
Message-ID: <jjbkf1dj2a6342jtcioi4oe7esqbeaui7i@4ax.com>
References: <42fa2cc5@newsgroups.borland.com>
X-Newsreader: Forte Agent 3.0/32.763
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 193.129.251.253
X-Trace: newsgroups.borland.com 1123692334 193.129.251.253 (10 Aug 2005 09:45:34 -0700)
Lines: 17
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!feeder.xsnews.nl!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail