?
Solved

Clicking button in program B by coding in program A

Posted on 2003-10-31
13
Medium Priority
?
280 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 136 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 132 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 132 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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

A short article about problems I had with the new location API and permissions in Marshmallow
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Six Sigma Control Plans
Suggested Courses

770 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