AutoHotkey Community

It is currently May 26th, 2012, 1:36 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Tray menu
PostPosted: December 3rd, 2008, 2:30 pm 
Offline
User avatar

Joined: August 4th, 2008, 1:22 pm
Posts: 241
Location: UK
hey this is relly bugggin me it keeps saying calling to nonexisting fuction i tried everything it just wont work.. what am i doing wrong?

Code:
#Persistent


TrayMenu() {
Global
   Menu("Tray","Add","Task Mgr","Task")
}
Return

Task:
Run, taskmgr
Return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 3rd, 2008, 2:37 pm 
Offline
User avatar

Joined: May 10th, 2007, 10:54 am
Posts: 649
Location: .switzerland
Function "Menu" doesn't exist. So you can't call it... what would you do?

_________________
http://securityvision.ch
AHK 2D GAME ENGINE


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 3rd, 2008, 2:39 pm 
Offline
User avatar

Joined: August 4th, 2008, 1:22 pm
Posts: 241
Location: UK
Oh i get it.. but i still dont get how to write this simple code.. basically i want a tray icon and when i right click it a menu comes up that shows a personalized list...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 3rd, 2008, 2:56 pm 
Offline
User avatar

Joined: May 10th, 2007, 10:54 am
Posts: 649
Location: .switzerland
try this:
Code:
; EXAMPLE #3: This is a working script that demonstrates some of the various menu commands.

#Persistent
#SingleInstance
menu, tray, add ; separator
menu, tray, add, TestToggle&Check
menu, tray, add, TestToggleEnable
menu, tray, add, TestDefault
menu, tray, add, TestStandard
menu, tray, add, TestDelete
menu, tray, add, TestDeleteAll
menu, tray, add, TestRename
menu, tray, add, Test
return

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

TestToggle&Check:
menu, tray, ToggleCheck, TestToggle&Check
menu, tray, Enable, TestToggleEnable ; Also enables the next test since it can't undo the disabling of itself.
menu, tray, add, TestDelete ; Similar to above.
return

TestToggleEnable:
menu, tray, ToggleEnable, TestToggleEnable
return

TestDefault:
if default = TestDefault
{
    menu, tray, NoDefault
    default =
}
else
{
    menu, tray, Default, TestDefault
    default = TestDefault
}
return

TestStandard:
if standard <> n
{
    menu, tray, NoStandard
    standard = n
}
else
{
    menu, tray, Standard
    standard = y
}
return

TestDelete:
menu, tray, delete, TestDelete
return

TestDeleteAll:
menu, tray, DeleteAll
return

TestRename:
if NewName <> renamed
{
    OldName = TestRename
    NewName = renamed
}
else
{
    OldName = renamed
    NewName = TestRename
}
menu, tray, rename, %OldName%, %NewName%
return

Test:
MsgBox, You selected "%A_ThisMenuItem%" in menu "%A_ThisMenu%".
return
:arrow: http://www.autohotkey.com/docs/commands/Menu.htm

_________________
http://securityvision.ch
AHK 2D GAME ENGINE


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 4th, 2008, 11:13 pm 
Offline
User avatar

Joined: August 4th, 2008, 1:22 pm
Posts: 241
Location: UK
Thanks, Any idea how to hide the default menu items

Open
Help
<Seperator>
Window Spy
Reload This Script
Edit This Script
<Seperator>
Etc.etc

so that it only shows the one you added in the script...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 4th, 2008, 11:32 pm 
Offline

Joined: May 25th, 2007, 6:13 pm
Posts: 373
This is what I've put in one of my scripts:

Code:
Menu, Tray, NoStandard  ;This removes standard tray
Menu, Tray, Add, Exit, LvNow
Menu, Tray, Default, Exit  ;This is how you make it so a Double-Click will activate an item in your menu.
Menu, Tray, Tip, `{Win+L`} = Auto-Replace List`n`{Win+Space`} [KEYS] = Replaces KEYS`n`{Win+Space`} xx = Cancel Replace


Ciao,
Dra'Gon

_________________
Image
For a good laugh {hopefully} >> megamatts.50megs.com

My WritersCafe profile>>
http://www.writerscafe.org/writers/BlueDragonFire/


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Newl, patgenn123, poserpro, Yahoo [Bot] and 16 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group