Article View: borland.public.cppbuilder.nativeapi
Article #11168Re: SendMessage BCB 6.0
From: Matt
Date: Tue, 24 Feb 2004 20:14
Date: Tue, 24 Feb 2004 20:14
51 lines
2684 bytes
2684 bytes
Soory but I have another problem, I now wish to recover the text (always
with SendMessage)
My code:
SendMessageA(rich, WM_GETTEXT, getTrim, (LPARAM)trimSpace);
getTrim is an integer which makes the size of the text has to recover and
trimSpace is a string which with a number of space "" correspondent with
getTrim. I make this code in VB and it runs but in C++ it returns me the
long in string.
I put Visual Basic code for Help:
' use a SendMessageLong with WM_GETTEXTLENGTH constant who will return the
length of the text
' and to place the result in GetTrim&
GetTrim& = SendMessageLong(Rich2&, WM_GETTEXTLENGTH, 0&, 0&)
' creation of the memory nessessary to the storage of the text in TrimSpace$
(- > size of GetTrim&)
TrimSpace$ = Space$(GetTrim&)
' get the text of the textbox in TrimSpace
GetString& = SendMessageString(Rich2&, WM_GETTEXT, GetTrim + 500,
TrimSpace$)
' place the text in the variable Texte
Texte$ = TrimSpace$
Thanks for your help !! (and sorry for my (google translation) english) :o)
"Michel Leunen" <mleu@STOPSPAMskynet.be> a οΏ½crit dans le message de
news:403a2ab4@newsgroups.borland.com...
> Mattdef wrote:
>
> > I use API SendMessageA in BCB 6.0 Windows application.
> >
> > My source code:
> >
> > SendMessageA(hwnd, WM_SETTEXT, 0, (LPARAM) &varText);
> >
> > I want to put a variable with a String type in last parameter but I have
an
> > error.
>
> AnsiString varText = "whatever";
> SendMessage(hwnd, WM_SETTEXT, 0, (LPARAM) varText.c_str());
>
> Michel
> --
> ----------------------------------------
> Michel Leunen
> mailto: see my homepage.
> C++Builder, C++BuilderX, BCC5.5.1 Web site:
> http://www.leunen.com/
> ----------------------------------------
Technical Details
Message-ID:
<403bb04e$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<403a1118$1@newsgroups.borland.com> <403a2ab4@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 10cc67,873d1353349458d0 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2004-02-24 12:40:46 PST From: "Matt" <matt@tek-pc.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <403a1118$1@newsgroups.borland.com> <403a2ab4@newsgroups.borland.com> Subject: Re: SendMessage BCB 6.0 Date: Tue, 24 Feb 2004 21:14:13 +0100 Lines: 53 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 172.176.217.103 Message-ID: <403bb04e$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1077653582 172.176.217.103 (24 Feb 2004 12:13:02 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail