Jump to content

identifying windows task tray


Recommended Posts

i cant identify windows task tray to bring up the program in the task tray

heres what i want to do, i want to make a script that clicks refresh button every 5-10 minutes cause my network gets disconnected frequently and wont reconnect unless its refreshed

Posted Image

Posted Image

Posted Image

also under window and control are 2 different position coordinates, under window its 398, 63, however under control its 6,7? which one am i suppose to follow, and how do i identify the windows task tray, theres no way to identify it

Edited by BOUNCER
Link to comment
Share on other sites

For the answer to the first part do a search in Example Scripts for SysTray_UDF.au3 bu Tuape


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

ok i got the task tray part working

#include "SysTray_UDF.au3"
; Press hide inactive icon's button part is from Valik's refresh system tray script!
$oldMatchMode = Opt("WinTitleMatchMode", 4)
$oldChildMode = Opt("WinSearchChildren", 1)

$class = "classname=Shell_TrayWnd"
$hControl = ControlGetHandle($class, "", "Button2")

; get tray position and move there. Helps if Auto Hide tray option is used.
$posTray = WinGetPos(_FindTrayToolbarWindow())
MouseMove($posTray[0], $posTray[1])

$index = _SysTrayIconIndex("RaUI.exe"); Change this to some other application if needed
If $index <> -1 Then
$pos = _SysTrayIconPos($index)

If $pos = -1 Then
 ; ***** Moved by CatchFish *****
 ; If XP and the Hide Inactive Icons mode is active
    If $hControl <> "" And ControlCommand($class, "", $hControl, "IsVisible","") Then
    ControlClick($class, "", $hControl)
    Sleep(250); Small delay to allow the icons to be drawn
    EndIf
 ; ******************************
    $pos = _SysTrayIconPos($index)
    If $pos = -1 Then Exit; ** A real error this time;)
EndIf

MouseMove($pos[0], $pos[1])
Sleep(1000)
MouseClick("left")
MouseClick("left")
WinWaitActive("Ralink Wireless Utility", "Rescan")
Sleep(1000)
WinWaitActive("Ralink Wireless Utility", "Ok")
EndIf
ConsoleWrite(@CRLF & @CRLF & "Pos[0]: " & $pos[0] & "$pos[1]: " & $pos[1])
; Restore Opt settings
Opt("WinTitleMatchMode", $oldMatchMode)
Opt("WinSearchChildren", $oldChildMode)

whats the best way to click the rescan button? it has no keyboard shortcuts, it has the visible text "Rescan" would it be ControlClick ?

Edited by BOUNCER
Link to comment
Share on other sites

This seems like a poor workaround for a more serious problem. Use netsh to connect to the wireless network instead.

http://technet.microsoft.com/en-us/windows...x#bkmk_wlanConn

netsh connect ssid=linksys name=Profile2 interface="Wireless Network Connection"

Hell you could even use at.exe or schtasks.exe to schedule it so you don't need an autoit process running 24 /7:

http://www.microsoft.com/resources/documen...s.mspx?mfr=true

Maybe??:

schtasks /create /SC MINUTE /MO 15 /TN reconnectwireless /TR netsh connect ssid=linksys name=Profile2 interface="Wireless Network Connection"

Link to comment
Share on other sites

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...