Rawox Posted August 21, 2009 Posted August 21, 2009 Hey, I didn't even solved the problem with the _MsgBox but I've already found another problem... I have created a traymenu (no GUI at all). When I click a trayitem a GUI shows up with options. There are several buttons in it but they don't work. I don't know where to put the variables in. Because when I put them in the while loop from the traymenu SciTE gives errors that there are several unknown variables because the optionsdialog is a functions so SciTE hasn't read this variables though. And when I create a new while loop I can't get back into the old while loop so when I delete the GUI the trayitems can not be clicked anymore. My code: expandcollapse popup#Include <Constants.au3> #include <GuiConstantsEx.au3> #Include <GuiListView.au3> #include <ListviewConstants.au3> #include <_MsgBox.au3> Opt ( "TrayMenuMode", 1 ) $AuthorFullName = "Cas Cornelissen" $AuthorNickName = "Rawox" $Title = "TaskBarHider" $Version = "0.1" $Release = "21-08-2009" ; Traymenu $TrayOptions = TrayCreateItem ( "Options" ) $TrayAbout = TrayCreateItem ( "About" ) TrayCreateItem ( "" ) $TrayExit = TrayCreateItem ( "Exit" ) TrayItemSetState ( $TrayOptions, $TRAY_DEFAULT ) While 1 $Traymsg = TrayGetMsg() $Guimsg = GUIGetMsg() Select Case $Traymsg = $TrayOptions optionsDialog() Case $Traymsg = $TrayAbout _MsgBox ( 64, "About " & $Title & " " & $Version, $Title & " is created by "& $AuthorFullName & " (a.k.a. " & $AuthorNickName & ")." & @CRLF & "Current version is version " & $Version & " released on " & $Release & ".", 0, 0, "Website|Email|Close" ) Case $Traymsg = $TrayExit Exit EndSelect WEnd Func optionsDialog() $optionsDialog = GUICreate ( $Title & " " & $Version & " Options", 350, 400 ) GUICtrlCreateGroup ( "Options", 10, 10, 330, 50 ) $CheckEnable = GUICtrlCreateCheckbox ( "Enable " & $Title, 30, 28 ) $CheckStartWindows = GUICtrlCreateCheckbox ( "Start with Windows", 165, 28 ) GUICtrlCreateGroup ( "Application management", 10, 70, 330, 202 ) $List = GUICtrlCreateListView ( "", 30, 95, 290, 130 ) $AddItem = GUICtrlCreateButton ( "Add item", 30, 234, 95, 24 ) $DeleteSelected = GUICtrlCreateButton ( "Delete", 128, 234, 95, 24 ) $ClearList = GUICtrlCreateButton ( "Clear list", 226, 234, 95, 24 ) GUICtrlCreateGroup ( "Overview", 10, 282, 330, 78 ) GUICtrlCreateLabel ( "Status:", 30, 308 ) GUICtrlCreateLabel ( "Items:", 190, 308 ) GUICtrlCreateLabel ( "Items hidden:", 30, 326 ) GUICtrlCreateLabel ( "Most hidden:", 190, 326 ) $Status = GUICtrlCreateLabel ( "00", 110, 308 ) $Items = GUICtrlCreateLabel ( "00", 110, 326 ) $Itemshidden = GUICtrlCreateLabel ( "00", 270, 308 ) $Mosthidden = GUICtrlCreateLabel ( "00", 270, 326 ) $Reset = GUICtrlCreateButton ( "Reset", 10, 367, 107, 24 ) $SaveConfiguration = GUICtrlCreateButton ( "Save", 122, 367, 107, 24 ) $CloseOptions = GUICtrlCreateButton ( "Close", 233, 367, 107, 24 ) _GUICtrlListView_AddColumn ( $List, "Nr.", 28 ) _GUICtrlListView_AddColumn ( $List, "Title", 80 ) _GUICtrlListView_AddColumn ( $List, "Codename", 72 ) _GUICtrlListView_AddColumn ( $List, "Text", 50 ) _GUICtrlListView_AddColumn ( $List, "Status", 60 ) _GUICtrlListView_AddColumn ( $List, "Hidden", 60 ) GUISetState ( @SW_SHOW, $optionsDialog ) EndFunc ;WinSetState ( "AutoIt Help", "", @SW_HIDE )
Moderators Melba23 Posted August 21, 2009 Moderators Posted August 21, 2009 Rawox,Here you go:expandcollapse popup#Include <Constants.au3> #include <GuiConstantsEx.au3> #Include <GuiListView.au3> #include <ListviewConstants.au3> ;#include <_MsgBox.au3> Opt ( "TrayMenuMode", 3 ) ; Add no check mode $AuthorFullName = "Cas Cornelissen" $AuthorNickName = "Rawox" $Title = "TaskBarHider" $Version = "0.1" $Release = "21-08-2009" ; Traymenu $TrayOptions = TrayCreateItem ( "Options" ) $TrayAbout = TrayCreateItem ( "About" ) TrayCreateItem ( "" ) $TrayExit = TrayCreateItem ( "Exit" ) TrayItemSetState ( $TrayOptions, $TRAY_DEFAULT ) While 1 $Traymsg = TrayGetMsg() Select Case $Traymsg = $TrayOptions optionsDialog() Case $Traymsg = $TrayAbout MsgBox (0,"About", "Him") ;( 64, "About " & $Title & " " & $Version, $Title & " is created by "& $AuthorFullName & " (a.k.a. " & $AuthorNickName & ")." & @CRLF & "Current version is version " & $Version & " released on " & $Release & ".", 0, 0, "Website|Email|Close" ) Case $Traymsg = $TrayExit Exit EndSelect WEnd Func optionsDialog() $optionsDialog = GUICreate ( $Title & " " & $Version & " Options", 350, 400 ) GUICtrlCreateGroup ( "Options", 10, 10, 330, 50 ) $CheckEnable = GUICtrlCreateCheckbox ( "Enable " & $Title, 30, 28 ) $CheckStartWindows = GUICtrlCreateCheckbox ( "Start with Windows", 165, 28 ) GUICtrlCreateGroup ( "Application management", 10, 70, 330, 202 ) $List = GUICtrlCreateListView ( "", 30, 95, 290, 130 ) $AddItem = GUICtrlCreateButton ( "Add item", 30, 234, 95, 24 ) $DeleteSelected = GUICtrlCreateButton ( "Delete", 128, 234, 95, 24 ) $ClearList = GUICtrlCreateButton ( "Clear list", 226, 234, 95, 24 ) GUICtrlCreateGroup ( "Overview", 10, 282, 330, 78 ) GUICtrlCreateLabel ( "Status:", 30, 308 ) GUICtrlCreateLabel ( "Items:", 190, 308 ) GUICtrlCreateLabel ( "Items hidden:", 30, 326 ) GUICtrlCreateLabel ( "Most hidden:", 190, 326 ) $Status = GUICtrlCreateLabel ( "00", 110, 308 ) $Items = GUICtrlCreateLabel ( "00", 110, 326 ) $Itemshidden = GUICtrlCreateLabel ( "00", 270, 308 ) $Mosthidden = GUICtrlCreateLabel ( "00", 270, 326 ) $Reset = GUICtrlCreateButton ( "Reset", 10, 367, 107, 24 ) $SaveConfiguration = GUICtrlCreateButton ( "Save", 122, 367, 107, 24 ) $CloseOptions = GUICtrlCreateButton ( "Close", 233, 367, 107, 24 ) _GUICtrlListView_AddColumn ( $List, "Nr.", 28 ) _GUICtrlListView_AddColumn ( $List, "Title", 80 ) _GUICtrlListView_AddColumn ( $List, "Codename", 72 ) _GUICtrlListView_AddColumn ( $List, "Text", 50 ) _GUICtrlListView_AddColumn ( $List, "Status", 60 ) _GUICtrlListView_AddColumn ( $List, "Hidden", 60 ) GUISetState ( @SW_SHOW, $optionsDialog ) While 1 $Guimsg = GUIGetMsg() Switch $Guimsg Case $Reset ConsoleWrite("Resetting" & @CRLF) Case $SaveConfiguration ConsoleWrite("Saving" & @CRLF) Case $CloseOptions, $GUI_EVENT_CLOSE GUIDelete($optionsDialog) Return ; Gets back to the TraygetMsg loop EndSwitch WEnd EndFuncI also alterred the TrayMenuMode option to 3 to remove the "tick" when you use the tray menu.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
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