Solved

Clicking button in program B by coding in program A

Posted on 2003-10-31
13
278 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
Independent Software Vendors: 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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…

732 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