AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Make F6 press "OK" on any message box

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
fogus



Joined: 28 Mar 2007
Posts: 28

PostPosted: Tue Apr 15, 2008 3:23 am    Post subject: Make F6 press "OK" on any message box Reply with quote

Basically, I would like to be able to press F6 (or some hotkey) press the OK button in a message box (if there is an OK button).

Example: there is a really annoying Outlook message that says "Your IMAP server closed the connection. This can occur.. blah blah blah..."
There is an "OK" and a "Details" button. I want a hotkey to press that button what that message is in focus.

I am not aware of a way to navigate through buttons, but I think there must be one. Suggestions, anyone?
_________________
~fogus
Back to top
View user's profile Send private message
poetbox



Joined: 07 Jan 2007
Posts: 60

PostPosted: Tue Apr 15, 2008 3:54 am    Post subject: Re: Make F6 press "OK" on any message box Reply with quote

fogus wrote:
Basically, I would like to be able to press F6 (or some hotkey) press the OK button in a message box (if there is an OK button).

Example: there is a really annoying Outlook message that says "Your IMAP server closed the connection. This can occur.. blah blah blah..."
There is an "OK" and a "Details" button. I want a hotkey to press that button what that message is in focus.

I am not aware of a way to navigate through buttons, but I think there must be one. Suggestions, anyone?


I'v been made a program Named AutoOk that can do this.First get the active window ,then find the button control,3rd find ok-yes-finish and so on,4th get the control position,5th click it at once.I also make it can autoclick the next-Iagree-etc to help me install program.The new vervion of it I let it close some known windows that contain my defined title,and tell it donot click some button I define. It does well.I haven't English version.I donnot write it by AHK.You can follow this guide to make you own.
Back to top
View user's profile Send private message
fogus



Joined: 28 Mar 2007
Posts: 28

PostPosted: Tue Apr 15, 2008 4:15 am    Post subject: Reply with quote

Quote:
I haven't English version

That's quite all right. Thanks for the info.

Did you use the AutoHotkey language to write this program?

Isn't there something like:
Code:
buttonpress, "OK"

Please?
_________________
~fogus
Back to top
View user's profile Send private message
tank



Joined: 21 Dec 2007
Posts: 1033

PostPosted: Tue Apr 15, 2008 4:28 am    Post subject: Reply with quote

get the classnn with windowspy
than you can use controlclick
_________________
Read this
Com
Automate IE7 with Tabs
Back to top
View user's profile Send private message
poetbox



Joined: 07 Jan 2007
Posts: 60

PostPosted: Tue Apr 15, 2008 4:30 am    Post subject: Reply with quote

I wrote the program long ago before I knew AHK.But you can use AHK' ControlClick to do this,I think so.
Back to top
View user's profile Send private message
[VxE]



Joined: 07 Oct 2006
Posts: 1494

PostPosted: Tue Apr 15, 2008 6:46 am    Post subject: Reply with quote

Code:
msgbox Press F6 to close this window
F6::
ControlGet, hwnd, hwnd,, OK, A
ControlClick, , Ahk_ID %hwnd%
return
Very Happy
_________________
My Home Thread
More Common Answers: [1]. It's in the FAQ [2]. Ternary ( a ? b : c ) guide [3]. Post code inside [code][/code] tags !
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group