Jump to content
Sign in to follow this  
CharlieNoyes

Pause Function Until Messagebox is Clicked

Recommended Posts

CharlieNoyes

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

Share this post


Link to post
Share on other sites
somdcomputerguy

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.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.