Jump to content

Recommended Posts

Posted (edited)

I've been fumbling around with my script for the past hour and I can't get GUIGetMsg() to return anything from my GUI, so it just keeps looping and won't let me close it unless I end task.

Func Aboutbox()
    TrayItemSetState($tray1, $TRAY_UNCHECKED)

    $Aboutbox = GUICreate("About MyProgram", 254, 223, Default, Default)
    $objIE = _IECreateEmbedded()
    GUICtrlCreateObj($objIE, 0, 0, 254, 177)
    _IENavigate($objIE, "res://" & @AutoItExe & "/ABOUT")
    $AboutBoxBtn = GUICtrlCreateButton("OK", 89, 189, 75, 23, $WS_GROUP)
    GUISetState(@SW_SHOW)

    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
            Case $AboutBoxBtn
                ExitLoop
        EndSwitch
        Sleep(45)
    WEnd
    _IEQuit($objIE)
    GUIDelete($Aboutbox)
EndFunc   ;==>Aboutbox

Anybody know why this won't work?

Edited by Tachibanya
Posted

You're probably running OnEventMode, but it's hard to tell when you provided nothing for us to work on. Show us some code that actually runs and fails and we can help you.

In the future when asking for help, please write a short runnable/working reproducer (example) so we don't have to make wild guesses (like I did here). As a bonus you will see that you often find the solution when writing the reproducer.

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
×
×
  • Create New...