So i have made this code
#include <GuiConstantsEx.au3> #include <EditConstants.au3> #include <WindowsConstants.au3> #include <IE.au3> $hGUI = GUICreate("Bine ai Venit v.1.1", 600, 400) ; Store the handle here <<<<<< LoginPassword() Func LoginPassword() Local $VarWord, $RetWord, $Pass = '1234' While 1 $RetWord = InputBox("user", "Introdu parola de acces:" , Default, "*", 200, 120, 370, 300) Select Case @error ExitLoop Case $RetWord = '' MsgBox(0, "", "Nu ai introdus nicio parola, incearca din nou.") Case $RetWord <> $Pass MsgBox(48, "", "Parola incorecta, incearca din nou.") Case Else GUICtrlCreateIcon("explorer.exe", 0, 175, 120) GUICtrlCreateLabel("Icon", 180, 160, 50, 20) $BrkEnd = GUICtrlCreateButton("&Exit", 200, 370, 80, 25) $sites = GUICtrlCreateButton("&Site-uri", 100, 370, 80, 25) $Google = GUICtrlCreateButton("&Google", 390, 10 , 80, 25) $youtube = GUICtrlCreateButton("&Youtube", 390, 50, 80, 25) GUISetState() ; set the GUI as Visible. GUISetBkColor (0x333333) ; will change background color $sText = @CRLF & " Google" & @CRLF & "Username: ctl" & @CRLF & "Password: 1234" ; And add the required styles to the edit control GUICtrlCreateEdit($sText, 50, 50, 300, 300, BitOr($ES_READONLY, $WS_VSCROLL, $ES_AUTOVSCROLL)) GUICtrlSetColor(-1, 0x0066CC) GUISetState(@SW_SHOW) While 1 ; start loop, so the script continues and does not exit. $msg = GUIGetMsg() ; listen for a message. If $msg = $GUI_EVENT_CLOSE Or $msg = $BrkEnd Then ; if exit is pressed, then exit the script. Exit ElseIf $msg = $sites then $o_IE = _IECreate () _IENavigate ($o_IE, "[url="http://www.google.ro"]http://www.google.ro[/url]") $o_IE = _IECreate () _IENavigate ($o_IE, "[url="http://youtube.com"]http://youtube.com[/url]") ElseIf $msg = $Google then $o_IE = _IECreate () _IENavigate ($o_IE, "[url="http://www.google.ro"]http://www.google.ro[/url]") ElseIf $msg = $Youtube Then $o_IE = _IECreate () _IENavigate ($o_IE, "[url="http://www.youtube.com"]http://www.youtube.com[/url]") EndIf WEnd ; end loop. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd EndSelect WEnd EndFunc ;==>LoginPassword
Everything works great, but i was wondering if i could make some improvements.
First of all i want to copy the text under a button, so i want to creat a button for the username and a button for the password and when i click on the button with username to copy my username automaticaly and same to the password, this way the all thing its more quickly, something like this:
$ctl = GUICtrlCreateButton("&ctl", 390, 10 , 80, 25) $1234 = GUICtrlCreateButton("&1234", 390, 50 , 80, 25) If $msg = $GUI_EVENT_CLOSE Or $msg = $BrkEnd Then ; if exit is pressed, then exit the script. Exit ElseIf $msg = $ctl then copy ctl Elseif $msg = $1234 then copy 1234
Hope you get the idea, i dont have any idea on how show i write that pice of code.
The second question is, that if i could somehow have the program to my pc at home, and at work, at home to have the sources and to make changes how i want, and at work to have the .exe, and whenever i make some changes on the home pc, thoes changes to take effect when i open the exe file at work, this could be possible ?
Thanks a lot.
Edited by ctl, 16 May 2012 - 02:31 PM.





