1 | global $NCTITLE = "Network Connections" |
---|
2 | global $NETWORKSCONTROL = "SysListView321" |
---|
3 | global $adapter = "Wireless" |
---|
4 | |
---|
5 | ;Launch Network Properties page |
---|
6 | Run ("control.exe ncpa.cpl") |
---|
7 | |
---|
8 | WinActivate ($NCTITLE) |
---|
9 | sleep (100) |
---|
10 | |
---|
11 | ;Select wireless adaptor |
---|
12 | ControlListView($NCTITLE, "", $NETWORKSCONTROL, "Select", ControlListView($NCTITLE,"",$NETWORKSCONTROL,"FindItem",$adapter) ) |
---|
13 | sleep (200) |
---|
14 | |
---|
15 | ;Get drop down options for Adaptor - same as right click |
---|
16 | ControlSend($NCTITLE, "", $NETWORKSCONTROL, "+{F10}") |
---|
17 | sleep (100) |
---|
18 | |
---|
19 | ;select Connect/Disconnect |
---|
20 | ControlSend($NCTITLE, "", $NETWORKSCONTROL, "o") |
---|
21 | sleep(200) |
---|
22 | |
---|
23 | WinActivate ("Connect to a network") |
---|
24 | |
---|
25 | |
---|
26 | ;Both of these variants should work but don't |
---|
27 | ControlClick ("Connect to a network", "", 1007) |
---|
28 | ControlClick ("Connect to a network", "", "SysLink4") |
---|