Solved

Clicking button in program B by coding in program A

Posted on 2003-10-31
13
279 Views
Last Modified: 2013-11-13
I have two program (A and B).Program B have 2 buttons. How can Iwrite a code from program A to click the button in Program B. I try to use API function (findwindow,findwindowex and sendmessgae) but I cannot focus the button that I wanted. Give me some suggestions?
0
Comment
Question by:wbuaklee
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +2
13 Comments
 
LVL 9

Accepted Solution

by:
bhagyesht earned 34 total points
ID: 9656863
in vb use appactivate and then use the sendkeys "{tab}" till you get focus then sendkeys "{Enter}"

0
 

Assisted Solution

by:mem_fam
mem_fam earned 33 total points
ID: 9656912
After you have found the window of B, you can enumerate its buttons as child windows using EnumChildWindows API.
0
 
LVL 5

Assisted Solution

by:DeerBear
DeerBear earned 33 total points
ID: 9660297
Hi,

The previous answers cover a nice range of
possibilities. But after you've found the right window using
EnumChildWindows, in most cases you can just send it the
appropriate message(s).

In case of a left mouse button click, just send:

WM_LBUTTONDOWN
WM_LBUTTONUP

In that sequence.

HTH,

Andrew
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Expert Comment

by:guynumber5764
ID: 9667594
Depending on your needs, you may be able just call "OnClick...." directly.
0
 

Expert Comment

by:mem_fam
ID: 10269363
wbuaklee,

What is the status of this question?

mem.f
0
 
LVL 9

Expert Comment

by:bhagyesht
ID: 10269372
mem_fam: doing the cleanup thing?

Bhagyesh Trivedi
0
 

Expert Comment

by:mem_fam
ID: 10270353
More or less
0
 
LVL 9

Expert Comment

by:bhagyesht
ID: 10995176
I would recommend a split between bhagyesht, mem_fam and DeerBear


Regards,
Bhagyesh
0
 

Author Comment

by:wbuaklee
ID: 11511134
Please delete this topic
0
 

Author Comment

by:wbuaklee
ID: 11511142
Thank you for all of you
0

Featured Post

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Six Sigma Control Plans

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question