Solved

Retreiving the IE's Proxy Settings.

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

758 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now