• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1120
  • Last Modified:

Autoit programming

How to show the details of IE web proxy (enable or disable ,ip of proxy server...etc) with a message box by using the Autoit programming?
0
Hitony
Asked:
Hitony
  • 2
1 Solution
 
matrixnzCommented:
Basically use RegRead and RegWrite, for MsgBox use flag of 4 for Yes and No for what ever question you want for enabling/disabling.  Wrote up a quick example below.

Example:
#NoTrayIcon

;~ Enter your Proxy Server Below
$IE_ProxyServer = 'PROXY.SERVER.COM:8080'
  ;~ Write Proxy Server into registry
  RegWrite('HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings', 'ProxyServer', 'REG_SZ', $IE_ProxyServer)
;~ Check to see if proxy is enabled/disabled
$IE_ProxyEnable = RegRead('HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings', 'ProxyEnable')

If $IE_ProxyEnable = 1 Then
  ;~ If proxy is enabled change message to disable proxy.
  $IE_ProxyString = 'Disable proxy "' & $IE_ProxyServer & '"?'
Else
  ;~ If proxy is disabled change message to enable proxy.
  $IE_ProxyString = 'Enable proxy "' & $IE_ProxyServer & '"?'
EndIf

;~ Message Box to enable/disable proxy.
$IE_ProxyMsgBox = MsgBox(4, 'Enable/Disable Proxy', $IE_ProxyString)
;~ If user clicks yes than it will enable/disable the proxy.
If $IE_ProxyMsgBox = 6 Then
  If $IE_ProxyEnable = 1 Then
    RegWrite('HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings', 'ProxyEnable', 'REG_DWORD', 0)
  Else
    RegWrite('HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings', 'ProxyEnable', 'REG_DWORD', 1)
  EndIf
EndIf

Open in new window

0
 
matrixnzCommented:
Why the B Grade?
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now