🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Getting text from within a window

#5503
From: Remy Lebeau (TeamB)
Date: Wed, 10 Aug 2005 17:46
19 lines
1781 bytes
"Jeff" <Jeff@nospam.com> wrote in message
news:42fa2cc5@newsgroups.borland.com...

> 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?

After you get the handle of the window that the label belongs to, you need
to then get the handle of the label itself.  Only then can you access the
label directly and do whatever you want with it.  Look at FindWindowEx(),
EnumChildWindows(), or GetDlgItem() to retreive the label's handle.  If the
label is not placed on the window directly, but rather is on a container
such as a panel, then you will have to drill down the parent/child hierarchy
until you reach the container that the label is actually in.


Gambit
Technical Details
Message-ID: <42fa3d58@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.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>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,148e8a2231e7af2d
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <42fa2cc5@newsgroups.borland.com>
Subject: Re: Getting text from within a window
Date: Wed, 10 Aug 2005 10:46:03 -0700
Lines: 21
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 68.69.17.41
Message-ID: <42fa3d58@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1123695960 68.69.17.41 (10 Aug 2005 10:46:00 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.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