?
Solved

Browser URL

Posted on 2000-01-31
2
Medium Priority
?
272 Views
Last Modified: 2010-08-05
Hi.

How can I know in what is the current Browser's URL?
(For netscape and explorer).

Thanks,
             Ran Manor
0
Comment
Question by:ranmanor
  • 2
2 Comments
 
LVL 12

Expert Comment

by:rwilson032697
ID: 2477043
Listening
0
 
LVL 12

Accepted Solution

by:
rwilson032697 earned 400 total points
ID: 2477065
From PAQs: (Credit to Jorge)

This code establishes a DDE connection to the browser (service specified in the Servicio variable) and returns the current URL.  THis code has been tested and works correctly in Netscape and in IExplore.   Be sure to add the DDEMan unit in your project's *uses* clause.

function Get_URL(Servicio: string): String;
var
 Cliente_DDE: TDDEClientConv;
begin
  Result := '';
  Cliente_DDE:= TDDEClientConv.Create( nil );
  with Cliente_DDE do
    begin
      SetLink( Servicio,'WWW_GetWindowInfo');
      Result := StrPas(RequestData('0xFFFFFFFF'));
      CloseLink;
    end;
  Cliente_DDE.Free;
end;

procedure TForm1.Button1Click(Sender);
begin
 showmessage(Get_URL('Netscape'));
    or
 showmessage(Get_URL('IExplore'));
end;

This function will return something like "http://some.url.com","Web Page Title"

Cheers,

Raymond.

0

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…
The video provides a quick and easy steps to migrate MBOX file to well known Outlook PST and Office 365. Besides this, it also supports and migrates more than 20 email clients of MBOX which include AppleMail, Opera, Thunderbird and SeaMonkey effortl…

593 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