Solved

IP - HTTP addresses

Posted on 1998-05-09
9
227 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

729 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