Jump to content

close msgbox() with hotkey


Recommended Posts

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.

Link to comment
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.

Link to comment
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

Link to comment
Share on other sites

  • Developers

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

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

Link to comment
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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...