Sign in to follow this  
Followers 0
Negative1

close msgbox() with hotkey

8 posts in this topic

Is it possible to close a msgbox with a hotkey? I used winclose in a function however it seams the function does not get called until the user closes the msgbox.


What are we going to do tonight Brain?Same thing we do every night Pinky try to automate the world.

Share this post


Link to post
Share on other sites



why would you want to close you own created msgbox.??

I want to put some troubleshooting hotkeys into my program. EG: press control + ~ and it closes the normal "user" screens and goes into troubleshooting mode.


What are we going to do tonight Brain?Same thing we do every night Pinky try to automate the world.

Share this post


Link to post
Share on other sites

It appears autoit msgbox always has a class of #32770

This works for me

#Include <Misc.au3>

$dll = DllOpen("user32.dll")

MsgBox(0,"","I LOVE AUTOIT")

While 1

; esc

if _IsPressed("1B", $dll) then winclose("[class:#32770]","")

sleep(100)

WEnd

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

That Hotkey doesn't do didly.

try this one liner script: MsgBox(0, "", "I LOVE AUTOIT")

run it and hit ESC. same result.

MsgBox() is a blocking Function so cannot be closed with a hotkey. Build your own GUI msgbox if anything like this is required.

Jos

Edited by Jos
1 person likes this

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

hehe, teach me to try stuff using esc

thanks...

Share this post


Link to post
Share on other sites

That Hotkey doesn't do didly.

try this one liner script: MsgBox(0, "", "I LOVE AUTOIT")

run it and hit ESC. same result.

MsgBox() is a blocking Function so cannot be closed with a hotkey. Build your own GUI msgbox if anything like this is required.

Jos

ugh good grief....

thanks Jos


What are we going to do tonight Brain?Same thing we do every night Pinky try to automate the world.

Share this post


Link to post
Share on other sites

Alternatively you could compile the script as a console app, then spew output to the console window using consolewrite()

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