Jump to content

{ENTER} while minimized?


bigred
 Share

Recommended Posts

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?

Link to comment
Share on other sites

  • Administrators

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}")
Link to comment
Share on other sites

  • Administrators

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?
Link to comment
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

Link to comment
Share on other sites

  • Administrators

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:
Link to comment
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.

Link to comment
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...

Link to comment
Share on other sites

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
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...