Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

API question using C++

Posted on 1999-07-24
7
Medium Priority
?
220 Views
Last Modified: 2010-04-02
Dear experts,
    How would I [through API] load up an exe file and paste text from the clipboard into a textbox on the loaded program then click a command button?  I know this is a lot to ask, but I would really like to know how.  Thanks
0
Comment
Question by:TrEaSoN
[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
  • 4
  • 2
7 Comments
 

Author Comment

by:TrEaSoN
ID: 1200974
Adjusted points to 500
0
 
LVL 6

Expert Comment

by:Triskelion
ID: 1200975
Does the target app accept OLE automation?
0
 

Author Comment

by:TrEaSoN
ID: 1200976
No, I don't believe it does.
0
Technology Partners: 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 6

Expert Comment

by:Triskelion
ID: 1200977
What is it?
0
 

Author Comment

by:TrEaSoN
ID: 1200978
It's a language translator application.  I'm trying to load it up and paste text into the translation window then click the translate button.
0
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 1500 total points
ID: 1200979
You would use CreateProcess() to  start up the application. Then you would use WaitForInputIdle() on the new process to determine when it is waiting for something. At this point, you will probably want to use a loop that uses FindWindow() to determine if the window/dialog is up. I'm assuming you already have the text in the clipboard. If so, then you can use SendMessage(hwndEditControl, WM_PASTE, 0, 0); to get the control to paste text from the clipboard. Finally, you can use SendMessage(hwndDialog, WM_COMMAND, MAKEWPARAM(idOfButton, BN_CLICK), hwndButton) to click the button. To get idOfButton, you should use Spy++ to figure it out. To get the hwndButton, you can GetDlgItem(hwndDialog, idOfButton).
0
 

Author Comment

by:TrEaSoN
ID: 1200980
It's a language translator application.  I'm trying to load it up and paste text into the translation window then click the translate button.
0

Featured Post

Technology Partners: 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!

Question has a verified solution.

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

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

715 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