Sign in to follow this  
Followers 0
joeybales

Setting text in Edit2 box also sets it in Edit3 box

6 posts in this topic

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")

Share this post


Link to post
Share on other sites



The thing is : it's the same in manual mode.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

The thing is : it's the same in manual mode.

What is manual mode?

Share this post


Link to post
Share on other sites

When you (the human) type in the edit.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

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


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

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