[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now


How to get Proxy settings from the default browser, and use them

Posted on 2004-10-31
Medium Priority
Last Modified: 2011-09-20
I'm building a telnet application, and i want to support proxy.
The question is: How to get the proxy settings from the default browser?
(i say "default browser" 'cause i always use IE, i don't know if others have differents way to use a proxy)

Question by:fab1970
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 12460282
IE proxy settings live in the registry:  HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings

Expert Comment

ID: 12461410
Put following in a module

Public Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
Public Declare Function RegOpenKeyA Lib "advapi32.dll" (ByVal hKey As Long, ByVal SubKey As String, Result As Long) As Long
Public Declare Function RegQueryValueExA Lib "advapi32.dll" (ByVal hKey As Long, ByVal KVName As String, ByVal Rvd As Long, Tpe As Long, Dta As Any, cbDta As Long) As Long

Public Function ReadRegistry(hKey As Long, KeyPath As String, SValue As String, Optional Default As String) As String
On Error Resume Next
Dim Buffr As String
RegOpenKeyA hKey, KeyPath, hCurKey
RegQueryValueExA hCurKey, SValue, 0&, lngValueType, ByVal 0&, lngDataBufferSize
Buffr = String(lngDataBufferSize, " ")
RegQueryValueExA hCurKey, SValue, 0&, 0&, ByVal Buffr, lngDataBufferSize
ZPos = InStr(Buffr, Chr$(0))
ReadRegistry = Left$(Buffr, ZPos - 1)
RegCloseKey hCurKey 'close Key !!
End Function

Then a textbox and put following in form load event

Text1.Text = ReadRegistry(&H80000001, "Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyServer")

I think this will solver your purpose.



Author Comment

ID: 12461779
I think i've encountered a version problem:
i'm actually working on a Win98SE machine, i've found that in
"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
i have a subkey called "Connections" containing two Binary value, "DefaultConnectionSettings" and "SavedLegacySettings".
Have each Windows version a different place to store these data?
More: how to "extract" settings from these values?

Accepted Solution

modulo earned 0 total points
ID: 12898585
PAQed with points refunded (250)

Community Support Moderator

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question