Jump to content
Sign in to follow this  
RichardDouwes

How to stop ESC from sending $GUI_EVENT_CLOSE

Recommended Posts

This might be a stupid question (I'm new), but is there a way to stop ESC from sending the $GUI_EVENT_CLOSE message?

I believe I read somewhere that the AutoIt GUI is basically a dialog, so an ESC *should* send a CLOSE message, but if it wouldn't, the GUI would look a bit more like a "real" window.

Again, maybe this is a stupid question, but a normal/"real" window shouldn't close with just an ESC, should it? (Try it...)

Thanks,

Richard

Share this post


Link to post
Share on other sites

HotKeySet('{ESC}', 'DummyFunc')

Func DummyFunc()
; Do nothing, or maybe something depending on what you want
EndFunc

That will catch the escape key and keep it from sending to your GUI. The only problem is that this catches the key whether the GUI is focussed or not. You'd best have a loop checking to see if your GUI window is active, and if it is then set the hotkey, and if not then unset it.

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...