Pakku Posted June 10, 2009 Share Posted June 10, 2009 (edited) Hi all,Wow it's been a while since I posted my last post here on the AutoIt forum.Well here we go, what have I done: I (at least I think) improved GUINetCC (credtis for Tlem) by taking the GUI to the system tray.Here at the Twente Uneversity (the Netherlands), wireless does a little strange sometimes and then I need to restart my NIC. IMO a system tray thingy would be more usefull than.The codeexpandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Include <Array.au3> #include <NetCC.au3> Opt("TrayMenuMode",1) $action = TrayCreateMenu("Actions") $on = TrayCreateItem("Turn ON",$action) $off = TrayCreateItem("Turn OFF",$action) $restart = TrayCreateItem("Restart",$action) $connection = TrayCreateMenu("Connection") Dim $list = _NetCCGetList() Dim $connectionitem[$list[0] + 1] $connectionitem[0] = TrayCreateItem("All Connections",$connection) TrayItemSetState($connectionitem[0],1) Dim $selected = "All" For $i = 1 To $list[0] $connectionitem[$i] = TrayCreateItem($list[$i],$connection) Next TrayCreateItem("") $exit = TrayCreateItem("Exit") TraySetState() While 1 $msg = TrayGetMsg() If $msg = $exit Then Exit ElseIf _ArraySearch($connectionitem,$msg) <> -1 Then For $i = 0 to $list[0] TrayItemSetState($connectionitem[$i],4) Next TrayItemSetState($msg,1) If TrayItemGetText($msg) == "All Connections" Then $selected = "All" Else $selected = TrayItemGetText($msg) EndIf ElseIf $msg = $on Then TrayTip("Turning ON","Start turning ON",1,1) _on() TrayTip("Turning ON","Done",1,1) ElseIf $msg = $off Then TrayTip("Turning OFF","Start turning OFF",1,1) _off() TrayTip("Turning ON","Done",1,1) ElseIf $msg = $restart Then TrayTip("Restart","Start restarting",1,1) _off() _on() TrayTip("Restart","Done",1,1) EndIf WEnd Func _on() _NetCC($selected, 1) EndFunc Func _off() _NetCC($selected, 0) EndFunc Edited November 16, 2010 by Pakku How can someone use Windows without using AutoIt?That one would properly don't know how to handle a computer!My scripts:Send files over internetKind of RSS reader3Draw ProUDF: convert a character string to a binary one and backCalculate PiCommand line downloader (Youtube/Google video)Set the transparency of a window just by hitting a key!Secure your pcOther things:My filemanMy profilePM me 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