Solved

IP - HTTP addresses

Posted on 1998-05-09
9
220 Views
Last Modified: 2010-04-03
How can I get IP or Http addresses (Browser´s addresses)
when i'm connected to Internet?
(Delphi codes)

                           THANKS
0
Comment
Question by:kort77
9 Comments
 

Expert Comment

by:chrb
ID: 1343878
Whos IP? Yours? First of all you should download F. Piette's winsocket components (http://www.rtfm.be/fpiette/). They are freeware w/source (remeber to send him a postcard :)
The component has a function, LocalIPList which gives you all the ip addresses your computer has. (Normally only one when you havn't got a network). It has also a function LocalHostName.

Just ask your questions and I will try to answear them as good as I can.

Chr
0
 

Author Comment

by:kort77
ID: 1343879
I need to IP or Http addresses that explore/netscape
or whatever browser is trying to connect to.
0
 
LVL 6

Expert Comment

by:Holger101497
ID: 1343880
chrb: hmm... this seems like a good opportunity to ask: I downloaded the components but cannot "install" them in Delphi 3.0 under Win NT 4.0 - error message is: Unsupported 16-bit resource. I guess there is a way around this? Does anybody use them in NT?
0
ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

 
LVL 1

Expert Comment

by:ssite
ID: 1343881
the ICS (Internet component suite) is much better. Do a search or look for it in delphi super page or tori's delphi pages.

16 Bit  resources : You used the wrong files to register the components. Look for the 32 directory.
0
 
LVL 1

Expert Comment

by:ssite
ID: 1343882
If I understand the question, while explorer and netscape are running, you want to "know" which url are they pointed at ?

let me know and I'll post the answer for that. You need to use DDE.
0
 
LVL 1

Expert Comment

by:ssite
ID: 1343883
oops. I posted an answer instead of a comment. reject it and let me know if that's what you need.
0
 

Author Comment

by:kort77
ID: 1343884
Yes!, that´s what i need...
0
 
LVL 1

Expert Comment

by:ssite
ID: 1343885
kort77 : reject the answer, so I can post a new one for you.
0
 
LVL 1

Accepted Solution

by:
ssite earned 180 total points
ID: 1343886
O.k. - for netscape :

// windowhandle is the netscape main window from which you want to get the url.
// this is optional and is needed only if the window is not enabled. you will need to change the // func a little
function GetURLFromIE(WindowHandle: integer): String;
var
  DDEClient: TDDEClientConv;
  TmpStr: String;
  WindowEnabled: boolean;
begin
  DDEClient := TDDEClientConv.Create(self);
  try
    WindowEnabled := IsWindowEnabled(WindowHandle);
    EnableWindow(WindowHandle, true);
    try
      if(DDEClient.SetLink('NETSCAPE','WWW_GetWindowInfo')) then begin
        TmpStr := DDEClient.RequestData('0xFFFFFFFF');

        // the result will contain url address and name - parse it out
        Result := TmpStr;
      end;
    finally
      if(not WindowEnabled) then // was disabled - disable it back
        EnableWindow(WindowHandle, false);
    end;
  finally
    try
      DDEClient.CloseLink;
    except
    end;
    DDEClient.Free;
  end;
end;

for IE :

function GetURLFromIE(WindowHandle: integer): String;
var
  DDEClient: TDDEClientConv;
  TmpStr: String;
  WindowEnabled: boolean;
begin
  Result := '';
  DDEClient := TDDEClientConv.Create(self);
  try
    WindowEnabled := IsWindowEnabled(WindowHandle);
    EnableWindow(WindowHandle, true);
    try
      if(DDEClient.SetLink('iexplore','WWW_GetWindowInfo')) then begin
        TmpStr := DDEClient.RequestData('0xFFFFFFFF');

        // same here - parse out what you need
        Result := TmpStr;
      end;
    finally
      if(not WindowEnabled) then // was disabled - disable it back
        EnableWindow(WindowHandle, false);
    end;
  finally
    try
      DDEClient.CloseLink;
    except
    end;
    DDEClient.Free;
  end;
end;

0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

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…
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

803 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