Hi All,
I am trying to use the FilterBy parameter of the registerHotkey property and it 
doesn't seemed to work for me. The following snippet should be able to detect 
that the notepad window is active and say "this is notepad" only and only when 
the notepad window is active, but at present this snippet says "this is 
notepad" when any application is active. I only want the hotkey to fire when 
notepad is active, so how do I set this parameter.
Begin VBScript:
' keyboard example using the FilterBy parameter
Dim myHotkey 
Set myHotkey = Keyboard.RegisterHotkey("h", "HandleKey", 
ActiveWindow.Children.FilterByClassAndModule("Edit", "NOTEPAD"))
Sub HandleKey()
Speak "this is notepad"
End Sub
Warm regards.
Martin Webster.

Reply via email to