Solved

Clicking button in program B by coding in program A

Posted on 2003-10-31
13
274 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
changeXy challenge 13 67
oracle query help 18 99
eclipse package explorer vs project explorer view 2 74
Base1 Encode/Decode 3 67
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
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 …

914 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

15 Experts available now in Live!

Get 1:1 Help Now