Solved

Retreiving the IE's Proxy Settings.

Posted on 2001-07-26
4
1,154 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
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 100 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 is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

831 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