🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
5 messages
5 total messages Started by Tom Tue, 11 Dec 2007 13:07
Controlling one application panels from MY Application?
#906
Author: Tom
Date: Tue, 11 Dec 2007 13:07
15 lines
1514 bytes
Hi, I have an application that I created using Builder 4.0, now
I have to build another application that can click on buttons 
AND menus in the first application, and that can also set values
and read values in & from Edit boxes on the different panels...

What is the best way for doing it? I can change the first 
application to send the second application the handles of each
button & menu & Edit box on each panel, but will the second 
application be able to use this handles for clicking the buttons
or for reading and setting values in the edit boxes? or to open
menus and so on?

Please advice, 
Thanks!
Re: Controlling one application panels from MY Application?
#907
Author: Remy Lebeau (TeamB)
Date: Tue, 11 Dec 2007 18:29
27 lines
2058 bytes
"Tom" <Tom@NoMail.com> wrote in message 
news:475e9997$1@newsgroups.borland.com...

> What is the best way for doing it?

If you can change the source code for the first application, then you could 
set it up so the second application can send custom window messages to 
control it.  That way, you don't have to worry about performing clicks at 
all.

Otherwise, the second application will have to manually locate the HWND 
handles of the desired controls and issue standard Win32 API messages to 
them directly, such as WM_COMMAND/BN_CLICKED and WM_SETTEXT.

> I can change the first application to send the second application
> the handles of each button & menu & Edit box on each panel

It does not need to do that.  The second application can do that on its own.

> will the second application be able to use this handles for clicking
> the buttons or for reading and setting values in the edit boxes?

Yes.


Gambit 
Re: Controlling one application panels from MY Application?
#909
Author: Tom
Date: Wed, 12 Dec 2007 07:50
23 lines
1729 bytes

>> will the second application be able to use this handles for clicking
>> the buttons or for reading and setting values in the edit boxes?
>
>Yes.

1. Can you please show me how to do that? if for example I have
   an EditBox that have the handle 0x73E87AD2, how do I use
   this handle to Set/Read value in that Edit box?

2. If I have a Menu that have the handle 0x24C87321, how do I 
   use this handle to perform a "Mouse" Click on this menu?


>> I can change the first application to send the second application
>> the handles of each button & menu & Edit box on each panel
>
>It does not need to do that.  The second application can do that on its own.

Can you Please show me how to do that? (If it's a short code...) 

Thanks!  
Re: Controlling one application panels from MY Application?
#910
Author: Remy Lebeau (TeamB)
Date: Wed, 12 Dec 2007 18:01
31 lines
2321 bytes
"Tom" <Tom@NoMail.com> wrote in message 
news:475fa0c5$1@newsgroups.borland.com...

> Can you please show me how to do that? if for example I
> have an EditBox that have the handle 0x73E87AD2, how
> do I use this handle to Set/Read value in that Edit box?

Send WM_GETTEXT and WM_SETTEXT messages to it, like I suggested earlier.

> If I have a Menu that have the handle 0x24C87321, how do
> I use this handle to perform a "Mouse" Click on this menu?

You don't.  What you need to do instead is determine the ID of the menu item 
you are interested in executing, and then send a WM_COMMAND message to the 
menu's owner window.

>>> I can change the first application to send the second application
>>> the handles of each button & menu & Edit box on each panel
>>
>> It does not need to do that.  The second application can do that
>> on its own.
>
> Can you Please show me how to do that? (If it's a short code...)

Look at the FindWindow/Ex() and EnumChildWindows() functions.  Start with 
the top-level window of the app and drill down its parent-child trees until 
you find the particular child control that you want to interact with.


Gambit 
Re: Controlling one application panels from MY Application?
#915
Author: Tom
Date: Thu, 13 Dec 2007 09:27
3 lines
995 bytes

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