locked
Copy from an external application RRS feed

  • Question

  • Hello everyone.  I have looked all over for an answer to this question and have failed to find one.  I have two applications. 

    App1: I have no control over anything in this application aside from standard user inteface options.  (Enter text, apply, ok)  Someone else has created this program and I have no direct access to the database or any code.  I can not make any changes to this application.

    App2: This is the application that I am currently creating.  All changes will need to be made here.

    I currently have a program set up to copy information from App2 to App1.  A user clicks a button in App2 and then goes to App1 and hits F8.  App2 is waiting to get F8 and when it does it proceeds to use a series of sendkeys to enter the information from App2 into App1.

    Question 1:  Is there a better way to get info from App2 into App1?

    I am trying to "smarten" my program up a bit.  I would like it to read fields from App1 and compare them to certain variables and then do an action.  I have tried to use sendkeys to copy from App1.  This sometimes works, and other times the clipboard says object not collected it is not a valid format.  So this method is obviously not reliable enough for me.

    Question 2: How do I copy data from a text box in App1?  Sendkeys seems to not work.  Again, keep in mind that I don't know textbox names in App1 so as far as I know, I can't do anything like textbox1.copy.
    Tuesday, March 17, 2009 4:14 PM

Answers

  • Does it have to be 2 applications?  if not 2 Forms in the same application would solve your problem. 

    However, if you can not, I would suggest looking into the My.Computer.Clipboard class to store the data in the clipboard, and then on F8 in the other application can read it.

    • Proposed as answer by Adam J ORourke Tuesday, March 17, 2009 4:43 PM
    • Marked as answer by Yichun Feng Monday, March 23, 2009 3:59 AM
    Tuesday, March 17, 2009 4:42 PM

All replies

  • Does it have to be 2 applications?  if not 2 Forms in the same application would solve your problem. 

    However, if you can not, I would suggest looking into the My.Computer.Clipboard class to store the data in the clipboard, and then on F8 in the other application can read it.

    • Proposed as answer by Adam J ORourke Tuesday, March 17, 2009 4:43 PM
    • Marked as answer by Yichun Feng Monday, March 23, 2009 3:59 AM
    Tuesday, March 17, 2009 4:42 PM
  • Yeah, it does have to be two applications.  One of the applications is already built and I am creating one to interact with it.  I will try looking into the clipboard class a little more.
    Monday, April 6, 2009 1:05 PM