Nigel Posted February 27, 2010 Share Posted February 27, 2010 I need to know how to make what they put in GUICtrlCreateInput("", 10, 35, 300, 20) (The box) to be pressed. I was thinking something like: If $msg = $button Then Send("$var") Pretty much, when they input.. lets say '1', and hit the button it will press 1 on the keyboard. I just need to know how exactly to put it in AutoIt script :| And if that doesn't make sense to someone, I want it to do this in these steps: 1) They input the number '1'. 2) They hit the Button 'Ok' 3) It presses the number '1' on their keyboard. _____________________________________________________ This may be a nooby question, but I really need to know this for the program I am making. Link to comment Share on other sites More sharing options...
somdcomputerguy Posted February 27, 2010 Share Posted February 27, 2010 Look up the function in question, use the example provided to see how it works.Functions - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
dani Posted February 27, 2010 Share Posted February 27, 2010 You might also want to look at ControlSend to send to a specific window / control. The Send() method sends whatever you specify as argument to the currently active window. If you want to use Send(), be sure to first use WinActivate() to activate the right window. As a side note, your script seems extremely useless and I cannot think of a practical use. I hope it's for practice only ? Link to comment Share on other sites More sharing options...
Reloaded Posted February 27, 2010 Share Posted February 27, 2010 I need to know how to make what they put in GUICtrlCreateInput("", 10, 35, 300, 20) (The box) to be pressed. I was thinking something like: If $msg = $button Then Send("$var") Pretty much, when they input.. lets say '1', and hit the button it will press 1 on the keyboard. I just need to know how exactly to put it in AutoIt script :| And if that doesn't make sense to someone, I want it to do this in these steps: 1) They input the number '1'. 2) They hit the Button 'Ok' 3) It presses the number '1' on their keyboard. _____________________________________________________ This may be a nooby question, but I really need to know this for the program I am making. You aren't by any chance trying to make a malicious tool are you? Keylogger?? I can see this happening: You make the program Someone uses the Input field to put in data (lets say an email and password) They click on the Submit button It Emails it to you Anyways to help with your question, you would need to have it to do this: Read the Input field, grab the character code(s)StringToASCIIArray($someVar) Send those characters ;Not sure if THIS right here works, never tried it StringToASCIIArray($someVar) Is the way i would work with it Link to comment Share on other sites More sharing options...
JohnOne Posted February 27, 2010 Share Posted February 27, 2010 Your first thinking seems pretty good $sVar = GUICtrlCreateInput("", 10, 35, 300, 20) Local $sVar2 While 1 $msg = GUIGetMsg() If $msg = $button Then $sVar2 = GUICtrlRead($sVar) Send($sVar2) EndIf WEnd @Reloaded Thats a pretty big question to ask a guy who just wants to read an input field. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Nigel Posted February 27, 2010 Author Share Posted February 27, 2010 @Reloaded, no I'm not making a keylogger. I am making a program that reads an input field and then does a Send command with what is in it :-P. To everyone else, thank you so much for the help :-D! 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