Solved

Retreiving the IE's Proxy Settings.

Posted on 2001-07-26
4
1,163 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 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

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

726 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