Jump to content

Mouse click on item in Windows system tray.


rasim
 Share

Recommended Posts

Well what happens is the bluetooth icon moves from "some" position in the tray to the far left. it also produces a "ballon tip" but I have ballon tips removed. when you single left click on the bluetooth icon it will produce the window needing attention.

Restore the balloon tips showing and try again.
Link to comment
Share on other sites

Win XP SP3, & it works

thnx for the code. :)

My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]
Link to comment
Share on other sites

  • 2 weeks later...

Hi there, this is a useful code.

An interesting thing I noticed is with some certain applications like Spyware Terminator for example, is it does not work unless you have already moused over the system tray icon and had a baloon tip show up.

If you try this with Spyware Terminator it will work, however log off and on again, and first of all run this script and it wont work.

My next question is how could autoit mouse over the selected system tray before running the click section

#Include <GuiToolBar.au3>

;Disable Real-Time Shield
_SysTray_ClickItem("Spyware Terminator", "right", 1)
WinWait("[CLASS:#32768]", "", 3)
SendKeepActive("[LAST]")
ControlSend("[LAST]", "", "", "{DOWN}{DOWN}{RIGHT}{UP}{ENTER}")
Sleep(1000)
WinWaitClose("[CLASS:#32768]", "", 3)

Func _SysTray_ClickItem($iTitle, $iButton = "left", $iClick = 1, $sMove = False, $iSpeed = 1)
    Local $hToolbar, $iButCount, $aRect, $hButton, $cID, $i
    
    $hToolbar = ControlGetHandle("[Class:Shell_TrayWnd]", "", "[Class:ToolbarWindow32;Instance:1]")
    If @error Then
        Return SetError(1, 0, 0)
    EndIf
    
    $iButCount = _GUICtrlToolbar_ButtonCount($hToolbar)
    If $iButCount = 0 Then
        Return SetError(1, 0, 0)
    EndIf
    
    $hButton = ControlGetHandle("[Class:Shell_TrayWnd]", "", "Button2")
    If $hButton <> "" Then ControlClick("[Class:Shell_TrayWnd]", "", "Button2")
    
    For $i = 0 To $iButCount - 1
        $cID = _GUICtrlToolbar_IndexToCommand($hToolBar, $i)
        If StringInStr(_GUICtrlToolbar_GetButtonText($hToolBar, $cID), $iTitle) Then
            _GUICtrlToolbar_ClickButton($hToolbar, $cID, $iButton, $sMove, $iClick, $iSpeed)
            Return 1
        EndIf
    Next
    Return SetError(1, 0, 0)
EndFunc
Link to comment
Share on other sites

  • 1 year later...
  • Moderators

dogsn0t,

This is a virtually dead thread (last post some 20 months ago) and the original author has not been seen on the forum for some time. ;)

If you want to know how to click on systray icons, I have some code which will do that, but I would suggest that you open a new thread in the General Support area rather than hijack this one. :blink:

M23

P.S. Oh, and it would help if you could make your posts in the new topic a little less cryptic! :P

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • 7 years later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...