Continue running script after displaying message issues.

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
codude
Posts: 128
Joined: 12 Nov 2015, 05:33

Continue running script after displaying message issues.

Post by codude » 30 Jun 2022, 11:39

Hello, I found this script within the forum to display a message while the script continues to run. To test it I added soundbeeps. I was expecting 2 quick sound beep’s, the message being displayed and then quickly 3 more soundbeeps. I’m getting 3 quick soundbeeps followed by the message appearing and then nothing happens until the message times out at 10 seconds and then I get 2 more quick soundbeeps. Apparently the first sound beep after the message is being run before the message can display but once the message appears the script stop for 10 seconds. What am I doing wrong? Thanks.

Code: Select all

=::
Soundbeep
Soundbeep
SetTimer, showmessage, -10
;program code continues execution
Soundbeep
Soundbeep
Soundbeep
return

showmessage:
    msgbox, , , This is message, 5
return
[Mod edit: [code][/code] tags added.]

User avatar
mikeyww
Posts: 26884
Joined: 09 Sep 2014, 18:38

Re: Continue running script after displaying message issues.

Post by mikeyww » 30 Jun 2022, 12:57

If you want something to happen after the MsgBox is closed, then put it after the MsgBox command.

codude
Posts: 128
Joined: 12 Nov 2015, 05:33

Re: Continue running script after displaying message issues.

Post by codude » 30 Jun 2022, 16:34

Looking at this I may have not explained it well. I want something to happen while the message is being displayed. In my sample script I would want 5 soundbeeps In quick succession with the message displaying for 5 seconds after the second soundbeep. Basically I want to display a message without delaying the progression of my script.

teadrinker
Posts: 4326
Joined: 29 Mar 2015, 09:41
Contact:

Re: Continue running script after displaying message issues.

Post by teadrinker » 30 Jun 2022, 17:15

Just use the Gui instead of the MsgBox.

Post Reply

Return to “Ask for Help (v1)”