Dialog Box Results in Message from Phython

With DNS 9.5 running, and Vocola, if a WordPerfect macro calls a dialog box, I get the following message from Python, in a window entitled "Messages from Python Macros"

202, in beginCallback
self.callIfExists( "gotBegin", (moduleInfo,) )
File "C:\PROGRA~1\NatLink\macrosystem\core\natlinkutils.py", line
213, in callIfExists
else: apply(func, argList)
File "C:\PROGRA~1\NatLink\macrosystem\wpwin12_vcl.py", line 240, i
gotBegin
self.activate(rule,window)
File "C:\PROGRA~1\NatLink\macrosystem\core\natlinkutils.py", line
404, in activate
self.gramObj.activate(ruleName,window)
natlink.BadWindow: The handle 331268 does not refer to an existing
window

and the focus of Windows 2000 switches to this message window.

Is there anyway to avoid this message and switching of focus?
Obviously, Natlink is not prepared for this dialog box window to come up, but is there some way to register the dialog box window so that Natlink does not object?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Hello, what is happening

Hello, what is happening exact?

1. You call the dialog box from a vocola command? What happens next?
-Speech is heard in the dialog box?
-Some HeardWord command is used inside the dialog box?
-Keystrokes and speech is done intermittently?

2. Possibly the windows handle is not recognised because it is an invalid number
-maybe a number above 32767?
-Maybe the windows handle changed during the command, and the new call (possibly from inside the macro) expects the old handle.
-windows "policy" during commands execution should be studied more carefully in some situations.

3. Another thing is that it would be best to restrict (by default, or by windows selector) vocola commands to "top" windows only. So when you are in a dialog ("child") window the grammar will not be activated. I am discussing this feature with the vocola developers.

4. You can make your commands window dependent (on the main window only) by specifying some constant (and unique) word of the title bar, maybe "wordperfect" in your case, so:

wordperfect:
  command = action;
  etc ...

Note: these window title words are case independent!

Quintijn

Dialog Box Results in Message from Phython

Thank you for your reply.

The dialog box is strictly produced by keystrokes made in WordPerfect. When I type the keystokes, it calls a macro which produces a dialog box in which I type keystokes (or would type keystrokes, except that Phython shifts the focus to its message window, and away from the dialog box), and the macro is suppossed to do different things (upon striking the Entery key) depending on what is typed in the box.
The dialog box in WordPerfect may possibly be produced by the WordPerfect macro program "PerfectScript" (ps120.exe) that runs as a process in a hidden window in the background.

What actually happens when Vocola is running is that when the keystokes are typed that bring up the dialog box, the Phython message appears, and the focus switches to that message. This happens even when the microphone in DNS is in the "asleep" mode. Thus, I am forced to exit DNS to use WordPerfect.

Restricting all vocola WordPerfect commands to windows that start with "WordPerfect" might work (although it would be tedious to have to insert that in all commands in wpwin12.vcl), except what about Global commands that I would want to always be available? Vocola/phyton would still be there listening for Global commands.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.




view recent posts