 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Cephei1
Joined: 04 Aug 2008 Posts: 199 Location: UK
|
Posted: Wed Dec 03, 2008 1:30 pm Post subject: Tray menu |
|
|
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 |
|
 |
IsNull
Joined: 10 May 2007 Posts: 593 Location: .switzerland
|
|
| Back to top |
|
 |
Cephei1
Joined: 04 Aug 2008 Posts: 199 Location: UK
|
Posted: Wed Dec 03, 2008 1:39 pm Post subject: |
|
|
| 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 |
|
 |
IsNull
Joined: 10 May 2007 Posts: 593 Location: .switzerland
|
Posted: Wed Dec 03, 2008 1:56 pm Post subject: |
|
|
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 | http://www.autohotkey.com/docs/commands/Menu.htm _________________ http://securityvision.ch
AHK 2D GAME ENGINE |
|
| Back to top |
|
 |
Cephei1
Joined: 04 Aug 2008 Posts: 199 Location: UK
|
Posted: Thu Dec 04, 2008 10:13 pm Post subject: |
|
|
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 |
|
 |
Dra_Gon
Joined: 25 May 2007 Posts: 373
|
Posted: Thu Dec 04, 2008 10:32 pm Post subject: |
|
|
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 |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|