SendMenusTo

Started by cheggp, September 04, 2013, 03:58:54 PM

Previous topic - Next topic

cheggp

I have a winbatch program that I use on two XP's to control an instrument by controlling a third party application.  I am building a third one now using WIN7.  I cannot get the SendMenusTo command to work, everything else seem to work.  Window name is not recognized in spite the winActivate.  Is there a workaround?

Deana

Which version of WinBatch are you running? What is the exact error?

Do you have a WinWaitExist to wait for the windowname? SendMenusTo attempts to wait until the specified application window is ready to accept input (like SendKey[..] does). This can be disabled with IntControl 43.

Note 1: "windowname" is the initial part of a window name, and may be a complete window name. It is case-sensitive. You should specify enough characters so that "windowname" matches only one existing window. If it matches more than one window, the most recently accessed window which it matches will be used.

Note 2: SendMenusTo does not work with all applications. If you get a 'windows menu not accessible' error, SendMenusTo will not work with that application. 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. Use SendKeysTo instead.

Some applications build menus "on the fly" when you click on the menu item. The problem is that the menu item simply does not exist  when you call the SendMenusTo, so we can't find it. Your only recourse at this point is to use SendKeysTo instead.
Deana F.
Technical Support
Wilson WindowWare Inc.