Microsoft Knowledge Base
WMenu, XSelectMenuItem Routines Fail with Some Applications
Last reviewed: October 19, 1994
Article ID: Q93191
The information in this article applies to:
- Microsoft Test for Windows, version 1.0
SYMPTOMS
The WMenu or XSelectMenuItem routines in Microsoft Test may fail to activate the desired menu on some Windows applications. For example, WMenu does not work reliably on the Paintbrush application provided with Windows, version 3.1.
RESOLUTION
To work around this problem, you can first pull down one of the application's menus, either by sending the appropriate accelerator keystroke, or queuing a mouse click event that clicks the menu. Once any menu is active, the WMenu and XSelectMenuItem routines work reliably.
STATUS
Microsoft has confirmed this to be a bug in Microsoft Test version 1.0 for Windows. This bug was corrected in Microsoft Test version 2.0 for Windows.
MORE INFORMATION
The following example test script demonstrates both the problem and the workaround:
'$define TESTCTRL '$define TESTEVNT '$include: 'MSTEST.INC'
Run "PBRUSH.EXE", Nowait
' This fails to activate the file menu or bring up the 'Open file' ' dialog box.
WMenu "&File" WMenu "&Open..."
Pause "Click 'OK' to correctly activate the menu"
' To work around this problem, send the appropriate ' accelerator to activate any menu, then call WMenu.
DoKeys "%h" ' Pull down the Help menu. WMenu "&File" WMenu "&Open..."
Additional reference words: buglist1.00 fixlist2.00 1.00 buglist1.00 Last reviewed: October 19, 1994 |