🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Modifing an external TEditBox

#2553
From: Dan Mayo
Date: Mon, 12 Feb 2007 23:18
30 lines
2030 bytes
I have a running application that I would like to read or modify from 
another.  To start out with, I just wanted to make a simple test app. 
The first app is a simple vcl app with only an edit box on it, the other 
app would control the first, if it was running.

With the following I can get a handle that matches the edit box on the 
running executable:

   HANDLE SubForm = NULL;
   HANDLE EditBox = NULL;
   String TheClassName = ClassNameEditBox->Text;
   String TheWindowName = WindowNameEditBox->Text;
   SubForm = FindWindow(TheClassName.c_str(), TheWindowName.c_str());
   EditBox = GetWindow(SubForm, GW_CHILD); //the editbox is the only 
child on the test standalone app.


Now, when I try to set or get the text in the editbox, nothing happens. 
  How can I do that?

SetWindowText(EditBox,TestMessage->Text.c_str());  //TestMessage is a 
TEdit on my main form

I've also tried  SetDlgItemText(EditBox, i, TestMessage->Text.c_str()); 
looping thru i=0 to 100000.

I've also tried the corresponding Get...Text, with no luck.

Alas, a new frontier that ought to be so easy and basic.  What am I 
doing wrong?
Technical Details
Message-ID: <45d0f5fb@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,fc8f67857d15dd0d,start
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Mon, 12 Feb 2007 17:18:29 -0600
From: Dan Mayo <do_not_spam_dmayo2@netzero.com>
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Modifing an external TEditBox
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 216.174.165.174
Message-ID: <45d0f5fb@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1171322363 216.174.165.174 (12 Feb 2007 15:19:23 -0800)
Lines: 30
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail