Examples Delphi

For the uncommon situation that a user does not have IE installed, one could try to retrieve the proxy information from an Opera installation.
Opera software stores in the registry the directory in that the Opera browser is installed.
In this directory there is a configuration file 'Opera.ini' that contains a [PROXY] section. This section holds the required information.
The following handy routine shows how to code it:

procedure TForm1.FormCreate(Sender: TObject);
var
OperaDir : string;
sResult : string;
begin
// get Proxy host info from an Opera installation!
with TRegistry.Create do
begin
sResult := '';
RootKey := HKEY_CURRENT_USER;
if OpenKey('\Software\Opera Software', false) then
begin
if ValueExists('Last Directory') then
begin
OperaDir := ReadString('Last Directory');
SetLength(sResult, 128);
SetLength(sResult,
GetPrivateProfileString(
'PROXY',
'HTTP Server',
'',
@sResult[1],
Length(sResult),
PChar(OperaDir + '\opera.ini')));
end;
end;
Free;
if sResult <> '' then
ShowMessage('Your http proxy is ' + sResult)
else
ShowMessage('Opera is not installed or no proxy found.');
end;
end;