Solved

IP - HTTP addresses

Posted on 1998-05-09
9
219 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi Mdi application Child forms get behind control 7 162
Delphi selector screen 2 69
QRReport  TQrmemo vertical stretching 1 42
Create a path if not exists 7 69
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…
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 Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

895 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