Bishop12 Posted April 11, 2019 Share Posted April 11, 2019 (edited) HI Guys im Trying to Find out how can i Get what inside Input_username or Input_password i mean is when i open GUI and Put like something else i want in user name like Test and password is 123456 i want is after i click Login Button func main() should activate notepad and send the user and password i put in GUI Login my problem is yes it was sending But only number 4 and 6 may be i miss something else or what little bit newbie in Autoit need some one to help thankyou. HERES my little example expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=d:\all drivers files\koda\forms\gui login.kxf $Form1_1 = GUICreate("Form1", 340, 148, 207, 124) $Label1 = GUICtrlCreateLabel("Password", 32, 56, 50, 17) $ip_password = GUICtrlCreateInput("", 104, 56, 105, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_PASSWORD)) $Label2 = GUICtrlCreateLabel("UserName", 32, 16, 54, 17) $ip_username = GUICtrlCreateInput("", 104, 8, 105, 21) $Login = GUICtrlCreateButton("Login", 96, 88, 129, 41) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $Login main() Exit EndSwitch WEnd Func main() WinActivate("Untitled - Notepad") sleep(500) Send($ip_password,0) sleep(500) Send("{ENTER}",0) Send($ip_username,0) sleep(500) EndFunc Edited April 11, 2019 by Bishop12 Link to comment Share on other sites More sharing options...
jdelaney Posted April 11, 2019 Share Posted April 11, 2019 (edited) Send is not reliable without adjusting the input speed and pause between characters to exactly match what every application you send at can handle (all applications are different)...use: Func main() $h = WinActivate("Untitled - Notepad") $c = ControlGetHandle($h,"",15) ControlSetText($h,"",$c,$ip_password & @CRLF & $ip_username) EndFunc Edited April 11, 2019 by jdelaney Bishop12 1 IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
Bishop12 Posted April 11, 2019 Author Share Posted April 11, 2019 (edited) 5 minutes ago, jdelaney said: Send is not reliable without adjusting the input speed and pause between characters to exactly match what every application you send at can handle...use: Func main() $h = WinActivate("Untitled - Notepad") $c = ControlGetHandle($h,"",15) ControlSetText($h,"",$c,$ip_password & @CRLF & $ip_username) EndFunc i try it already it was still sending only number 4 and 6 i dont know why i cant get the text or user or password i wrote in GUI login user and password. i type in GUI login User is yes and in password is 123 and hit login and activate notepad then only 4 and 6 number showing not the message or user password i wrote in GUI Edited April 11, 2019 by Bishop12 Link to comment Share on other sites More sharing options...
jdelaney Posted April 11, 2019 Share Posted April 11, 2019 (edited) sorry, didn't notice you were not reading in the variables, but just sending the control ids Local $sLogin = "" Local $sPassword = "" While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $Login $sPassword = GUICtrlRead($ip_password) $sLogin = GUICtrlRead($ip_username) main($sLogin,$sPassword) Exit EndSwitch WEnd Func main($login,$pass) $h = WinActivate("Untitled - Notepad") $c = ControlGetHandle($h,"",15) ControlSetText($h,"",$c,$pass & @CRLF & $login) EndFunc Edited April 11, 2019 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
Bishop12 Posted April 11, 2019 Author Share Posted April 11, 2019 1 hour ago, jdelaney said: sorry, didn't notice you were not reading in the variables, but just sending the control ids Local $sLogin = "" Local $sPassword = "" While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $Login $sPassword = GUICtrlRead($ip_password) $sLogin = GUICtrlRead($ip_username) main($sLogin,$sPassword) Exit EndSwitch WEnd Func main($login,$pass) $h = WinActivate("Untitled - Notepad") $c = ControlGetHandle($h,"",15) ControlSetText($h,"",$c,$pass & @CRLF & $login) EndFunc ohh i see ill try it in few mns just doing something thankyou in advance again sir thankyou so much in fast reply and help Link to comment Share on other sites More sharing options...
Bishop12 Posted April 12, 2019 Author Share Posted April 12, 2019 On 4/11/2019 at 11:13 AM, jdelaney said: sorry, didn't notice you were not reading in the variables, but just sending the control ids Local $sLogin = "" Local $sPassword = "" While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $Login $sPassword = GUICtrlRead($ip_password) $sLogin = GUICtrlRead($ip_username) main($sLogin,$sPassword) Exit EndSwitch WEnd Func main($login,$pass) $h = WinActivate("Untitled - Notepad") $c = ControlGetHandle($h,"",15) ControlSetText($h,"",$c,$pass & @CRLF & $login) EndFunc Its now working SIR thankyou so much Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now