Sign in to follow this  
Followers 0
schmidty1913

please lend a hand

3 posts in this topic

ok first things first i feel like a complete idiot for asking this because im made scripts before and this ones just doesn't work some please take a look at it and tell me what i am doing wrong its late and its bugging me..... many thankz

#include <GuiConstants.au3>

$proxystatus = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\InternetSettings","ProxyEnable")

GUICreate ("Geek Squad Tools",140,@desktopheight-30,@desktopwidth-140,0,0x10000000,0x00000080)

$Proxy = GuiCtrlCreateLabel("STupid",10,10,55,16, 0x1000)

$proxybutton = GuiCtrlCreateButton("Switch",70,8,60,20)

If $proxystatus = 1 Then

GuiCtrlSetData($proxy, "Proxy ON")

Else

GuiCtrlSetData($proxy, "Proxy OFF")

Endif

While 1

$msg = GUIGetMsg()

Select

Case $msg = $proxybutton

MsgBox(0, "AutoIt Example", "button pressed")

If $proxystatus = 0 Then

MsgBox(0, "AutoIt Example", "adding proxy")

;--------------Add Proxy----------------

RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings","ProxyEnable","REG_DWORD","1")

RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings","ProxyOverride","REG_SZ","<local>")

RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings","ProxyServer","REG_SZ","168.94.74.68:8080")

$proxystatus = 1

GuiCtrlSetData($proxy, "Proxy ON")

MsgBox(0, "AutoIt Example", "Proxy added")

Else

MsgBox(0, "AutoIt Example", "Removing proxy")

;--------------Remove Proxy-------------

RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings","ProxyEnable","REG_DWORD","0")

RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings","ProxyOverride","REG_SZ","")

RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings","ProxyServer","REG_SZ","")

$proxystatus = 0

GuiCtrlSetData($proxy, "Proxy OFF")

MsgBox(0, "AutoIt Example", "Proxy removed")

Endif

Endselect

wend

Share this post


Link to post
Share on other sites



try adding the GuiSetState()

#include <GuiConstants.au3>
$proxystatus = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\InternetSettings", "ProxyEnable")


GUICreate("Geek Squad Tools", 140, @DesktopHeight - 30, @DesktopWidth - 140, 0, 0x10000000, 0x00000080)
$Proxy = GUICtrlCreateLabel("STupid", 10, 10, 55, 16, 0x1000)
$proxybutton = GUICtrlCreateButton("Switch", 70, 8, 60, 20)
If $proxystatus = 1 Then
 GUICtrlSetData($Proxy, "Proxy ON")
Else
 GUICtrlSetData($Proxy, "Proxy OFF")
EndIf

GUISetState()

While 1
 $msg = GUIGetMsg()
 Select
  Case $msg = $proxybutton
   MsgBox(0, "AutoIt Example", "button pressed")
   If $proxystatus = 0 Then
    MsgBox(0, "AutoIt Example", "adding proxy")
   ;--------------Add Proxy----------------
    RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyEnable", "REG_DWORD", "1")
    RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyOverride", "REG_SZ", "<local>")
    RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyServer", "REG_SZ", "168.94.74.68:8080")
    $proxystatus = 1
    GUICtrlSetData($Proxy, "Proxy ON")
    MsgBox(0, "AutoIt Example", "Proxy added")
   Else
    MsgBox(0, "AutoIt Example", "Removing proxy")
   ;--------------Remove Proxy-------------
    RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyEnable", "REG_DWORD", "0")
    RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyOverride", "REG_SZ", "")
    RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyServer", "REG_SZ", "")
    $proxystatus = 0
    GUICtrlSetData($Proxy, "Proxy OFF")
    MsgBox(0, "AutoIt Example", "Proxy removed")
   EndIf
 EndSelect
WEnd

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

wow thanks i thought the style 0x10000000 took care of that but i guess not

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