There has been some noise on this mailing list about the limitations of the
command and control environment in Dragon NaturallySpeaking Deluxe compared
to that of DragonDictate for Windows. It is difficult for me to understand
the specific areas in which people are having problems. However, I suspect
based on some previous notes that one of the issues is the lack of the
commands like "SetHomeGroup" in Dragon NaturallySpeaking.
In this note, I'm going to document the simple way to do the same type of
command switching that you can do in DragonDictate for Windows using the
command SetHomeGroup.
In Dragon NaturallySpeaking, the concept of a group maps to a said commands
which are all active when a specific window title is active. For example,
if you use the Edit Command Wizard, you can see that for the application
"Dragon NaturallySpeaking", there are three groups defined: "Dragon
NaturallySpeaking", "Mouse Grid", and "Correction".
"Dragon NaturallySpeaking" contains the command which are active when the
main Dragon NaturallySpeaking editing window is active. Dragon
NaturallySpeaking switches to the set of commands because the caption of
the currently active window (Dragon NaturallySpeaking) contains the string
"Dragon NaturallySpeaking". The group "Correction" contains the commands
which are active when the Correction Dialog is on the screen because the
Correction Dialog has the window caption "Correction".
Therefore, in order to create group of commands for Dragon
NaturallySpeaking Deluxe Edition, it is only necessary to use the new
command Wizard and type in the name of your group as the "title of the
target window or dialog box".
Then, to force Dragon NaturallySpeaking to activate the commands in your
group, your active window must have the name of your group in its title
bar.
Introducing SetTitle. SetTitle is a very simple module which I have
written which will actually change the current title of the currently
active window.
For people who access to a C or C++ compiler, I have attached the source
code for the module SetTitle. For people who do not have access to a
compiler, Susan Fulton has agreed to try to add a pointer to the SetTitle
code (settitle.zip) on her http://www.out-loud.com Web page.
Joel Gould
joelg@@alum.mit.edu
---------Documentation--------------------------------------
Here is a module called "SetTitle.dll". This module allows you to change
the title of the currently active window. You may recall that the title of
the currently active window is used by Dragon NaturallySpeaking to
determine which list of commands is currently active. If you change the
title of the currently active window, for some application, then you can
change the list of commands which Dragon NaturallySpeaking make active.
I'm providing this module for users of Dragon NaturallySpeaking to use at
your own risk. I have included both the executable code and the source
code in the file SetTitle.zip.
You can call SetTitle.dll using Dragon NaturallySpeaking scripting language
command "DllCall". As an example, the following macros demonstrate how use
SetTitle.
First, copy SetTitle.dll to your Windows directory. (You can actually use
any directory, but I am using the Windows directory in this example.)
Now, create a macro called "Special Mode" which runs the following
scripting line:
DllCall "C:\Windows\SetTitle.dll", "SetTitle", "Special Mode"
The third argument is the new caption for the currently active window.
When you say the command "Special Mode", the caption of your currently
active window (the Dragon NaturallySpeaking editor window in this example)
will change to be "Special Mode".
Now, you can create a macro called "Test Macro" which is only active when
the window caption is " Special Mode". For example, here is a "Test
Macro":
SendKeys "See, it works."
Finally, create a macro called "Normal Mode" to restore things to the way
they were before. "Normal Mode" needs to run the following scripting
command:
DllCall "C:\Windows\SetTitle.dll", "SetTitle", " Dragon
NaturallySpeaking"
To test this say "Test Macro". You'll notice the text "test macro" is
typed. Now say "Special Mode". This changes the caption of Dragon
NaturallySpeaking. Now say "Test Macro", and your new macro will execute.
Finally, say "Normal Mode" and the caption will change back to "Dragon
NaturallySpeaking", and your usual set of commands will return.
(Yes, I know that this sequence will cause the current document name to be
dropped from the caption until you save your file. But this side effect
will not cause any problems.)
Given this basic example, the clever developers among you should be able to
significantly enhance the macro capabilities of Dragon NaturallySpeaking
Deluxe Edition.
IMPORTANT: SetTitle is not a product from Dragon Systems were any other
company. There is no support for SetTitle. Use this program at your own
risk. I am officially placing SetTitle in the public domain. You may
freely copy this program and use it as you would like. The program carries
no warranties implied or otherwise.
---------Source Code: SetTitle.cpp--------------------------------------
#include <windows.h>
extern "C"
int APIENTRY DllMain( HINSTANCE, DWORD, LPVOID )
{
return 1; // ok
}
extern "C"
int WINAPI SetTitle( LPSTR pszCaption )
{
HWND hWnd = GetForegroundWindow();
if( IsWindow( hWnd ) && pszCaption != NULL )
{
SetWindowText( hWnd, pszCaption );
}
return 0;
}
---------Source Code: SetTitle.def--------------------------------------
LIBRARY SetTitle
DESCRIPTION 'Change active window title'
SECTIONS
EXPORTS
SetTitle @@1
---------End of Source Code--------------------------------------
![]() |