Sign in to follow this  
Followers 0
Armand

Obj.Send() stucks an AVI control?!

1 post in this topic

#include <GUIConstantsEx.au3>

Example()
Example2()

Func Example()
    Local $ani1, $buttonstart, $buttonstop, $msg
    
    $GUI1 = GUICreate("My GUI Animation", 300, 200)
    $ani1 = GUICtrlCreateAvi(@SystemDir & "\shell32.dll", 150, 50, 10)

    $buttonstart = GUICtrlCreateButton("start", 50, 150, 70, 22)
    $buttonstop = GUICtrlCreateButton("stop", 150, 150, 70, 22)

    GUISetState()

    ; Run the GUI until the dialog is closed
    While 1
        $msg = GUIGetMsg()

        Select
            Case $msg = $GUI_EVENT_CLOSE
                ExitLoop
                
            Case $msg = $buttonstart
                GUICtrlSetState($ani1, 1)
                
            Case $msg = $buttonstop
                Sleep(10000)
                GUICtrlSetState($ani1, 0)
                
        EndSelect
    WEnd
    GUIDelete($GUI1)
EndFunc   ;==>Example
        
Func Example2()
    Local $ani1, $buttonstart, $buttonstop, $msg
    
    $GUI1 = GUICreate("My GUI Animation", 300, 200)
    $ani1 = GUICtrlCreateAvi(@SystemDir & "\shell32.dll", 150, 50, 10)

    $buttonstart = GUICtrlCreateButton("start", 50, 150, 70, 22)
    $buttonstop = GUICtrlCreateButton("stop", 150, 150, 70, 22)

    GUISetState()

    ; Run the GUI until the dialog is closed
    While 1
        $msg = GUIGetMsg()

        Select
            Case $msg = $GUI_EVENT_CLOSE
                ExitLoop
                
            Case $msg = $buttonstart
                GUICtrlSetState($ani1, 1)
                
            Case $msg = $buttonstop
                $HTTPOBJ = ObjCreate("MSXML2.ServerXMLHTTP")
                $HTTPOBJ.Open("GET", 'http://www.autoitscript.com/forum/index.php?showforum=2')
                $HTTPOBJ.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
                $HTTPOBJ.Send()
                $HTTPOBJGet = $HTTPOBJ.Responsetext
                GUICtrlSetState($ani1, 0)
                
        EndSelect
    WEnd
EndFunc   ;==>Example

Run the script, click start and then stop -> the AVI control will go on playing while sleep() is in action.

->> in the second example it'll get stuck... any way around it ?!


[u]My Au3 Scripts:[/u]____________(E)Lephant, A Share download manager (RS/MU etc)Http1.1 Console, The Ez Way!Internet Reconnection Automation Suite & A Macro Recording Tool.SK's Alarm Clock, Playing '.MP3 & .Wav' Files._________________Is GOD a mistake of the Humanity Or the Humanity is a mistake of GOD ?!

Share this post


Link to post
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
Sign in to follow this  
Followers 0