dao Posted September 14, 2007 Share Posted September 14, 2007 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 &? Link to comment Share on other sites More sharing options...
martin Posted September 14, 2007 Share Posted September 14, 2007 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 & chipsthen 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 More sharing options...
Zedna Posted September 14, 2007 Share Posted September 14, 2007 (edited) I didn't test it but try &&EDIT: martin beat me ;-) Edited September 14, 2007 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
ssubirias3 Posted September 14, 2007 Share Posted September 14, 2007 (edited) 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 September 14, 2007 by ssubirias3 Link to comment Share on other sites More sharing options...
dao Posted September 14, 2007 Author Share Posted September 14, 2007 I tried the '&&' and the chr(38) and neither seemed to work.(For a little background, the menu item is "Test & Copy") Link to comment Share on other sites More sharing options...
ssubirias3 Posted September 14, 2007 Share Posted September 14, 2007 (edited) I tried the '&&' and the chr(38) and neither seemed to work.(For a little background, the menu item is "Test & Copy")So WinMenuSelectItem(Title, Text, "Test " & Chr(38) & "C&opy") doesn't work? Edited September 14, 2007 by ssubirias3 Link to comment Share on other sites More sharing options...
dao Posted September 14, 2007 Author Share Posted September 14, 2007 That's correct... neither of the following worked: WinMenuSelectItem("title", "text", "Test && C&opy") WinMenuSelectItem("title", "text", "Test " & chr(38) & " C&opy") Link to comment Share on other sites More sharing options...
dao Posted September 14, 2007 Author Share Posted September 14, 2007 My apologies, the double ampserand (below) does work. I had an error in the another part of the indented menu structure. WinMenuSelectItem("title", "text", "Test && C&opy") Thanks all for your help! Link to comment Share on other sites More sharing options...
ssubirias3 Posted September 14, 2007 Share Posted September 14, 2007 (edited) 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 September 14, 2007 by ssubirias3 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now