Jump to content
Sign in to follow this  
Negative1

close msgbox() with hotkey

Recommended Posts

Negative1

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
Negative1

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
picea892

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
Jos

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
  • Like 1

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
picea892

hehe, teach me to try stuff using esc

thanks...

Share this post


Link to post
Share on other sites
Negative1

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
TurionAltec

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  

×