WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Functions

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

SendMenusTo Not Working

Keywords:  SendMenusTo 1317 PostMessage Manifest

Question:

Any idea why from the winbatch interpreter this line works fine but once compiled I get this error message. 1317: SendMenusTo PostMessage Failed?

Answer:

The code should work the same interpreted as it does compiled. What windows platform are you running on. Keep in mind that you can define the manifest settings for your compiled exes. By default the WinBatch interpreter uses the manifest setting : HighestAvailable/TRUE.

User Reply:

Thanks for the help. I’m working on W2008R2 SP1. Changing the settings from AsInvoker to HighestAvailable made the compiled version run as the interpreted one.


Question:

We use Winbatch and SendMenusTo to control menus in a product called Open Insight. They just made some changes to there product and WinBatch stopped working (or SendMenusTo did). I asked them for help. They asked the following: Can you contact WinBatch and ask if their product supports scripting OwnerDrawn menus?

Answer:

WinBatch does not support owner drawn menus. The reason for that is simple. The data associated with the menu item is application-defined instead of it being a text string. WinBatch has no way of knowing how to interpret the data.


Question:

I am trying to use the SendMenusTo command with Microsoft Word97 and MSOFFICE 97 (Specifically Extra )(WinNT) and it tells me that the Window menu not accessible.

I'm trying to send menus to the MS Internet Explorer, as in:

        SendMenusTo("~Microsoft Internet Explorer", "Help Help Topics")
works as expected. But
        SendMenusTo("~Microsoft Internet Explorer", "View Options")

doesn't. What's going on?

Also, I am having trouble with the SendMenusTo failing to execute with MS Word. The interesting part is that if the Word window does not exist and my process opens it up before doing the send menu, it works. But if the window already exists, Word acts like it never saw the commands.

Answer:

Yes. Word menus are strange and unreliable. Use SendKeysTo instead.

The problems is that sometimes the menu items are NOT there until you click on the menu, and then Word rapidly makes and displays them. This will make SendMenusTo fail. So use SendKeysTo instead.

Some applications, especially the new ones out of Microsoft build menus "on the fly" when you click on the menu item. The problem is that the menu item simply does not exist (sometimes) when you do the SendMenusTo, so we can't find it. Your only recourse at this point is to use SendKeysTo instead.

A lot of the menu items in Office 95/97 (in Word, Excel, PPT, etc.) don't actually exist until you pull down the menu item. Then Word (or whatever) scurries around and builds the menu. As a consequence, they don't actually exist for a SendMenusTo.

In addition, we're having problems with the SendMenus functions in Windows98. It seems most of the new Microsoft stuff does not even use real menus anymore (as defined by the WIndows API) but rather some text based button bar instead.

It seems we can see the menus in *some* applications but not others. So we're still kicking it around.

Question (thread continued):

How can I send the ALT+key combinations that I need to access the menu using SendKey?

Answer:

Assuming you want to access File Open it would be something like:
	SendKeysTo("Microsoft Word","!fo")

Article ID:   W13110
Filename:   SendMenusTo Not Working.txt
File Created: 2013:09:10:08:09:50
Last Updated: 2013:09:10:08:09:50