Solved

SendMessage or SendKeys  ??

Posted on 2013-01-24
4
704 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
[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
  • 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

Independent Software Vendors: 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

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

724 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