hello, I have a problem with a password edit box. I can input text into the password box but I cannot delete the text sending "". Seems the password box disables some properties or has different properties than a normal edit box when its focused. The following command did not work for me:
ControlSend("Connecting to **********", "", "Edit3", "")oÝ÷ ÚØb²+&ÉÊ&¦WzÇ+p'!ëlj§vW¡¬"Ú0§Êç(w¶)à¢÷«¶§zÚ+iDzȧZjW¦j)^ÅÈZ¬z»Þ¯brÞªè«zËaz)éºÚ¶©jË0¢·^½êò¶)y²q«jëh×6
$pass = "12345"
$a = ""
;getting focus of active windows by tittle which are hard to be focused
;the script can be improved a lot and there is a bit of garbage, but seems to work nice most of the times :)
;sending the handle of a window and checking if exist
Func IsVisible($handle)
If BitAnd( WinGetState($handle), 1 ) Then
Return 1
Else
Return 0
EndIf
EndFunc
While 1
$var = WinList() ;needs to be here to refresh each time the array list of windows
;loop to check all the active windows
For $i = 1 to $var[0][0]
;checking if it is our window
If ($var[$i][0] == "Credenciales de Microsoft Office Outlook" OR $var[$i][0] == "Conectar a ******") AND IsVisible($var[$i][1]) Then
;messagebox test to check script errors
;MsgBox(0, "Details", "Title=" & $var[$i][0] & @LF & "Handle=" & $var[$i][1])
;set the window attribute on top
WinSetOnTop ("Conectar a ******", "", 1 )
;show the window in case its hidden
WinSetState ( "title", "text", @SW_SHOW )
;while we have focus on the window
While (WinActivate ( "Conectar a ******", "" ) )
;if we got focus to the window, then we set focus to the textbox and finally send the text clearing it before.
If (WinActive ("Conectar a ******", "") ) Then
;setting textbox focus
$a = ControlGetText("Conectar a ******", "", "Edit3")
MsgBox(0, "Details", "a = " & $a)
;clear textbox if it has something, DOESNT WORK!!!, finds "" everytime maybe because of the password properties
If ($a = "" ) Then ;its already clear
;send text to the textbox identified by Edit3.
MsgBox(0, "Details", "no text found, found:" & $a)
ControlSend("Conectar a ******", "", "Edit3", $pass)
ControlSend("Conectar a ******", "", "Edit3", "")
;alternative method to send text, --less secure.
;Clipput("") ;clean clipboard memory
;ClipPut($pass) ;send text to the clipboard
;Send("^V")
;Send("{ENTER}")
Else ;the textbox if not clear, and we must clear it before sending text.
;ControlSend must clear the textbox before adding more text.
MsgBox(0, "Details", "text found!!")
ControlSend("Conectar a ******", "", "Edit3", "")
ControlSend("Conectar a ******", "", "Edit3", $pass)
EndIf
;if the window is found and info has been sent to the control, wait more seconds to search for the windows again
Sleep(5000)
EndIf
WEnd
EndIf
Clipput("") ;clean clipboard memory
Next
Sleep(3000)
WEnd
(I used ****** instead of my personal info)
Autoit Window Info of the password box (Edit 3):
---------------------------------------------------------
>>>>>>>>>>>> Window Details <<<<<<<<<<<<<
Title: Connecting to ***************
Class: #32770
Size: X: 495 Y: 346 W: 326 H: 289
>>>>>>>>>>> Mouse Details <<<<<<<<<<<
Screen: X: 665 Y: 517
Cursor ID: 5
>>>>>>>>>>> Pixel Color Under Mouse <<<<<<<<<<<
RGB: Hex: 0xFFFFFF Dec: 16777215
>>>>>>>>>>> Control Under Mouse <<<<<<<<<<<
Size: X: 116 Y: 134 W: 169 H: 20
Control ID: 1005
ClassNameNN: Edit3
Text:
Style: 0x500100A0
ExStyle: 0x00000204
>>>>>>>>>>> Status Bar Text <<<<<<<<<<<
>>>>>>>>>>> Visible Window Text <<<<<<<<<<<
Connecting to ***************
&User:
***********
??
***********
&...
&Password:
&Remember Password
Aceptar
Cancelar
>>>>>>>>>>> Hidden Window Text <<<<<<<<<<<
the problem: (Edit3 = password box)
-----------------------
$a = ControlGetText("Conectar a ******", "", "Edit3")
finds everytime "", you can type anything in the password field but only "" will be return
the control E which select all the text doesnt work here.
there could be a fix but i dont like it very much, and its just with ALT C in my case, which will automaticaly set focus to the box because its the predefined key, and then deleting the selection with {BACKSPACE}.
any help is welcome thanks