Gedzy Posted April 7, 2011 Share Posted April 7, 2011 Facebook Login Pretty Simpleexpandcollapse popup#NoTrayIcon #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <GUIConstantsEx.au3> #include <EditConstants.au3> #include <GUIConstants.au3> #include <GDIPlus.au3> #include <String.au3> #Include <WinAPI.au3> #include <array.au3> #include <Misc.au3> #include <IE.au3> FBLogin() Func FBLogin() Global $Enter = False Local $msg, $GUI_FBN, $GUI_FBP $GUI = GUICreate("F a c e b o o k | L o g i n", 385, 110) $GUI_Label1 = GUICtrlCreateLabel("Email Address:", 10, 28) $GUI_FBN = GUICtrlCreateInput("", 100, 25, 200, 20) $GUI_Label2 = GUICtrlCreateLabel("Login Password:", 10, 53) $GUI_FBP = GUICtrlCreateInput("", 100, 50, 200, 20, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL)) $GUI_Create = GUICtrlCreateButton("Login", 100, 75, 200, 20) $BACKGROUNDX = GuiCtrlCreatePic("Facebook.gif", 310 ,20 ,64, 64) GUICtrlSetState($BACKGROUNDX, $GUI_DISABLE) GUISetState() HotKeySet("{Enter}", "EnterPressed") While 1 $msg = GUIGetMsg() If WinActive("F a c e b o o k | L o g i n") Then HotKeySet("{Enter}", "EnterPressed") Else HotKeySet("{Enter}") EndIf If $msg = -3 Then Exit If $msg = $GUI_Create Or $Enter = True Then Global $Enter = False If GUICtrlRead($GUI_FBN) = "" Then MsgBox(48, "F a c e b o o k | E r r o r", "Fields are Blank, Please Fill in the Fields...") Else $1 = GUICtrlRead($GUI_FBN) $2 = GUICtrlRead($GUI_FBP) $timeout = 5000 _IEErrorHandlerRegister() _IELoadWaitTimeout($timeout) $oIE = _IECreate("http://www.facebook.com/login.php") $oHWND = _IEPropertyGet($oIE, "hwnd") WinSetState($oHWND, "", @SW_MAXIMIZE) $oForm = _IEFormGetObjByName($oIE, "login_form") $oQuery = _IEFormElementGetObjByName($oForm, "email") $o_Query = _IEFormElementGetObjByName($oForm, "pass") $oSubmit = _IEFormElementGetObjByName($oForm, "login") _IEFormElementSetValue($oQuery, $1) _IEFormElementSetValue($o_Query, $2) _IEAction($oSubmit, "click") ExitLoop EndIf EndIf WEnd EndFunc ;FBLgin()Any Feedback? Gedzy Download: MediaFire Servant 1 Link to comment Share on other sites More sharing options...
Hellooopsforgotsendcommand Posted April 11, 2011 Share Posted April 11, 2011 Well it certainly works well on my pc (xp sp2) however I dont use IE but firefox, and yes I know its not as easy with that. Link to comment Share on other sites More sharing options...
USMC85 Posted May 28, 2011 Share Posted May 28, 2011 It worked, but when I ran it in Scite using the "Go" function, it said: C:\Program Files\AutoIt3\Examples\FBlogin.au3(31,36) : ERROR: EnterPressed(): undefined function. HotKeySet("{Enter}", "EnterPressed") ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Program Files\AutoIt3\Examples\FBlogin.au3 - 1 error(s), 0 warning(s) Did I do something wrong or not set something up right? Im trying to make something similar that just automatically logs you into an Outlook Webmail site at work. Thanks 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