Jump to content

Help with ControlSend


Recommended Posts

Hi.  I have an Excel macro that I already clikced with autoit.  Now I need to complete the input window.  I am trying with control send but its not working

ControlSend("Sign into Office 365", "", "usernameTextBox", "usernameHere")

I have tried variations on class name, still now luck

WindowsForms10.EDIT.app.0.190610d_r81_ad22

usernameTextBox

[NAME:usernameTextBox]

WindowsForms10.EDIT.app.0.190610d_r81_ad2

Here is the spy output

>>>> Window <<<<
Title:  Sign into Office 365
Class:  WindowsForms10.Window.8.app.0.190610d_r84_ad2
Position:   603, 334
Size:   393, 201
Style:  0x16C30000
ExStyle:    0x00050101
Handle: 0x003305BE

>>>> Control <<<<
Class:  WindowsForms10.EDIT.app.0.190610d_r84_ad2
Instance:   2
ClassnameNN:    WindowsForms10.EDIT.app.0.190610d_r84_ad22
Name:   usernameTextBox
Advanced (Class):   [NAME:usernameTextBox]
ID: 2035604
Text:   
Position:   15, 54
Size:   357, 23
ControlClick Coords:    81, 9
Style:  0x560100C0
ExStyle:    0x00000200
Handle: 0x001F0F94

>>>> Mouse <<<<
Position:   702, 422
Cursor ID:  0
Color:  0xFFFFFF

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<
Enter your credentials to sign into Office 365
Cancel
Login
Password:
User ID:


>>>> Hidden Text <<<<

I am getting exit code 0.  Any suggestions?

Thanks

Matt

Edited by MattAlter
Link to comment
Share on other sites

Try this:

; window is already expected to be opened, and active
ControlSend("Sign into Office 365", "", "[NAME:usernameTextBox]", "usernameHere")
Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Link to comment
Share on other sites

Try this...let's see where it's failing...send back output

$hWnd = WinGetHandle("Sign into Office 365")
If IsHWnd($hWnd) Then
    ConsoleWrite("found window" & @CRLF)
    WinActivate($hWnd)
Else
    ConsoleWrite("could not find window" & @CRLF)
    Exit 0
EndIf

$hControl = ControlGetHandle($hWnd, "", "[NAME:usernameTextBox]")
If IsHWnd($hControl) Then
    ConsoleWrite("found control" & @CRLF)
Else
    ConsoleWrite("could not find control" & @CRLF)
    Exit 0
EndIf

ControlFocus($hWnd, "", $hControl)
ControlSetText($hWnd, "", $hControl,"usernameHere")
Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
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...