Sign in to follow this  
Followers 0
BALA

Beep when dialog box pops up

10 posts in this topic

#1 ·  Posted (edited)

I was thinking something like this:

MsgBox(64, "Ring! Ring!", "The time is currently: ")
While 1
    If WinExists("Ring! Ring!") = 0 Then
        ExitLoop
    EndIf
    Beep(500, 500)
    Sleep(10)
WEnd

But it waits for the dialog box to close before it starts the beeping. Any ideas?

Edited by BALA

[font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com

Share this post


Link to post
Share on other sites



MsgBox pauses the execution of the script, which is kind of logical if you think about it.

If AutoIt followed your logic the script below would require some keen senses from the

user's side...

$answer = MsgBox(36, "Question", "Yes or no ?")

If $answer = 6 Then
    ; yes
EndIf

Share this post


Link to post
Share on other sites

MsgBox pauses the execution of the script,...

...but if you really want a MsgBox to do what is requested in the OP, you can do it. Offload either the MsgBox of the Beeping to a child script.

TrayTip, ToolTip, SplashScreen, ... would be easier.


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

Cheap workaround

$answer = -1
While $answer = -1
    Beep(500, 500)
    Beep(500, 500)
    $answer = MsgBox(64, "Ring! Ring!", "The time is currently: ",5)
WEnd

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Run(@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(64, ""Ring! Ring!"", ""The time is currently: "")"')

WinWait("Ring! Ring!")

While 1
    If WinExists("Ring! Ring!") = 0 Then
        ExitLoop
    EndIf
    Beep(500, 500)
    Sleep(10)
WEnd

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

Run(@AutoItExe & ' /AutoIt3ExecuteLine "MsgBox(64, ""Ring! Ring!"", ""The time is currently: "")"')

WinWait("Ring! Ring!")

While 1
    If WinExists("Ring! Ring!") = 0 Then
        ExitLoop
    EndIf
    Beep(500, 500)
    Sleep(10)
WEnd
Will this work on a client without AutoIt installed? All my PCs have autoit installed.

Share this post


Link to post
Share on other sites

Will this work on a client without AutoIt installed? All my PCs have autoit installed.

Yes. I was pretty sure that it would - so, I uninstalled AutoIt and tested it. It works just fine.

This from the help file under "Running Scripts":

Execute another script file from a compiled AutoIt3 Script File. Then you don't need to fileinstall another copy of AutoIT3.exe in your compiled file.

It is true for execute line as well.

[size="1"][font="Arial"].[u].[/u][/font][/size]

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