🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
3 messages
3 total messages Started by Dan Mayo Mon, 12 Feb 2007 23:18
Modifing an external TEditBox
#2553
Author: 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?
Re: Modifing an external TEditBox
#2556
Author: Remy Lebeau (TeamB)
Date: Tue, 13 Feb 2007 00:23
20 lines
1507 bytes
"Dan Mayo" <do_not_spam_dmayo2@netzero.com> wrote in message
news:45d0f5fb@newsgroups.borland.com...

> Now, when I try to set or get the text in the editbox, nothing
happens.

If you read the documentation for Get/SetWindowText(), you will see
that they do not work across process boundaries.  You have to send the
WM_GET/SETTEXT messages directly instead.

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

VCL components do not use any dialog IDs at all, so you cannot use the
Get/SetDlgItem...() functions with them.


Gambit
Re: Modifing an external TEditBox
#2557
Author: Dan Mayo
Date: Tue, 13 Feb 2007 01:32
23 lines
1662 bytes
Remy Lebeau (TeamB) wrote:
> "Dan Mayo" <do_not_spam_dmayo2@netzero.com> wrote in message
> news:45d0f5fb@newsgroups.borland.com...
> 
>> Now, when I try to set or get the text in the editbox, nothing
> happens.
> 
> If you read the documentation for Get/SetWindowText(), you will see
> that they do not work across process boundaries.  You have to send the
> WM_GET/SETTEXT messages directly instead.
> 
>> I've also tried  SetDlgItemText(EditBox, i,
> TestMessage->Text.c_str());
>> looping thru i=0 to 100000.
> 
> VCL components do not use any dialog IDs at all, so you cannot use the
> Get/SetDlgItem...() functions with them.
> 
> 
> Gambit
> 
> 
thanks.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads