YpR^ Posted April 15, 2005 Share Posted April 15, 2005 Can anybody tell me what code to use if i would like to: Etc. open a box with 2 squares... in the first you write a login and the second a pass. This data should get stored and used later in the script to log-in to Hotmail etc. Otherwise.... Where to look in the FAQ ? Thank you Link to comment Share on other sites More sharing options...
buzz44 Posted April 15, 2005 Share Posted April 15, 2005 (edited) #include <GUIConstants.au3> GUICreate(" My GUI input acceptfile", 320,120) $file = GUICtrlCreateInput ( "", 10, 5, 300, 20) GUICtrlCreateInput ("", 10, 35, 300, 20) $btn = GUICtrlCreateButton ("Ok", 40, 75, 60, 20) GUISetState () While 1 $msg = GUIGetMsg() Select Case $msg = $btn exitloop EndSelect Wend And for saving it, you have 2 choices, save it to an INI file for which you will need... IniReadSection () IniRead () IniWrite () Or to save it to the registry and read it, for which you will need... RegRead () RegWrite () Look up the above functions in the help file. Edited April 15, 2005 by Burrup qq Link to comment Share on other sites More sharing options...
YpR^ Posted April 15, 2005 Author Share Posted April 15, 2005 If i would use it for Hotmail... would this be usefull ?:#include <GUIConstants.au3>GUICreate(" My GUI input acceptfile", 320,120)$file = GUICtrlCreateInput ( "Login", 10, 5, 300, 20)GUICtrlCreateInput ("Password", 10, 35, 300, 20)$btn = GUICtrlCreateButton ("Ok", 40, 75, 60, 20)GUISetState ()While 1 $msg = GUIGetMsg() Select Case $msg = $btn exitloop EndSelectWend(((Save the entered info somehow)))Run('explorer http://www.hotmail.com', @WindowsDir)WinSetState("xxxxx - Microsoft Internet Explorer", "", @SW_MAXIMIZE)MouseClick("left", xxx, xxx, 1,)(((Use the first entered info)))MouseClick("left", xxx, xxx, 1,)(((Use the second entered info)))Send({ENTER})Would this work.. or is it messy ? Link to comment Share on other sites More sharing options...
buzz44 Posted April 15, 2005 Share Posted April 15, 2005 For the password input box use. $Pass = GUICtrlCreateInput ("Password", 10, 35, 300, 20,$ES_PASSWORD) The $ES_PASSWORD is so that when you type something in there its hiddden behind asterisk's. Somethings in you script are a little bit in the wrong place, heres a template for you to fill in . #include <GUIConstants.au3> GUICreate("Hotmail Log-On", 320,120) $Email = GUICtrlCreateInput ( "Email Address", 10, 5, 300, 20) $Pass = GUICtrlCreateInput ("Password", 10, 35, 300, 20, $ES_PASSWORD) $Ok = GUICtrlCreateButton ("Ok", 40, 75, 60, 20) GUISetState () While 1 $msg = GUIGetMsg() Select Case $msg = $Ok ;IniWrite () ... Look up and use this function Exitloop Case $msg = $GUI_EVENT_CLOSE Exit EndSelect Wend Run('explorer http://www.hotmail.com', @WindowsDir) WinSetState("xxxxx - Microsoft Internet Explorer", "", @SW_MAXIMIZE) MouseClick("left", xxx, xxx, 1,) Send(GUICtrlRead($Email));Read what was in the above input boxes and type the email MouseClick("left", xxx, xxx, 1,) Send(GUICtrlRead($Password));Read what was in the above input boxes and type the password Send({ENTER}) qq Link to comment Share on other sites More sharing options...
YpR^ Posted April 15, 2005 Author Share Posted April 15, 2005 Thank you very much for the template Still can't figure out how the Iniwrite works... IniWrite("C:\Temp\myfile.ini", "section2", "key", "this is a new value") This is the template in the helpfile - The path is ok - Section doesn't matter ? Don't know what the "key" and "this is a new value" means... Should i fill those with a $Pass ? Link to comment Share on other sites More sharing options...
buzz44 Posted April 15, 2005 Share Posted April 15, 2005 (edited) A standard ini file looks like: [SectionName] Key=ValueegIniWrite("C:\Temp\myfile.ini", "Settings", "Email", $Email); Writes the email IniWrite("C:\Temp\myfile.ini", "Settings", "Pass", $Pass); Writes the passwordThe ini file will look something like this[Settings] Email = blah blah Pass = blah blahParametres for INIWrite()filename: The filename of the .ini file. section: The section name in the .ini file. key: The key name in the in the .ini file. value: The value to write/change. Edited April 15, 2005 by Burrup qq Link to comment Share on other sites More sharing options...
YpR^ Posted April 15, 2005 Author Share Posted April 15, 2005 I used your example and entered my login and pass - then i opened the ini fil but it shows: [settings] Email=3 Pass=4 Link to comment Share on other sites More sharing options...
buzz44 Posted April 15, 2005 Share Posted April 15, 2005 (edited) My bad, I forgot you have to read the control first... replace these lines IniWrite("C:\Temp\myfile.ini", "Settings", "Email", $Email); Writes the email IniWrite("C:\Temp\myfile.ini", "Settings", "Pass", $Pass); Writes the password with IniWrite("C:\Temp\myfile.ini", "Settings", "Email", GUICtrlRead($Email)) IniWrite("C:\Temp\myfile.ini", "Settings", "Pass", GUICtrlRead($Pass)) Edited April 15, 2005 by Burrup qq Link to comment Share on other sites More sharing options...
YpR^ Posted April 15, 2005 Author Share Posted April 15, 2005 Works great now ! Thank you 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