Jump to content

Setting text in Edit2 box also sets it in Edit3 box


Go to solution Solved by FireFox,

Recommended Posts

I'm having trouble with a script for installing printers on Windows 7.  I'm using AutoIT 3.3.10.2, but have also replicated this issue on Windows 8 with AutoIT versions 3.3.10.2 and 3.3.8.1.

When I attempt setting the text in a specific Edit box (Edit2 in this case), it also sets the text in the text box Edit3.  See my example code below.  I can easily set the text for Edit3 and it does not affect Edit2.  Am I doing something wrong or is this a bug in AutoIT or Windows?  I've tried searching for this problem, but have been unable to find anything because my search terms have been so generic.  Any help would be greatly appreciated.

I've added a sleep and commented out the Edit3 line to make the issue obvious.  The problematic code is at line 15.

; Run the Add Printer Wizard
Run(@ComSpec & " /c " & 'rundll32 printui.dll,PrintUIEntry /il', "",@SW_HIDE)

; Wait for the window and get handle, move through dialogs
Local $hPrtWnd = WinWait("Add Printer", "Add a net&work, wireless or Bluetooth printer")
ControlClick($hPrtWnd, "Add a net&work, wireless or Bluetooth printer", "[CLASSNN:Button6]", "left")
WinWait($hPrtWnd, "The p&rinter that I want isn't listed")
ControlClick($hPrtWnd, "The p&rinter that I want isn't listed", "[CLASSNN:Button8]", "left")
WinWait($hPrtWnd, "Add a printer using a TCP/&IP address or hostname")
ControlClick($hPrtWnd, "Add a printer using a TCP/&IP address or hostname", "[CLASSNN:Button11]", "left")
ControlClick($hPrtWnd, "Add a printer using a TCP/&IP address or hostname", "[CLASSNN:Button1]", "left")

; Enter data
ControlCommand($hPrtWnd, "Type the IP address or hostname", "[CLASSNN:ComboBox1]", "SelectString", "Autodetect")
ControlSetText($hPrtWnd, "Type the IP address or hostname", "[CLASSNN:Edit2]", "192.168.1.201")
Sleep(10000)
;ControlSetText($hPrtWnd, "Type the IP address or hostname", "[CLASSNN:Edit3]", "27001")
ControlCommand($hPrtWnd, "Type the IP address or hostname", "[CLASSNN:Button14]", "Check")
ControlClick($hPrtWnd, "Type the IP address or hostname", "[CLASSNN:Button1]", "left")

; title "Error"
; text "Error loading the Tcp Mib library."
WinWait("Error", "Error loading the Tcp Mib library.")
ControlClick("Error", "Error loading the Tcp Mib library.", "[CLASSNN:Button1]", "left")

WinWait("[CLASS:#32770]")
ControlClick("[CLASS:#32770]", "", "[CLASSNN:Button1]", "left")

ControlClick($hPrtWnd, "Type the IP address or hostname", "[CLASSNN:Button3]", "left")
Link to comment
Share on other sites

  • Moderators

joeybales,

I understand FireFox to be saying that the same thing happens when entering the text manually via the keyboard - which is what indeed what I see on my Win7 machine when I access that dialog. It looks like a Windows problem - nothing to do with AutoIt. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

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