fizyk Posted February 5, 2009 Share Posted February 5, 2009 Hi, I'm trying to prepare tray application that show popup GUI. Problem is with event that shows/hides popup GUI. I don't know how to show popup GUI when cursor is on tray icon and how to hide it when cursor is out of tray icon. I used "$TRAY_EVENT_MOUSEOVER" it shows popup but I can't hide it automaticaly. Please help.... Link to comment Share on other sites More sharing options...
fizyk Posted February 5, 2009 Author Share Posted February 5, 2009 anybody??? Link to comment Share on other sites More sharing options...
BJJ Posted February 5, 2009 Share Posted February 5, 2009 maybe make hide to tray by hotkey Link to comment Share on other sites More sharing options...
fizyk Posted February 5, 2009 Author Share Posted February 5, 2009 maybe make hide to tray by hotkey I want do some automatic popup. When I put mouse cursor on tray icon it shows up when I take off mouse it dispersers. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 5, 2009 Moderators Share Posted February 5, 2009 fizyk,Firstly, do not bump a post within 24 hours again. These forums are not a 24/7 tech support - if someone can help you they will, but you need to be patient. If you are not....you will get no help! :-) But you do get help this time. I think this is what you are looking for - the GUI appears when your cursor is over the icon and vanishes when you move away:expandcollapse popup#include <GUIConstantsEx.au3> #include <Constants.au3> #Include <GuiToolBar.au3> Global $aIcon[4] Find_Icon() $hWin = GUICreate("Test", 100, 100) GUISetState(@SW_HIDE, $hWin) $fShowing = False While 1 If GUIGetMsg() = -3 Then Exit $aMouse = MouseGetPos() If $aMouse[0] >= $aIcon[0] And $aMouse[0] <= $aIcon[2] And $aMouse[1] >= $aIcon[1] And $aMouse <= $aIcon[3] Then ; Over icon If $fShowing = False Then $fShowing = True GUISetState(@SW_SHOW, $hWin) ConsoleWrite("Showing" & @CRLF) EndIf Else ; Off icon If $fShowing Then ConsoleWrite("Hidden" & @CRLF) GUISetState(@SW_HIDE, $hWin) $fShowing = False EndIf EndIf WEnd Func Find_Icon() ; Find systray handle $SysTray_Handle = ControlGetHandle('[Class:Shell_TrayWnd]', '', '[Class:ToolbarWindow32;Instance:1]') If @error Then MsgBox(16, "Error", "System tray not found") Exit EndIf ; Get systray item count $Systray_ButCount = _GUICtrlToolbar_ButtonCount($SysTray_Handle) If $Systray_ButCount = 0 Then MsgBox(16, "Error", "No items found in system tray") Exit EndIf ; Look for tooltip $Tool_Tip = "" For $Systray_ButtonNumber = 0 To $Systray_ButCount - 1 ; Need to change "AutoIt" to name of your exe when compiled $Test = StringSplit(_GUICtrlToolbar_GetButtonText($SysTray_Handle, $Systray_ButtonNumber), "AutoIt" ,1) If $Test[0] <> 1 Then ExitLoop Next If $Systray_ButtonNumber = $Systray_ButCount Then ; Icon not found MsgBox(16, "Error", "AutoIt icon not found in system tray") Exit Else ; Get absolute coords of icon ; get icon size $aIcon = _GUICtrlToolbar_GetButtonRect($SysTray_Handle, $Systray_ButtonNumber) ; get x coord of systray $aSysTray = ControlGetPos('[Class:Shell_TrayWnd]', '', '[Class:ToolbarWindow32;Instance:1]') $aIcon[0] = $aSysTray[0] $aIcon[2] = $aSysTray[0] + $aIcon[2] ; get y coord of taskbar $aTaskBar = WinGetPos('[Class:Shell_TrayWnd]', '') $aIcon[1] = $aTaskBar[1] $aIcon[3] = $aTaskBar[1] + $aIcon[3] EndIf EndFuncPlease ask if there is anything you do not understand.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...
fizyk Posted February 5, 2009 Author Share Posted February 5, 2009 (edited) Thank you very much. That is what I looking for... Edited February 5, 2009 by fizyk 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