Solved

IP - HTTP addresses

Posted on 1998-05-09
9
218 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
 
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
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…

706 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

15 Experts available now in Live!

Get 1:1 Help Now