Solved

SendMessage or SendKeys  ??

Posted on 2013-01-24
4
703 Views
Last Modified: 2013-01-25
I'm trying to automate the process of sending text to an application. The application consists of several textboxes. Not sure which method would work SendMessage or SendKeys.

This question is related to an earlier EE question: ID: 27998591 concerning automating mouse/cursor movement.

Attached a screen print of the application displaying the textboxes.

I need to enter the text: Dave into the "FIRST NAME" textbox and Jones into the "LAST NAME" textbox and then automate the "ENTER" key.

thanks
Screen-Print.JPG
0
Comment
Question by:rkckjk
  • 2
  • 2
4 Comments
 
LVL 25

Expert Comment

by:Luis Pérez
ID: 38817725
Well, you can use AppActivate to set the focus on the client application, then use SendKeys to send the keystrokes. To change the active field inside the client window, you can send a {TAB} with SendKeys too.
0
 
LVL 2

Author Comment

by:rkckjk
ID: 38817738
Could you please show code for the AppActivate method??
0
 
LVL 25

Accepted Solution

by:
Luis Pérez earned 500 total points
ID: 38817746
Microsoft.VisualBasic.Interaction.AppActivate("Window title of the window you want to activate")
0
 
LVL 2

Author Closing Comment

by:rkckjk
ID: 38817935
Thanks!!!
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

733 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