#100 closed Bug (No Bug)
ControlSend Error
| Reported by: | ChrisL | Owned by: | |
|---|---|---|---|
| Milestone: | Component: | AutoIt | |
| Version: | 3.2.10.0 | Severity: | |
| Keywords: | ControlSend() | Cc: |
Description
in Autoit 3.2.10 and 3.2.11 controlsend doesn't just send the characters to the control but wipes out any data that was previously there.
This never used to be the case. I expect the string of data in the input box to be added to not wip[ed out on every button press.
This is a cut down version of the script to demonstrate the issue
[code]
#include <GuiConstants.au3>
$keyboard = GuiCreate("Lab Setup", 700, 522,(@DesktopWidth-700)/2, (@DesktopHeight-522)/2 ,$WS_CAPTION, $WS_EX_TOPMOST)
GuiCtrlCreateLabel ("Some data is missing from the database please enter this manually", 40, 10, 600, 40)
GUICtrlSetFont (-1, 14)
GuiCtrlCreateLabel ("1st line of address:", 40, 47, 99, 40)
$Input_1 = GuiCtrlCreateInput("", 140, 40, 340, 30)
GUICtrlSetFont (-1, 14)
GuiCtrlCreateLabel ("Town:", 40, 97, 99, 40)
$Input_2 = GuiCtrlCreateInput("", 140, 90, 340, 30)
GUICtrlSetFont (-1, 14)
GuiCtrlCreateLabel ("Phone Number:", 40, 147, 99, 40)
$Input_3 = GuiCtrlCreateInput("", 140, 140, 340, 30,$ES_NUMBER)
GUICtrlSetFont (-1, 14)
$Button_1 = GuiCtrlCreateButton("1", 20, 190, 40, 40)
$Button_2 = GuiCtrlCreateButton("2", 70,190, 40, 40)
$Button_3 = GuiCtrlCreateButton("3", 120,190, 40, 40)
$Button_4 = GuiCtrlCreateButton("4", 170,190, 40, 40)
$Button_5 = GuiCtrlCreateButton("5", 220,190, 40, 40)
$Button_6 = GuiCtrlCreateButton("6", 270,190, 40, 40)
$Button_7 = GuiCtrlCreateButton("7", 320,190, 40, 40)
$Button_8 = GuiCtrlCreateButton("8", 370,190, 40, 40)
$Button_9 = GuiCtrlCreateButton("9", 420,190, 40, 40)
$Button_0 = GuiCtrlCreateButton("0", 470,190, 40, 40)
GuiSetState()
Global $Active = ControlGetFocus(""); edit1 is active
While 1
$msg = GuiGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $Button_1
pressed ("1")
Case $msg = $Button_2
pressed ("2")
Case $msg = $Button_3
pressed ("3")
Case $msg = $Button_4
pressed ("4")
Case $msg = $Button_5
pressed ("5")
Case $msg = $Button_6
pressed ("6")
Case $msg = $Button_7
pressed ("7")
Case $msg = $Button_8
pressed ("8")
Case $msg = $Button_9
pressed ("9")
Case $msg = $Button_0
pressed ("0")
Case Else
;This is the cunning bit that sets the Focus back to the last input box rather than the last button pressed
If not StringinStr (ControlGetFocus (""), "button") then $active = ControlGetFocus ( "")
EndSelect
WEnd
Func Pressed ($Key)
ControlFocus("","",$active)
ControlSend ("","",$active, $key ,0)
EndFunc
code
Attachments (0)
Change History (3)
comment:1 by , 18 years ago
comment:2 by , 18 years ago
| Resolution: | → nobug |
|---|---|
| Status: | new → closed |
This is a bug in edit control focus and has been fixed in 3.2.11.1. It's not a bug in any Control* function so I'm resolving it as no bug. All the edit focus bugs are fixed in 3.2.11.1, however.

Sorry about this I was trying to find away around this and I have found that it is ControlFocus() that is wiping the data. If I use ControlClick() instead the data remains. When using ControlFocus() the data in the control gets highlighted this never used to happen