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 

Filling a menu in a loop

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Jon



Joined: 28 Apr 2004
Posts: 373

PostPosted: Thu Jul 01, 2004 12:27 am    Post subject: Filling a menu in a loop Reply with quote

Hi, I am trying to get the "clipboard manager" I made before to work with the menu that that is now built into autohotkey so that it will work on more operating systems and the size of text you set in display properties doesn't affect it.

One thing I have got stuck with is if you fill up a menu in a loop, is there any way to tell which button was clicked? Or getting the name of the button that was clicked?

e.g.

Code:

Loop, %word_array0%
{
StringTrimLeft, word_array, word_array%a_index%, 0

menu, MenuSelection, Add, %word_array%, Label
}


I was thinking of something like having a variable that would be equal to 1 if the first button was pressed etc.

Thanks, Acsell
Back to top
View user's profile Send private message Send e-mail
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10465

PostPosted: Thu Jul 01, 2004 2:27 am    Post subject: Reply with quote

The built-in variables A_ThisMenuItem and A_ThisMenu contain the names of the menu item most recently selected, and the menu from which it was selected (TRAY in many cases). Hopefully that will be enough to do what you need.
Back to top
View user's profile Send private message Send e-mail
Jon



Joined: 28 Apr 2004
Posts: 373

PostPosted: Thu Jul 01, 2004 5:06 pm    Post subject: Reply with quote

That's great, thanks. I forgot about those variables.
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 -> Ask for Help 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