?
Solved

Retreiving the IE's Proxy Settings.

Posted on 2001-07-26
4
Medium Priority
?
1,164 Views
Last Modified: 2012-06-27

Hai Experts,

   How can I retreive the Internet Options (deatails about the proxy settings) found in the Internet Explorer through a Delphi application. Is there any windows API's to track this. Please help...
0
Comment
Question by:mrk_raj
[X]
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
4 Comments
 
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 6321670
Hello

  you can do that easy by reading the proxy setting from IE setting in the registry

procedure TForm1.Button1Click(Sender: TObject);
var
  Reg: TRegistry;
begin
  Reg := TRegistry.Create;
  Reg.RootKey := HKEY_CURRENT_USER;
  Reg.OpenKey('Software\Microsoft\Windows\CurrentVersion\Internet Settings',false);
  Edit1.Text :=Reg.ReadString('ProxyServer');
end;

Best regards
Mohammed Nasman
0
 

Accepted Solution

by:
BryGuy earned 400 total points
ID: 6341672
That will only retrieve the settings for a LAN.  Try this - it will allow you to pass a connection name and retrieve the settings for it:

function GetIeProxyStatus (Connection : string; var FullProxyHost : string;
  var Enabled : boolean; var ProxyOverride : string) : boolean;
var
  List          : TInternetPerConnOptionList;
  Option        : array [0..2] of TInternetPerConnOption;
  Size          : Cardinal;
begin
  Size := SizeOf(TInternetPerConnOptionList);

  Option[0].dwOption := INTERNET_PER_CONN_PROXY_SERVER;
  Option[1].dwOption := INTERNET_PER_CONN_FLAGS;
  Option[2].dwOption := INTERNET_PER_CONN_PROXY_BYPASS;

  List.dwSize := SizeOf(TInternetPerConnOptionList);

  if Connection = '' then
    List.pszConnection := nil
  else
    List.pszConnection := PChar(Connection);

  List.dwOptionCount := 3;
  List.dwOptionError := 0;
  List.pOptions := @Option;

  Result := InternetQueryOption (nil, INTERNET_OPTION_PER_CONNECTION_OPTION,
    @List, Size);

  if Result then
  begin
    if Option[0].Value.pszValue <> nil then
    begin
      FullProxyHost := string(Option[0].Value.pszValue);
      GlobalFree (Cardinal(Option[0].Value.pszValue));
    end;

    Enabled := (Option[1].Value.dwValue and PROXY_TYPE_PROXY = PROXY_TYPE_PROXY);

    if Option[2].Value.pszValue <> nil then
    begin
      ProxyOverride := string(Option[2].Value.pszValue);
      GlobalFree (Cardinal(Option[2].Value.pszValue));
    end;
  end;
end;

Bryan Ashby
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6466948
Greetings, mrk_raj:  

Please return to all your open questions here and update them with comments if more is needed, or award the expert(s) who helped you to close/finalize them.  I will be posting this in all your open questions shortly so that you are advised of the links and can navigate to them more easily:




It's time to clean up this topic area and that means taking care of this question. Your options at this point are:
 
1. Award points to the Expert who provided an answer, or who helped you most. Do this by clicking on the "Accept Comment as Answer" button that lies above and to the right of the appropriate expert's name.
 
2. PAQ the question because the information might be useful to others, but was not useful to you. To use this option, you must state why the question is no longer useful to you, and the experts need to let me know if they feel that you're being unfair.
 
3.  Ask Community Support to help split points between participating experts.  Just comment here with details.
 
4.  Delete the question because it is of no value to you or to anyone else.  To use this option, you must state why the question is no longer useful to you, and the experts need to let me know if they feel that you're being unfair.
 
If you elect for option 2, 3 or 4, just post comment with details here and I'll take it from there.  We also request that you review any other open questions you might have and update/close them.  Display all your question history from your Member Profile to view details.
 
PLEASE DO NOT AWARD THE POINTS TO ME.
 
____________________________________________
 
 
 
Hi Experts:
 
In the event that the Asker does not respond, I would very much appreciate your opinions as to which Expert ought to receive points (if any) as a result of this question.  Likewise, you can also suggest that I PAQ or delete the question.
 
Experts, please do not add further "answer" information to this question.  I will be back in about one week to finalize this question.
 
Thank you everyone.
 
Moondancer :)
Community Support Moderator @ Experts Exchange
 
P.S.  Engineering has been advised about the error in the comment date/time sort order for year 2000 questions, they're in userID order instead.  REGARDING POINTS, Guidelines and more:  http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp  
0
 

Expert Comment

by:SpideyMod
ID: 8280624
Force Accepted

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses
Course of the Month14 days, left to enroll

801 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