AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Does Menu "x" exist?

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> General Chat
View previous topic :: View next topic  
Author Message
bLisTeRinG



Joined: 15 Nov 2004
Posts: 45
Location: Warrnambool

PostPosted: Sun Jan 09, 2005 10:39 am    Post subject: Does Menu "x" exist? Reply with quote

I'm putzing around with a File/Folder menu which is absolutly [b]Brilliant[/b].

[i]Except [/i]I've got all these same-name folders, and they end up in each others sub-menus.

If only I could find out whether or not they exist.
Like some imaginary ...
"[b]Loop, Menu, %MyMenuName%[/b]"
...command.

Anyone worked this out?
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10467

PostPosted: Sun Jan 09, 2005 3:24 pm    Post subject: Reply with quote

Although I don't understand the exact nature of the problem, you can detect whether a menu exists by trying a harmless command on it while UseErrorLevel is in effect. For example:
Code:
Menu, Tray, UseErrorLevel   ; This affects all menus, not just the tray.
Menu, MyMenu, NoDefault
if ErrorLevel <> 0
    MsgBox That menu does not exist.

Similarly, to detect whether a menu item exists, try a harmless command on it:
Code:
Menu, MyMenu, Uncheck, MyMenuItem
if ErrorLevel <> 0
    MsgBox That menu item does not exist.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> General Chat All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group