Jump to content

Unable to Send text to a specific application


xoail
 Share

Recommended Posts

I am trying to send text to a textbox on an application by point my cursor at it (ensuring it is active) but unfortunately it does not work. Other apps such as Notepad and Word do not have any problem?

Very simple test code:

AutoItX3 auto = new AutoItX3();
Thread.Sleep(3000);//allows me to point my cursor at desired text field
auto.Send("Test sending text"); //works on all apps except 1 program

The Window and Control info is as follows:

>>>> Window <<<<
Title:  Edit Email Message
Class:  WindowsForms10.Window.8.app.0.141b42a_r9_ad1
Position:   345, 96
Size:   990, 735
Style:  0x16CF0000
ExStyle:    0x00050100
Handle: 0x00030606

>>>> Control <<<<
Class:  WindowsForms10.RichEdit20W.app.0.141b42a_r9_ad1
Instance:   7
ClassnameNN:    WindowsForms10.RichEdit20W.app.0.141b42a_r9_ad17
Name:   
Advanced (Class):   [CLASS:WindowsForms10.RichEdit20W.app.0.141b42a_r9_ad1; INSTANCE:7]
ID: 329328
Text:   
Position:   278, 194
Size:   682, 459
ControlClick Coords:    469, 214
Style:  0x56010044
ExStyle:    0x00000200
Handle: 0x00050670

>>>> Mouse <<<<
Position:   1100, 535
Cursor ID:  0
Color:  0xFFFFFF

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<
Edit
Insert
Delete
&Add
E-mail Autograph
Delete
Save
Edit
Insert
Delete
&Add
E-mail Template
&Send
&Cancel
BCC:
CC:
Neither
Sent/Received:
Attach...
Unsent
Date / Time:
From:
To:
Subject:

I've also tried using ControlSend and still no luck.

How can I troubleshoot this?

Link to comment
Share on other sites

what application are you trying to automate? Outlook? post pics of the Info Tool, each tab. this means next to nothing.

it's ironic, reading this thread's title, '...A SPECIFIC APPLICATION', yet the specific application was not mentioned.... lol

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Link to comment
Share on other sites

Hi, thanks for the reply.

The app is our internal Email client (developed by another company, hence we don't have the source to know much about how it was built). I am looking to automate few things by using AutoIt and C#.

I must say that if I use Send("Test sending text", 1); with flag it does work. Is there a reason why it wouldn't for Send("Test sending text")?

Link to comment
Share on other sites

your best bet is to use the IUIAutomation stuff in FAQ 31. use simplespy to get a code and property dump and use the wrapper to set text, setText is part of UI_Action (beware, this is not for newbies). If the developers did not use or expose their controls to automation then Send is all you can really do.

download here: UIA_V0_64.zipEXAMPLES_V0_64.zip

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...