Solved

Clicking button in program B by coding in program A

Posted on 2003-10-31
13
273 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
  • 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
 
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Report events not being triggered 8 100
count7 challenge 12 70
When i run adoquery my application freezes 26 98
Not needed 13 57
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
A short article about a problem I had getting the GPS LocationListener working.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

758 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now