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 

detect focus and speak with com

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



Joined: 19 Feb 2007
Posts: 338
Location: Czech Republic

PostPosted: Tue Aug 04, 2009 8:33 am    Post subject: detect focus and speak with com Reply with quote

Good afternoon.
I want detect focused guy example, button, edit, menu etc and speak it with sapi.
I use this:
Code:

#include com.ahk
COM_CoInitialize()
sapi:=COM_CreateObject("SAPI.SPvoice")
gui,add,button,vopen ggo,open
gui,add,button,gclose vclose,close
gui,show,,test
settimer,speaktext,2000
return

go:
COM_Invoke(sapi, "speak", "This is test only", "3")
return
close:
exitapp
return

speaktext:
    GUIControlGet Control, FocusV
if control=open
COM_Invoke(sapi, "speak",  control "button", "3")
else if control=close
COM_Invoke(sapi, "speak",  control "button", "3")
return



but this isn't good, because the timer speak the focused button again.
Exists some other method to detect focus and speak it?
_________________
Thanks.


Last edited by vlcek on Tue Aug 04, 2009 8:37 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
Hasso



Joined: 23 Mar 2005
Posts: 321
Location: Germany

PostPosted: Tue Aug 04, 2009 8:36 am    Post subject: Re: detect focus and speak with com Reply with quote

vlcek wrote:

I use this:
Code:


I can't find any code in your post Question
_________________
Hasso

Programmers don't die, they GOSUB without RETURN
Back to top
View user's profile Send private message
Display posts from previous:   
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