#include <StaticConstants.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
#include <GDIPlus.au3>
Global $oForm
_GDIPlus_Startup ()
;~ START GUI
$Form1 = GUICreate("WMmail.ru", 273, 225, 192, 114)
$InputPnum = GUICtrlCreateInput("", 126, 190, 61, 21)
$BottonSend = GUICtrlCreateButton("Отправить", 192, 190, 75, 21, 0)
$oIE = ObjCreate("Shell.Explorer.2")
GUICtrlCreateObj($oIE, 6, 6, 260, 167)
GUISetState(@SW_SHOW)
;~ END GUI
TrayTip("Внимание!","Загружаемся...",1)
_IENavigate($oIE,"http://wmmail.ru/index.php?cf=reg-newr")
_LoadCaptcha()
TrayTip("","",1)
While 1
$nMsg = GUIGetMsg()
_ShowCaptcha()
Select
Case $nMsg = $GUI_EVENT_CLOSE
_GDIPlus_ShutDown ()
Exit
Case $nMsg = $BottonSend
_Submit()
EndSelect
WEnd
Func _LoadCaptcha() ; Загружаем и сохраняем картинку
$oForm = _IEFormGetObjByName ($oIE, "reg")
$oInputs = _IETagNameGetCollection ($oForm, "img")
$oFocus = _IEFormElementGetObjByName($oForm, "nwlogin")
_IEAction($oFocus,"Focus")
For $oInput In $oInputs
$oInput.src
Next
InetGet($oInput.src, @ScriptDir &"\captcha.bmp",1)
_ShowCaptcha()
EndFunc
Func _ShowCaptcha() ; Показываем картинку в GUI
$hBitmap = _GDIPlus_BitmapCreateFromFile (@ScriptDir & "\captcha.bmp")
$hGraphic = _GDIPlus_GraphicsCreateFromHWND ($Form1)
_GDIPlus_GraphicsDrawImage ($hGraphic, $hBitmap, 6, 180)
_GDIPlus_GraphicsDispose ($hGraphic)
_GDIPlus_BitmapDispose ($hBitmap)
Sleep(20)
EndFunc
Func _Submit() ; Отправляем данные
Local $sNW_login, $sNW_pass, $sNW_pass1, $sNW_email, _
$sNW_wmi, $sNW_wmz, $sNW_ref, $sNW_chk, $sNW_pnum
$sNW_login = _IEFormElementGetObjByName($oForm, "nwlogin") ; Логин
_IEFormElementSetValue($sNW_login, "Tim")
$sNW_pass = _IEFormElementGetObjByName($oForm, "nwpass") ; Пароль
_IEFormElementSetValue($sNW_pass, "1234567")
$sNW_pass1 = _IEFormElementGetObjByName($oForm, "nwpass1") ; Повтор пароля
_IEFormElementSetValue($sNW_pass1, "1234567")
$sNW_email = _IEFormElementGetObjByName($oForm, "nwemail") ; Почта
_IEFormElementSetValue($sNW_email, "[email protected]")
$sNW_wmi = _IEFormElementGetObjByName($oForm, "nwwmi") ; WMI
_IEFormElementSetValue($sNW_wmi, "")
$sNW_wmz = _IEFormElementGetObjByName($oForm, "nwwmz") ; WMZ
_IEFormElementSetValue($sNW_wmz, "")
$sNW_ref = _IEFormElementGetObjByName($oForm, "nwref") ; Referrer
_IEFormElementSetValue($sNW_ref, "")
$sNW_chk = _IEFormElementGetObjByName($oForm, "nwchk") ; Правила
_IEFormElementSetValue($sNW_chk, "1")
$sNW_pnum = _IEFormElementGetObjByName($oForm, "pnum") ; Число с картинки
_IEFormElementSetValue($sNW_pnum, GUICtrlRead($InputPnum))
_IEFormSubmit($oForm)
_IELoadWait ($oIE)
_Start()
EndFunc