#cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.14.2 Author: faustf Script Function: menu di gestionale per ufffico NEW Template AutoIt script. #ce ---------------------------------------------------------------------------- Global $ExitItem Func _Menu() ;$hMainGUI = GUICreate("Sample Menu") ;GUISetOnEvent($GUI_EVENT_CLOSE, "MenuEvents") ;$bUseAdvMenu = TRUE ; Global variable to switch on/off advanced menu ;$bUseAdvTrayMenu = TRUE ; Global variable to switch on/off advanced tray menu ;$bUseRGBColors = FALSE; Global variable to change color mode, set TRUE to use RGB color values, default is FALSE ; Set default color values - BGR-values! ;SetGreenMenuColors() ;SetBlueTrayColors() ;SetOLBlueColors() ; near blue outlook 2003 style ;SetOLSilverColors() ; near silver outlook 2003 style ; Set flash timeout for tray flashing icons (milliseconds) - default are 750, minimum is 50 _SetFlashTimeOut(250) ; _SetFlashTimeOut() - set back to default ; To activate flashing use _TrayIconSetState($ID, 4) ; To dactivate flashing use _TrayIconSetState($ID, 8) ; !!! To delete menu items please use: ; _TrayDeleteItem($nID) ; or ; _GUICtrlODMenuItemDelete($nID) ; !!! ; File-Menu $FileMenu = GUICtrlCreateMenu("&File") $nSideItem1 = _CreateSideMenu($FileMenu) _SetSideMenuText($nSideItem1, "My File Menu") _SetSideMenuColor($nSideItem1, 0xFFFFFF) ; default color - white _SetSideMenuBkColor($nSideItem1, 0x921801) ; bottom start color - dark blue _SetSideMenuBkGradColor($nSideItem1, 0xFBCE92) ; top end color - light blue $OpenItem = _GUICtrlCreateODMenuItem("&Open..." & @Tab & "Ctrl+O", $FileMenu) _GUICtrlODMenuItemSetIcon(-1, "shell32.dll", -4) _GUICtrlODMenuItemSetSelIcon(-1, "shell32.dll", -5) $SaveItem = _GUICtrlCreateODMenuItem("&Save" & @Tab & "Ctrl+S", $FileMenu, "shell32.dll", -7) _GUICtrlODMenuItemSetSelIcon(-1, "shell32.dll", -79) _GUICtrlCreateODMenuItem("", $FileMenu) ; Separator $RecentMenu = _GUICtrlCreateODMenu("Recent Files", $FileMenu) _GUICtrlCreateODMenuItem("", $FileMenu) ; Separator $ExitItem = _GUICtrlCreateODMenuItem("E&xit", $FileMenu, "shell32.dll", -28) ; Tools-Menu $ToolsMenu = GUICtrlCreateMenu("&Tools") $CalcItem = _GUICtrlCreateODMenuItem("Calculator", $ToolsMenu, "calc.exe", 0) $CmdItem = _GUICtrlCreateODMenuItem("CMD", $ToolsMenu, "cmd.exe", 0) $EditorItem = _GUICtrlCreateODMenuItem("Editor", $ToolsMenu, "notepad.exe", 0) $RegeditItem = _GUICtrlCreateODMenuItem("Regedit", $ToolsMenu, "regedit.exe", 0) ; View-Menu $ViewMenu = GUICtrlCreateMenu("&View") $ViewColorMenu = _GUICtrlCreateODMenu("Menu Colors", $ViewMenu, "mspaint.exe", 0) $nSideItem2 = _CreateSideMenu($ViewColorMenu) _SetSideMenuText($nSideItem2, "Choose a color") _SetSideMenuColor($nSideItem2, 0x00FFFF) _SetSideMenuBkColor($nSideItem2, 0xD00000) $SetDefClrItem = _GUICtrlCreateODMenuItem("Default", $ViewColorMenu, "", 0, 1) _GUICtrlCreateODMenuItem("", $ViewColorMenu) ; Separator $SetRedClrItem = _GUICtrlCreateODMenuItem("Red", $ViewColorMenu, "", 0, 1) $SetGrnClrItem = _GUICtrlCreateODMenuItem("Green", $ViewColorMenu, "", 0, 1) GUICtrlSetState(-1, $GUI_CHECKED) $SetBlueClrItem = _GUICtrlCreateODMenuItem("Blue", $ViewColorMenu, "", 0, 1) _GUICtrlCreateODMenuItem("", $ViewColorMenu) ; Separator $SetOLBlueItem = _GUICtrlCreateODMenuItem("Outlook-Blue", $ViewColorMenu, "", 0, 1) $SetOLSlvItem = _GUICtrlCreateODMenuItem("Outlook-Silver", $ViewColorMenu, "", 0, 1) $ViewStateItem = _GUICtrlCreateODMenuItem("Enable Config", $ViewMenu) GUICtrlSetState(-1, $GUI_CHECKED) ; Help-Menu $HelpMenu = GUICtrlCreateMenu("&?") $HelpItem = _GUICtrlCreateODMenuItem("Help Topics" & @Tab & "F1", $HelpMenu, "shell32.dll", -24) _GUICtrlCreateODMenuItem("", $HelpMenu) ; Separator $AboutItem = _GUICtrlCreateODMenuItem("About...", $HelpMenu) ; You can also the same things on context menus $GUIContextMenu = GUICtrlCreateContextMenu(-1) $ConAboutItem = _GUICtrlCreateODMenuItem("About...", $GUIContextMenu, "explorer.exe", -8) _GUICtrlCreateODMenuItem("", $GUIContextMenu) ; Separator $ConExitItem = _GUICtrlCreateODMenuItem("Exit", $GUIContextMenu, "shell32.dll", -28) EndFunc