Ashww Posted January 27, 2009 Share Posted January 27, 2009 Ok, well im still making my Account Control.I wish to use a TrayMenu instead of hotkeys.I cannot get this to work.Here is what i have tested in a blank GUI script:expandcollapse popupWhile 1 $nMsg = GUIGetMsg() $msg = TrayGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch Select Case $msg = $menuedit MsgBox(89,"title","you have opened the edit menu") Case $msg = $MenuInfo MsgBox(89,"title","you have opened the info menu") EndSelectWEnd[code=auto:0]Can someone point me in the correct direction, or better still fix this code CheerAshww X) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Projects: Account Control Wii style gui Bingo Caller - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Want a website? Click here!- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -I use my Blackberry Storm to browse the forum! Please be patient!- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Link to comment Share on other sites More sharing options... Moderators Melba23 Posted January 27, 2009 Melba23 Moderators 31.1k 477 I'm old, what's your excuse? Moderators Share Posted January 27, 2009 Ashww, You need to disable the built-in menu items or the script pauses when you click on the icon. Try this:Opt("TrayMenuMode",1) ; Default tray menu items will not be shown. $menuedit = TrayCreateItem("Edit") $MenuInfo = TrayCreateItem("Info") GUICreate("Test", 100, 100) GUISetState() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case -3 Exit EndSwitch $msg = TrayGetMsg() Switch $msg Case $menuedit MsgBox(0,"title","you have opened the edit menu") Case $MenuInfo MsgBox(0,"title","you have opened the info menu") EndSwitch WEnd M23 P.S. If you use the "Preview Post" button you will not forget the / in the closing Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Ashww Posted January 27, 2009 Author Share Posted January 27, 2009 Ashww,You need to disable the built-in menu items or the script pauses when you click on the icon. Try this:Opt("TrayMenuMode",1) ; Default tray menu items will not be shown. $menuedit = TrayCreateItem("Edit") $MenuInfo = TrayCreateItem("Info") GUICreate("Test", 100, 100) GUISetState() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case -3 Exit EndSwitch $msg = TrayGetMsg() Switch $msg Case $menuedit MsgBox(0,"title","you have opened the edit menu") Case $MenuInfo MsgBox(0,"title","you have opened the info menu") EndSwitch WEndM23P.S. If you use the "Preview Post" button you will not forget the / in the closing Ahh thanks. Does the While part have to be like that? cause sometimes it doent recognise i have clickedCheersAshwwX) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Projects: Account Control Wii style gui Bingo Caller - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Want a website? Click here!- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -I use my Blackberry Storm to browse the forum! Please be patient!- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 27, 2009 Moderators Share Posted January 27, 2009 Ashww,Personally I always use: Opt("TrayOnEventMode",1) ; Use event trapping for tray menuto prevent that. Just be aware that your tray menu is then always active and will store up clicks which are acted upon once the current function ends. You may have to use:TraySetClick(0) ; Tray context menu cannot be opened.....TraySetClick(16) ; Tray context menu can be opened by right clickto prevent that if it becomes a problem.M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Ashww Posted January 27, 2009 Author Share Posted January 27, 2009 Ashww,Personally I always use: Opt("TrayOnEventMode",1) ; Use event trapping for tray menuto prevent that. Just be aware that your tray menu is then always active and will store up clicks which are acted upon once the current function ends. You may have to use:TraySetClick(0) ; Tray context menu cannot be opened.....TraySetClick(16) ; Tray context menu can be opened by right clickto prevent that if it becomes a problem.M23Thank youI will try this when I get homeCheersAshwwX) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Projects: Account Control Wii style gui Bingo Caller - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Want a website? Click here!- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -I use my Blackberry Storm to browse the forum! Please be patient!- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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