Jump to content

'&' in Menu Item


dao
 Share

Recommended Posts

I have a menu item that uses an '&' in the actual menu text (in addition to an underlined character). Can someone tell me how to use the WinMenuSelectItem function with the two "flavours" of &?

I think I understand what you mean. If the menu item looks like this

fish & chips

then the actual text will be

&fish && chips

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

I have a menu item that uses an '&' in the actual menu text (in addition to an underlined character). Can someone tell me how to use the WinMenuSelectItem function with the two "flavours" of &?

What application is it that has the menu like this? Is it something you've created with Autoit? Also it would be helpful if you typed out an example like this:

Notpad has File

To use WinMenuSelectItem() I would use WinMenuSelectItem("Untitled - ", "", "&File")

Now if your application has &Menu1 then the code might be the following. At least that's what would make sense to me. Without more information that's the best I can offer at this time.

WinMenuSelectItem(Title, Text, Chr(38) & "Menu&1")

Edit: You guys are just too fast for me! :) I would be interested to see if both methods work.

Edited by ssubirias3
Link to comment
Share on other sites

That's correct... neither of the following worked:

WinMenuSelectItem("title", "text", "Test && C&opy")

WinMenuSelectItem("title", "text", "Test " & chr(38) & " C&opy")

Well I've searched several of my applications and I can't find an example that uses "&" as part of the menu text. My initial guess is that this is poor software design since its pretty standard that the & means something in Windows menu commands. The other thing to note is that I personally have found WinMenuSelectItem() a bit buggy. You can search the forum for "WinMenuSelectItem()" for a few of my posts including a feature request.

Probably the best alternative is to use ControlSend() or ControlClick() until enough people agree this is a problem and the dev team does something to fix it. If you feel passionate about it, you can always add your 2 cents on this tread.

Edit: good job getting it working. Both martin and Zedna are some of the best you'll find here.

Edited by ssubirias3
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...