Sign in to follow this  
Followers 0
bigred

{ENTER} while minimized?

12 posts in this topic

I am submitting a string to a Edit using ControlSetText. The text seems to be entered without a problem when minimized, but I also need the emulate the 'Enter' key to submit the text in the program.

Doing a 'Send' or 'ContolClick' work but they maximize the program. Is there another method that would let me submit the text in the program without having it maximize?

Share this post


Link to post
Share on other sites



I am submitting a string to a Edit using ControlSetText.  The text seems to be entered without a problem when minimized, but I also need the emulate the 'Enter' key to submit the text in the program.

Doing a 'Send' or 'ContolClick' work but they maximize the program.  Is there another method that would let me submit the text in the program without having it maximize?

ControlSend("title", "text", "control", "{ENTER}")

Share this post


Link to post
Share on other sites

Thanks Jon. :ph34r:

Share this post


Link to post
Share on other sites

It seems to work in AI3, but not in AIX, is that normal? All that happens is that the 3 lines of text over write each other without being submitted.

AIX in VB is where I want to use it.

Share this post


Link to post
Share on other sites

It seems to work in AI3, but not in AIX, is that normal?  All that happens is that the 3 lines of text over write each other without being submitted.

AIX in VB is where I want to use it.

What code are you using?

Share this post


Link to post
Share on other sites

Dim iCount As Integer
Dim iResult As Integer

iResult = aix.WinExists("app_name", "")
If iResult = 1 Then
Do While iCount <> 3
aix.ControlSetText "app_name", "", "Edit4", "blah" & Chr(34) & "blahblahblah" & Chr(34)
aix.ControlSend "app_name", "", "Edit4", "{ENTER}"
aix.Sleep 250
aix.ControlSetText "app_name", "", "Edit4", "blah" & Chr(34) & "blahblahblah" & Chr(34)
aix.ControlSend "app_name", "", "Edit4", "{ENTER}"
aix.Sleep 250
aix.ControlSetText "app_name", "", "Edit4", "blah" & Chr(34) & "blahblahblah" & Chr(34)
aix.ControlSend "app_name", "", "Edit4", "{ENTER}"
aix.Sleep 1250
: iCount = iCount + 1: Loop
End If

Share this post


Link to post
Share on other sites

Dim iCount As Integer
Dim iResult As Integer

iResult = aix.WinExists("app_name", "")
If iResult = 1 Then
Do While iCount <> 3
aix.ControlSetText "app_name", "", "Edit4", "blah" & Chr(34) & "blahblahblah" & Chr(34)
aix.ControlSend "app_name", "", "Edit4", "{ENTER}"
aix.Sleep 250
aix.ControlSetText "app_name", "", "Edit4", "blah" & Chr(34) & "blahblahblah" & Chr(34)
aix.ControlSend "app_name", "", "Edit4", "{ENTER}"
aix.Sleep 250
aix.ControlSetText "app_name", "", "Edit4", "blah" & Chr(34) & "blahblahblah" & Chr(34)
aix.ControlSend "app_name", "", "Edit4", "{ENTER}"
aix.Sleep 1250
: iCount = iCount + 1: Loop
End If

Looks OK to me :ph34r:

Share this post


Link to post
Share on other sites

Hmm it refuses to work. I even just put the aix.ControlSend "app_name", "", "Edit4", "{ENTER}" code on its own and manually typed in something to the textbox then ran the code. Still no go.

But that same code in a AI3 file worked perfect.

Share this post


Link to post
Share on other sites

Not trying to hijack your thread but I am trying to send a string to a minimized window too. The code looks like [in its early form]

AutoItSetOption("SendKeyDelay", 350)
While 1
ControlSend("Xaev - Click The Button - Microsoft Internet Explorer", "", "IEFrame", "{SHIFTDOWN}{TAB}{TAB}{TAB}{TAB}{SHIFTUP}{ENTER}")
Sleep(500)
Wend

but it does nothing...

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

I'm not 100% sure but I think the problem is your class type. "IEFrame" may not be supported by AI3.

The rest of your code looks ok, so long as the Title string is correct.

EDIT: If it will work I think the real class name is "Internet Explorer_Server1". At least that's what I interpret from AI3spy.

Edited by bigred

Share this post


Link to post
Share on other sites

The window spy gave me "IEFrame" as the classname, I'll try what you have though.

Share this post


Link to post
Share on other sites

Would you mind posting the actual code you have a problem with instead of an example, since it seems the example is not giving us enough information to help much.


Who else would I be?

Share this post


Link to post
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
Sign in to follow this  
Followers 0