Func _ShowList()
Local $sText = GUICtrlRead($hEdit), $i, $j = 0, $sContents = ''
If $sText <> '' Then
$sText = StringLeft($sText, ControlCommand("", "", $hEdit, "GetCurrentCol") - 1) ; <= добавил
$sText = StringRight($sText, StringLen($sText) - StringInStr($sText, " ", 0, -1)) ; <= добавил
If StringLen($sText) < 5 Then Return ; <= добавил
For $i = 0 To UBound($aValid) - 1
If StringRegExp($aValid[$i], '(?i)^' & $sText & '.*') Then
$sContents &= '|' & $aValid[$i]
$j += 1
EndIf
Next
EndIf
If $sContents <> '' Then
ConsoleWrite($j & ' ' & $iHeight * $j & @CRLF)
GUICtrlSetPos($hList, 8, 8 + $iHeight, 496, $iHeight * $j)
GUICtrlSetData($hList, $sContents)
GUICtrlSetState($hList, $GUI_SHOW)
Else
GUICtrlSetState($hList, $GUI_HIDE)
EndIf
EndFunc ;==>_ShowList
Func _OnListClick()
ConsoleWrite(GUICtrlRead($hList) & @CRLF)
ControlFocus("", "", $hEdit) ; <= добавил
ControlSend("", "", $hEdit, "^+{left}") ; <= добавил
Sleep(10) ; <= добавил
GUICtrlSetData($hEdit, GUICtrlRead($hList), 1) ; <= изменил
GUICtrlSetState($hList, $GUI_HIDE) ; <= добавил
EndFunc ;==>_OnListClick