Sign in to follow this  
Followers 0
lopolop

GUI Loop problem..

9 posts in this topic

ok i cant figure out what to do.. so i have a normal GUI that works good, if i hit Ext, File>Exit, or A Exit button it works, then if i hit start it all goes well.. but when i hit start i disable all buttons except for one.. i enable, and then run a loop, my GUI becomes unresponisve.. so then i add like If $Msg = $GUI_Button Then Exit, still nothing happens, i dont under stand why it doesnt work..


Share this post


Link to post
Share on other sites



I think its line 60 that is causing the problem .. :D

60's fine, its like 142 thats the real problem. Could be the magic ball is acting up tho :)

Share this post


Link to post
Share on other sites

Well, the entire syntax is wrong for the first 14 lines, but i must say your formatting is beautiful.

(Just in case you don't get it, we need to see your code... :):D )

Share this post


Link to post
Share on other sites

yeah i no.. lol sorry ill post it once i get home >.<


Share this post


Link to post
Share on other sites

ok here is some code..

While 1
    $Msg = GUIGetMsg()
        ; ##"Exit"##
        If $Msg = $GUI_EVENT_CLOSE Then Exit
        If $Msg = $GUI_Func_Exit Then Exit
        If $Msg = $GUI_Menu_File_Exit Then Exit
        ; ##########
        If $Msg = $GUI_Func_Start Then
            Start()
        EndIf
        If $Msg = $GUI_Func_Stop Then Exit  
WEnd
;Ok so now i hit $GUI_Func_Start...
Func Start()
    Disable()
    GUICtrlSetData($GUI_Status, "Running")
    While 1
        Sleep(.05)
        If _IsPressed(10, $dll) Then
                $pos = MouseGetPos()
                $coord = PixelSearch(($pos[0] - 50) , ($pos[1] - 50) , ($pos[0] + 50) , ($pos[1] + 50), $AIMCOLOR, 15)
                If IsArray($coord) = 1 Then
                    MouseMove($coord[0], $coord[1], 0)
                EndIf
        EndIf
        If $Msg = $GUI_EVENT_CLOSE Then Exit
        If $Msg = $GUI_Func_Stop Then Exit  
    WEnd
EndFunc
Func Disable()
    GUICtrlSetState($GUI_Func_Start, $GUI_DISABLE)
    GUICtrlSetState($GUI_Func_Exit, $GUI_DISABLE)
    GUICtrlSetState($GUI_Func_Stop, $GUI_ENABLE)
EndFunc
;Now $GUI_Func_Stop wont work...

Share this post


Link to post
Share on other sites

ooo i see ok thanks.. i didnt realize that the $msg didnt work for that function..


Share this post


Link to post
Share on other sites

ooo i see ok thanks.. i didnt realize that the $msg didnt work for that function..

Do you actually understand ? GUIGetMsg is in an entirely different loop and since it isn't called in the active loop

then you can't expect AutoIt to update $msg automagically for you.

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