File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes How to get URL information Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to get URL information" Watch "How to get URL information" New topic
Author

How to get URL information

Barry Brashear
Ranch Hand

Joined: Jun 05, 2001
Posts: 303
I have a standalone java application that is not running inside a browser. Is there a way to get the current URL displayed inside the address field
of Internet Explorer?
Thanks.
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
First you would have to get your application to find out of IE is even RUNNING . . . Suddenly this gets very OS dependant.


"JavaRanch, where the deer and the Certified play" - David O'Meara
Barry Brashear
Ranch Hand

Joined: Jun 05, 2001
Posts: 303
Let's assume that IE si the browser that will be used. Is there a way to get this information?
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
I seriously doubt if you are going to get this done using Java. What you need to do is go to the Windows OS (I am making the assumption that you meant this OS) and find out what processes are running. Then you have to find out which of those processes is handling IE (note that there may be more than one running at a time). Then you need to find out what page it is looking at.
Essentially this is what the TaskManager in Windows does, so you would need to find the MicroSoft dll that does this and use some JNI to integrate those functions into your java app.
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
I was reading this other thread on Proxy Servers, and they were talking about: if you know the port that the browser will connect to you can listen for connections and parse the HTTP Headers etc.
Proxy Servers
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to get URL information