Solved

IP - HTTP addresses

Posted on 1998-05-09
9
222 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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Process Javascript errors with Delphi TWebBrowser 1 174
Intraweb download file link ? 1 153
delphi parse string to params 3 136
Convert GUI app into console app for Win32 Env 5 109
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…
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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

792 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