AutoHotkey Community

It is currently May 26th, 2012, 9:26 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: August 4th, 2009, 9:33 am 
Offline

Joined: February 19th, 2007, 9:03 am
Posts: 338
Location: Czech Republic
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 August 4th, 2009, 9:37 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
PostPosted: August 4th, 2009, 9:36 am 
Offline

Joined: March 23rd, 2005, 7:53 am
Posts: 321
Location: Germany
vlcek wrote:
I use this:
Code:

I can't find any code in your post :?:

_________________
Hasso

Programmers don't die, they GOSUB without RETURN


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], BrandonHotkey, wolverineks and 63 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group