TK_Incorperate Posted October 13, 2005 Share Posted October 13, 2005 (edited) I've found the help menu isnt as user friendly as people would think, alot of people just learning probably couldnt understand so i thought i'd make tray icon menus a little more understandableFirst off you'll need to add this line, i found that the 2 top lines in the readme are pretty much useless but this one is neededOpt("TrayMenuMode",1)Then you'll need to create menus or items, i'll give you 2 exmaples hereExample 1: Menu$menu1 = TrayCreateMenu("####") $****item = TrayCreateItem("####", $menu1) $****item = TrayCreateItem("####", $menu1) $****item = TrayCreateItem("####", $menu1)Where there is #### you'll need to change to the name of the menu/menu itemWhere there is **** you'll need to a shorter version of the name, example if your menu item is About it would look something like this$menu1 = TrayCreateMenu("About") $atritem = TrayCreateItem("Auther", $menu1) $vsnitem = TrayCreateItem("Version", $menu1) $infitem = TrayCreateItem("Info", $menu1)You can add as many or as little of these menus as possible, but afterwards you ALWAYS want to set an exit button to exit the script$exititem = TrayCreateItem("Exit")Now we need to add a couple more lines in before we start editing the menusTraySetState() While 1 $msg = TrayGetMsg() Select Case $msg = 0 ContinueLoopAnd now we can start editing the menus and menu items, i personaly like to use popup windows to explain the script, ill explain thisCase $msg = $atritem;This is where you set witch menu item links to this window Msgbox(64,"Info:","Auther: TK_Incorperate - TK_Incorperate@yahoo.com")Where it says "Info:", edit that to change the header of your windowYou'll compile these one after another to make the full menu and it should look something like thisCase $msg = $atritem Msgbox(64,"Info:","Auther: TK_Incorperate - TK_Incorperate@yahoo.com") Case $msg = $vsnitem Msgbox(64,"Info:","Version: 1.0 Pub release") Case $msg = $infitem Msgbox(64,"Info:","About: Tray menu for AutoIt scripts made easy")After this we need to add the Exit commant and link it to the one above and finish the menu offCase $msg = $exititem ExitLoop EndSelect WEnd ExitNow that should be it and your finished script should look something like this....Opt("TrayMenuMode",1) $menu1 = TrayCreateMenu("About") $atritem = TrayCreateItem("Auther", $menu1) $vsnitem = TrayCreateItem("Version", $menu1) $infitem = TrayCreateItem("Info", $menu1) $exititem = TrayCreateItem("Exit") TraySetState() While 1 $msg = TrayGetMsg() Select Case $msg = 0 ContinueLoop Case $msg = $atritem Msgbox(64,"Info:","Auther: TK_Incorperate - TK_Incorperate@yahoo.com") Case $msg = $vsnitem Msgbox(64,"Info:","Version: 1.0 Pub release") Case $msg = $infitem Msgbox(64,"Info:","About: Tray menu for AutoIt scripts made easy") Case $msg = $exititem ExitLoop EndSelect WEnd ExitI dont have too much patients so i'll post example 2 to finish later, but that should do you good for menus and popup windows Edited October 13, 2005 by TK_Incorperate Link to comment Share on other sites More sharing options...
ph00dz Posted October 17, 2005 Share Posted October 17, 2005 Sweet!!! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now