Jump to content

Making a "login - GUI" ?


YpR^
 Share

Recommended Posts

Or this one:

#include <GUIConstants.au3>

$sGUI = GUICreate("E-Mail Address Reading", 368, 150, 193, 115)
$Begin = GUICtrlCreateInput("", 8, 8, 145, 21)
$Middle = GUICtrlCreateCombo("Select one", 160, 8, 105, 25)
GUICtrlSetData(-1, "@GMail")
$End = GUICtrlCreateInput("", 272, 8, 89, 21)
$BTxt = GUICtrlCreateLabel("Beginning of email", 8, 32, 146, 17)
$MTxt = GUICtrlCreateLabel("@ Where", 160, 32, 106, 17)
$ETxt = GUICtrlCreateLabel(".com? .co.uk?", 272, 32, 72, 17)
$FullEMail = GUICtrlCreateInput("", 8, 120, 353, 21)
$GetMyAd = GUICtrlCreateButton("&What's my E-mail address?", 112, 64, 161, 41, 0)
GUISetState(@SW_SHOW)


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $GetMyAd
            Select
                Case StringInStr(GUICtrlRead($Middle), "GMail")
                    $Advance = GuiCtrlRead($Middle)
                    $Start = GuiCtrlRead($Begin)
                    $Ending = GuiCtrlRead($End)
                    GuiCtrlSetData($FullEMail, $Start & $Advance & $Ending)
                Case Else
                    MsgBox(0, "Error", "Please specify a string and engine to search with.")
            EndSelect
    EndSwitch
WEnd

Just add more "Case" to the $GetMyAd and add more email providers.

Link to comment
Share on other sites

ohh.... the drop down box was an alternative to the string search.

I'll have a look on the scripts you've provided... thank you.

EDIT:

Maybe i didn't write it clear enough :whistle:

I like the basic script jokke provided.... but would like to add several other email-providers available through the script (so i dont have to make a script for each provider)

I think the string search and then execute is to advanced for me - so i'll stick to the drop down boxes.

i'll try to play with it myself... and return if i get problems :)

Edited by YpR^
Link to comment
Share on other sites

Made the GUI now.... using your provided drop-downboxes :whistle:

#include <GUIConstants.au3>
#include <IE.au3>


GUICreate('Mail-checker', 230,140)
$Account = GUICtrlCreateCombo("Vælg udbyder", 16, 8, 209, 25)
GUICtrlSetData(-1, "GMail|Yahoo|Hotmail|Ofir")
GUICtrlCreateLabel('Email:',5,40)
GUICtrlCreateLabel('Password:',5,70)


$email = GUICtrlCreateInput('',60,40,145,17)
$password = GUICtrlCreateInput('',60,70,145,17,$ES_PASSWORD)


$Login = GUICtrlCreateButton('Log på',15,100,190)

GUISetState()

while 1
    $msg = GUIGetMsg()
   
    Select
        Case $msg = $Login
           ;Logginin.
            _Login()
        Case $msg = $GUI_EVENT_CLOSE
            
            Exit
    EndSelect
WEnd


Func _Login()

$oIE = _IECreate()
_IENavigate($oIE, "http://www.hotmail.com")

WinSetState("Log på -", "", @SW_MAXIMIZE)

; get pointers to the login form and username and password fields
$o_form = _IEFormGetObjByName($oIE, "f1")
$o_login = _IEFormElementGetObjByName($o_form, "login")
$o_password = _IEFormElementGetObjByName($o_form, "passwd")

; Set field values and submit the form
_IEFormElementSetValue($o_login, GUICtrlRead($email))
_IEFormElementSetValue($o_password, GUICtrlRead($password))
Sleep(1000)
_IEFormSubmit($o_form)
   
EndFunc

But as the script is now - no matter what "Provider" i choose in the drop down box i'll be taken to Hotmail..... how do i implent the dropdownbox ? So the

Func _Login()

$oIE = _IECreate()
_IENavigate($oIE, "http://www.hotmail.com")

WinSetState("Log på -", "", @SW_MAXIMIZE)

; get pointers to the login form and username and password fields
$o_form = _IEFormGetObjByName($oIE, "f1")
$o_login = _IEFormElementGetObjByName($o_form, "login")
$o_password = _IEFormElementGetObjByName($o_form, "passwd")

; Set field values and submit the form
_IEFormElementSetValue($o_login, GUICtrlRead($email))
_IEFormElementSetValue($o_password, GUICtrlRead($password))
Sleep(1000)
_IEFormSubmit($o_form)
   
EndFunc

Only will be executed when HOTMAIL is choosen?

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...