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 

Tray menu

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



Joined: 04 Aug 2008
Posts: 199
Location: UK

PostPosted: Wed Dec 03, 2008 1:30 pm    Post subject: Tray menu Reply with quote

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
Back to top
View user's profile Send private message
IsNull



Joined: 10 May 2007
Posts: 593
Location: .switzerland

PostPosted: Wed Dec 03, 2008 1:37 pm    Post subject: Reply with quote

Function "Menu" doesn't exist. So you can't call it... what would you do?
_________________
http://securityvision.ch
AHK 2D GAME ENGINE
Back to top
View user's profile Send private message Visit poster's website
Cephei1



Joined: 04 Aug 2008
Posts: 199
Location: UK

PostPosted: Wed Dec 03, 2008 1:39 pm    Post subject: Reply with quote

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...
Back to top
View user's profile Send private message
IsNull



Joined: 10 May 2007
Posts: 593
Location: .switzerland

PostPosted: Wed Dec 03, 2008 1:56 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
Cephei1



Joined: 04 Aug 2008
Posts: 199
Location: UK

PostPosted: Thu Dec 04, 2008 10:13 pm    Post subject: Reply with quote

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...
Back to top
View user's profile Send private message
Dra_Gon



Joined: 25 May 2007
Posts: 373

PostPosted: Thu Dec 04, 2008 10:32 pm    Post subject: Reply with quote

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
_________________

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

My WritersCafe profile>>
http://www.writerscafe.org/writers/BlueDragonFire/
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
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