Jump to content

Pause Function Until Messagebox is Clicked


Go to solution Solved by CharlieNoyes,

Recommended Posts

Hello all,

I have a question as to how to pause a function until someone hits "ok" on a messagebox (id:1). Here is the sample code that I put together but it does not run (throws errors related to either switch of a "bad function). Any advice or other implementation techniques? 

Func MsgWait()
    $input1 = MsgBox(0, "randometext", "loremipsum")
        Switch $input1
            Case 1
                Send("+{F10}")
                Send("i")
                Send("{Enter}")
                Send("{Enter}")
                Send("{Enter}")
                Send("{Enter}")
            EndSwitch
EndFunc

 

Edited by CharlieNoyes
Link to comment
Share on other sites

MsgBox, when it's called, will pause the script until the MsgBox function is ended. Here is a slightly modified version of the script you posted above.Operationally, except for the ouput, it is pretty much the same. And it works just fine for me.

MsgWait()
Func MsgWait()
    $input1 = MsgBox(0, "randometext", "loremipsum")
    Switch $input1
        Case 1
            ConsoleWrite("OK!" & @CRLF)
    EndSwitch
EndFunc
Edited by somdcomputerguy

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...