Jump to content

Search the Community

Showing results for tags 'Tray'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 20 results

  1. ; https://www.autoitscript.com/forum/topic/209550-tray-example/ #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w 7 #include <StringConstants.au3> #include <TrayConstants.au3> Opt("TrayMenuMode", 3) ; These are options 1 and 2 for TrayMenuMode. Opt("TrayOnEventMode", 1) ; Enable TrayOnEventMode. Local $bPaused = False TraySetIcon(StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", $STR_NOCASESENSEBASIC, -1) - 1) & "\Icons\MyAutoIt3_Blue.ico") #Region === Tray_Menu === TraySetOnEvent($TRAY_EVENT_PRIMARYDOUBLE, "TogglePause") Local $idPaused = TrayCreateItem("Pause", -1, -1, $TRAY_ITEM_RADIO) TrayItemSetOnEvent(-1, "TogglePause") TrayItemSetState(-1, $TRAY_UNCHECKED) TrayCreateItem("") ; Create a separator line. Local $idExit = TrayCreateItem("Exit") TrayItemSetOnEvent(-1, "GoToExit") #EndRegion === Tray_Menu === ToolTip(@ScriptName & @CRLF & " ", @DesktopWidth / 2, @DesktopHeight / 5, "Started", 1) Sleep(3000) ToolTip("") While 1 _GetTrayStatus() Sleep(10) WEnd GoToExit() ;---------------------------------------------------------------------------------------- Func GoToExit() ; exit Exit EndFunc ;==>GoToExit ;---------------------------------------------------------------------------------------- Func _GetTrayStatus() While 1 ;~ ConsoleWrite("-loop" & @CRLF) If $bPaused = False Then ExitLoop Else ; calm down and stay Sleep(500) EndIf WEnd EndFunc ;==>_GetTrayStatus ;---------------------------------------------------------------------------------------- Func TogglePause() If $bPaused = False Then $bPaused = True TrayItemSetState($idPaused, $TRAY_CHECKED) ; $TRAY_UNCHECKED, $TRAY_CHECKED TraySetIcon(StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", $STR_NOCASESENSEBASIC, -1) - 1) & "\Icons\MyAutoIt3_Red.ico") Else $bPaused = False TrayItemSetState($idPaused, $TRAY_UNCHECKED) ; $TRAY_UNCHECKED, $TRAY_CHECKED TraySetIcon(StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", $STR_NOCASESENSEBASIC, -1) - 1) & "\Icons\MyAutoIt3_Blue.ico") EndIf EndFunc ;==>TogglePause ;----------------------------------------------------------------------------------------
  2. Opt('TrayAutoPause', 0) $iTray1 = TrayCreateItem('Tray 1') TrayItemSetState(-1, 1) TrayCreateItem('') $iTrayMenu1 = TrayCreateMenu('Tray Menu 1') $iTray2 = TrayCreateItem('Tray 2', $iTrayMenu1, -1, 1) TrayItemSetState(-1, 1) $iTray3 = TrayCreateItem('Tray 3', $iTrayMenu1, -1, 1) $iTray4 = TrayCreateItem('Tray 4', $iTrayMenu1, -1, 1) TrayCreateItem('') $iTrayMenu2= TrayCreateMenu('Tray Menu 2') $iTray5 = TrayCreateItem('Tray 5', $iTrayMenu2, -1, 1) TrayItemSetState(-1, 1) $iTray6 = TrayCreateItem('Tray 6', $iTrayMenu2, -1, 1) $iTray7 = TrayCreateItem('Tray 7', $iTrayMenu2, -1, 1) TrayCreateItem('') $iTray8 = TrayCreateItem('Tray 8') $iTray9 = TrayCreateItem('Tray 9') $iTray10 = TrayCreateItem('Tray 10') TrayItemSetState(-1, 1) While True Sleep(1000*5) WEnd When I click on Tray 3 / Tray 4 / Tray 6 / Tray 7 nothing happens. Only Tray 2 and Tray 5 stay checked. I have tried setting Opt("TrayMenuMode", 8) In this case radio menuitems act like normal menuitems only looks different. I'm using AutoIt v3.3.14.5. Tested on Windows 10 LTSC 2019 (1809) x64 version: 10.0.17763 build 17763.475 and Windows Server 2008 R2. Tried run script x64 and x86 same result. Is this kind a bug or something?
  3. So I'm coding in win 10, ..every thing looks nice but then I think, what about XP, ...ugly, but I make it pretty again, no problem. Lets check in Win 7 and here is my conundrum. Win 10, DRM is on, XP is off ( well, non-existant ), so far so good. I decide to make it the "switch" to enable or disable the checkbox in the context menu. Win 7 ... I try to apply the same logic and: DRM on: DRM off: now, "Windows 7 Basic": DRM is off Question: how should I determine if to hide the check-mark or not?, Is there a way to know that this theme is ? or better yet, how can I know that the theme is classic ? Thanks PS: I know that the code is not here but I think that my trend of thought would make it irrelevant anyway.
  4. LAST VERSION - 1.0 19-May-12 I think many of you would like to perform some action (for example, to call the dialog box) when a user clicks on the tray tip. Here is a simple way to do it. Unfortunately, without .dll do not seem possible. Note, only AutoIt window can be registered as a source window, see example. AITray.dll (x86 and x64) Previous downloads: 74 AITray.zip Example #Include <WindowsConstants.au3> Opt('TrayAutoPause', 0) Opt('WinTitleMatchMode', 3) Opt('WinWaitDelay', 0) Global Const $NIN_BALLOONSHOW = $WM_USER + 2 Global Const $NIN_BALLOONHIDE = $WM_USER + 3 Global Const $NIN_BALLOONUSERCLICK = $WM_USER + 5 Global Const $NIN_BALLOONTIMEOUT = $WM_USER + 4 $hForm = GUICreate('') If @AutoItX64 Then $hDll = DllOpen(@ScriptDir & '\AITray_x64.dll') Else $hDll = DllOpen(@ScriptDir & '\AITray.dll') EndIf If $hDll <> -1 Then $Ret = DllCall($hDll, 'int', 'AISetTrayRedirection', 'hwnd', WinGetHandle(AutoItWinGetTitle()), 'hwnd', $hForm) If (@Error) Or (Not $Ret[0]) Then DllClose($hDll) Exit EndIf Else Exit EndIf GUIRegisterMsg($WM_USER + 1, 'WM_TRAYNOTIFY') TrayTip('Tip', 'This is a tray tip, click here.', 10, 1) While 1 Sleep(1000) WEnd DllCall($hDll, 'int', 'AIRemoveTrayRedirection') DllClose($hDll) Func WM_TRAYNOTIFY($hWnd, $iMsg, $wParam, $lParam) Switch $hWnd Case $hForm Switch $lParam Case $NIN_BALLOONSHOW ConsoleWrite('Balloon tip show.' & @CR) Case $NIN_BALLOONHIDE ConsoleWrite('Balloon tip hide.' & @CR) Case $NIN_BALLOONUSERCLICK ConsoleWrite('Balloon tip click.' & @CR) Case $NIN_BALLOONTIMEOUT ConsoleWrite('Balloon tip close.' & @CR) EndSwitch EndSwitch EndFunc ;==>WM_TRAYNOTIFY
  5. I need to read the status of OneDrive icon running in the taskbar and update the status in a log file. 2nd part I can complete But the first part, how to read the status of tray menu icon. I need the text above from the tray icon. I looked into , but not that helpful.
  6. Hi All, I'm using UseTraySetIcon("shell32.dll", xx) to set my tray icon to a specific icon while running, is there a way I can specify this icon when I compile my script into an exe so my exe icon is the same? Thanks!
  7. Hello Guys, Is there a way to have Auto it Exe messages/line number when you hover over the tray icon just at it shows when you run Au3.? For an example, if I the script has paused due to WinWait or Sleep I could hover over the icon and it shows the line where it's at. Is there a way to achieve the same with the compiled exe? Many thanks for the help!
  8. I have a script that gets a list of visible windows and makes a tray item of each in the tray menu. I'd also want it to update every time I want to access that menu again, in case new windows have appeared or some would have been closed. I'm using TrayOnEventMode option and trying to get the update going with TraySetOnEvent($TRAY_EVENT_PRIMARYDOWN...) as in the snippet below. However, the list doesn't update until after the tray menu has been closed again. I think I could work around this by having the script update the list constantly in the background, but that feels like it'd take up unnecessary amount of resources since the script might be used rarely by the user anyway. I tried using TraySetOnEvent($TRAY_EVENT_MOUSEOVER...), and that kind of does it, but it actually still calls my function many times (since the mouse cursor moves quite a bit on the icon) before the tray menu is opened. I could put another menuitem to call the update function, but I'd much rather have just the minimal amount of user actions. Similarly I could have tray menu open with a double click (with TraySetClick()) and have the first click just call the update function, but can anyone tell me if there's a way to call the update once and then have the menu open without these gimmicks? Opt("TrayOnEventMode", 1) TraySetOnEvent($TRAY_EVENT_PRIMARYDOWN, "UpdateWindowsList")
  9. Hi All, I have a custom icon for the tray menu icon, which was working until I copied in the example code for a custom menu when clicking on the tray icon, now it just displays the default AutoIt tray icon. The menu works fine, but the tray icon initiates as the AutoIt default icon and the icon won't change on event. Can anyone advise what I need to do to use my custom icon while retaining the tray custom menu? Thanks! Also, the While 1 ... WEnd makes me nervous, how does this not lock up the system? If anyone would like to comment on that - thanks. Opt("TrayMenuMode", 3) #include <TrayConstants.au3> Local $idAbout = TrayCreateItem("About") Local $idExit = TrayCreateItem("Exit") TraySetState($TRAY_ICONSTATE_SHOW) While 1 Switch TrayGetMsg() Case $idAbout MsgBox(1,"test","test msg") Case $idExit Exit EndSwitch WEnd If Not FileExists (@TempDir & "\MyIcons") Then DirCreate(@TempDir & "\MyIcons") FileInstall(".\Grey-1.ico", @TempDir & "\MyIcons\Grey-1.ico", 1) FileInstall(".\Yellow-1.ico", @TempDir & "\MyIcons\Yellow-1.ico", 1) TraySetIcon(@TempDir & "\MyIcons\Grey-1.ico");Change icon to grey initially ; If X happens then change tray icon to yellow ; If Y happens then change tray icon to grey
  10. I have a working code here. #include <GUIConstants.au3> #include <Constants.au3> Opt("GUIOnEventMode",1) $title = "WINDOW" $text="" $fullTest = WinExistsExact($title, $text) $PASSWORD = "PASS" $retryCount = 0 $stop = 1 ;<<<<<<<<<<<<<<<<<<<<<<<<< While 1 if $retryCount > 0 then Exit $input = InputBox("Password Protected", "Enter the password to continue", "", "*") If @error Or $input <> $PASSWORD Then MsgBox(4096,"Error", "Incorrect Password") $retryCount = $retryCount + 1 Else ;MsgBox(4096,"Success", "Password Accepted") ExitLoop EndIf Wend If $fullTest = 1 Then ;MsgBox(0, "WINDOW", "Press Ok to continue") GUICreate("WINDOW", 241, 78) ;$label = GUICtrlCreateInput ("test", 10, 10, 50, 20) GuiSetOnEvent($GUI_EVENT_CLOSE,"Quit") $button = GUICtrlCreateButton ("Start", 18, 31, 100, 25) $button1 = GUICtrlCreateButton ("Hide", 128, 31, 91, 25) ; <----- THIS IS THE BUTTON GuiCtrlSetOnEvent($button,"DoScript") GUISetState (@SW_SHOW) GUIRegisterMsg($WM_COMMAND, "_WM_COMMAND") ;<<<<<<<<<<<<<<<<<<<<< Else MsgBox(0, "WINDOW", "You need to run WINDOW client first.") EndIf While 1 Sleep(10) Wend Func _WM_COMMAND($hWnd, $Msg, $wParam, $lParam) If BitAND($wParam, 0x0000FFFF) = $button Then $stop = not $stop If $stop = 0 Then GUICtrlSetData($button, "Stop") If $stop = 1 Then GUICtrlSetData($button, "Start") EndIf Return $GUI_RUNDEFMSG EndFunc Func WinExistsExact($title, $text) AutoItSetOption( "WinTitleMatchMode", $OPT_MATCHEXACT ) $res = WinExists($title, $text) AutoItSetOption( "WinTitleMatchMode", $OPT_MATCHSTART ) Return $res EndFunc Func DoScript() While 1 For $i = 1 to 300 Sleep (10) If $stop = 1 Then Return ; GuiCtrlSetData($label, $i) Next ControlSend ( $title, "", 0, "{F12}") $a = Random(300, 900, 1) For $i = 1 to $a Sleep (10) If $stop = 1 Then Return Next ControlSend ( $title, "", 0, "{Del}") $a = Random(100, 500, 1) For $i = 1 to $a Sleep (10) If $stop = 1 Then Return Next WEnd EndFunc Func Quit() Exit EndFuncWhat I wanted to do is to make the 'Hide' button minimized the entire window when clicked and while it is on tray, there will be a menu if a user right clicked on it. Exactly what the code below should do. #NoTrayIcon #include <guiconstantsex.au3> #include <constants.au3> Opt("TrayOnEventMode", 1) Opt("TrayMenuMode", 3) ; Create tray menu items and set the events $About = TrayCreateItem("About") TrayItemSetOnEvent($About, "_About") TrayCreateItem("") ; Create a separator line. $Exit = TrayCreateItem("Exit") TrayItemSetOnEvent($Exit, "_Exit") ; Set the action if you left click on the tray icon TraySetOnEvent($TRAY_EVENT_PRIMARYUP, "SpecialEvent") ; Show the menu if the icon is right clicked TraySetClick(8) Global $MainGui = GUICreate("TestGUI", 392, 316, -1, -1) GUISetState() ;Test() While 1 Switch GUIGetMsg() Case $GUI_EVENT_MINIMIZE ; Hide the GUI GUISetState(@SW_HIDE) ; Show the icon TraySetState(1) Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd Func SpecialEvent() ; Show the GUI GUISetState(@SW_SHOW) GUISetState(@SW_RESTORE) ; Hide the icon TraySetState(2) EndFunc ;==>SpecialEvent Func _About() MsgBox(0,0,"Test") EndFunc Func _Exit() Exit EndFuncMy problem is I cannot integrate this code to the one I have. Can anyone help me with this? I would be very much thankful as I am just starting to learn.
  11. Hi, Here is an UDF to create, delete, set the icon and state, tooltip and tip for your notify icons. The main advantage is that you can handle mouse events as you want, there is no default events. You can create fully customised notifyicons/tooltips. Thanks to Holger Kotsch for his ModernMenu UDF. Note : Breaking changes ! Please use the 1.2+ version. Functions : Attachments : Example + UDF : AutoIt v3.3.10.0+ NotifyIcon_1.2.zip TrayIconEx_1.1.zip AutoIt v3.3.8.0+ TrayIconEx.zip & Requirements : >WinAPIEx UDF. As usual, enjoy !
  12. Hi! Please, give me script that would hide all tray icons which appear when the script is working.
  13. I was helping another user the other day And decided To make a UDF so here it is. Let me know what ya think. #include-once #include <GuiListView.au3> Global Const $SW_HIDENA = 2, $SW_HIDENOACTIVE = 2 ; Examples are below. ; #FUNCTION# ==================================================================================================================== ; Name ..........: _ToggleSystemTrayState ; Description ...: Hide/Show System Tray Icons by Name or Set the State for all Icons ; Syntax ........: _ToggleSystemTrayState([$vTrayItems = ""[, $iStartSearchIndex = 0[, $iSystemTrayState = 0[, $iDebug = 0]]]]) ; Parameters ....: $vTrayItems - [optional] A variant value. Default is "". ; $iStartSearchIndex - [optional] An integer value. Default is 0. Set this to -1 to search from end to start. ; $iSystemTrayState - [optional] An integer value. Default is 0. ; $iDebug - [optional] An integer value. Default is 0. Set this to either @SW_SHOW or 1 to see dialogs and debug information. ; Return values .: None ; Author ........: Decipher ; Modified ......: ; Remarks .......: Tested only on XP ; ; $iSystemTrayState can be one of the following: ; @SW_SHOW == ALWAYS_SHOW == 5 ; @SW_HIDE == ALWAYS_HIDE == 0 ; $SW_HIDENA == HIDE WHEN INACTIVE == 2 ; ; $vTrayItems can be a string for a specific icon or an array for multiple icons ; There is no error checking implemented but feel free to change it to your needs. ; ; Related .......: ; Link ..........: ; Example .......: Yes, The examples need to be uncommented to run. Remove the ( ;- ) prefix on the example to be ran. ; =============================================================================================================================== ;;;; Set all icons to hide when inactive. ;;;; ;- _ToggleSystemTrayState($SW_HIDENA) ; Example #1 ;;;; Hide all system tray icons. ;;;; ;- _ToggleSystemTrayState(@SW_HIDE) ; Example #2 ;;;; Show two specific icons. ;;;; ;- Local $aIcons[2] = ["Local Area Connection", "Volume"] ; Example #3 ;- _ToggleSystemTrayState($aIcons, 0, @SW_SHOW) ;;;; Hide a specific icon. ;;;; ;- _ToggleSystemTrayState("Volume", 0, @SW_HIDE) ; Example #4 ;;;; Show all system tray icons. ;;;; ;- _ToggleSystemTrayState(@SW_SHOW) ; Example #5 ;;;; Hide all system tray icons but show the dialogs aka debug mode and log the names of the icons hidden. ;;;; ;- _ToggleSystemTrayState("", 0, @SW_HIDE, 1) ; Example #6 Func _ToggleSystemTrayState($vTrayItems = "", $iStartSearchIndex = 0, $iSystemTrayState = 0, $iDebug = 0) If IsInt($vTrayItems) Then $iSystemTrayState = $vTrayItems $vTrayItems = "" EndIf Local Const $sOPTIONS_DIALOG_PROCESS = "rundll32.exe shell32.dll, Options_RunDLL 1" Local Const $sTASKBAR_PROPERTIES_TITLE = "[TITLE:Taskbar and Start Menu Properties; CLASS:#32770; INSTANCE:1]" Local Const $sCUSTOMIZE_BUTTON = "[ClassnameNN:Button10]", $sSENDKEYS = "!c" Local Const $sTASKBAR_CUSTOMIZE_TITLE = "[TITLE:Customize Notifications; CLASS:#32770; INSTANCE:1]" Local Const $sTRAYICONS_LISTVIEW = "[CLASS:SysListView32; INSTANCE:1]" Local Const $sLISTVIEW_COMBOX_CONTROL = "[CLASS:ComboBox; INSTANCE:1]" Local Const $sTASKBAR_CHILD_OK_BUTTON = "[CLASS:Button; INSTANCE:2]" Local Const $iRUNDLL32 = Run($sOPTIONS_DIALOG_PROCESS) WinWait($sTASKBAR_PROPERTIES_TITLE, "", 2000) Local Const $hTASKBAR_DIALOG = WinGetHandle($sTASKBAR_PROPERTIES_TITLE) WinSetState($hTASKBAR_DIALOG, "", $iDebug) ControlSend($hTASKBAR_DIALOG, "", ControlGetHandle($hTASKBAR_DIALOG, "", $sCUSTOMIZE_BUTTON), $sSENDKEYS) WinWait($sTASKBAR_CUSTOMIZE_TITLE, "", 2000) $hTASKBAR_CHILD_DIALOG = WinGetHandle($sTASKBAR_CUSTOMIZE_TITLE) WinSetState($hTASKBAR_CHILD_DIALOG, "", $iDebug) Local Const $hDIALOG_LISTVIEW = ControlGetHandle($hTASKBAR_CHILD_DIALOG, "", $sTRAYICONS_LISTVIEW) Local $iListViewItem = 0, $hComboBox_Instance = 0, $aTrayIcon[1], $iTrayIcon, $iSkipTask = False, $sTrayItemText If IsArray($vTrayItems) Or $vTrayItems <> "" Then If Not IsArray($vTrayItems) Then $aTrayIcon[0] = $vTrayItems Else $aTrayIcon = $vTrayItems EndIf For $i = 0 To UBound($aTrayIcon, 1) - 1 Step 1 $iTrayIcon = _GUICtrlListView_FindInText($hDIALOG_LISTVIEW, $aTrayIcon[$i], $iStartSearchIndex) If $iDebug Then ConsoleWrite("Tray Icon: " & @TAB & _GUICtrlListView_GetItemText($hDIALOG_LISTVIEW, $iTrayIcon) & @CRLF) EndIf _GUICtrlListView_SetItemFocused($hDIALOG_LISTVIEW, $iTrayIcon) $hComboBox_Instance = ControlGetHandle($hTASKBAR_CHILD_DIALOG, "", $sLISTVIEW_COMBOX_CONTROL) ControlSend($hTASKBAR_CHILD_DIALOG, "", $hDIALOG_LISTVIEW, "{SPACE}") For $iLoopIndex = 1 To 3 Step 1 ControlSend($hTASKBAR_CHILD_DIALOG, "", $hComboBox_Instance, "{DOWN}") Next If $iSystemTrayState <> 5 Then ControlSend($hTASKBAR_CHILD_DIALOG, "", $hComboBox_Instance, "{UP}") If $iSystemTrayState = 2 Then ControlSend($hTASKBAR_CHILD_DIALOG, "", $hComboBox_Instance, "{UP}") EndIf EndIf Next $iSkipTask = True EndIf While WinExists($hTASKBAR_CHILD_DIALOG) If $iSkipTask Then ExitLoop EndIf If $iListViewItem >= _GUICtrlListView_GetItemCount($hDIALOG_LISTVIEW) + 1 Then ExitLoop EndIf $iListViewItem += 1 ControlFocus($hTASKBAR_CHILD_DIALOG, "", $hDIALOG_LISTVIEW) If $iDebug Then $sTrayItemText = _GUICtrlListView_GetItemText($hDIALOG_LISTVIEW, $iListViewItem) If $sTrayItemText <> "" Then ConsoleWrite("Tray Icon: " & @TAB & $sTrayItemText & @CRLF) EndIf EndIf $hComboBox_Instance = ControlGetHandle($hTASKBAR_CHILD_DIALOG, "", $sLISTVIEW_COMBOX_CONTROL) For $i = 1 To 3 Step 1 ControlSend($hTASKBAR_CHILD_DIALOG, "", $hComboBox_Instance, "{DOWN}") Next If $iSystemTrayState <> 5 Then ControlSend($hTASKBAR_CHILD_DIALOG, "", $hComboBox_Instance, "{UP}") If $iSystemTrayState = 2 Then ControlSend($hTASKBAR_CHILD_DIALOG, "", $hComboBox_Instance, "{UP}") EndIf EndIf ControlSend($hTASKBAR_CHILD_DIALOG, "", $hDIALOG_LISTVIEW, "{DOWN}") WEnd ControlSend($hTASKBAR_CHILD_DIALOG, "", $sTASKBAR_CHILD_OK_BUTTON, "{ENTER}") WinClose($hTASKBAR_DIALOG) If ProcessExists($iRUNDLL32) Then ProcessClose($iRUNDLL32) EndIf EndFunc ;==>_ToggleSystemTrayState
  14. Sorry for such a general question, I asked a more in depth one a week ago and was unable to get the answer I needed. I have a tray item and one of them is nested 2 deep, and its set to display that its selected and all that. I have two questions about this: 1. How once the tray item is selected with the dot next to it, how do i know its selected? Where would I look in the script? 2. Is there a way to make the tray not close after selecting the tray item? Thanks guys!
  15. Searched and found one thread but it wasn't very helpful. I was wondering how to do this, I have a UI and I would like it when you hit minimize it will go to the tray. Not the start bar. Then the tray will have options to just run from there, or restoring to the UI the saw before. I am sure its a common thing, just cant figure it out so far.
  16. I have 2 guis both of which minimize to the system tray like I want, however the first GUI when it is "restored" pops right up, and yet the second GUI, when it "restores", looks like it is flying in. On the second GUI I have and want to have the minimize and Close butttons but how do I get is so that when the GUI is restored from the taskbar it does not fly in. Code for the first GUI #NoTrayIcon #include <File.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <Constants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Opt("TrayOnEventMode",1) Opt("TrayMenuMode",1) TraySetOnEvent($TRAY_EVENT_PRIMARYUP,"SpecialEvent") GUICreate("HelpDesk App", 300, 620, Default, Default, BitAND($WS_CAPTION, $WS_POPUP, $WS_SYSMENU), $WS_EX_CONTEXTHELP) GUISetState() Func SpecialEvent() GUISetState(@SW_SHOW) TraySetState(2) ; hide EndFunc ;==> SpecialEvent Code for the second GUI #include <File.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <Constants.au3> #include <GUIConstantsEx.au3> #include <GUIConstants.au3> #include <GUIListBox.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <Array.au3> #include <Process.au3> #include <WinAPI.au3> #include <GUIComboBox.au3> #Include <String.au3> #include <Icons.au3> #include <GuiTab.au3> #include <GUIButton.au3> #Include <TabConstants.au3> #NoTrayIcon Opt("TrayOnEventMode",1) Opt("TrayMenuMode",1) TraySetOnEvent($TRAY_EVENT_PRIMARYUP,"SpecialEvent") GUICreate("Utility v3.0", 315, 750) GUISetState() Func SpecialEvent() GUISetState(@SW_SHOW) TraySetState(2) ; hide EndFunc ;==> SpecialEvent Note* I have tried adding the same styles to the second GUI but it removes the Minimize and close buttons Thanks, Grimm
  17. Is it possible to show different menus for left click and right on tray icon simultaneously, if yes, please tell how, hoping for a reply soon
  18. Everytime when you start a program, its icon shows up in the taskbar, like in the picture: The 'Paint' and 'Excel' programs are running, so appears their icons in the Taskbar. If they aren't running,the taskbar is clean. How can I hide or make to dissapear the icon from another program that shows there ? I would appreciate any help !
  19. I'm making a Traymenu in systray to initiate a certain function automatically based on changes in @ipaddress. The While loop uses about 2-4 cpu constantly. Example: While 1 $msg = TrayGetMsg() Select Case $msg = 0 If $ipstring <> @IPAddress1 & @IPAddress2 & @IPAddress3 & @IPAddress4 Then _CheckIPs() ContinueLoop Case $msg = $connect _Connect() TrayItemSetState($connect, $tray_unchecked) Case $msg = $disconnect _Disconnect() EndIf ;Case $msg = $exititem ; ExitLoop EndSelect WEnd $ipstring = @IPAddress1 & @IPAddress2 & @IPAddress3 & @IPAddress4 is set inside _CheckIPs(). I've tried different solutins, but it seems that everything I try will utilize 2-4% CPU. I've also tried _DateDiff() before the $ipstring check, but _NowCalc() also uses CPU. Anyone got any ideas on how to solve this without utilizing the CPU?
  20. I'm writing a tray based program, and for every different option the user selects, the icon changes... I add the #include"icon.ico" where icon.ico would be the icon name obviously... But when I compile the program with the offical autoit compiler it doesn't seem to include the icons... Any clue what I'm doing wrong?
×
×
  • Create New...