Имя пользователя:
Пароль:  
Помощь | Регистрация | Забыли пароль?  

Показать сообщение отдельно

Аватара для madmasles

Ветеран


Сообщения: 812
Благодарности: 353

Профиль | Отправить PM | Цитировать


saavaage,
Попробуйте так:
читать дальше »
Код: Выделить весь код
#include <GUIConstantsEx.au3>
#include <GIFAnimation.au3>
#include <IE.au3>
#include <StaticConstants.au3>
#include <GuiMenu.au3>

Opt("MustDeclareVars", 1)

Global $sResume = 'Error', $pGIF, _
        $sFileGIF = @WindowsDir & "\pchealth\helpctr\System\images\progbar.gif", _
        $Form1, $Label1, $hGIF, $Button1, $nMsg, $hMenu

$Form1 = GUICreate("Form1", 300, 200, -1, -1)
$Label1 = GUICtrlCreateLabel('', 50, 20, 200, 20, $SS_CENTER)
$hGIF = _GUICtrlCreateGIF($sFileGIF, "", 75, 50, $pGIF)
_GIF_PauseAnimation($pGIF)
$Button1 = GUICtrlCreateButton("Start", 100, 100, 100, 50)
$hMenu = _GUICtrlMenu_GetSystemMenu($Form1)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            _GUICtrlMenu_EnableMenuItem($hMenu, $SC_CLOSE, 2)
            GUICtrlSetState($Button1, $GUI_DISABLE)
            GUICtrlSetData($Label1, "")
            _GIF_ResumeAnimation($pGIF)
            _SpeedInternet()
            _GIF_PauseAnimation($pGIF)
            GUICtrlSetData($Label1, "Ваша скорость: " & $sResume)
            GUICtrlSetState($Button1, $GUI_ENABLE)
            _GUICtrlMenu_EnableMenuItem($hMenu, $SC_CLOSE, 0)
    EndSwitch
WEnd

Func _SpeedInternet()
    Local $sPattern = '(?s).*?= (.*?)\r\n?.*', $sText
    Local $oIE = _IECreate("http://www.spbtlg.ru/index.html", 0, 0)
    If Not IsObj($oIE) Then Return $sResume
    If _IENavigate($oIE, "http://www.spbtlg.ru/stb.php") <> -1 Then
        _IEQuit($oIE)
        Return $sResume
    EndIf
    $sText = _IEBodyReadText($oIE)
    _IEQuit($oIE)
    If $sText Then
        $sText = StringRegExpReplace($sText, $sPattern, "\1")
        If Number($sText) Then $sResume = $sText & ' Kbps'
    EndIf
    Return $sResume
EndFunc   ;==>_SpeedInternet

GIFAnimation.au3
Это сообщение посчитали полезным следующие участники:

Отправлено: 17:34, 09-08-2010 | #5