Sign in to follow this  
Followers 0
BOUNCER

identifying windows task tray

9 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

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



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

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

Share this post


Link to post
Share on other sites

hmm i cant install autolib it wants older version of autoit

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

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

Share this post


Link to post
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"

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

ah damn i got it working too, ill look at the netsh, i dont seem to have most of the netsh commands, such as add profile

Edited by BOUNCER

Share this post


Link to post
Share on other sites

the new netsh commands seem to be vista, i dont have any of those commands

Share this post


Link to post
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
Sign in to follow this  
Followers 0