vlcek
Joined: 19 Feb 2007 Posts: 338 Location: Czech Republic
|
Posted: Tue Aug 04, 2009 8:33 am Post subject: detect focus and speak with com |
|
|
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 |
|