• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 710
  • Last Modified:

SendMessage or SendKeys ??

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
Richard Kreidl
Asked:
Richard Kreidl
  • 2
  • 2
1 Solution
 
Luis PérezSoftware Architect in .NetCommented:
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
 
Richard KreidlSoftware DeveloperAuthor Commented:
Could you please show code for the AppActivate method??
0
 
Luis PérezSoftware Architect in .NetCommented:
Microsoft.VisualBasic.Interaction.AppActivate("Window title of the window you want to activate")
0
 
Richard KreidlSoftware DeveloperAuthor Commented:
Thanks!!!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now