Sign in to follow this  
Followers 0
PcExpert

Do something while n msgbox is displayed

8 posts in this topic

Hi all,

How can I let the script do something while an msgbox is displayed?

I tried this:

while MsgBox(64, "test", "test")

Run("notepad.exe")

WinWaitActive("Naamloos - Kladblok")

Send("yreeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeefddddddddddddddddddfdgwrgwgwrgwrgwrgwrg")

WEnd

But that didnt work. Any Ideas? Thanks!

Share this post


Link to post
Share on other sites



Easy answer is you cannot.

You can do what you are describing with a GUI that you create.

The msgbox is just a small gui... so if you make your own, you could have your own code running while its up

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Hi all,

How can I let the script do something while an msgbox is displayed?

I tried this:

But that didnt work. Any Ideas? Thanks!

Put it in a func ;example

instead of a action being done and sending

CODE

Msgbox(64,'test','test')

;

;Just send

;

Mes()

and add func

CODE

func Mes()

MsgBox(64, "test", "test")

Run("notepad.exe")

WinWaitActive("Naamloos - Kladblok")

Send("yreeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeefddddddddddddddddddfdgwrgwgwrgwrgwrgwrg")

endfunc

PS i suck at codeboxes

Edited by lordicast

[Cheeky]Comment[/Cheeky]

Share this post


Link to post
Share on other sites

@lordicast, sorry but that does not help the problem, now the msgbox just hangs in the function...

He is looking for a way to execute code while the msgbox is up I believe, and to do that you need to make your own GUI

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

@lordicast, sorry but that does not help the problem, now the msgbox just hangs in the function...

Works just fine for me.

Func Mes()
MsgBox(64,'test','test')
run('notepad.exe')
WinWaitActive('Untitled - Notepad')
Send("yreeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeefddddddddddddddddddfdgwrgwgwrgwrgwrgwrg")
EndFunc

But I think if a Msgbox is up you cant get to anything else on the gui till you closed it right, so its gonna close at one point then why not send somthing after the box is closed. makes sense

Edited by lordicast

[Cheeky]Comment[/Cheeky]

Share this post


Link to post
Share on other sites

How can I let the script do something while an msgbox is displayed?

Your function just does the same thing his script does... it waits until AFTER the msgbox is gone to continue...

No it does not do what he wants.

He wants a message box to be up, and to perform lines of code WHILE the msgbox is up... your code does NOT do that.

Share this post


Link to post
Share on other sites

This was the solution from my previous post:

Run(@AutoItExe & ' /AutoIt3ExecuteLine  "If MsgBox(262209,''Ready to Re-Start'',''The Installation is completed and ready to re-start.     '' & @CRLF & @CRLF & ''Press OK to restart now.'' & @CRLF & @CRLF) = 1 Then Shutdown(6)"')

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