behdadsoft Posted October 30, 2014 Share Posted October 30, 2014 Hi. I want Remove or hide Script Paused when right click on icon in taskbar.mean only exist Exit button.how can do it? Link to comment Share on other sites More sharing options...
AutID Posted October 30, 2014 Share Posted October 30, 2014 (edited) Opt("TrayMenuMode", 1) Edit: sorry this will not set a default menu but play with it. See also TrayItemDelete maybe Edited October 30, 2014 by AutID https://iblockify.wordpress.com/ Link to comment Share on other sites More sharing options...
Zedna Posted October 30, 2014 Share Posted October 30, 2014 (edited) Partial solution: Opt("TrayAutoPause",0) For removing use: Opt("TrayMenuMode",1) ; no default menu (Paused/Exit) If you want your own tray menu items then use TrayCreateItem() TraySetState() TraySetClick() and in main loop use TrayGetMsg() You can look here at my Frame example using it '?do=embed' frameborder='0' data-embedContent>> Edited October 30, 2014 by Zedna 232showtime 1 Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
behdadsoft Posted October 31, 2014 Author Share Posted October 31, 2014 Thanks. I create a Function that create tray Item but there is a Problem, that when run script and right click on tray icon do't show any thing. Please Guide Me. expandcollapse popup#RequireAdmin #include <GUIConstantsEx.au3> #include <TrayConstants.au3> Opt("TrayMenuMode",3) ; no default menu (Paused/Exit) ; Functions Example () _CreateTrayItem () Func Example () $GUI = GUICreate ("Autoit") GUISetState(@SW_SHOW, $GUI) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd ; Delete the previous GUI and all controls. GUIDelete($GUI) EndFunc ; Function for Create custom Tray Item Func _CreateTrayItem () Local $TrayExit = TrayCreateItem ("Exit", -1, -1, 1) TraySetState($TRAY_ICONSTATE_SHOW) ; Show the tray menu. While 1 Switch TrayGetMsg() Case $TrayExit GUIDelete () ExitLoop EndSwitch WEnd EndFunc Link to comment Share on other sites More sharing options...
BrewManNH Posted October 31, 2014 Share Posted October 31, 2014 That's because the function Example is stuck in an endless loop and the CreateTrayItem function never gets run until you exit the GUI. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
behdadsoft Posted October 31, 2014 Author Share Posted October 31, 2014 (edited) how can fix it? i'm Weak in loop and array. Edited October 31, 2014 by behdadsoft Link to comment Share on other sites More sharing options...
kylomas Posted October 31, 2014 Share Posted October 31, 2014 i'm Weak in loop and array This has more to do with GUI management. You should read the GUI Management section in the Help file and Wiki. kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
behdadsoft Posted October 31, 2014 Author Share Posted October 31, 2014 This has more to do with GUI management. You should read the GUI Management section in the Help file and Wiki. OK, but now I need fix it. Link to comment Share on other sites More sharing options...
Solution BrewManNH Posted October 31, 2014 Solution Share Posted October 31, 2014 #RequireAdmin #include <GUIConstantsEx.au3> #include <TrayConstants.au3> Opt("TrayMenuMode", 3) ; no default menu (Paused/Exit) ; Functions Example() Func Example() $GUI = GUICreate("Autoit") GUISetState(@SW_SHOW, $GUI) Local $TrayExit = TrayCreateItem("Exit", -1, -1, 1) TraySetState($TRAY_ICONSTATE_SHOW) ; Show the tray menu. ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch Switch TrayGetMsg() Case $TrayExit GUIDelete() ExitLoop EndSwitch WEnd ; Delete the previous GUI and all controls. GUIDelete($GUI) EndFunc ;==>Example Use one While loop, check for both GUI and Tray messages within it. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
behdadsoft Posted October 31, 2014 Author Share Posted October 31, 2014 Thanks BrewManNH Link to comment Share on other sites More sharing options...
Chimaera Posted November 1, 2014 Share Posted November 1, 2014 Is there a way to just have Exit with no Pause? Or a way to hide pause? Pause often confuses people who use my scripts If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted November 1, 2014 Share Posted November 1, 2014 Is there a way to just have Exit with no Pause? Or a way to hide pause? Pause often confuses people who use my scripts What's wrong with the already presented solutions? .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 1, 2014 Moderators Share Posted November 1, 2014 Chimaera,As far as I know you have both the default items or neither - but it is simple to add your own "Exit" trayitem: #include <GUIConstantsEx.au3> Opt("TrayMenuMode", 1) $cTrayExit = TrayCreateItem("Exit") $hGUI = GUICreate("Test", 500, 500) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch Switch TrayGetMsg() Case $cTrayExit Exit EndSwitch WEndOr, as I usually prefer: #include <GUIConstantsEx.au3> Opt("TrayMenuMode", 1) Opt("TrayOnEventMode", 1) $cTrayExit = TrayCreateItem("Exit") TrayItemSetOnEvent($cTrayExit, "_Exit") $hGUI = GUICreate("Test", 500, 500) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _Exit() Exit EndFuncM23 Zedna 1 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...
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