Jump to content
Sign in to follow this  
automax2012

Force closing InputBox

Recommended Posts

automax2012

Hello friends,

I'm using HotKeySet("{ESC}", "MyExit") in my code to exit my script just by pressing ESC key.

I have noticed that if I have an inputbox waiting for some input text, even if I press ESC, my script still waits until the inputbox has been closed by OK button, after text has been entered, or by Cancel, and only then the ESC command will be executed, exiting the script.

Is there a way to force closing inputbox, by pressing ESC, when it is still waiting for text to be entered? (I cannot use Cancel button because I already use it to jump to the next input box in my script).

Thanks in advance for any reply

Share this post


Link to post
Share on other sites
notsure

Hmm, normally the program is frozen at Msgboxes also, so i can imagine it works the same for inputboxes.

Share this post


Link to post
Share on other sites
notsure

Maybe thats because MSGboxes are canceled when pressed ESC and inputboxes are not? I'm notsure :oops:

Share this post


Link to post
Share on other sites
automax2012

Right. It seems Msgbox can be forced to be closed, while InputBox not.

Share this post


Link to post
Share on other sites
JLogan3o13

Automax, the help file is your FRIEND. One of the parameters for InputBox (as well as MsgBox) is the timeout feature:

"How many seconds to wait before automatically cancelling the InputBox."

If you need the InputBox to time out if there is no input, this is the easiest way to accomplish it.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
automax2012

Thanks JLogan3o13, but I would need to force closing inputbox by my choice (pressing ESC), not by timeout. Any idea how to do that?

Share this post


Link to post
Share on other sites
bogQ

maby to make your own custom input box with GUI commands?


TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 

Share this post


Link to post
Share on other sites
automax2012

Thanks bogQ, you're right, that's probably would work. I was just wondering if it was doable using the standard inputbox.

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  

×