Board index » cppbuilder » Controlling one application panels from MY Application?

Controlling one application panels from MY Application?


2007-12-11 09:07:19 PM
cppbuilder14
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?

"Tom" < XXXX@XXXXX.COM >wrote in message
Quote
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.
Quote
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.
Quote
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?

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

{smallsort}

Re:Controlling one application panels from MY Application?

"Tom" < XXXX@XXXXX.COM >wrote in message
Quote
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.
Quote
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.
Quote
>>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?

Thanks!