Jump to content

Jahar

Active Members
  • Posts

    44
  • Joined

  • Last visited

Everything posted by Jahar

  1. I am using code to create splash screen. But neither screen is splashing or balls are increasing or moving. It works on one machine (old windows 10 laptop) but not works in other machine. Out of 5 machines, only one is working. Please #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <Memory.au3> #include <GDIPlus.au3> #include <StaticConstants.au3> #include <TrayConstants.au3> Global Const $sExcelColor = "217346", $sWordColor = "2b579a", $sOutlookColor = "B7472A" Global Const $sThemeColor = $sOutlookColor Local Const $PI = 3.141592653589793 Global Const $hDwmApiDll = DllOpen("dwmapi.dll") Global $sChkAero = DllStructCreate("int;") DllCall($hDwmApiDll, "int", "DwmIsCompositionEnabled", "ptr", DllStructGetPtr($sChkAero)) Global $bAero = DllStructGetData($sChkAero, 1) Global $fStep = 0.02 If Not $bAero Then $fStep = 1.25 _GDIPlus_Startup() Global $iW = 442, $iH = 30 $hGUI = GUICreate("Office", $iW, 252, @DesktopWidth / 2.95, @DesktopHeight / 3.2, $WS_POPUP) GUISetBkColor("0x" & $sThemeColor) $Label1 = GUICtrlCreateLabel("SciTE4AutoIt3", 8, 8, 102, 21) GUICtrlSetFont(-1, 10, 400, 0, "Segoe UI Light") GUICtrlSetColor(-1, 0xFFFFFF) $Label2 = GUICtrlCreateLabel("AutoIt 247", 64, 72, 314, 75, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetFont(-1, 40, 400, 0, "Segoe UI Light") GUICtrlSetColor(-1, 0xFFFFFF) $Label3 = GUICtrlCreateLabel("Starting...", 10, 205, 54, 21) GUICtrlSetFont(-1, 10, 400, 0, "Segoe UI Light") GUICtrlSetColor(-1, 0xFFFFFF) $Label4 = GUICtrlCreateLabel("r", 410, 4, 20, 21) GUICtrlSetFont(-1, 12, 400, 0, "Webdings") GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetTip(-1, "Closes the splash screen.") $Label5 = GUICtrlCreateLabel("0", 385, 0, 20, 21) GUICtrlSetFont(-1, 12, 400, 0, "Webdings") GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetTip(-1, "Minimises the splash screen.") GUISetState(@SW_SHOW) Global Const $iPic = GUICtrlCreatePic("", 0, 150, $iW, $iH) GUICtrlSetState(-1, $GUI_DISABLE) WinSetTrans($hGUI, "", 0) GUISetState() Global $hHBmp_BG, $hB, $iSleep = 20 GUIRegisterMsg($WM_TIMER, "PlayAnim") DllCall("user32.dll", "int", "SetTimer", "hwnd", $hGUI, "int", 0, "int", $iSleep, "int", 0) Global $iballs = 5 Global $aPos[$iballs][3] For $i = 0 To $iballs - 1 $aPos[($iballs - 1) - $i][0] = -10 $aPos[($iballs - 1) - $i][1] = $iH / 2 Next $aPos[0][2] = 1 Global $z, $iPerc For $z = 1 To 255 Step $fStep WinSetTrans($hGUI, "", $z) Next Do Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $Label4 ConsoleWrite("Exit") GUIRegisterMsg($WM_TIMER, "") _WinAPI_DeleteObject($hHBmp_BG) _GDIPlus_Shutdown() For $z = 255 To 1 Step -$fStep WinSetTrans($hGUI, "", $z) Next GUIDelete($hGUI) Exit EndSwitch Until False Func PlayAnim() $hHBmp_BG = _GDIPlus_LinearBalls($iW, $iH, $iPerc, 3, $iballs) $hB = GUICtrlSendMsg($iPic, $STM_SETIMAGE, $IMAGE_BITMAP, $hHBmp_BG) If $hB Then _WinAPI_DeleteObject($hB) _WinAPI_DeleteObject($hHBmp_BG) If $aPos[$iballs - 1][2] = 2 Then For $i = 0 To $iballs - 1 $aPos[$i][0] = -10 $aPos[$i][2] = 0 Next $aPos[0][2] = 1 EndIf EndFunc ;==>PlayAnim Func _GDIPlus_LinearBalls($iW, $iH, $iPerc, $iRadius = 5, $iballs = 3, $bHBitmap = True) Local Const $iDiameter = $iRadius * 2 Local $tPointF1 = DllStructCreate("float;float") Local $pPointF1 = DllStructGetPtr($tPointF1) Local $tPointF2 = DllStructCreate("float;float") Local $pPointF2 = DllStructGetPtr($tPointF2) DllStructSetData($tPointF1, 1, $iDiameter) DllStructSetData($tPointF1, 2, 0) DllStructSetData($tPointF2, 1, $iDiameter) DllStructSetData($tPointF2, 2, $iDiameter) Local $hBrushBall2 = DllCall($__g_hGDIPDll, "uint", "GdipCreateLineBrush", "ptr", $pPointF1, "ptr", $pPointF2, "uint", 0xFFcecbca, "uint", 0xFFf2eeed, "int", 1, "int*", 0) $hBrushBall2 = $hBrushBall2[6] Local $hBitmap = _GDIPlus_BitmapCreateFromScan0($iW, $iH) Local Const $hCtxt = _GDIPlus_ImageGetGraphicsContext($hBitmap) _GDIPlus_GraphicsSetSmoothingMode($hCtxt, 2) _GDIPlus_GraphicsSetPixelOffsetMode($hCtxt, $GDIP_PIXELOFFSETMODE_HIGHQUALITY) Local Const $hBrushBall1 = _GDIPlus_BrushCreateSolid("0xFF" & $sThemeColor) _GDIPlus_GraphicsFillRect($hCtxt, 0, 0, $iW, $iH, $hBrushBall1) Local $i, $fDH, $height Local $ixPartScreen = $iW / 16 For $i = 0 To $iballs - 1 Local $iSpeed, $x If $aPos[$i][2] = 1 Then If $aPos[$i][0] < $ixPartScreen * 7 Then $x = $aPos[$i][0] If $x < 0 Then $x = 0 $iSpeed = 5 + (20 * ((($ixPartScreen * 7) - $x) * 100) / ($ixPartScreen * 7)) / 100 ElseIf $aPos[$i][0] > ($ixPartScreen * 9 - ($i * $iRadius * 1.5)) Then $iSpeed = 20 + (60 * ((($aPos[$i][0] - $ixPartScreen * 9)) * 100) / ($ixPartScreen * 9)) / 100 Else $iSpeed = 2 EndIf If $i > 0 And $aPos[$i - 1][0] - ($aPos[$i][0] + $iSpeed) < 13 And $aPos[$i][0] < $ixPartScreen * 9 Then $aPos[$i][0] = $aPos[$i - 1][0] - 13 Else $aPos[$i][0] = $aPos[$i][0] + $iSpeed EndIf EndIf If $i < $iballs - 1 Then If $aPos[$i][0] > $ixPartScreen * 3 Then $aPos[$i + 1][2] = 1 EndIf If $aPos[$i][0] > $iW + $iRadius Then $aPos[$i][2] = 0 If $i = $iballs - 1 Then $aPos[$i][2] = 2 EndIf _GDIPlus_GraphicsFillCircle($hCtxt, $aPos[$i][0], $aPos[$i][1], $iRadius, $hBrushBall2) Next _GDIPlus_GraphicsDispose($hCtxt) _GDIPlus_BrushDispose($hBrushBall1) _GDIPlus_BrushDispose($hBrushBall2) If $bHBitmap Then Local $hHBITMAP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) _GDIPlus_BitmapDispose($hBitmap) Return $hHBITMAP EndIf Return $hBitmap EndFunc ;==>_GDIPlus_LinearBalls Func _GDIPlus_GraphicsFillCircle($hCtxt, $iXCenterPos, $iCenterYPos, $iRadius, $hBrush) _GDIPlus_GraphicsFillEllipse($hCtxt, $iXCenterPos - $iRadius, $iCenterYPos - $iRadius, $iRadius * 2, $iRadius * 2, $hBrush) EndFunc ;==>_GDIPlus_GraphicsFillCircle help
  2. @Jos I understood your post clearly. You said not to beg. And i stopped begging in this forum. And one more time.... Go thru my post and see how Xman humiliates me, you can see. Afterall, everything has a limit. If you want remove me.
  3. @TheXman Could you please react to this post too. Your reaction is "sad" as you are a sadist
  4. @JLogan3o13 Could you please help me.
  5. @Dan_555 So, could you please guide me how to correct that issue?
  6. I am using code to create splash screen. But neither screen is splashing or balls are increasing or moving. It works on one machine (old windows 10 laptop) but not works in other machine. Out of 5 machines, only one is working. Please help #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <Memory.au3> #include <GDIPlus.au3> #include <StaticConstants.au3> #include <TrayConstants.au3> Global Const $sExcelColor = "217346", $sWordColor = "2b579a", $sOutlookColor = "B7472A" Global Const $sThemeColor = $sOutlookColor Local Const $PI = 3.141592653589793 Global Const $hDwmApiDll = DllOpen("dwmapi.dll") Global $sChkAero = DllStructCreate("int;") DllCall($hDwmApiDll, "int", "DwmIsCompositionEnabled", "ptr", DllStructGetPtr($sChkAero)) Global $bAero = DllStructGetData($sChkAero, 1) Global $fStep = 0.02 If Not $bAero Then $fStep = 1.25 _GDIPlus_Startup() Global $iW = 442, $iH = 30 $hGUI = GUICreate("Office", $iW, 252, @DesktopWidth / 2.95, @DesktopHeight / 3.2, $WS_POPUP) GUISetBkColor("0x" & $sThemeColor) $Label1 = GUICtrlCreateLabel("SciTE4AutoIt3", 8, 8, 102, 21) GUICtrlSetFont(-1, 10, 400, 0, "Segoe UI Light") GUICtrlSetColor(-1, 0xFFFFFF) $Label2 = GUICtrlCreateLabel("AutoIt 247", 64, 72, 314, 75, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetFont(-1, 40, 400, 0, "Segoe UI Light") GUICtrlSetColor(-1, 0xFFFFFF) $Label3 = GUICtrlCreateLabel("Starting...", 10, 205, 54, 21) GUICtrlSetFont(-1, 10, 400, 0, "Segoe UI Light") GUICtrlSetColor(-1, 0xFFFFFF) $Label4 = GUICtrlCreateLabel("r", 410, 4, 20, 21) GUICtrlSetFont(-1, 12, 400, 0, "Webdings") GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetTip(-1, "Closes the splash screen.") $Label5 = GUICtrlCreateLabel("0", 385, 0, 20, 21) GUICtrlSetFont(-1, 12, 400, 0, "Webdings") GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetTip(-1, "Minimises the splash screen.") GUISetState(@SW_SHOW) Global Const $iPic = GUICtrlCreatePic("", 0, 150, $iW, $iH) GUICtrlSetState(-1, $GUI_DISABLE) WinSetTrans($hGUI, "", 0) GUISetState() Global $hHBmp_BG, $hB, $iSleep = 20 GUIRegisterMsg($WM_TIMER, "PlayAnim") DllCall("user32.dll", "int", "SetTimer", "hwnd", $hGUI, "int", 0, "int", $iSleep, "int", 0) Global $iballs = 5 Global $aPos[$iballs][3] For $i = 0 To $iballs - 1 $aPos[($iballs - 1) - $i][0] = -10 $aPos[($iballs - 1) - $i][1] = $iH / 2 Next $aPos[0][2] = 1 Global $z, $iPerc For $z = 1 To 255 Step $fStep WinSetTrans($hGUI, "", $z) Next Do Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $Label4 ConsoleWrite("Exit") GUIRegisterMsg($WM_TIMER, "") _WinAPI_DeleteObject($hHBmp_BG) _GDIPlus_Shutdown() For $z = 255 To 1 Step -$fStep WinSetTrans($hGUI, "", $z) Next GUIDelete($hGUI) Exit EndSwitch Until False Func PlayAnim() $hHBmp_BG = _GDIPlus_LinearBalls($iW, $iH, $iPerc, 3, $iballs) $hB = GUICtrlSendMsg($iPic, $STM_SETIMAGE, $IMAGE_BITMAP, $hHBmp_BG) If $hB Then _WinAPI_DeleteObject($hB) _WinAPI_DeleteObject($hHBmp_BG) If $aPos[$iballs - 1][2] = 2 Then For $i = 0 To $iballs - 1 $aPos[$i][0] = -10 $aPos[$i][2] = 0 Next $aPos[0][2] = 1 EndIf EndFunc ;==>PlayAnim Func _GDIPlus_LinearBalls($iW, $iH, $iPerc, $iRadius = 5, $iballs = 3, $bHBitmap = True) Local Const $iDiameter = $iRadius * 2 Local $tPointF1 = DllStructCreate("float;float") Local $pPointF1 = DllStructGetPtr($tPointF1) Local $tPointF2 = DllStructCreate("float;float") Local $pPointF2 = DllStructGetPtr($tPointF2) DllStructSetData($tPointF1, 1, $iDiameter) DllStructSetData($tPointF1, 2, 0) DllStructSetData($tPointF2, 1, $iDiameter) DllStructSetData($tPointF2, 2, $iDiameter) Local $hBrushBall2 = DllCall($__g_hGDIPDll, "uint", "GdipCreateLineBrush", "ptr", $pPointF1, "ptr", $pPointF2, "uint", 0xFFcecbca, "uint", 0xFFf2eeed, "int", 1, "int*", 0) $hBrushBall2 = $hBrushBall2[6] Local $hBitmap = _GDIPlus_BitmapCreateFromScan0($iW, $iH) Local Const $hCtxt = _GDIPlus_ImageGetGraphicsContext($hBitmap) _GDIPlus_GraphicsSetSmoothingMode($hCtxt, 2) _GDIPlus_GraphicsSetPixelOffsetMode($hCtxt, $GDIP_PIXELOFFSETMODE_HIGHQUALITY) Local Const $hBrushBall1 = _GDIPlus_BrushCreateSolid("0xFF" & $sThemeColor) _GDIPlus_GraphicsFillRect($hCtxt, 0, 0, $iW, $iH, $hBrushBall1) Local $i, $fDH, $height Local $ixPartScreen = $iW / 16 For $i = 0 To $iballs - 1 Local $iSpeed, $x If $aPos[$i][2] = 1 Then If $aPos[$i][0] < $ixPartScreen * 7 Then $x = $aPos[$i][0] If $x < 0 Then $x = 0 $iSpeed = 5 + (20 * ((($ixPartScreen * 7) - $x) * 100) / ($ixPartScreen * 7)) / 100 ElseIf $aPos[$i][0] > ($ixPartScreen * 9 - ($i * $iRadius * 1.5)) Then $iSpeed = 20 + (60 * ((($aPos[$i][0] - $ixPartScreen * 9)) * 100) / ($ixPartScreen * 9)) / 100 Else $iSpeed = 2 EndIf If $i > 0 And $aPos[$i - 1][0] - ($aPos[$i][0] + $iSpeed) < 13 And $aPos[$i][0] < $ixPartScreen * 9 Then $aPos[$i][0] = $aPos[$i - 1][0] - 13 Else $aPos[$i][0] = $aPos[$i][0] + $iSpeed EndIf EndIf If $i < $iballs - 1 Then If $aPos[$i][0] > $ixPartScreen * 3 Then $aPos[$i + 1][2] = 1 EndIf If $aPos[$i][0] > $iW + $iRadius Then $aPos[$i][2] = 0 If $i = $iballs - 1 Then $aPos[$i][2] = 2 EndIf _GDIPlus_GraphicsFillCircle($hCtxt, $aPos[$i][0], $aPos[$i][1], $iRadius, $hBrushBall2) Next _GDIPlus_GraphicsDispose($hCtxt) _GDIPlus_BrushDispose($hBrushBall1) _GDIPlus_BrushDispose($hBrushBall2) If $bHBitmap Then Local $hHBITMAP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) _GDIPlus_BitmapDispose($hBitmap) Return $hHBITMAP EndIf Return $hBitmap EndFunc ;==>_GDIPlus_LinearBalls Func _GDIPlus_GraphicsFillCircle($hCtxt, $iXCenterPos, $iCenterYPos, $iRadius, $hBrush) _GDIPlus_GraphicsFillEllipse($hCtxt, $iXCenterPos - $iRadius, $iCenterYPos - $iRadius, $iRadius * 2, $iRadius * 2, $hBrush) EndFunc ;==>_GDIPlus_GraphicsFillCircle
  7. But i am not a sadist in finding pleasure like you
  8. @TheXman @JLogan3o13 Sorry for dupilcate post. I did so as none gave me reply. Wont repeat this in future. Please help me to resolve the above issue
  9. I have an issue with response text received with the code. I am having a mail with subject "You've received" - but response text gives "You&#39;ve received " . Please help me to solve this. #include <Constants.au3> test() Func test() ;Put your USERNAME and PASSWORD below Const $USERNAME = "username", _ $PASSWORD = "password" Local $oComErr = ObjEvent("AutoIt.Error", com_error_handler) With ObjCreate("winhttp.winhttprequest.5.1") ;Set up and send request .Open("GET", "https://mail.google.com/mail/feed/atom", False) .SetCredentials($USERNAME, $PASSWORD, 0) .Send() If .Status <> 200 Then Exit MsgBox($MB_ICONWARNING, "WARNING", _ "BAD HTTP RESPONSE" & @CRLF & @CRLF & .Status & " " & .StatusText) ;Display response ConsoleWrite(StringLeft(.ResponseText, 200) & @CRLF) ;First 200 bytes of response EndWith EndFunc Func com_error_handler($oComErr) Local $sErrMsg With $oComErr $sErrMsg = @CRLF $sErrMsg &= ">>> COM ERROR <<<" & @CRLF $sErrMsg &= StringFormat("Script Line Number : %s", .ScriptLine) & @CRLF $sErrMsg &= StringFormat("HRESULT : 0x%x (%s)", .Number, .Number) & @CRLF $sErrMsg &= StringFormat("Windows Error : %s", StringStripWS(.WinDescription, $STR_STRIPTRAILING)) & @CRLF $sErrMsg &= StringFormat("Object Description : %s", StringStripWS(.Description, $STR_STRIPTRAILING)) & @CRLF $sErrMsg &= StringFormat("GetLastError() : %s", .LastDllError) & @CRLF EndWith ConsoleWrite($sErrMsg) MsgBox($MB_ICONERROR, "ERROR", $sErrMsg) Exit EndFunc
  10. @TheXman I have an issue with response text received with the code. I am having a mail with subject "You've received" - but response text gives "You&#39;ve received " . Please help me to solve this. #include <Constants.au3> test() Func test() ;Put your USERNAME and PASSWORD below Const $USERNAME = "username", _ $PASSWORD = "password" Local $oComErr = ObjEvent("AutoIt.Error", com_error_handler) With ObjCreate("winhttp.winhttprequest.5.1") ;Set up and send request .Open("GET", "https://mail.google.com/mail/feed/atom", False) .SetCredentials($USERNAME, $PASSWORD, 0) .Send() If .Status <> 200 Then Exit MsgBox($MB_ICONWARNING, "WARNING", _ "BAD HTTP RESPONSE" & @CRLF & @CRLF & .Status & " " & .StatusText) ;Display response ConsoleWrite(StringLeft(.ResponseText, 200) & @CRLF) ;First 200 bytes of response EndWith EndFunc Func com_error_handler($oComErr) Local $sErrMsg With $oComErr $sErrMsg = @CRLF $sErrMsg &= ">>> COM ERROR <<<" & @CRLF $sErrMsg &= StringFormat("Script Line Number : %s", .ScriptLine) & @CRLF $sErrMsg &= StringFormat("HRESULT : 0x%x (%s)", .Number, .Number) & @CRLF $sErrMsg &= StringFormat("Windows Error : %s", StringStripWS(.WinDescription, $STR_STRIPTRAILING)) & @CRLF $sErrMsg &= StringFormat("Object Description : %s", StringStripWS(.Description, $STR_STRIPTRAILING)) & @CRLF $sErrMsg &= StringFormat("GetLastError() : %s", .LastDllError) & @CRLF EndWith ConsoleWrite($sErrMsg) MsgBox($MB_ICONERROR, "ERROR", $sErrMsg) Exit EndFunc
  11. @TheXman The unfortunate thing is the other codes are still throwing error. Hope the last one will work in all machine.
  12. @TheXman I changed google settings to allow less secure apps and it worked well with your last code. Now let me try with old codes. Thanks
  13. @thexman I tried the above code and ended with a message "BAD HTTP RESPONSE : 401 Unauthorized" - at the same time manually atom url is working. The surprise is I got a mail from google security alert that "Someone just used your password to try to sign in to your account from a non-Google app. Google blocked them, but you should check what happened. Review your account activity to make sure no one else has access." What should I do to solve this?
  14. @TheXman Both are getting error 11. I checked with other gmail account after signing out and re logging with new one. Same error coming thru code, but with atom url manually, it works
  15. InetRead failed - @error = 11 - Again error
  16. @TheXman I am getting error 13. What should I do? Is there any setup to be done before executing the script?
  17. @TheXman @JLogan3o13 Is the same code, working for you guys?
  18. @TheXman Thanks for your help and time. I am using my username (excluding gmail.com) and password (have no special characters). Kindly help me or provide another method. I have to read unread mails from my specific label.
  19. @TheXman I have corrected the url in the code. But still same error. #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Compression=4 #AutoIt3Wrapper_UseUpx=n #AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #AutoIt3Wrapper_Run_Obfuscator=y #Obfuscator_Parameters=/so #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <string.au3> Global $eReturn = _CheckMail("myUserName", "myPwd") Global $Emails = @extended Switch @error Case 0 Switch @extended Case True ConsoleWrite(" 0>"&$eReturn[0][0] & @CR) ConsoleWrite(" "& $Emails & " " & $eReturn[0][1] & @CR) For $x = 1 To $Emails ConsoleWrite("!>Title - " & $eReturn[$x][0] & @CR) ConsoleWrite("+>Name - " & $eReturn[$x][1] & @CR) ConsoleWrite("->Email - " & $eReturn[$x][2] & @CR) ConsoleWrite(">summary - " & $eReturn[$x][3] & @CR & @CR) Next Case Else MsgBox(64,"success!","Success! But you have no new emails :(") EndSwitch Case 1 MsgBox(0,"Error!","Couldn't get your new emails for some reason...") Case 2,3 MsgBox(0,"Error!","you need to enter an user name and password!") Case 4 MsgBox(16,"Error!","Error Getting URL Source!") Case 5 MsgBox(16,"Error!","No response?") Case 6 MsgBox(16,"Error!","Unauthorized access, possibly a wrong username or password!") EndSwitch ; #FUNCTION# ==================================================================================================================== ; Name ..........: _CheckMail ; Description ...: Checks a Google Email for new emails. ; Syntax ........: _CheckMail($UserName, $Pswd[, $UserAgentString = ""]) ; Parameters ....: $UserName - An unknown value. ; $Pswd - An unknown value. ; $UserAgentString - [optional] An unknown value. Default is "". ; Return values .: A 2d array with email information as follows~ ; 1|Title ; 2|Name ; 3|Email ; 4|Summary ; 5|Date ; 6|Time ; ; Author ........: dantay9 ; Modified ......: THAT1ANONYMOUSDUDE ; Remarks .......: ; Related .......: ; Link ..........: http://www.autoitscript.com/forum/topic/111853-gmail-email-checker/page__view__findpost__p__819409 ; Example .......: Yes ; =============================================================================================================================== Func _CheckMail($UserName, $Pswd, $UserAgentString = "") If Not $UserName Then Return SetError(2,0,0) If Not $Pswd Then Return SetError(3,0,0) If $UserAgentString Then HttpSetUserAgent($UserAgentString) Local $source = InetRead("https://" & $UserName & ":" & $Pswd & "@mail.google.com/mail/feed/atom",1) If @error Then ConsoleWrite("!>Error Getting URL Source!" & @CR & " 404>@Error =" & @error & @CR & " 404>@Extended =" & @extended & @CR) Return SetError(4,0,0) EndIf If $source Then $source = BinaryToString($source) Else Return SetError(5,0,0) EndIf If StringLeft(StringStripWS($source, 8), 46) == "<HTML><HEAD><TITLE>Unauthorized</TITLE></HEAD>" Then Return SetError(6, 0, 0) If Not Number(StringBetween($source, "<fullcount>", "</fullcount>")) Then Return SetError(0,0,0) Local $Email = _StringBetween($source, "<entry>", "</entry>") If @error Then Return SetError(1, 0, 0) Local $Time Local $Count = UBound($Email) Local $Datum[$Count + 1][6] $Datum[0][0] = StringBetween($source, "<title>", "</title>") $Datum[0][1] = StringBetween($source, "<tagline>", "</tagline>") For $i = 0 To $Count - 1 $Datum[$i+1][0] = StringBetween($Email[$i], "<title>", "</title>") If Not $Datum[$i+1][0] Then $Datum[$i][0] = "(no subject)" $Datum[$i+1][1] = StringBetween($Email[$i], "<name>", "</name>") $Datum[$i+1][2] = StringBetween($Email[$i], "<email>", "</email>") $Datum[$i+1][3] = StringBetween($Email[$i], "<summary>", "</summary>") $Time = StringBetween($Email[$i], "<issued>", "</issued>") $Datum[$i+1][4] = DateFromTimeDate($Time) $Datum[$i+1][5] = TimeFromTimeDate($Time) Next Return SetError(0,$Count,$Datum) EndFunc Func StringBetween($Str, $S, $E) Local $B = _StringBetween($Str, $S, $E) If @error Then Return SetError(1,0,0) Return SetError(0,0,$B[0]) EndFunc ;==>StringBetween ; #FUNCTION# ==================================================================================================================== ; Name ..........: DateFromTimeDate ; Description ...: Returns email sent date. ; Syntax ........: DateFromTimeDate($String) ; Parameters ....: $String - A gmail date string ; Return values .: None ; Author ........: ??? ; Example .......: No ; =============================================================================================================================== Func DateFromTimeDate($String) Local $RegEx = StringRegExp($String, "(?<Year>d{2}|d{4})(?:-)(?<Month>d{1,2})(?:-)(?<Day>d{1,2})", 1) If IsArray($RegEx) Then Return Int($RegEx[0]) & "/" & Int($RegEx[1]) & "/" & Int($RegEx[2]) Else Return SetError(1, 0, 0) EndIf EndFunc ;==>DateFromTimeDate ; #FUNCTION# ==================================================================================================================== ; Name ..........: TimeFromTimeDate ; Description ...: Returns the email sent time. ; Syntax ........: TimeFromTimeDate($String) ; Parameters ....: $String - An unknown value. ; Return values .: None ; Author ........: ??? ; Example .......: No ; =============================================================================================================================== Func TimeFromTimeDate($String) Local $RegEx = StringRegExp($String, "(?<Hour>d{1,2})(?::)(?<Minute>d{1,2})(?::)(?<Second>d{1,2})", 1) If IsArray($RegEx) Then Return (Int($RegEx[0]) - 4) & ":" & Int($RegEx[1]) & ":" & Int($RegEx[2]) ;don't know why I have to subtract 4 Else Return SetError(1, 0, 0) EndIf EndFunc ;==>TimeFromTimeDate
  20. @TheXman Now the url is working manually. I just tried logging to my gmail manually. After that Atom url worked manually fine
×
×
  • Create New...